public TextProcessor(long languageId) { _languageId = languageId; _textAnalyzer = TextAnalyzerFactory.Create(); _wordsQuery = new WordsQuery(); _sentencesQuery = new SentencesQuery(); _sentenceWordsQuery = new SentenceWordsQuery(_languageId); }
public ISentencesSearchEngine Create(long languageId) { Language language = _languagesQuery.GetByShortName(LanguageShortName.En); if (language == null) { LoggerWrapper.LogTo(LoggerName.Errors).ErrorFormat( "SentencesSearchEngineFactory.Create не смогли получить язык по имени {0}", LanguageShortName.En); return(new NullSentencesSearchEngine()); } var sentenceWordsQuery = new SentenceWordsQuery(languageId); return(language.Id == languageId ? (ISentencesSearchEngine) new SentencesSearchEngine(sentenceWordsQuery, TextAnalyzerFactory.Create()) : new NullSentencesSearchEngine()); }
public TextParser() { _textAnalyzer = TextAnalyzerFactory.Create(); }