pibrary.string

Classes

String

This class is used to preprocess a text.

Module Contents

class pibrary.string.String(seq)[source]

Bases: collections.UserString

This class is used to preprocess a text.

property str: str[source]

Property to get the string of the text.

Returns:

String of the text.

Return type:

str

remove_punctuation_except_period() collections.UserString[source]

Remove punctuation except period from a text.

Returns:

Text without punctuation except period.

Return type:

UserString

remove_punctuation() collections.UserString[source]

Remove punctuation from a text.

Returns:

Text without punctuation.

Return type:

UserString

remove_digits() collections.UserString[source]

This function is used to remove digits from a text.

Returns:

Text without digits.

Return type:

UserString

remove_duplicate_spaces() collections.UserString[source]

Remove duplicate spaces from a text.

Returns:

Text without duplicate spaces.

Return type:

UserString