Skip to content

Commit f133a21

Browse files
committed
Support for camel case sub indexing As well as picking individual letters
1 parent 47e2d3c commit f133a21

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@
3939

4040
* sub indexing moved from big_roi to info module!
4141

42-
* furthermore , you can now sub index strings, arithmetical operations and more!
42+
43+
44+
* furthermore , you can now sub index strings, arithmetical operations and more! Regarding strings, you can now get words of the sentenceseparated by space or by full stop, but you can also pick up parts of the snake or camel case words as well as individual letters!
4345

4446
* the abstract_vertical and big_roi modules have been modified so as to offer alternatives when there are multiple logical lines in the same physical line.
4547

library/info.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,11 @@ def split_string(s):
290290
second_attempt = [x for x in re.split("[_]",s) if not x.isspace()]
291291
if len(second_attempt) > 1:
292292
return second_attempt
293+
third_attempt = re.sub('([A-Z][a-z]+)', r' \1', re.sub('([A-Z]+)', r' \1', s)).split()
294+
if len(third_attempt) > 1:
295+
return third_attempt
296+
297+
return list(s)
293298

294299

295300

0 commit comments

Comments
 (0)