I'm working with .NET speech recognizer and I'm trying to make an alarm clock.
So I need that the speech recognizer understands dates, and the way I'm doing it is adding to the grammar all the posible values of an hour in a day like this:
private SemanticResultKey GetClockValues()
{
DateTime start = new DateTime(1, 1, 1, 0, 0, 0);
DateTime end = start.AddDays(1);
Choices choices = new Choices();
while (start < end)
{
choices.Add(start.ToShortTimeString());
start = start.AddMinutes(1);
}
return new SemanticResultKey("value", choices);
}
Is there a better way? I hope so!
Thanks a lot!