MoneyEntity

  • MoneyEntity is a class that extracts monetary values from text, providing the amount (integer and fractional parts) and currency information.

  • It inherits from the Entity class and includes methods to access the fractional and integer parts of the amount, as well as the unnormalized currency.

  • The currency returned is a substring of the original text and is not formatted.

  • You can access more detailed information using inherited methods from the Entity class for tasks such as type identification and casting to specific entity types.

public final class MoneyEntity extends Entity

A money entity extracted from a piece of text. It provides the values extracted for the amount (split between the integer and fractional parts) and a canonical format for the currency.

Inherited Constant Summary

Public Method Summary

int
getFractionalPart()
Returns the decimal part of the detected annotation.
int
getIntegerPart()
Returns the whole part of the detected annotation.
String
getUnnormalizedCurrency()
Returns the currency part of the detected annotation.

Inherited Method Summary

Public Methods

public int getFractionalPart ()

Returns the decimal part of the detected annotation. The amount is split between whole part and decimal part since different dividers could be used.

public int getIntegerPart ()

Returns the whole part of the detected annotation. The amount is split between whole part and decimal part since different dividers could be used.

public String getUnnormalizedCurrency ()

Returns the currency part of the detected annotation. No formatting is applied so this will return a subset of the initial String.