mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
testing Hrv smart paradigms against Wiktionary
This commit is contained in:
@@ -100,6 +100,8 @@ oper
|
|||||||
zenaNForms : Str -> NForms
|
zenaNForms : Str -> NForms
|
||||||
= zenaN ;
|
= zenaN ;
|
||||||
|
|
||||||
|
PNForms : Type = {snom, sgen, sdat, sacc, svoc, sins : Str} ;
|
||||||
|
|
||||||
mkPN = overload {
|
mkPN = overload {
|
||||||
mkPN : Str -> PN
|
mkPN : Str -> PN
|
||||||
= \s ->
|
= \s ->
|
||||||
@@ -110,6 +112,18 @@ oper
|
|||||||
s = \\c => n.s ! Sg ! c ; ---- TODO check this
|
s = \\c => n.s ! Sg ! c ; ---- TODO check this
|
||||||
g = nf.g
|
g = nf.g
|
||||||
} ;
|
} ;
|
||||||
|
mkPN : PNForms -> Gender -> PN
|
||||||
|
= \fs, g -> lin PN {
|
||||||
|
s = table {
|
||||||
|
Nom => fs.snom ;
|
||||||
|
Gen => fs.sgen ;
|
||||||
|
Dat | Loc => fs.sdat ;
|
||||||
|
Acc => fs.sacc ;
|
||||||
|
Voc => fs.svoc ;
|
||||||
|
Ins => fs.sins
|
||||||
|
} ;
|
||||||
|
g = g
|
||||||
|
} ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
---------------------
|
---------------------
|
||||||
|
|||||||
@@ -427,6 +427,7 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> {
|
|||||||
cit + "ati" => aeiVerbForms s (cit + "am") (cit + "ao") ;
|
cit + "ati" => aeiVerbForms s (cit + "am") (cit + "ao") ;
|
||||||
vid + "jeti" => aeiVerbForms s (vid + "im") (vid + "io") ;
|
vid + "jeti" => aeiVerbForms s (vid + "im") (vid + "io") ;
|
||||||
radi + "ti" => aeiVerbForms s (init radi + "em") (radi + "o") ;
|
radi + "ti" => aeiVerbForms s (init radi + "em") (radi + "o") ;
|
||||||
|
radi + ? => aeiVerbForms s (init radi + "em") (radi + "o") ; ----
|
||||||
_ => Predef.error ("expect infinitive form \"-ti\", found" ++ s)
|
_ => Predef.error ("expect infinitive form \"-ti\", found" ++ s)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
concrete MorphoDictHrv of MorphoDictHrvAbs = CatHrv **
|
concrete MorphoDictHrv of MorphoDictHrvAbs = CatHrv **
|
||||||
open (P=ParadigmsHrv), (R=ResHrv)
|
open (P=ParadigmsHrv), (R=ResHrv), ResHrv
|
||||||
in {
|
in {
|
||||||
|
|
||||||
oper
|
oper
|
||||||
@@ -13,7 +13,7 @@ oper
|
|||||||
gender : R.Gender ;
|
gender : R.Gender ;
|
||||||
snom, sgen, sdat, sacc, svoc, sins : Str
|
snom, sgen, sdat, sacc, svoc, sins : Str
|
||||||
} -> PN
|
} -> PN
|
||||||
= \nfg -> P.mkPN nfg.snom ; ----
|
= \nfg -> P.mkPN <nfg : P.PNForms> nfg.gender ;
|
||||||
|
|
||||||
mkA : {
|
mkA : {
|
||||||
msnom, fsnom, nsnom, msgen,
|
msnom, fsnom, nsnom, msgen,
|
||||||
@@ -29,7 +29,23 @@ oper
|
|||||||
ppart_masc_sg, ppart_fem_sg, ppart_neutr_sg,
|
ppart_masc_sg, ppart_fem_sg, ppart_neutr_sg,
|
||||||
ppart_masc_pl, ppart_fem_pl, ppart_neutr_pl : Str
|
ppart_masc_pl, ppart_fem_pl, ppart_neutr_pl : Str
|
||||||
} -> V
|
} -> V
|
||||||
= \vfs -> P.mkV vfs.infin vfs.pres_sg_1 vfs.ppart_masc_sg ; ----
|
= \vfs ->
|
||||||
|
let forms : VerbForms = table {
|
||||||
|
VInf => vfs.infin ;
|
||||||
|
VPres Sg P1 => vfs.pres_sg_1 ;
|
||||||
|
VPres Sg P2 => vfs.pres_sg_2 ;
|
||||||
|
VPres Sg P3 => vfs.pres_sg_3 ;
|
||||||
|
VPres Pl P1 => vfs.pres_pl_1 ;
|
||||||
|
VPres Pl P2 => vfs.pres_pl_2 ;
|
||||||
|
VPres Pl P3 => vfs.pres_pl_3 ;
|
||||||
|
VPastPart (Masc _) Sg => vfs.ppart_masc_sg ;
|
||||||
|
VPastPart (Masc _) Pl => vfs.ppart_masc_pl ;
|
||||||
|
VPastPart Fem Sg => vfs.ppart_fem_sg ;
|
||||||
|
VPastPart Fem Pl => vfs.ppart_fem_pl ;
|
||||||
|
VPastPart Neutr Sg => vfs.ppart_neutr_sg ;
|
||||||
|
VPastPart Neutr Pl => vfs.ppart_neutr_pl
|
||||||
|
}
|
||||||
|
in P.mkV forms ;
|
||||||
|
|
||||||
lin 'Ćaba_13871_PN' = mkPN {gender = P.feminine ; snom = "Ćaba" ; sgen = "Ćabe" ; sdat = "Ćabi" ; sacc = "Ćabu" ; svoc = "Ćabo" ; sins = "Ćabom"} ;
|
lin 'Ćaba_13871_PN' = mkPN {gender = P.feminine ; snom = "Ćaba" ; sgen = "Ćabe" ; sdat = "Ćabi" ; sacc = "Ćabu" ; svoc = "Ćabo" ; sins = "Ćabom"} ;
|
||||||
lin 'ćaknut_44346_A' = mkA {msnom = "ćaknut" ; fsnom = "ćaknuta" ; nsnom = "ćaknuto" ; msgen = "ćaknuta" ; fsgen = "ćaknute" ; msdat = "ćaknutu" ; fsdat = "ćaknutoj" ; fsacc = "ćaknutu" ; msins = "ćaknutim" ; fsins = "ćaknutom" ; mpnom = "ćaknuti" ; mpgen = "ćaknutih" ; cmsnom = "ćaknutiji"} ;
|
lin 'ćaknut_44346_A' = mkA {msnom = "ćaknut" ; fsnom = "ćaknuta" ; nsnom = "ćaknuto" ; msgen = "ćaknuta" ; fsgen = "ćaknute" ; msdat = "ćaknutu" ; fsdat = "ćaknutoj" ; fsacc = "ćaknutu" ; msins = "ćaknutim" ; fsins = "ćaknutom" ; mpnom = "ćaknuti" ; mpgen = "ćaknutih" ; cmsnom = "ćaknutiji"} ;
|
||||||
|
|||||||
30
src/croatian/wiktionary/smart-results.txt
Normal file
30
src/croatian/wiktionary/smart-results.txt
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
gf -run MorphoDictHrv.gf <test-smart.gfs
|
||||||
|
mv *.tmp full/
|
||||||
|
gf -run MorphoDictHrvSmart.gf <test-smart.gfs
|
||||||
|
mv *.tmp smart/
|
||||||
|
|
||||||
|
Aarnes-MacBook-Pro:wiktionary aarne$ diff -y full/N-list.tmp smart/N-list.tmp | wc
|
||||||
|
10509 147652 1331546
|
||||||
|
Aarnes-MacBook-Pro:wiktionary aarne$ diff -y full/N-list.tmp smart/N-list.tmp | grep "|" | wc
|
||||||
|
5877 86924 749699
|
||||||
|
Aarnes-MacBook-Pro:wiktionary aarne$ diff -y full/N-table.tmp smart/N-table.tmp | grep "|" | wc
|
||||||
|
22354 156623 994255
|
||||||
|
Aarnes-MacBook-Pro:wiktionary aarne$ diff -y full/N-table.tmp smart/N-table.tmp | wc
|
||||||
|
105080 652941 4161921
|
||||||
|
Aarnes-MacBook-Pro:wiktionary aarne$ diff -y full/A-table.tmp smart/A-table.tmp | wc
|
||||||
|
50760 416532 3014404
|
||||||
|
Aarnes-MacBook-Pro:wiktionary aarne$ diff -y full/A-table.tmp smart/A-table.tmp | grep "|" | wc
|
||||||
|
10452 94068 648853
|
||||||
|
Aarnes-MacBook-Pro:wiktionary aarne$ diff -y full/V-table.tmp smart/V-table.tmp | wc
|
||||||
|
69555 896719 5053646
|
||||||
|
Aarnes-MacBook-Pro:wiktionary aarne$ diff -y full/V-table.tmp smart/V-table.tmp | grep "|" | wc
|
||||||
|
44589 607381 3485218
|
||||||
|
Aarnes-MacBook-Pro:wiktionary aarne$ diff -y full/A-list.tmp smart/A-list.tmp | grep "|" | wc
|
||||||
|
1361 16068 173486
|
||||||
|
Aarnes-MacBook-Pro:wiktionary aarne$ diff -y full/A-list.tmp smart/A-list.tmp | wc
|
||||||
|
1410 16661 179955
|
||||||
|
Aarnes-MacBook-Pro:wiktionary aarne$ diff -y full/V-list.tmp smart/V-list.tmp | wc
|
||||||
|
4632 65408 590028
|
||||||
|
Aarnes-MacBook-Pro:wiktionary aarne$ diff -y full/V-list.tmp smart/V-list.tmp | grep "|" | wc
|
||||||
|
3979 56003 507444
|
||||||
|
Aarnes-MacBook-Pro:wiktionary aarne$
|
||||||
9
src/croatian/wiktionary/test-smart.gfs
Normal file
9
src/croatian/wiktionary/test-smart.gfs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
gt -cat=N | l -list | wf -file=N-list.tmp
|
||||||
|
gt -cat=A | l -list | wf -file=A-list.tmp
|
||||||
|
gt -cat=PN | l -list | wf -file=PN-list.tmp
|
||||||
|
gt -cat=V | l -list | wf -file=V-list.tmp
|
||||||
|
gt -cat=N | l -table | wf -file=N-table.tmp
|
||||||
|
gt -cat=A | l -table | wf -file=A-table.tmp
|
||||||
|
gt -cat=PN | l -table | wf -file=PN-table.tmp
|
||||||
|
gt -cat=V | l -table | wf -file=V-table.tmp
|
||||||
|
|
||||||
Reference in New Issue
Block a user