Example #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)
Example #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)
Example #3
0
    def testSpanish(self):

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

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

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

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

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

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