forked from GitHub/gf-core
*** empty log message ***
This commit is contained in:
@@ -11,7 +11,7 @@ mkVP : V -> NP -> VP;
|
||||
mkNP1 : D -> N -> NP;
|
||||
mkNP2 : N -> NP;
|
||||
mkNP3 : NP -> PP -> NP;
|
||||
mkPP : P -> NP -> PP;
|
||||
mkPP : NP -> P -> PP;
|
||||
|
||||
robin : NP;
|
||||
dog : N;
|
||||
|
||||
@@ -18,7 +18,7 @@ mkVP x y = {s = table {n => x.s ! n ++ y.s}};
|
||||
mkNP1 x y = {s = x.s ++ y.s ! x.n ; n = x.n};
|
||||
mkNP2 x = {s = x.s ! Pl ; n = Pl};
|
||||
mkNP3 x y = {s = x.s ++ y.s; n = x.n};
|
||||
mkPP x y = {s = x.s ++ y.s};
|
||||
mkPP x y = {s = y.s ++ x.s};
|
||||
|
||||
robin = {s = "Robin" ; n = Sg};
|
||||
dog = {s = table {Sg => "dog" ; Pl => "dogs"}};
|
||||
|
||||
@@ -8,6 +8,8 @@ NP = {s : Str};
|
||||
V = {s : Str};
|
||||
N = {s : Num => Str ; g : Gen};
|
||||
D = {s : Gen => Str ; n : Num};
|
||||
PP = {s : Str};
|
||||
P = {s : Str};
|
||||
|
||||
lin
|
||||
cyclic x = x;
|
||||
@@ -15,14 +17,18 @@ mkS x y = {s = x.s ++ y.s};
|
||||
mkVP x y = {s = x.s ++ y.s};
|
||||
mkNP1 x y = {s = x.s ! y.g ++ y.s ! x.n};
|
||||
mkNP2 x = {s = x.s ! Pl};
|
||||
mkNP3 x y = {s = x.s ++ y.s};
|
||||
mkPP x y = {s = y.s ++ x.s};
|
||||
|
||||
robin = {s = "Robin"};
|
||||
dog = {s = table {Sg => "hund" ; Pl => "hundar"} ; g = Utr};
|
||||
child = {s = table {_ => "barn"} ; g = Neu};
|
||||
love = {s = "älskar"};
|
||||
hate = {s = "hatar"};
|
||||
one = {s = table {Utr => "en" ; Neu => "ett"} ; n = Sg};
|
||||
hate = {s = variants{"hatar"; "avskyr"}};
|
||||
one = {s = variants{table {Utr => "en" ; Neu => "ett"};
|
||||
table {Utr => "någon" ; Neu => "något"}} ; n = Sg};
|
||||
all = {s = table {_ => "alla"} ; n = Pl};
|
||||
inside = {s = variants{"i"; "inuti"}};
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ resource SimpleSweRes = {
|
||||
|
||||
param Num = Sg | Pl;
|
||||
param Gen = Utr | Neu;
|
||||
param NumGen = NG Num Gen;
|
||||
|
||||
}
|
||||
|
||||
|
||||
42
grammars/testConversions/TestVars.gf
Normal file
42
grammars/testConversions/TestVars.gf
Normal file
@@ -0,0 +1,42 @@
|
||||
|
||||
-- param Num = Sg | Pl;
|
||||
-- param Gen = Utr | Neu;
|
||||
-- param NumGen = NG Num Gen;
|
||||
|
||||
concrete TestVars of TestVarsA = open TestVarsR in {
|
||||
|
||||
-- lincat S = { s : Str; n : Num };
|
||||
-- lincat A = { s1 : Str; s2 : Num => Str ; g : Gen };
|
||||
-- lincat B = { s : Str; n : Num };
|
||||
-- lin a x = { s = table { Sg => "sg" ; Pl => "pl" } ! x.n ++ x.s ; n = x.n };
|
||||
-- lin b x y = { s = table { Neu => variants{"neu";"NEU"} ; Utr => "utr" } ! x.g;
|
||||
-- n = variants { y.n ; Sg } };
|
||||
-- lin c = { s = variants{"a";"A"} ++ variants{"b";"B"} ++ variants{"c";"C"}; n = Sg };
|
||||
|
||||
-- lincat V = { a : { s1 : Str ; s2 : Str } };
|
||||
-- lincat W = { s1 : Str ; ng:{n:Num;g:Gen} ; s2 : Str };
|
||||
-- lin v = { a = variants { {s1="a1";s2="a2"} ; {s1="b1";s2=variants{}} } };
|
||||
-- lin w = variants { {s1="a1";ng=variants{};s2="a2"} ;
|
||||
-- {s1="b1";ng=variants{{n=Pl;g=Utr};{n=Sg;g=Neu}};s2="b2"} };
|
||||
|
||||
-- lincat E = { a : { b : {s1:Str; s2:Str} ; c : {n:Num;g:Gen} }; d:{e:{f:{s:Str}}} };
|
||||
-- lin e = { a = { b = {s1="1"; s2="2"} ; c = {n=Sg ;g=Utr} }; d={e={f={s="s"}}} };
|
||||
-- lin f x = { a = { b = {s1=x.d.e.f.s;s2=x.a.b.s1}; c = {n=x.a.c.n;g=Neu}};
|
||||
-- d={e={f={s="s"++x.a.b.s2}}} };
|
||||
|
||||
lincat S = { s : Str };
|
||||
lin
|
||||
--s = { s = variants { "a" ; "b" ; "c" } };
|
||||
e = { s = variants { "e" ; "f" } };
|
||||
ee x = { s = x.s ++ x.s };
|
||||
f = { s = "g" };
|
||||
ff x = { s = "e" ++ x.s };
|
||||
|
||||
|
||||
-- lincat D = { s1 : Str; s2 : Str };
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
24
grammars/testConversions/TestVarsA.gf
Normal file
24
grammars/testConversions/TestVarsA.gf
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
abstract TestVarsA = {
|
||||
|
||||
-- cat S; A; B;
|
||||
-- fun a : B -> S;
|
||||
-- fun b : A -> B -> S;
|
||||
-- fun c : S;
|
||||
|
||||
-- cat V; W;
|
||||
-- fun v : V;
|
||||
-- fun w : W;
|
||||
|
||||
cat S;
|
||||
--fun s : S;
|
||||
fun e : S;
|
||||
fun ee : S -> S;
|
||||
fun f : S;
|
||||
fun ff : S -> S;
|
||||
|
||||
-- cat D;
|
||||
-- fun d : D;
|
||||
-- fun dd : D -> D;
|
||||
}
|
||||
|
||||
28
grammars/testConversions/TestVarsR.gf
Normal file
28
grammars/testConversions/TestVarsR.gf
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
resource TestVarsR = {
|
||||
|
||||
param Num = Sg | Pl;
|
||||
param Gen = Utr | Neu;
|
||||
param NumGen = NG Num Gen;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
24
grammars/testConversions/TimeFlies.gf
Normal file
24
grammars/testConversions/TimeFlies.gf
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
concrete TimeFlies of TimeFliesAbs = {
|
||||
|
||||
lin
|
||||
s1 x y = {s = x.s ++ y.s};
|
||||
vp1 x = {s = x.s};
|
||||
vp2 x y = {s = x.s ++ y.s};
|
||||
vp3 x y = {s = x.s ++ y.s};
|
||||
np1 x = {s = x.s};
|
||||
np2 x y = {s = x.s ++ y.s};
|
||||
np3 x y = {s = x.s ++ y.s};
|
||||
pp1 x y = {s = x.s ++ y.s};
|
||||
|
||||
flyV = {s = "flies"};
|
||||
timeV = {s = "time"};
|
||||
likeV = {s = "like"};
|
||||
flyN = {s = "flies"};
|
||||
timeN = {s = "time"};
|
||||
arrowN = {s = "arrow"};
|
||||
anD = {s = "an"};
|
||||
timeD = {s = "time"};
|
||||
likeP = {s = "like"};
|
||||
|
||||
}
|
||||
27
grammars/testConversions/TimeFliesAbs.gf
Normal file
27
grammars/testConversions/TimeFliesAbs.gf
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
abstract TimeFliesAbs = {
|
||||
|
||||
cat
|
||||
S; VP; NP; PP; V; N; D; P;
|
||||
|
||||
fun
|
||||
s1 : NP -> VP -> S;
|
||||
vp1 : V -> VP;
|
||||
vp2 : V -> NP -> VP;
|
||||
vp3 : VP -> PP -> VP;
|
||||
np1 : N -> NP;
|
||||
np2 : D -> N -> NP;
|
||||
np3 : NP -> PP -> NP;
|
||||
pp1 : P -> NP -> PP;
|
||||
|
||||
flyV : V;
|
||||
timeV : V;
|
||||
likeV : V;
|
||||
flyN : N;
|
||||
timeN : N;
|
||||
arrowN : N;
|
||||
anD : D;
|
||||
timeD : D;
|
||||
likeP : P;
|
||||
}
|
||||
|
||||
2
grammars/testConversions/TimeFliesCnc.gf
Normal file
2
grammars/testConversions/TimeFliesCnc.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
resource
|
||||
Reference in New Issue
Block a user