Skip to content

Commit

Permalink
update back end to process max_synonyms in the POSTed dict. #2367
Browse files Browse the repository at this point in the history
  • Loading branch information
edeutsch committed Oct 30, 2024
1 parent 940fa32 commit 5d10fbe
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions code/ARAX/NodeSynonymizer/node_synonymizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,15 @@ def get_normalizer_results(self, entities: Optional[Union[str, Set[str], List[st
entities = entities_dict.get("terms")
output_format = entities_dict.get("format")

# Allow the caller to encode the max_synonyms in the input dict (used by web UI)
max_synonyms_raw = entities_dict.get("max_synonyms")
try:
max_synonyms_int = int(max_synonyms_raw)
if max_synonyms_int > 0:
max_synonyms = max_synonyms_int
except:
pass

# Convert any input curies to Set format
entities_set = self._convert_to_set_format(entities)

Expand Down

0 comments on commit 5d10fbe

Please sign in to comment.