Exemplo n.º 1
0
    def test_process_processed_change(self):
        analyzer = MorphologicalAnalyzer(self.TEST_WORD)

        assert not analyzer.processed

        analyzer.analyze()

        assert analyzer.processed
Exemplo n.º 2
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
Exemplo n.º 4
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'])
Exemplo n.º 5
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
Exemplo n.º 6
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()
Exemplo n.º 7
0
    def test_process_cache(self):
        analyzer = MorphologicalAnalyzer(self.TEST_WORD)

        assert analyzer.analyze() == True
        assert analyzer.analyze() == None
Exemplo n.º 8
0
    def test_process(self):
        analyzer = MorphologicalAnalyzer(self.TEST_WORD)

        assert analyzer.analyze()
Exemplo n.º 9
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
Exemplo n.º 10
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)
Exemplo n.º 11
0
    def test_verbs_process(self):
        for word in self.VALID_WORDS:
            analyzer = MorphologicalAnalyzer(word)

            assert analyzer.analyze()
Exemplo n.º 12
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)
Exemplo n.º 13
0
    def test_prepositions_results(self):
        for word in self.VALID_WORDS:
            analyzer = MorphologicalAnalyzer(word)

            assert analyzer.analyze()
            assert isinstance(analyzer.results, AnalyzeResult)
Exemplo n.º 14
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)
Exemplo n.º 15
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)
Exemplo n.º 16
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)