test for gfcc

This commit is contained in:
aarne
2007-10-02 05:57:57 +00:00
parent f72e601d12
commit 2202cf3ef5
2 changed files with 49 additions and 0 deletions

12
devel/koe/Koe.gf Normal file
View File

@@ -0,0 +1,12 @@
abstract Koe = {
cat S ; NP ; VP ;
fun
Pred : NP -> VP -> S ;
He, She : NP ;
Strong : VP ;
}

37
devel/koe/KoeFre.gf Normal file
View File

@@ -0,0 +1,37 @@
concrete KoeFre of Koe = {
param
Gen = Masc | Fem ;
Num = Sg | Pl ;
oper
Agr : Type = {g : Gen ; n : Num} ;
predA : Str -> {s : Agr => Str} = \adj ->
{s = \\a => copula a.n ++ regA adj a.g a.n} ;
copula : Num -> Str = \n -> case n of {
Sg => "est" ;
Pl => "sont"
} ;
regA : Str -> Gen -> Num -> Str = \s,g,n -> case <g,n> of {
<Masc,Sg> => s ;
<Masc,Pl> => s + "s" ;
<Fem,Sg> => s + "e";
<Fem,Pl> => s + "es"
} ;
lincat
NP = {s : Str ; a : Agr} ;
VP = {s : Agr => Str} ;
lin
Pred np vp = {s = np.s ++ vp.s ! np.a} ;
He = {s = "il" ; a = {g = Masc ; n = Sg}} ;
She = {s = "elle" ; a = {g = Fem ; n = Sg}} ;
Strong = predA "fort" ;
}