I found a way to receive numbers, but it is not perfect.
<PhraseTopic Label="amount" Scenario="Commands">
<Subject>Phone Number</Subject>
</PhraseTopic>
Note I'm using PhraseTopic instead of PhraseList. I don't really know which Scenario
is the best here, but I found Commands
to yield better results than having no Scenario
set. The PhraseTopic tag must be placed after all PhraseList tags for some odd reason...
When trying subjects, the auto complete feature showed a few options where the most promising were Date/Time
, Addresses
and Phone Number
. When trying with multiple subjects I could never have a match, but with "Phone Number" (or just "Number" even if there's no such option) I was able to receive number values somewhat consistently.
The number cames in digits form, so I only need int.TryParse(myText, out myNumber)
and use it or say something as "invalid number input".
Be aware that any thing can be input here, even with the subject and scenario restrictions... The folowing will work:
"Hey Cortana, MyAppName add blah blah blah dollars"
And the amount will literally be "blah blah blah"