windows phone语音命令语法

时间:2014-02-27 14:18:50

标签: windows-phone-8 speech-recognition

我想知道在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>

实际上我想让withtime可选,并避免为它们的每个组合编写单独的命令!

谢谢

1 个答案:

答案 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>
相关问题