コード例 #1
0
 public NLPActionResult GrammarDumpWithSpellingMistake(define2 define, [AboditNLP.Attributes.Insensitive(caseInsensitive: true, editDistance: 1)] IAmbiguous <ITokenText> token)
 {
     if (token.Count() == 1)
     {
         st.Say($"I think you perhaps meant 'define {token.First().Text}'");
         // But go ahead and show some more aggressive approximate matches anyway
         intent.DefineSuggestions(st, token.First().Text);
     }
     else
     {
         st.Say($"I think you perhaps meant 'define' and then one of {string.Join(", ", token.Select(x => x.Text))}");
     }
     return(NLPActionResult.None);
 }
コード例 #2
0
 // Using a priority lower than any other 'define' rule with an arbitrary phrase
 // this will handle edits that are even further out
 public NLPActionResult GrammarDump(define2 define, TokenPhrase phrase)
 {
     st.Say("Sorry " + phrase.Text + " isn't in my dictionary");
     intent.DefineSuggestions(st, phrase.Text);
     return(NLPActionResult.None);
 }
コード例 #3
0
 public NLPActionResult GrammarDump(define2 define, ITokenText token)
 {
     intent.GrammarDump(st, token);
     return(NLPActionResult.None);
 }
コード例 #4
0
 public NLPActionResult GrammarDump(define2 define, IAmbiguous <ITokenText> tokenAmbiguous)
 {
     intent.GrammarDump(st, tokenAmbiguous);
     return(NLPActionResult.None);
 }