示例#1
0
    def test_middle_high_german_stemmer(self):
        """
        Test stemming Middle High German words
        """
        stemmed = middle_high_german_stemmer("Man lūte dā zem münster nāch gewoneheit")
        target = ['man', 'lut', 'dâ', 'zem', 'munst', 'nâch', 'gewoneheit']

        self.assertEqual(stemmed, target)
示例#2
0
    def test_middle_high_german_stemmer_strip_umlaut(self):
        """
        Test Middle High German stemmer's strip umlaut function
        """
        stemmed = middle_high_german_stemmer("Man lūte dā zem münster nāch gewoneheit", rem_umlauts=False)
        target = ['man', 'lût', 'dâ', 'zem', 'münst', 'nâch', 'gewoneheit']

        self.assertEqual(stemmed, target)
示例#3
0
    def test_middle_high_german_stemmer_strip_umlaut(self):
        """
        Test Middle High German stemmer's strip umlaut function
        """
        stemmed = middle_high_german_stemmer(
            "Man lūte dā zem münster nāch gewoneheit", rem_umlauts=False)
        target = ['man', 'lût', 'dâ', 'zem', 'münst', 'nâch', 'gewoneheit']

        self.assertEqual(stemmed, target)
示例#4
0
    def test_middle_high_german_stemmer(self):
        """
        Test stemming Middle High German words
        """
        stemmed = middle_high_german_stemmer(
            "Man lūte dā zem münster nāch gewoneheit")
        target = ['man', 'lut', 'dâ', 'zem', 'munst', 'nâch', 'gewoneheit']

        self.assertEqual(stemmed, target)
示例#5
0
    def test_middle_high_german_stemmer_dictionary(self):
        """
        Test Middle High German stemmer's user-defined dictionary function
        """
        exception_dic = {"biuget" : "biegen"}
        stemmed = middle_high_german_stemmer("swaȥ kriuchet unde fliuget und bein zer erden biuget", rem_umlauts=False,
                                             exceptions=exception_dic)
        target = ['swaȥ', 'kriuchet', 'unde', 'fliuget', 'und', 'bein', 'zer', 'erden', 'biegen']

        self.assertEqual(stemmed, target)
示例#6
0
    def test_middle_high_german_stemmer_dictionary(self):
        """
        Test Middle High German stemmer's user-defined dictionary function
        """
        exception_dic = {"biuget": "biegen"}
        stemmed = middle_high_german_stemmer(
            "swaȥ kriuchet unde fliuget und bein zer erden biuget",
            rem_umlauts=False,
            exceptions=exception_dic)
        target = [
            'swaȥ', 'kriuchet', 'unde', 'fliuget', 'und', 'bein', 'zer',
            'erden', 'biegen'
        ]

        self.assertEqual(stemmed, target)