@Language.factory("eds.measurements", default_config=DEFAULT_CONFIG)
@deprecated_factory("eds.measures", "eds.measurements", default_config=DEFAULT_CONFIG)
def create_component(
nlp: Language,
name: str,
measurements: Optional[Union[Dict[str, MeasureConfig], List[str]]],
units_config: Dict[str, UnitConfig],
number_terms: Dict[str, List[str]],
stopwords: List[str],
unit_divisors: List[str],
ignore_excluded: bool,
attr: str,
):
return MeasurementsMatcher(
nlp,
units_config=units_config,
number_terms=number_terms,
unit_divisors=unit_divisors,
measurements=measurements,
stopwords=stopwords,
attr=attr,
ignore_excluded=ignore_excluded,
)