我想知道在Windows Phone 8语音命令中有没有办法选择短语。 我的意思是这样的:
<Command Name="actoin">
<Example>he goes to school</Example>
<ListenFor> he goes to school [{with}] [{time}] </ListenFor>
<Feedback>ok!</Feedback>
<Navigate Target="MainPage.xaml"/>
</Command>
<PhraseList Label="with">
<Item>by bus</Item>
<Item>by tax</Item>
<Item>by his father</Item>
</PhraseList>
<PhraseList Label="time">
<Item>sometimes</Item>
<Item>always<Item>
</PhraseList>
实际上我想让with
和time
可选,并避免为它们的每个组合编写单独的命令!
谢谢
答案 0 :(得分:1)
每个命令可以有多个<ListenFor>
元素(最多10个);你可以用这种方式构建选项。
例如:
<Command Name="action">
<Example>he goes to school</Example>
<ListenFor> he goes to school {with} {time} </ListenFor>
<ListenFor> he goes to school {time} </ListenFor>
<ListenFor> he goes to school {with} </ListenFor>
<ListenFor> he goes to school </ListenFor>
<Feedback>ok!</Feedback>
<Navigate Target="MainPage.xaml"/>
</Command>
<PhraseList Label="with">
<Item>by bus</Item>
<Item>by tax</Item>
<Item>by his father</Item>
</PhraseList>
<PhraseList Label="time">
<Item>sometimes</Item>
<Item>always<Item>
</PhraseList>