X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=support%2Flanguage_models.py;h=1b21e49b1190ff4cbc2e0bc480a12c5cb2d12a3f;hb=79f017cbe657922d163f9ca6bfa0f1cdf3d3658c;hp=791d0836dbc85da75bf4004f64fc31f4710a8531;hpb=3889a0daa495879e4b6fd7a5289dd57e0bf3a709;p=cipher-tools.git diff --git a/support/language_models.py b/support/language_models.py index 791d083..1b21e49 100644 --- a/support/language_models.py +++ b/support/language_models.py @@ -6,6 +6,7 @@ from math import log10 import os import support.norms +from support.utilities import sanitise def datafile(name, sep='\t'): """Read key,value pairs from file. @@ -109,7 +110,7 @@ def cosine_distance_score(text): of the frequency distribution. >>> cosine_distance_score('abcabc') # doctest: +ELLIPSIS - 0.73777... + 0.73771... """ # return support.norms.cosine_distance(english_counts, # collections.Counter(sanitise(text)))