Пример #1
0
 def test_dic_parsing(self):
     """ test_dic_parsing """
     from pyspell.aff import aff_mgr
     from pyspell.dic import dic_mgr
     aff = aff_mgr(self.aff_file())
     dic = dic_mgr(self.dic_file(), aff)
     dic.parse()
Пример #2
0
 def test_dic_parsing( self ):
     """ test_dic_parsing """
     from pyspell.aff import aff_mgr
     from pyspell.dic import dic_mgr
     aff = aff_mgr(self.aff_file())
     dic = dic_mgr(self.dic_file(), aff)
     dic.parse()
Пример #3
0
    def test_unmunch(self):
        """ test_unmunch """
        from pyspell.dic import dic_mgr
        from pyspell.aff import aff_mgr

        aff = aff_mgr(self.aff_file("mini"))
        aff.parse()

        dic = dic_mgr(self.dic_file("mini"), aff)
        dic.parse()
        i = 0
        s = set()
        for w in dic.unmunch_words(False):
            #self.assertNotIn(w, s)
            s.add(w)
            i += 1
            try:
                msg = "%3d: %s" % (i, w.encode("utf-8"))
                self.log(msg)
                #print "%3d: %s" % (i, w.encode("utf-8"))
            except:
                pass
Пример #4
0
    def test_unmunch( self ):
        """ test_unmunch """
        from pyspell.dic import dic_mgr
        from pyspell.aff import aff_mgr

        aff = aff_mgr(self.aff_file("mini"))
        aff.parse()

        dic = dic_mgr(self.dic_file("mini"), aff)
        dic.parse()
        i = 0
        s = set()
        for w in dic.unmunch_words(False):
            #self.assertNotIn(w, s)
            s.add(w)
            i += 1
            try:
                msg = "%3d: %s" % (i, w.encode("utf-8"))
                self.log(msg)
                #print "%3d: %s" % (i, w.encode("utf-8"))
            except:
                pass
Пример #5
0
 def test_aff_parsing(self):
     """ test_aff_parsing """
     from pyspell.aff import aff_mgr
     aff = aff_mgr(self.aff_file())
     aff.parse()
     print aff
Пример #6
0
 def test_aff_parsing( self ):
     """ test_aff_parsing """
     from pyspell.aff import aff_mgr
     aff = aff_mgr(self.aff_file())
     aff.parse()
     print aff