Beispiel #1
0
    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
Beispiel #2
0
    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'])
Beispiel #3
0
    def test_process(self):

        for klass in self.VALID_WORDS:
            for word in self.VALID_WORDS[klass]['words']:
                analyzer = MorphologicalAnalyzer(word)

                assert analyzer.analyze()
Beispiel #4
0
    def test_process_processed_change(self):
        analyzer = MorphologicalAnalyzer(self.TEST_WORD)

        assert not analyzer.processed

        analyzer.analyze()

        assert analyzer.processed
Beispiel #5
0
    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
Beispiel #7
0
    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)
Beispiel #8
0
    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)
Beispiel #9
0
    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)
Beispiel #10
0
    def test_process(self):
        analyzer = MorphologicalAnalyzer(self.TEST_WORD)

        assert analyzer.analyze()
Beispiel #11
0
    def test_process_cache(self):
        analyzer = MorphologicalAnalyzer(self.TEST_WORD)

        assert analyzer.analyze() == True
        assert analyzer.analyze() == None
Beispiel #12
0
    def test_initialize_results(self):
        analyzer = MorphologicalAnalyzer(self.TEST_WORD)

        assert analyzer.results is None
Beispiel #13
0
    def test_initialize_processed(self):
        analyzer = MorphologicalAnalyzer(self.TEST_WORD)

        assert analyzer.processed is False
Beispiel #14
0
    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
Beispiel #15
0
    def test_initialize_raw_word(self):
        analyzer = MorphologicalAnalyzer(self.TEST_WORD)

        assert analyzer.raw_word == self.TEST_WORD
Beispiel #16
0
    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)
Beispiel #17
0
    def test_verbs_process(self):
        for word in self.VALID_WORDS:
            analyzer = MorphologicalAnalyzer(word)

            assert analyzer.analyze()
Beispiel #18
0
 def test_initialize(self):
     assert MorphologicalAnalyzer(self.TEST_WORD)
Beispiel #19
0
    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)
Beispiel #20
0
    def test_prepositions_results(self):
        for word in self.VALID_WORDS:
            analyzer = MorphologicalAnalyzer(word)

            assert analyzer.analyze()
            assert isinstance(analyzer.results, AnalyzeResult)