maha.parsers.functions.parse_dimensions#

Module Contents#

Functions#

parse_dimension(text[, amount_of_money, ...])

Extract dimensions from a given text.

parse_dimension(text, amount_of_money=None, duration=None, distance=None, numeral=None, ordinal=None, quantity=None, temperature=None, time=None, volume=None, names=None)[source]#

Extract dimensions from a given text.

Parameters
  • text (str) – Text to extract dimensions from

  • amount_of_money (bool, optional) – Extract amount of money using the rule RULE_AMOUNT_OF_MONEY, by default None

  • duration (bool, optional) – Extract duration using the rule RULE_DURATION, by default None

  • distance (bool, optional) – Extract distance using the rule RULE_DISTANCE, by default None

  • numeral (bool, optional) – Extract numeral using the rule RULE_NUMERAL, by default None

  • ordinal (bool, optional) – Extract ordinal using the rule RULE_ORDINAL, by default None

  • quantity (bool, optional) – Extract quantity using the rule RULE_QUANTITY, by default None

  • temperature (bool, optional) – Extract temperature using the rule RULE_TEMPERATURE, by default None

  • time (bool, optional) – Extract time using the rule RULE_TIME, by default None

  • volume (bool, optional) – Extract volume using the rule RULE_VOLUME, by default None

  • names (bool | None) –

Returns

List of Dimension objects extracted from the text

Return type

List[Dimension]

Raises

ValueError – If no argument is set to True