From 92975951f7de365b6f1d77073334198652af87ad Mon Sep 17 00:00:00 2001 From: Elise Huard Date: Fri, 29 Jul 2016 16:30:35 +0100 Subject: [PATCH] renamed fn from newer version of pyxDamerauLevenshtein --- lda2vec/corpus.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lda2vec/corpus.py b/lda2vec/corpus.py index b93aae0a..23915fb4 100644 --- a/lda2vec/corpus.py +++ b/lda2vec/corpus.py @@ -4,7 +4,7 @@ import pandas as pd try: - from pyxdameraulevenshtein import damerau_levenshtein_distance_withNPArray + from pyxdameraulevenshtein import damerau_levenshtein_distance_ndarray except ImportError: pass @@ -572,7 +572,7 @@ def compact_word_vectors(self, vocab, filename=None, array=None, idx = lengths >= len(word) - 3 idx &= lengths <= len(word) + 3 sel = choices[idx] - d = damerau_levenshtein_distance_withNPArray(word, sel) + d = damerau_levenshtein_distance_ndarray(word, sel) choice = np.array(keys_raw)[idx][np.argmin(d)] # choice = difflib.get_close_matches(word, choices)[0] vector = model[choice]