markovipy package

Submodules

markovipy.constants module

>>> list(string.punctuation)
['!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+', ',', '-', '.',
'/', ':', ';', '<', '=', '>', '?', '@', '[', '\', ']', '^', '_', '`',
'{', '|', '}', '~']
>>>

markovipy.markovipy module

markovipy.utils module

markovipy.utils.fix_caps(word)[source]

Used to compare words, irrespective of their capitalisation

Parameters:word (<str>) – the word to be fixed
Returns:<str>
markovipy.utils.get_word_list(file)[source]

Used to get the words inside the corpus file and generate a list of words by parsing it

Something like = [“once”, “upon”, “a”, ...]

Check the regex on https://regex101.com/ with any file inside the corpus/ dir

w matches any word character (equal to [a-zA-Z0-9_]) ‘ matches the character ‘ literally (case sensitive) .,!?; matches a single character in the list .,!?; (case sensitive)

Parameters:file (<str>) – the file being passed to create the list of words
Returns:<list>

Module contents