* Ensure word senses are loaded, even if not in probabilities file

This commit is contained in:
Matthew Honnibal 2015-07-05 11:31:07 +02:00
parent 149a901ea7
commit 9534d336ed

View File

@ -110,7 +110,7 @@ def setup_vocab(src_dir, dst_dir):
lexicon = []
for word, prob in reversed(sorted(probs.items(), key=lambda item: item[1])):
entry = get_lex_props(word)
if word in clusters or float(prob) >= -17:
if word in clusters or word in senses or float(prob) >= -17:
entry['prob'] = float(prob)
cluster = clusters.get(word, '0')
# Decode as a little-endian string, so that we can do & 15 to get