public class NumberEntityRecognizer extends java.lang.Object implements EntityRecognizer
EntityRecognizer
for numbers.
The provided implementation is immutable and, therefore, instances can be freely shared.
DUMMY_ENTITY_RECOGNIZER
Constructor and Description |
---|
NumberEntityRecognizer(java.lang.String thousandsSeparator,
java.lang.String decimalSeparator)
Constructs a new number recognizer for the specified delimiters.
|
public NumberEntityRecognizer(java.lang.String thousandsSeparator, java.lang.String decimalSeparator)
thousandsSeparator
- the delimiter used to divide the digits before the decimal mark in groups of three (such as "," in "1,500,000"). Numbers without this separator are still recognized (for instance, "1500000").decimalSeparator
- the delimiter used to separate the integer part from the fractional part of a number (such as "." in "3.14159265").public Sentence recognizeEntities(Sentence sentence)
EntityRecognizer
Sentence
.recognizeEntities
in interface EntityRecognizer
sentence
- the Sentence
in which to recognize entities.Sentence
with recognized entities.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object