Skip to content

Commit

Permalink
Exclude terms that result in empty norm texts
Browse files Browse the repository at this point in the history
  • Loading branch information
bgyori committed Jul 6, 2023
1 parent 5a08c79 commit b84028a
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions mira/dkg/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,25 +598,29 @@ def get_terms(
from gilda.process import normalize
from gilda.term import Term

yield Term(
norm_text=normalize(name),
text=name,
db=prefix,
id=identifier,
entry_name=name,
status="name",
source=prefix,
)
for synonym in synonyms or []:
norm_text = normalize(name)
if norm_text:
yield Term(
norm_text=normalize(synonym),
text=synonym,
norm_text=norm_text,
text=name,
db=prefix,
id=identifier,
entry_name=name,
status="synonym",
status="name",
source=prefix,
)
for synonym in synonyms or []:
norm_text = normalize(synonym)
if norm_text:
yield Term(
norm_text=norm_text,
text=synonym,
db=prefix,
id=identifier,
entry_name=name,
status="synonym",
source=prefix,
)


def build_match_clause(
Expand Down

0 comments on commit b84028a

Please sign in to comment.