public class NumberNormalizer
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.util.List<CoreMap> |
findAndAnnotateNumericExpressions(CoreMap annotation) |
static java.util.List<CoreMap> |
findAndAnnotateNumericExpressionsWithRanges(CoreMap annotation) |
static java.util.List<CoreMap> |
findAndMergeNumbers(CoreMap annotationRaw)
Takes annotation and identifies numbers in the annotation.
|
static java.util.List<CoreMap> |
findNumbers(CoreMap annotation)
Find and mark numbers (does not need NumberSequenceClassifier)
Each token is annotated with the numeric value and type:
- CoreAnnotations.NumericTypeAnnotation.class: ORDINAL, UNIT (hundred, thousand,..., dozen, gross,...), NUMBER
- CoreAnnotations.NumericValueAnnotation.class: Number representing the numeric value of the token
( two thousand => 2 1000 ).
|
static Env |
getNewEnv() |
static void |
setVerbose(boolean verbose) |
static java.lang.Number |
wordToNumber(java.lang.String str)
Fairly generous utility function to convert a string representing
a number (hopefully) to a Number.
|
public static void setVerbose(boolean verbose)
public static java.lang.Number wordToNumber(java.lang.String str)
str
- The String to convertpublic static Env getNewEnv()
public static java.util.List<CoreMap> findNumbers(CoreMap annotation)
annotation
- The annotation structurepublic static java.util.List<CoreMap> findAndMergeNumbers(CoreMap annotationRaw)
annotationRaw
- The annotation to find numbers inpublic static java.util.List<CoreMap> findAndAnnotateNumericExpressions(CoreMap annotation)