MoneyEntity
Stay organized with collections
Save and categorize content based on your preferences.
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
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eMoneyEntity\u003c/code\u003e is a class that extracts monetary values from text, providing the amount (integer and fractional parts) and currency information.\u003c/p\u003e\n"],["\u003cp\u003eIt inherits from the \u003ccode\u003eEntity\u003c/code\u003e class and includes methods to access the fractional and integer parts of the amount, as well as the unnormalized currency.\u003c/p\u003e\n"],["\u003cp\u003eThe currency returned is a substring of the original text and is not formatted.\u003c/p\u003e\n"],["\u003cp\u003eYou can access more detailed information using inherited methods from the \u003ccode\u003eEntity\u003c/code\u003e class for tasks such as type identification and casting to specific entity types.\u003c/p\u003e\n"]]],["`MoneyEntity` extracts monetary values from text, providing the integer and fractional parts of the amount and the currency. It inherits from `Entity`, which defines various entity types like address, date/time, email, etc. `MoneyEntity` offers methods to retrieve the fractional part (`getFractionalPart`), the integer part (`getIntegerPart`), and the unnormalized currency (`getUnnormalizedCurrency`). The class also supports casting to other entity types like `DateTimeEntity` and `IbanEntity`.\n"],null,[]]