Closed yuripourre closed 3 years ago
We should update Measure: instead having a String, unit should be a concept itself because it has a name and a symbol.
We could also add new modifiers like (many, few, more than, less than,...)
Since convertrs only need amount and unit name, we can have helpers methods (or a helper class) to convert from Measure to Measure).
Remember that unit has a name and a symbol because the symbol can have different meanings depending on the context.
Time Unit should be changed to just Unit.
It can be made with a parser and a set of converters.
Converter should be an interface with a method that receives value+unit and the output unit and converts to value
The parser reads the input and then define what converter should be used.
E.g:
"Tea spoon" -> "g" kcal -> cal cm -> inches "yesterday" -> date