MoneyEntity

  • MoneyEntity is a type of entity extracted from text representing an amount of money.

  • It provides the integer and fractional parts of the amount, as well as the currency.

  • You can retrieve the fractional part, integer part, and unnormalized currency using dedicated methods.

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.