mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-06-17 23:30:14 -06:00
the names API in more languages
This commit is contained in:
@@ -91,7 +91,10 @@ concrete CatEst of Cat = CommonX ** open HjkEst, ResEst, Prelude in {
|
||||
c2,c3 : Compl ;
|
||||
isPre,isPre2 : Bool
|
||||
} ;
|
||||
GN, SN, LN, PN = {s : Case => Str} ;
|
||||
PN = {s : Case => Str} ;
|
||||
LN = {s : Case => Str; n : Number} ;
|
||||
GN = {s : Case => Str; g : Sex} ;
|
||||
SN = {s : Sex => Case => Str; pl : Case => Str} ;
|
||||
|
||||
linref
|
||||
VP = \vp -> linV vp.v ;
|
||||
|
||||
@@ -36,6 +36,33 @@ lin
|
||||
s2 = inflNoun (caseplus2nf noun)
|
||||
} ;
|
||||
|
||||
InflectionPN = \pn -> {
|
||||
t = "s" ;
|
||||
s1 = heading1 "Õige Nimi" ;
|
||||
s2 = inflPN pn.s
|
||||
} ;
|
||||
|
||||
InflectionLN = \ln -> {
|
||||
t = "s" ;
|
||||
s1 = heading1 "Asukoha Nimi" ;
|
||||
s2 = inflPN ln.s
|
||||
} ;
|
||||
|
||||
InflectionGN = \gn -> {
|
||||
t = "s" ;
|
||||
s1 = heading1 "Eesnimi"++case gn.g of {
|
||||
Male => "(mees)" ;
|
||||
Female => "(naine)"
|
||||
} ;
|
||||
s2 = inflPN gn.s
|
||||
} ;
|
||||
|
||||
InflectionSN = \sn -> {
|
||||
t = "s" ;
|
||||
s1 = heading1 "Perekonnanimi" ;
|
||||
s2 = inflPN (sn.s ! Male)
|
||||
} ;
|
||||
|
||||
InflectionA, InflectionA2 = \adj ->
|
||||
let posit : (AForm => Str) = adj.s ! Posit ;
|
||||
compar : (AForm => Str) = adj.s ! Compar ;
|
||||
@@ -272,6 +299,20 @@ oper
|
||||
tr (th (heading instructive_Parameter) ++ td (nouns Sg Terminative) ++ td (nouns Pl Terminative))
|
||||
) ;
|
||||
|
||||
inflPN : (ResEst.Case => Str) -> Str = \pn ->
|
||||
frameTable (
|
||||
tr (th (heading nominative_Parameter) ++ td (pn ! Nom)) ++
|
||||
tr (th (heading genitive_Parameter) ++ td (pn ! Gen)) ++
|
||||
tr (th (heading partitive_Parameter) ++ td (pn ! Part)) ++
|
||||
tr (th (heading translative_Parameter) ++ td (pn ! Transl)) ++
|
||||
tr (th (heading illative_Parameter) ++ td (pn ! Illat)) ++
|
||||
tr (th (heading inessive_Parameter) ++ td (pn ! Iness)) ++
|
||||
tr (th (heading elative_Parameter) ++ td (pn ! Elat)) ++
|
||||
tr (th (heading allative_Parameter) ++ td (pn ! Allat)) ++
|
||||
tr (th (heading adessive_Parameter) ++ td (pn ! Adess)) ++
|
||||
tr (th (heading ablative_Parameter) ++ td (pn ! Ablat))
|
||||
) ;
|
||||
|
||||
lin
|
||||
NoDefinition t = {s=t.s};
|
||||
MkDefinition t d = {s="<p><b>Definitsioon:</b>"++t.s++d.s++"</p>"};
|
||||
|
||||
@@ -1,20 +1,44 @@
|
||||
concrete NamesEst of Names = CatEst ** open ResEst, Prelude in {
|
||||
concrete NamesEst of Names = CatEst ** open ResEst, ParadigmsEst, Prelude in {
|
||||
|
||||
lin GivenName, MaleSurname, FemaleSurname = \n -> emptyNP ** {
|
||||
lin GivenName n = emptyNP ** {
|
||||
s = \\c => n.s ! npform2case Sg c ;
|
||||
a = agrP3 Sg ;
|
||||
isPron = False
|
||||
} ;
|
||||
lin MaleSurname n = emptyNP ** {
|
||||
s = \\c => n.s ! Male ! npform2case Sg c ;
|
||||
a = agrP3 Sg ;
|
||||
isPron = False
|
||||
} ;
|
||||
lin FemaleSurname n = emptyNP ** {
|
||||
s = \\c => n.s ! Female ! npform2case Sg c ;
|
||||
a = agrP3 Sg ;
|
||||
isPron = False
|
||||
} ;
|
||||
lin PlSurname n = emptyNP ** {
|
||||
s = \\c => n.pl ! npform2case Sg c ;
|
||||
a = agrP3 Pl ;
|
||||
isPron = False
|
||||
} ;
|
||||
lin FullName gn sn = emptyNP ** {
|
||||
s = \\c => gn.s ! Nom ++ sn.s ! npform2case Sg c ;
|
||||
s = \\c => gn.s ! Nom ++ sn.s ! gn.g ! npform2case Sg c ;
|
||||
a = agrP3 Sg ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
lin UseLN pn = emptyNP ** {
|
||||
s = \\c => pn.s ! npform2case Sg c ;
|
||||
lin UseLN, PlainLN = \ln -> emptyNP ** {
|
||||
s = \\c => ln.s ! npform2case Sg c ;
|
||||
a = agrP3 Sg ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
lin InLN pn = {
|
||||
s = appCompl True Pos (casePrep inessive)
|
||||
(emptyNP ** {
|
||||
s = \\c => pn.s ! npform2case Sg c ;
|
||||
a = agrP3 Sg ;
|
||||
isPron = False
|
||||
})
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -42,6 +42,9 @@ resource ParadigmsEst = open
|
||||
-- defined in $ResEst$.
|
||||
|
||||
oper
|
||||
male = Male ;
|
||||
female = Female ;
|
||||
|
||||
Number : Type ;
|
||||
|
||||
singular : Number ;
|
||||
@@ -610,6 +613,55 @@ oper
|
||||
|
||||
mkPN_1 : Str -> PN = \s -> lin PN {s = \\c => (mk1N s).s ! NCase Sg c} ;
|
||||
|
||||
mkLN = overload {
|
||||
mkLN : Str -> LN =
|
||||
\s -> lin LN {s = \\c => (mk1N s).s ! NCase Sg c ;
|
||||
n = Sg} ;
|
||||
mkLN : Str -> Number -> LN =
|
||||
\s,n -> lin LN {s = \\c => (mk1N s).s ! NCase n c ;
|
||||
n = n} ;
|
||||
mkLN : N -> LN =
|
||||
\noun -> lin LN {s = \\c => noun.s ! NCase Sg c ;
|
||||
n = Sg} ;
|
||||
mkLN : N -> Number -> LN =
|
||||
\noun,n -> lin LN {s = \\c => noun.s ! NCase n c ;
|
||||
n = n} ;
|
||||
} ;
|
||||
|
||||
mkGN = overload {
|
||||
mkGN : Str -> GN =
|
||||
\s -> lin GN {s = \\c => (mk1N s).s ! NCase Sg c ;
|
||||
g = Male} ;
|
||||
mkGN : Str -> Sex -> GN =
|
||||
\s,g -> lin GN {s = \\c => (mk1N s).s ! NCase Sg c ;
|
||||
g = g} ;
|
||||
mkGN : N -> GN =
|
||||
\noun -> lin GN {s = \\c => noun.s ! NCase Sg c ;
|
||||
g = Male} ;
|
||||
mkGN : N -> Sex -> GN =
|
||||
\noun,g -> lin GN {s = \\c => noun.s ! NCase Sg c ;
|
||||
g = g} ;
|
||||
} ;
|
||||
|
||||
mkSN = overload {
|
||||
mkSN : Str -> SN =
|
||||
\s -> lin SN {s = \\_,c => (mk1N s).s ! NCase Sg c ;
|
||||
pl = \\c => (mk1N s).s ! NCase Sg c} ;
|
||||
mkSN : Str -> Str -> Str -> SN =
|
||||
\male,female,pl -> lin SN {s = table {Male =>\\c => (mk1N male).s ! NCase Sg c ;
|
||||
Female=>\\c => (mk1N female).s ! NCase Sg c} ;
|
||||
pl = \\c => (mk1N pl).s ! NCase Sg c} ;
|
||||
mkSN : N -> SN =
|
||||
\noun -> lin SN {s = \\_,c => noun.s ! NCase Sg c ;
|
||||
pl = \\c => noun.s ! NCase Sg c} ;
|
||||
mkSN : N -> N -> N -> SN =
|
||||
\male,female,pl -> lin SN {s = table {Male =>\\c => male.s ! NCase Sg c ;
|
||||
Female=>\\c => female.s ! NCase Sg c} ;
|
||||
pl = \\c => pl.s ! NCase Sg c} ;
|
||||
} ;
|
||||
|
||||
prepLN : LN -> Prep -> LN = \n,s -> n ** {c = s} ;
|
||||
|
||||
-- adjectives
|
||||
|
||||
mkA = overload {
|
||||
|
||||
Reference in New Issue
Block a user