ngram package¶
Submodules¶
ngram.Corpus module¶
ngram.Distance module¶
-
ngram.Distance.
Dice_coeff
(wordA, wordB)[source]¶ # Calculate edit-distance - Implements the Dice coefficent # Ref: https://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice_coefficient # distance should be between 0 - 1.0. can be used as a similarity match
-
ngram.Distance.
edit_distance
(wordA, wordB)[source]¶ ” Implements Daegmar-Levenshtein edit distance algorithm: Ref: https://en.wikipedia.org/wiki/Edit_distance Ref: https://en.wikipedia.org/wiki/Levenshtein_distance
ngram.LetterModels module¶
-
class
ngram.LetterModels.
Bigram
(filename)[source]¶ Bases:
ngram.LetterModels.Unigram
-
class
ngram.LetterModels.
Trigram
(filename)[source]¶ Bases:
ngram.LetterModels.Unigram