コード例 #1
0
ファイル: test_de.py プロジェクト: uttamkgulshan/pattern
 def test_lexeme(self):
     # Assert all inflections of "sein".
     v = de.lexeme("sein")
     self.assertEqual(
         v,
         [
             "sein",
             "bin",
             "bist",
             "ist",
             "sind",
             "seid",
             "seiend",
             "war",
             "warst",
             "waren",
             "wart",
             "gewesen",
             "sei",
             "seien",
             "seiest",
             "seiet",
             u"wäre",
             u"wärest",
             u"wären",
             u"wäret",
         ],
     )
     print "pattern.de.inflect.lexeme()"
コード例 #2
0
ファイル: test_de.py プロジェクト: iicc/pattern
 def test_lexeme(self):
     # Assert all inflections of "sein".
     v = de.lexeme("sein")
     self.assertEqual(v, [
         "sein", "bin", "bist", "ist", "sind", "seid", "seiend", "war",
         "warst", "waren", "wart", "gewesen", "sei", "seien", "seiest",
         "seiet", u"wäre", u"wärest", u"wären", u"wäret"
     ])
     print("pattern.de.inflect.lexeme()")
コード例 #3
0
# Author: Devon Fritz
# Date: 30.5.15
# Stems the lexicon of german words

import sys
from pattern.de import lemma, lexeme

reload(sys)
sys.setdefaultencoding('utf-8')
input_file = sys.argv[1]

with open(input_file) as f:
    for line in f:
        print lemma(line.strip())
        for l in lexeme(line.strip()):
            print l