Recognizers-Text icon indicating copy to clipboard operation
Recognizers-Text copied to clipboard

[* Number] Percentage recognizer resolution should resolve to fraction

Open johnataylor opened this issue 8 years ago • 2 comments

Recognizing an utterance such as 'fifty percent' as a percentage value is great but it would be more helpful to client code if the resolution was to a floating point value.

Specifically: an utterance such as 'fifty percent' results in: "resolution": { "value": "50%" },

Given the type has been correctly identified as percentage it would be better for the client code to receive a floating point number.

This would also fit more naturally with NumberFormat where the client could use code like this:

        const formatter = new Intl.NumberFormat('en-US', { style: 'percent' });
        return formatter.format(obj.value);

Which would assume obj.value to be 0.5 for 50%

johnataylor avatar Nov 17 '17 01:11 johnataylor

@tellarin, should we address this one?

aitelint avatar Nov 16 '20 05:11 aitelint

This is lower priority for now. And the initial implementation would need a config flag (or resolution policy) to toggle between the old value representation and the new one.

tellarin avatar Nov 16 '20 07:11 tellarin