Skip to content

Commit

Permalink
Update grounder.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Feb 5, 2024
1 parent a64021b commit c1407ea
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions gilda/grounder.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,23 @@ def _score_namespace(self, term) -> int:
except ValueError:
return 0

def ground_best(
self,
raw_str: str,
context: Optional[str] = None,
organisms: Optional[List[str]] = None,
namespaces: Optional[List[str]] = None,
) -> Optional["ScoredMatch"]:
"""Return the best scored grounding for a given raw string."""
scored_matches = self.ground(
raw_str=raw_str,
context=context,
organisms=organisms,
namespaces=namespaces,
)
if scored_matches:
return scored_matches[0]

def ground(self, raw_str, context=None, organisms=None,
namespaces=None):
"""Return scored groundings for a given raw string.
Expand Down

0 comments on commit c1407ea

Please sign in to comment.