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:
pi times i
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:
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).
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:
because it parses everything as left-associative. One could solve this problem by two utterances:
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:;)