projects
/
cipher-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Done challenge 7
[cipher-tools.git]
/
support
/
language_models.py
diff --git
a/support/language_models.py
b/support/language_models.py
index 791d0836dbc85da75bf4004f64fc31f4710a8531..1b21e49b1190ff4cbc2e0bc480a12c5cb2d12a3f 100644
(file)
--- a/
support/language_models.py
+++ b/
support/language_models.py
@@
-6,6
+6,7
@@
from math import log10
import os
import support.norms
import os
import support.norms
+from support.utilities import sanitise
def datafile(name, sep='\t'):
"""Read key,value pairs from file.
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
of the frequency distribution.
>>> cosine_distance_score('abcabc') # doctest: +ELLIPSIS
- 0.7377
7
...
+ 0.7377
1
...
"""
# return support.norms.cosine_distance(english_counts,
# collections.Counter(sanitise(text)))
"""
# return support.norms.cosine_distance(english_counts,
# collections.Counter(sanitise(text)))