Skip to content

Commit

Permalink
Make enricher algorithm configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
pudo committed Oct 6, 2023
1 parent 3a39fd4 commit ca3663d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nomenklatura/enrich/yente.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def __init__(self, dataset: DS, cache: Cache, config: EnricherConfig):
self._api: str = config.pop("api")
self._dataset: str = config.pop("dataset", "default")
self._threshold: Optional[float] = config.pop("threshold", None)
self._algorithm: Optional[float] = config.pop("algorithm", "best")
self._nested: bool = config.pop("expand_nested", True)
self._fuzzy: bool = config.pop("fuzzy", False)
self._ns: Optional[Namespace] = None
Expand All @@ -48,7 +49,7 @@ def match(self, entity: CE) -> Generator[CE, None, None]:
if not entity.schema.matchable:
return
url = urljoin(self._api, f"match/{self._dataset}")
params: Dict[str, Any] = {"fuzzy": self._fuzzy}
params: Dict[str, Any] = {"fuzzy": self._fuzzy, "algorithm": self._algorithm}
if self._threshold is not None:
params["threshold"] = self._threshold
url = normalize_url(url, params)
Expand Down

0 comments on commit ca3663d

Please sign in to comment.