Kaljurand / Arvutaja

An Android app for voice actions in Estonian and English
http://kaljurand.github.io/Arvutaja/
Apache License 2.0
29 stars 18 forks source link

Show history (in addition to ambiguity) #2

Closed Kaljurand closed 13 years ago

Kaljurand commented 13 years ago

Currently the output is a list which shows the ambiguity of the input. But we need history as well.

Solution. Store both the history and ambiguity of the results in a database and populate an ExpandableListView via a cursor adapter. The main list is for the history (the user should be able to clear the list or delete its individual items), and each list item has possibly a sublist that presents the ambiguity (e.g. all the results of linearizing "10 USD in whatever currency").

Bonus points. Since each list item is essentially a number (i.e. an evaluation result of an arithmetical or unit conversion expression) it would also be cool to feed existing numbers into future expressions, e.g. the expression grammar does not allow:

e to the power of (pi times i)

because it parses everything as left-associative. One could solve this problem by two utterances:

  1. pi times i
  2. e to the power of LAST

where LAST is linearized into some sort of variable which will be bound to the value found on the top of the history stack. After evaluation the history stack will become:

  1. -1
  2. pi * i

;)

Kaljurand commented 13 years ago

There is now a basic history support. Deleting of individual items is not possible though. The bonus points part was not implemented but a new issue was created (see Issue #3).