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

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

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

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

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

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

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