GildaMatcher

class GildaMatcher(grounder: gilda.Grounder, *, reference_cls: type[R] | None = None)[source]

Bases: Matcher[R], Generic[R]

A matcher that uses gilda as a backend.

Initialize a grounder wrapping a gilda.Grounder.

Methods Summary

default()

Get the default/builtin grounder.

from_literal_mappings(literal_mappings, *[, ...])

Initialize a grounder wrapping a gilda.Grounder.

get_matches(text[, context, organisms, ...])

Get matches in the SSSLM format using gilda.Grounder.ground().

not_empty()

Return if this matcher has lookups indexed in it.

Methods Documentation

classmethod default() Self[source]

Get the default/builtin grounder.

classmethod from_literal_mappings(literal_mappings: Iterable[LiteralMapping[R]], *, prefix_priority: list[str] | None = None, grounder_cls: type[gilda.Grounder] | None = None, filter_duplicates: bool = True, on_error: GildaErrorPolicy = 'ignore') Self[source]

Initialize a grounder wrapping a gilda.Grounder.

Parameters:
  • literal_mappings – The literal mappings to populate the grounder

  • prefix_priority – The priority list of prefixes to break ties. Maps to namespace_priority in gilda.Grounder.__init__()

  • grounder_cls – A custom subclass of gilda.Grounder, if given.

  • filter_duplicates – Should duplicates be filtered using gilda.term.filter_out_duplicates()? Defaults to true.

  • on_error – The policy for what to do on error converting to Gilda

get_matches(text: str, context: str | None = None, organisms: list[str] | None = None, namespaces: list[str] | None = None) list[Match][source]

Get matches in the SSSLM format using gilda.Grounder.ground().

not_empty() bool[source]

Return if this matcher has lookups indexed in it.