class documentation

class TextCat(object): (source)

View In Hierarchy

Undocumented

Method __init__ Undocumented
Method calc_dist Calculate the "out-of-place" measure between the text and language profile for a single trigram
Method guess_language Find the language with the min distance to the text and return its ISO 639-3 code
Method lang_dists Calculate the "out-of-place" measure between the text and all languages
Method profile Create FreqDist of trigrams within text
Method remove_punctuation Get rid of punctuation except apostrophes
Class Variable fingerprints Undocumented
Instance Variable last_distances Undocumented
Constant _END_CHAR Undocumented
Constant _START_CHAR Undocumented
Instance Variable _corpus Undocumented
def __init__(self): (source)

Undocumented

def calc_dist(self, lang, trigram, text_profile): (source)

Calculate the "out-of-place" measure between the text and language profile for a single trigram

def guess_language(self, text): (source)

Find the language with the min distance to the text and return its ISO 639-3 code

def lang_dists(self, text): (source)

Calculate the "out-of-place" measure between the text and all languages

def profile(self, text): (source)

Create FreqDist of trigrams within text

def remove_punctuation(self, text): (source)

Get rid of punctuation except apostrophes

fingerprints: dict = (source)

Undocumented

last_distances = (source)

Undocumented

_END_CHAR: str = (source)

Undocumented

Value
'>'
_START_CHAR: str = (source)

Undocumented

Value
'<'

Undocumented