core

aitoolbox.nlp.core.core.unicode_to_ascii(text_string)[source]

Turn a Unicode string to plain ASCII

Taken from: http://stackoverflow.com/a/518232/2809427

Parameters

text_string (str) –

Returns

Return type

str

aitoolbox.nlp.core.core.normalize_string(text_string, unicode_to_ascii_convert=True)[source]

Lowercase, trim, and remove non-letter characters

Parameters
  • text_string (str) –

  • unicode_to_ascii_convert (bool) –

Returns

Return type

str

aitoolbox.nlp.core.core.str2bool(w)[source]
Parameters

w

Returns

Return type

bool

aitoolbox.nlp.core.core.find_sub_list(sub_list, main_list)[source]

Find starting and ending position of a sublist in a longer list.

Parameters
  • sub_list (list) – sublist

  • main_list (list) – main longer list

Returns

start and end index in the list l. Returns None if sublist is not found in the main list.

Return type

(int, int)