I'd like to use Pepper as a calculator... Now the first problem is the number recognition... Considering that "*" does not work, and that it is not possible to add all numbers as concept....It is a problem. I can write a concept composition to make recognize numbers in letters (not in numbers), e.g. "one hundred twenty one" instead of 121. Now I don't know how to convert the letters-number to digit-number in a simple way... (the only way I know is using a parser in a remote phyton function) Another problem is that I cannot make a "sum" in qiChat language. Is there a way to make a sum in qichat without using a %script? If I use a script I cannot assign the result to a qichat variable, the only way is using events... Thanks if you can suggest some simpler way to proceed. Debora
Asked
Active
Viewed 140 times
1 Answers
0
Starting from the 100s, the numbers are expressed in a systematic way, like in "three million two hundreds fifty two thousands six hundreds and ninety one" for "3,252,691".
As you can see, you don't need neither to capture *
nor "all numbers", but rather a combination of just some possible chunks.
concept:(digits) ["one", "two", ...]
concept:(tens) ["ten", "twenty", ...]
concept:(number_tens) {~tens} {~digits}
concept:(number_hundreds) {~digit hundred{s}} ~number_tens
concept:(number) {~number_hundreds million{s}} {~number_hundreds thousand{s}} ~number_hundreds
u:(_~number}
$number_out=$1
An ALMemory
event named number_out
should be raised with the value when a number is matched. You can subscribe to it, and process it with a script to convert the natural language into numbers, like propose here for example.

Victor Paléologue
- 2,025
- 1
- 17
- 27
-
I've already did it, but I got "twenty" and not 20. In this case the numbers are expressed in letters and not in numbers. So I cannot use them to make the calculator. I was trying to associating a value to each number, but for complex number I would need a script and it is not possibile to associate a script in the concepts.. Suggestions? – Debora Desideri Dec 13 '18 at 15:25
-
$number_out is an ALMemory event that any program can subscribe to, and parse it. I think I'll add that to this reply. – Victor Paléologue Dec 14 '18 at 08:58