protected override void DoTranslate(string phrase, LanguagePair languagesPair, string subject, Result result, NetworkSetting networkSetting) { List <string> words = StringParser.SplitToWords(phrase); foreach (string word in words) { TranslateWord(word, languagesPair, subject, result, networkSetting); } }
static int GetWordsCount(string phrase) { lock (cacheLock) { if (cachedPhrase != phrase) { cachedPhrase = phrase; cachedPhraseWordsCount = StringParser.SplitToWords(phrase).Count; } return(cachedPhraseWordsCount); } }