Skip to content
DeepForgeby svx
All problems
HardNLPnlp-329

Camel Case Split Tokenizer

Problem

Camel-case splitting inserts a boundary before each uppercase letter that follows a lowercase letter or digit, and before an uppercase letter followed by lowercase when it follows another uppercase.

Given a camelCase or PascalCase identifier, return the lowercased word list.

Hint

Track the current run and flush it at boundaries; treat acronym-to-word transitions correctly.

Test cases

case 1
in: ["camelCaseText"]
expected: ["camel","case","text"]
case 2
in: ["HTTPServer"]
expected: ["http","server"]
case 3
in: ["already"]
expected: ["already"]
Starter codePython
def camel_case_split_tokenizer(identifier):
    # Your code here
    pass

3 test cases · run your code against them in the editor