maha.parsers.functions.parse_dimensions#
Module Contents#
Functions#
|
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 Noneduration (bool, optional) – Extract duration using the rule
RULE_DURATION, by default Nonedistance (bool, optional) – Extract distance using the rule
RULE_DISTANCE, by default Nonenumeral (bool, optional) – Extract numeral using the rule
RULE_NUMERAL, by default Noneordinal (bool, optional) – Extract ordinal using the rule
RULE_ORDINAL, by default Nonequantity (bool, optional) – Extract quantity using the rule
RULE_QUANTITY, by default Nonetemperature (bool, optional) – Extract temperature using the rule
RULE_TEMPERATURE, by default Nonetime (bool, optional) – Extract time using the rule
RULE_TIME, by default Nonevolume (bool, optional) – Extract volume using the rule
RULE_VOLUME, by default Nonenames (bool | None) –
- Returns
List of
Dimensionobjects extracted from the text- Return type
List[
Dimension]- Raises
ValueError – If no argument is set to True