The quantities class is a FSA that recognizes ratios, percentages, and physical or currency magnitudes (e.g. twenty per cent, 20%, one out of five, 1/5,one hundred miles per hour, etc.
This module depends on the numbers detection module (section 3.4). If numbers are not previously detected and annotated in the sentence, quantities will not be recognized.
This module, similarly to number recognition, is language dependent: That is, a FSA has to be programmed to match the patterns of ratio expressions in that language.
Currency and physical magnitudes can be recognized in any language, given the appropriate data file.
class quantities { public: /// Constructor: receives the language code, and the data file. quantities(const std::string &, const std::string &); /// Detect magnitude expression in given sentence void annotate(sentence &); };