Skip to content

Commit

Permalink
ignore wordnet types
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethEnevoldsen committed Dec 9, 2023
1 parent 231a955 commit 91e097e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/augmenty/token/insert.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def __insert(t: Token, d: dict) -> dict:
__insert = partial(__insert, d=d)
return partial(
token_insert_augmenter_v1,
level=level,
level=level,
respect_ents=respect_ents,
insert=__insert,
)
Expand Down Expand Up @@ -297,13 +297,13 @@ def __insert(
{
(lem, pos)
for syn in syns
for lem in syn.lemma_names(lang=lang) # noqa
for lem in syn.lemma_names(lang=lang) # type: ignore
},
)
else:
syns = wordnet.synsets(word, lang=lang)
rep = rep.union(
{lem for syn in syns for lem in syn.lemma_names(lang=lang)}, # noqa
{lem for syn in syns for lem in syn.lemma_names(lang=lang)}, # type: ignore
)

if rep:
Expand Down
2 changes: 1 addition & 1 deletion src/augmenty/token/replace.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def __replace(t):
rep = {
l
for syn in syns
for l in syn.lemma_names(lang=lang) # noqa E741
for l in syn.lemma_names(lang=lang) # noqa E741 # type: ignore
}
if word in rep:
rep.remove(word)
Expand Down

0 comments on commit 91e097e

Please sign in to comment.