mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
added NamesIna
This commit is contained in:
@@ -78,7 +78,8 @@ concrete CatIna of Cat = CommonX ** open ResIna, Prelude in {
|
|||||||
N2 = {s : Number => Str} ** {p2 : Str; c2 : Case} ;
|
N2 = {s : Number => Str} ** {p2 : Str; c2 : Case} ;
|
||||||
N3 = {s : Number => Str} ** {p2,p3 : Str; c2,c3 : Case} ;
|
N3 = {s : Number => Str} ** {p2,p3 : Str; c2,c3 : Case} ;
|
||||||
|
|
||||||
PN,LN = {s : Str} ;
|
PN = {s : Str} ;
|
||||||
|
LN = {s : Str ; n : Number ; art : Bool} ;
|
||||||
GN = {s : Str ; g : Sex} ;
|
GN = {s : Str ; g : Sex} ;
|
||||||
SN = {s : Sex => Str ; pl : Str} ;
|
SN = {s : Sex => Str ; pl : Str} ;
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ concrete GrammarIna of Grammar =
|
|||||||
TextX,
|
TextX,
|
||||||
StructuralIna,
|
StructuralIna,
|
||||||
IdiomIna,
|
IdiomIna,
|
||||||
TenseX
|
TenseX,
|
||||||
|
NamesIna
|
||||||
** {
|
** {
|
||||||
|
|
||||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||||
|
|||||||
60
src/interlingua/NamesIna.gf
Normal file
60
src/interlingua/NamesIna.gf
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
concrete NamesIna of Names = CatIna ** open Prelude, ResIna in {
|
||||||
|
|
||||||
|
lin GivenName gn = {
|
||||||
|
s = \\_ => gn.s;
|
||||||
|
a = agrP3 Sg;
|
||||||
|
isPronoun = False
|
||||||
|
} ;
|
||||||
|
lin MaleSurname = \sn -> {
|
||||||
|
s = \\_ => sn.s ! Male;
|
||||||
|
a = agrP3 Sg;
|
||||||
|
isPronoun = False
|
||||||
|
} ;
|
||||||
|
lin FemaleSurname = \sn -> {
|
||||||
|
s = \\_ => sn.s ! Female;
|
||||||
|
a = agrP3 Sg;
|
||||||
|
isPronoun = False
|
||||||
|
} ;
|
||||||
|
lin PlSurname = \sn -> {
|
||||||
|
s = \\_ => sn.pl;
|
||||||
|
a = agrP3 Pl;
|
||||||
|
isPronoun = False
|
||||||
|
} ;
|
||||||
|
lin FullName gn sn = {
|
||||||
|
s = \\_ => gn.s ++ sn.s ! gn.g ;
|
||||||
|
a = agrP3 Pl;
|
||||||
|
isPronoun = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
lin UseLN ln = {
|
||||||
|
s = \\c => artLN ln c ;
|
||||||
|
a = agrP3 ln.n;
|
||||||
|
isPronoun = False
|
||||||
|
} ;
|
||||||
|
lin PlainLN ln = {
|
||||||
|
s = \\_ => ln.s;
|
||||||
|
a = agrP3 ln.n;
|
||||||
|
isPronoun = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
lin InLN ln = {
|
||||||
|
s = "in" ++ artLN ln Acc ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
lin AdjLN ap ln = ln ** {
|
||||||
|
s = preOrPost ap.isPre (ap.s ! agrP3 ln.n) ln.s ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
artLN : LN -> Case -> Str = \ln,c ->
|
||||||
|
case ln.art of {
|
||||||
|
True => case c of {
|
||||||
|
Dat => "al";
|
||||||
|
Gen | Abl => "del";
|
||||||
|
_ => "le"
|
||||||
|
} ++
|
||||||
|
ln.s ;
|
||||||
|
False => ln.s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -185,8 +185,12 @@ oper
|
|||||||
-- cnN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p.s ; c3 = q.s} ;
|
-- cnN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p.s ; c3 = q.s} ;
|
||||||
--
|
--
|
||||||
mkPN : Str -> PN = regGenPN;
|
mkPN : Str -> PN = regGenPN;
|
||||||
|
|
||||||
mkLN : Str -> LN = \s -> lin LN {s=s};
|
mkLN = overload {
|
||||||
|
mkLN : Str -> LN = \s -> lin LN {s=s; n=Sg; art=False};
|
||||||
|
mkLN : Str -> Number -> LN = \s,n -> lin LN {s=s; n=n; art=False};
|
||||||
|
} ;
|
||||||
|
|
||||||
mkGN : Str -> Sex -> GN = \s,g -> lin GN {s=s; g=g};
|
mkGN : Str -> Sex -> GN = \s,g -> lin GN {s=s; g=g};
|
||||||
mkSN = overload {
|
mkSN = overload {
|
||||||
mkSN : Str -> SN = \s -> lin SN {s=\\_ => s; pl=s};
|
mkSN : Str -> SN = \s -> lin SN {s=\\_ => s; pl=s};
|
||||||
|
|||||||
Reference in New Issue
Block a user