04.07., 9:00 - 11:00: Due to updates GitLab will be unavailable for some minutes between 09:00 and 11:00.

Commit 2144a10f authored by di68kap's avatar di68kap

- neuer Testfall Flexion

parent 76530a03
DHParser-submodule @ 169128d2
Subproject commit 93c7ad109ceefeef0c8ab6410e1d0b7c86ef6d83
Subproject commit 169128d210baae10b4beb55c113c378063258533
......@@ -62,6 +62,7 @@ from DHParser.log import logging
CONFIG_PRESET = access_presets()
CONFIG_PRESET['test_parallelization'] = True
CONFIG_PRESET['ast_serialization'] = "S-expression"
finalize_presets()
#######################################################################
......
......@@ -6,7 +6,7 @@ sys.path.extend(['../', '../DHParser-submodule'])
from MLWCompiler import lemma_verdichtung, Verdichtungsfehler, has_token, add_token, eq_tokens, \
MLWCompiler, AusgabeTransformation
from DHParser.syntaxtree import parse_sxpr
from DHParser.syntaxtree import parse_sxpr, RootNode
class TestLemmaVerdichtung:
......@@ -47,7 +47,7 @@ class TestLemmaVerdichtung:
('ineptus', 'in.|ept|u.s', ''),
('ineptus', 'in.|ept|us', ''),
('ineptus', 'in|ept|u|s', ''),
('ineptus', 'in|.ekt.|us', ''),
# ('ineptus', 'in|.ekt.|us', ''), # Auskommentiert, da inzwischen erlaubt
('ineptus', 'in|..|eptus', ''),
('ineptus', 'im|ept|us', ''),
('ineptus', 'im.|.|eptus', ''),
......@@ -95,7 +95,7 @@ class TestMLWCompiler:
def test_finde_naechstes_BelegLemma(self):
node = parse_sxpr('(BelegText (Anker "interdico_1") (BelegLemma "inter.|ticente") (TEXT ", (") (Anker "interdico_2") (BelegLemma "inter.|titente") (L " ") (Zusatz "var. l.") (TEXT ") Deo."))')
print(node.as_sxpr())
# print(node.as_sxpr())
d = {'interdico_1' : 'inter.|ticente',
'interdico_2' : 'inter.|titente'}
for anker in node.select('Anker'):
......@@ -175,11 +175,17 @@ class TestAusgabeTransformation:
assert node.as_sxpr() == '(A (B (C (D "(1") (E "2"))) (C "3)"))'
def test_on_LemmaVarianten(self):
node = parse_sxpr('(LemmaVarianten (LemmaVariante (TEXT "fasc-")) (LemmaVariante (TEXT "-iet-"))'
' (Zusatz "sim."))')
node = self.at.on_LemmaVarianten(node)
node = RootNode(parse_sxpr('(LemmaVarianten (LemmaVariante (TEXT "fasc-")) '
'(LemmaVariante (TEXT "-iet-")) (Zusatz "sim."))'))
node = self.at(node)
assert node.content == '(fasc-, -iet- sim.)'
def test_on_GVariante(self):
node = RootNode(parse_sxpr('(GVariante (flexion (FLEX "-um") (FLEX "-i")) (genus (neutrum "n.")))'))
node = self.at(node)
assert node.content == "-um, -i n.: "
# print(node.as_sxpr())
if __name__ == "__main__":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment