delimit_words

stringtools.delimit_words(string)

Delimits words in string.

Delimits words:

>>> stringtools.delimit_words('scale degrees 4 and 5.')
['scale', 'degrees', '4', 'and', '5']

Delimits conjoined words:

>>> stringtools.delimit_words('scale degrees 4and5.')
['scale', 'degrees', '4', 'and', '5']

Delimits lower camel case:

>>> stringtools.delimit_words('scaleDegrees4and5.')
['scale', 'Degrees', '4', 'and', '5']

Delimits upper camel case:

>>> stringtools.delimit_words('ScaleDegrees4and 5.')
['Scale', 'Degrees', '4', 'and', '5']

Delimits dash case:

>>> stringtools.delimit_words('scale-degrees-4-and-5.')
['scale', 'degrees', '4', 'and', '5']

Delimits shout case:

>>> stringtools.delimit_words('SCALE_DEGREES_4_AND_5.')
['SCALE', 'DEGREES', '4', 'AND', '5']

Works with greater-than and less-than signs:

>>> stringtools.delimit_words('one < two')
['one', '<', 'two']

Works with exclamation points:

>>> stringtools.delimit_words('one! two!')
['one', '!', 'two', '!']

Returns list.