public final class NumberSpeller extends Object
This code is based on 'numword' by Dr. Georg Fischer, https://github.com/gfis/numword.
Constructor and Description |
---|
NumberSpeller() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isOrdinal(String string) |
static Double |
parse(String string) |
static Long |
parseCardinal(String text)
Parses a cardinal number from the string supplied.
|
static Long |
parseOrdinal(String string) |
static String |
spellCardinal(int num)
Returns the word for a number in some language.
|
static String |
spellOrdinal(int ordinal) |
@Nullable public static Long parseCardinal(String text)
text
- string to be parsedpublic static String spellCardinal(int num)
number
- a sequence of digit characters, maybe interspersed with non-digits (spaces,
punctuation).public static String spellOrdinal(int ordinal)
public static boolean isOrdinal(String string)
Copyright © 2016–2020 FBK. All rights reserved.