def test_result_raw_word(self): for klass in self.VALID_WORDS: for word in self.VALID_WORDS[klass]['words']: analyzer = MorphologicalAnalyzer(word) assert analyzer.analyze() assert analyzer.results.result.raw_word == word
def test_results_result_analyzer(self): for klass in self.VALID_WORDS: for word in self.VALID_WORDS[klass]['words']: analyzer = MorphologicalAnalyzer(word) assert analyzer.analyze() assert isinstance(analyzer.results.result, self.VALID_WORDS[klass]['analyzer'])
def test_process(self): for klass in self.VALID_WORDS: for word in self.VALID_WORDS[klass]['words']: analyzer = MorphologicalAnalyzer(word) assert analyzer.analyze()
def test_process_processed_change(self): analyzer = MorphologicalAnalyzer(self.TEST_WORD) assert not analyzer.processed analyzer.analyze() assert analyzer.processed
def test_process_results_change(self): analyzer = MorphologicalAnalyzer(self.TEST_WORD) assert analyzer.results is None analyzer.analyze() assert analyzer.results is not None
def _process_words(self, words): results = [] for word in words: analyzer = MorphologicalAnalyzer(word) analyzer.analyze() results.append(analyzer) return results
def test_verbs_result_word(self): for word in self.VALID_WORDS: analyzer = MorphologicalAnalyzer(word) assert analyzer.analyze() assert isinstance(analyzer.results.result.word, Verb)
def test_interjections_result_word(self): for word in self.VALID_WORDS: analyzer = MorphologicalAnalyzer(word) assert analyzer.analyze() assert isinstance(analyzer.results.result.word, Interjection)
def test_adjectives_results_result_is_analyzer(self): for word in self.VALID_WORDS: analyzer = MorphologicalAnalyzer(word) assert analyzer.analyze() assert isinstance(analyzer.results.result, AdjectiveMorphologicalAnalyzer)
def test_process(self): analyzer = MorphologicalAnalyzer(self.TEST_WORD) assert analyzer.analyze()
def test_process_cache(self): analyzer = MorphologicalAnalyzer(self.TEST_WORD) assert analyzer.analyze() == True assert analyzer.analyze() == None
def test_initialize_results(self): analyzer = MorphologicalAnalyzer(self.TEST_WORD) assert analyzer.results is None
def test_initialize_processed(self): analyzer = MorphologicalAnalyzer(self.TEST_WORD) assert analyzer.processed is False
def test_verbs_result_raw_word(self): for word in self.VALID_WORDS: analyzer = MorphologicalAnalyzer(word) assert analyzer.analyze() assert analyzer.results.result.raw_word == word
def test_initialize_raw_word(self): analyzer = MorphologicalAnalyzer(self.TEST_WORD) assert analyzer.raw_word == self.TEST_WORD
def test_numerals_results_result_is_analyzer(self): for word in self.VALID_WORDS: analyzer = MorphologicalAnalyzer(word) assert analyzer.analyze() assert isinstance(analyzer.results.result, NumeralMorphologicalAnalyzer)
def test_verbs_process(self): for word in self.VALID_WORDS: analyzer = MorphologicalAnalyzer(word) assert analyzer.analyze()
def test_initialize(self): assert MorphologicalAnalyzer(self.TEST_WORD)
def test_pronouns_results_result_is_analyzer(self): for word in self.VALID_WORDS: analyzer = MorphologicalAnalyzer(word) assert analyzer.analyze() assert isinstance(analyzer.results.result, PronounMorphologicalAnalyzer)
def test_prepositions_results(self): for word in self.VALID_WORDS: analyzer = MorphologicalAnalyzer(word) assert analyzer.analyze() assert isinstance(analyzer.results, AnalyzeResult)