Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion camel_tools/disambig/mle.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,13 @@ def _scored_analyses(self, word_dd):
return scored_analyses[0:self._top]

def _scored_analyses_cached(self, word_dd):
return self._cache.get(word_dd, self._scored_analyses(word_dd))
if word_dd in self._cache:
scored_analyses = self._cache[word_dd]
else:
scored_analyses = self._scored_analyses(word_dd)
self._cache[word_dd] = scored_analyses

return scored_analyses

def _disambiguate_word(self, word):
word_dd = dediac_ar(word)
Expand Down