Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions ldt/dicts/derivation/custom/en/en.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ def _suffix_sion(self, word, res=None):

if word.endswith("ssion"):
if self.dictionary.is_a_word(word[:-3]):
return word[:-3]
res["suffixes"].append("-ion")
res["roots"].append(word[:-3])
else:
endings = ["d", "t", "de", "se"]
for end in endings:
Expand Down Expand Up @@ -195,4 +196,4 @@ def _decompose_suffix_e(self, word, res=None):
if self.dictionary.is_a_word(candidate):
res["suffixes"].append(dash_suffix(suffix))
res["roots"].append(candidate)
return res
return res
4 changes: 3 additions & 1 deletion ldt/dicts/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ def turn_to_words(word):
if subword:
res.append(subword)
subword = ""
res.append(subword)

if subword:
res.append(subword)
return res

class Normalization(MorphMetaDict):
Expand Down
2 changes: 2 additions & 0 deletions ldt/dicts/semantics/wiktionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ def get_relations(self, word, relations="all",
new_res = {k: v for k, v in dicts.items() if k in relations}

return new_res
else:
return {}


# def dig_deeper(input, field, res):
Expand Down
2 changes: 1 addition & 1 deletion ldt/dicts/spellcheck/en/en.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def _double_letters(self, misspelling, word, inserts, res):
if word[ind].lower() in inserts and len(inserts) == 1:
if word[ind].lower() == word[ind-1].lower():
res.append("double_letter_missed")
elif len(word) >= ind+1:
elif len(word) > ind+1:
if word[ind].lower() == word[ind+1].lower():
res.append("double_letter_missed")
return res
Expand Down
4 changes: 2 additions & 2 deletions ldt/relations/ontology_path/en.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ def get_shortest_path(word1, word2):
"""
try:
return _get_wn_paths(word1, word2)
except timeout_decorator.timeout_decorator.TimeoutError:
return 0
except AssertionError:
return 0