Spaces:
Running
Running
a-v-bely
commited on
Commit
·
adf7190
1
Parent(s):
ba46b41
Fix morphology.py
Browse files
utilities_language_bert/esp_sentence_bert.py
CHANGED
@@ -225,7 +225,7 @@ class TASK:
|
|
225 |
continue
|
226 |
else:
|
227 |
inflected = inflect(lemma=distractor_lemma, target_pos=self.pos[1], target_tags=self.tags)
|
228 |
-
if inflected is not None
|
229 |
inflected_distractors.append(inflected)
|
230 |
num_distractors = min(4, self.max_num_distractors) if self.max_num_distractors >= 4 \
|
231 |
else self.max_num_distractors
|
|
|
225 |
continue
|
226 |
else:
|
227 |
inflected = inflect(lemma=distractor_lemma, target_pos=self.pos[1], target_tags=self.tags)
|
228 |
+
if inflected is not None:
|
229 |
inflected_distractors.append(inflected)
|
230 |
num_distractors = min(4, self.max_num_distractors) if self.max_num_distractors >= 4 \
|
231 |
else self.max_num_distractors
|
utilities_language_general/morphology.py
CHANGED
@@ -55,7 +55,7 @@ def pluralize_noun(lemma):
|
|
55 |
else:
|
56 |
plural = lemma + 's'
|
57 |
else:
|
58 |
-
return None
|
59 |
plural_vocals = [char for char in plural if char in all_vocals]
|
60 |
if lemma.endswith(('n', 's')) and current_vocals[-1] in stressed_vocals:
|
61 |
plural = multi_replace(plural)
|
|
|
55 |
else:
|
56 |
plural = lemma + 's'
|
57 |
else:
|
58 |
+
return None
|
59 |
plural_vocals = [char for char in plural if char in all_vocals]
|
60 |
if lemma.endswith(('n', 's')) and current_vocals[-1] in stressed_vocals:
|
61 |
plural = multi_replace(plural)
|