コード例 #1
0
 private bool checkForWord(string word)
 {
     while (true)
     {
         if (rawWords.Any(x => Soundex.Generate(word) == Soundex.Generate(x.Word)))
         {
             return(true);
         }
     }
 }
コード例 #2
0
 private bool checkForCommand(string word, int applicationId)
 {
     while (true)
     {
         if (processedWords.Any(x => Soundex.Generate(word) == Soundex.Generate(x.Word) && x.WordType == VoiceWord.wordType.ApplicationCommand && x.ApplicationIdCommand == applicationId))
         {
             return(true);
         }
     }
 }
コード例 #3
0
 public bool commandWasSaid(string command, int applicationId)
 {
     if (processedWords.Any(x => Soundex.Generate(command) == Soundex.Generate(x.Word) && x.WordType == VoiceWord.wordType.ApplicationCommand && x.ApplicationIdCommand == applicationId))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #4
0
 public bool wordWasSaid(string word)
 {
     if (rawWords.Any(x => Soundex.Generate(word) == Soundex.Generate(x.Word)))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #5
0
        private List <VoiceWord> getCommandMessage(string word, int applicationId)
        {
            var command = processedWords.Where(x => Soundex.Generate(word) == Soundex.Generate(x.Word) && x.WordType == VoiceWord.wordType.ApplicationCommand && x.ApplicationIdCommand == applicationId).FirstOrDefault();

            if (command != null)
            {
                var message = rawWords.Where(x => x.MessageId == command.MessageId).ToList();
                return(message);
            }
            else
            {
                return(null);
            }
        }
コード例 #6
0
        private List <VoiceWord> getWordMessage(string word, int applicationId)
        {
            var requestedWord = rawWords.Where(x => Soundex.Generate(word) == Soundex.Generate(x.Word)).FirstOrDefault();

            if (requestedWord != null)
            {
                var message = rawWords.Where(x => x.MessageId == requestedWord.MessageId).ToList();
                return(message);
            }
            else
            {
                return(null);
            }
        }