Parsa Room with Cortana

I have a Cortana XML file and I need to enter a number. What should I do to convert it to a number?

<Command Name="AddMoney"> <Example> Add 10 dollars </Example> <ListenFor> add {amount} {currency} </ListenFor> <Feedback> Adding some money </Feedback> <Navigate/> </Command> <PhraseList Label="currency"> <item>dollar</item> <item>euro</item> <item>pound</item> </PhraseList> <PhraseList Label="amount"> </PhraseList> 
+6
source share
1 answer

I found a way to get the numbers, but this is not perfect.

 <PhraseTopic Label="amount" Scenario="Commands"> <Subject>Phone Number</Subject> </PhraseTopic> 

Note. I use PhraseTopic instead of PhraseList . I really don't know which Scenario best here, but I found Commands to get better results than not having Scenario . The PhraseTopic tag must be placed after all the PhraseList tags for some odd reason ...

When testing objects, the automatic completion function showed several options, in which the most promising were Date/Time , Addresses and Phone Number . When I tried with several objects, I never had a match, but with "Phone number" (or simply "Number", even if there is no such parameter), I was able to consistently receive numerical values.

The number of characters in digits, so I only need int.TryParse(myText, out myNumber) and use it or say something like "invalid number input."

Keep in mind that any thing can be entered here, even with restrictions on the theme and script ... The following will work:

 "Hey Cortana, MyAppName add blah blah blah dollars" 

And the amount will be literally "blah blah blah"

+4
source

All Articles