Esempio n. 1
0
    def testHoles(self):
        
        expected = ["one", "enough"]

        AnalyzerUtils.assertAnalyzesTo(self.stopAnalyzer, "one is not enough",
                                       expected)
        AnalyzerUtils.assertAnalyzesTo(self.stopAnalyzer, "one is enough",
                                       expected)
        AnalyzerUtils.assertAnalyzesTo(self.stopAnalyzer, "one enough",
                                       expected)
        AnalyzerUtils.assertAnalyzesTo(self.stopAnalyzer, "one but not enough",
                                       expected)
Esempio n. 2
0
    def testHoles(self):

        expected = ["one", "enough"]

        AnalyzerUtils.assertAnalyzesTo(self.stopAnalyzer, "one is not enough",
                                       expected)
        AnalyzerUtils.assertAnalyzesTo(self.stopAnalyzer, "one is enough",
                                       expected)
        AnalyzerUtils.assertAnalyzesTo(self.stopAnalyzer, "one enough",
                                       expected)
        AnalyzerUtils.assertAnalyzesTo(self.stopAnalyzer, "one but not enough",
                                       expected)
Esempio n. 3
0
    def testSpanish(self):

        analyzer = SnowballAnalyzer(Version.LUCENE_CURRENT, "Spanish")
        AnalyzerUtils.assertAnalyzesTo(analyzer, "algoritmos", ["algoritm"])
Esempio n. 4
0
    def testEnglish(self):

        analyzer = SnowballAnalyzer(Version.LUCENE_CURRENT, "English")
        AnalyzerUtils.assertAnalyzesTo(analyzer, "stemming algorithms",
                                       ["stem", "algorithm"])
Esempio n. 5
0
    def testStopAnalyzerFlawed(self):

        AnalyzerUtils.assertAnalyzesTo(StopAnalyzerFlawed(),
                                       "The quick brown...",
                                       ["the", "quick", "brown"])
Esempio n. 6
0
    def testStopAnalyzer2(self):

        AnalyzerUtils.assertAnalyzesTo(StopAnalyzer2(),
                                       "The quick brown...",
                                       ["quick", "brown"])
Esempio n. 7
0
    def testSpanish(self):

        analyzer = SnowballAnalyzer(Version.LUCENE_CURRENT, "Spanish")
        AnalyzerUtils.assertAnalyzesTo(analyzer, "algoritmos", ["algoritm"])
Esempio n. 8
0
    def testEnglish(self):

        analyzer = SnowballAnalyzer(Version.LUCENE_CURRENT, "English")
        AnalyzerUtils.assertAnalyzesTo(analyzer, "stemming algorithms",
                                       ["stem", "algorithm"])