Fumes

class fumigate.Fumes[source]

Instantiate a Fumes object. Text will be fumigated according to mention methods.

clean(text: str, methods: Optional[List[str]] = None, extract: bool = False) Union[str, Tuple[str, list]][source]

Fumigate the text

Parameters
  • methods (List[str]) – Available methods [“sym” | “num” | “url” | “emo”].

  • text (string) – The text to fumigate.

  • extract (bool) – Return fumigated values.

Returns

(The result after fumigation, fumigated values).

Return type

Union[str, Tuple[str, list]]

static lemm(text: str, pos: str = 'n') str[source]

Lemmatizing method

Parameters
  • text – The text to apply Lemmatizing.

  • pos – The part of speech to apply.

Returns

The result after Lemmatizing.

Return type

str

purge(text: str) str[source]

Fumigate the text using all methods

Parameters

text (str) – The text to fumigate.

Returns

The result after fumigation.

Return type

str

static stem(text: str) str[source]

Stemming method

Parameters

text – The text to apply stemming.

Returns

The result after stemming.

Return type

str