Skip to content

Commit b0eec40

Browse files
committed
tests for paradigm tables in parad/
1 parent 6582650 commit b0eec40

11 files changed

+119
-119
lines changed

docs/formalism.rst

+2
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ In the simplified two-level model, much information is extracted out of the exam
88

99
m ä {kØ}:Ø {ieeØ}:e s s {aä}:ä
1010

11+
Note that all letters and morphophonemes which are mentioned in the definitions or the rules must be present in the examples.
12+
1113
The two-level grammar consists of (a) definitions and (b) rules and (c) comments. Definitions give names for expressions so that these names can be used in subsequent rules and definitions.

fi/ksk-paradigms.csv

-96
This file was deleted.

parad/demo-affixes.csv

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"",+
2+
"INE",+
3+
"ESS",+
4+
"PL INE",+
5+
,
6+
INE,s s {aä}
7+
GEN,n
8+
ESS,n {aä}
9+
PL,i

parad/demo-newnames.csv

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{kØkØ},{kØ},la<k>i la<>in
2+
{sdts},{tds},kä<t>enä kä<d>essä kä<s>issä
File renamed without changes.
File renamed without changes.

fi/ksk-rules.text renamed to parad/ksk-nouns-rules.twol

+7-6
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,13 @@ OPEN = Vo ((VØ) {ij}:i|{ØiØ}:) [Ci Vo|:Ø* END] ;
237237
{tØthn}:h => _ [Vo-{ij}:] ,
238238
_ VØ {ij}:i [e|:s|:t|e|{Øt}:Ø {aä}:] ;
239239
{tØthn}:Ø => _ VØ {ij}: , _ Vo ;
240-
! kuollu<t> kuollu<t>ta (kuollu<t>ten) kevä<t>
241-
! (kuollu<n>na) (kevä<n>nä)
242-
! kevä<h>än kuolle<h>en kevä<h>änä (kevä<h>itten) kuolle<h>isin
243-
! kevä<>än kevä<>änä kuolle<>en kuolle<>ena
244-
! kevä<>itä kevä<>isiin kuolle<>ita kuolle<>itten
245-
! airu<h>itten airu<h>ien (airu<h>isin)
240+
! kuollu<t> kuolle<>en kuolle<h>en kuollu<t>ta kuolle<>ena
241+
! kuolle<h>en kuolle<>ita (kuollu<t>ten) kuolle<>isiin kuolle<h>isin
242+
! kevä<t> kevä<>än kevä<h>än kevä<t>tä
243+
! kevä<>änä kevä<h>änä (kevä<n>nä)
244+
! kevä<>itä (kevä<h>itten) kevä<>isiin
245+
! aru<t> airu<>en airu<t>ta airu<>ena airu<>ita
246+
! airu<h>itten airu<h>ien airu<>isiin (airu<h>isin)
246247
! äity<h>itten äity<h>ien (äity<h>isin)
247248

248249
{uØ}:Ø <=> _ (o) {ij}: ;

parad/ksk-nouns-table.csv

+96
Large diffs are not rendered by default.
File renamed without changes.
File renamed without changes.

zerofilled2rawmphon.py renamed to zerofilled2raw.py

+3-17
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@
7575
principal_set.add(row[0])
7676
else:
7777
feat2mphons[row[0]] = row[1]
78-
print("principal_set =", principal_set)
79-
print("feat2mphons =", feat2mphons)
78+
#print("principal_set =", principal_set)####
79+
#print("feat2mphons =", feat2mphons)####
8080

8181
# Read in the morpheme names and the zero-filled morphs
8282

@@ -102,8 +102,7 @@
102102
stem_morpheme_data[stem_name].append((form_name, orig_morphs, zerof_morph_lst))
103103

104104
ofil = open(args.output, "w")
105-
writer = csv.DictWriter(ofil, fieldnames=["MORPHEMES", "MORPHS", "ZEROFILLED",
106-
"RAW", "PAIRSYMS"])
105+
writer = csv.DictWriter(ofil, fieldnames=["MORPHEMES", "MORPHS", "ZEROFILLED", "RAW"])
107106
writer.writeheader()
108107

109108
for stem_morpheme, data_lst in stem_morpheme_data.items():
@@ -141,17 +140,4 @@
141140
for feat in feat_lst:
142141
raw_lst.append(feat2mphons[feat])
143142
row["RAW"] = " ".join(raw_lst)
144-
zerof_morph_lst = orig_zerof_morphs.split(args.morph_separator)
145-
zerof_morph_str = "".join(zerof_morph_lst)
146-
raw_str = " ".join(raw_lst).strip()
147-
raw_lst = raw_str.split(" ")
148-
# print("zerof_output_str:", zerof_output_str)###
149-
# print("raw_lst:", raw_lst)###
150-
pairsym_lst = []
151-
if len(raw_lst) != len(zerof_morph_str):
152-
print("***", raw_lst, zerof_morph_str)
153-
for insym, outsym in zip(raw_lst, zerof_morph_str):
154-
psym = insym if insym == outsym else insym + ":" + outsym
155-
pairsym_lst.append(psym)
156-
row["PAIRSYMS"] = " ".join(pairsym_lst)
157143
writer.writerow(row)

0 commit comments

Comments
 (0)