subword

subword(string, sub)

Extract number of subwords from sentences and words.

Parameters

string: str Text selected to apply transformation.

sub: str subwords from sentences

Examples:

sentence = 'Fundamentalism and constructivism are important skills'
subword(sentence,'ism') # change subword and try for others
    >>> 2