R
R
r0t0r2016-08-03 15:38:26
Java
r0t0r, 2016-08-03 15:38:26

Is there a library for converting numeral to number?

Is there a library (preferably in Java) that would be able to parse numbers written in Russian words? It would be nice if she still knew how to work with different cases.
An example of what she should have at the input and output:
one -> 1
thirty-ninth -> 39
two hundred and seventy-eighth -> 278
It would be great if she could find numbers in an arbitrary line of text. For example, like this:
"It happened in 1998" -> "It happened in 98"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail, 2016-08-04
@Ostrie_Brevna

Try to dig in the direction of the means that implement morphological normalization. Then your task will be divided into two relatively simple steps:
1) for any form of the numeral you will receive the "normal form"
one -> one
thirty-ninth -> thirty-nine
two hundred and seventy-eighth -> two hundred seventy-eight
2) you will broadcast the numeral in normal form already into a number (which is easier than your original task of converting any form of the numeral)
Basically some kind of morph tools. normalization is in the Tomita-parser from Yandex.
https://tech.yandex.ru/tomita/doc/dg/concept/inter...
(But there are probably other implementations available, not only in Tomita)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question