forked from GitHub/gf-rgl
the names API in more languages
This commit is contained in:
@@ -41,16 +41,14 @@ lin
|
||||
s2 = frameTable (
|
||||
tr (th "nom" ++ td (n.s ! Nom)) ++
|
||||
tr (th "gen" ++ td (n.s ! Gen))
|
||||
) ++
|
||||
heading1 ("Adverb") ++
|
||||
paragraph (n.c.s ++ n.s ! caseNP accusative) ;
|
||||
) ;
|
||||
} ;
|
||||
|
||||
InflectionGN = \pn -> {
|
||||
t = "fnm" ;
|
||||
s1 = heading1 ("Förnamn" ++ case pn.g of {
|
||||
Utr => "(utr)" ;
|
||||
Neutr => "(neutr)"
|
||||
Male => "(man)" ;
|
||||
Female => "(kvinna)"
|
||||
}) ;
|
||||
s2 = frameTable (
|
||||
tr (th "nom" ++ td (pn.s ! Nom)) ++
|
||||
@@ -60,13 +58,10 @@ lin
|
||||
|
||||
InflectionSN = \pn -> {
|
||||
t = "enm" ;
|
||||
s1 = heading1 ("Efternamn" ++ case pn.g of {
|
||||
Utr => "(utr)" ;
|
||||
Neutr => "(neutr)"
|
||||
}) ;
|
||||
s1 = heading1 "Efternamn" ;
|
||||
s2 = frameTable (
|
||||
tr (th "nom" ++ td (pn.s ! Nom)) ++
|
||||
tr (th "gen" ++ td (pn.s ! Gen))
|
||||
tr (th "nom" ++ td (pn.s ! Male ! Nom)) ++
|
||||
tr (th "gen" ++ td (pn.s ! Male ! Gen))
|
||||
)
|
||||
} ;
|
||||
|
||||
|
||||
@@ -1,13 +1,28 @@
|
||||
concrete NamesSwe of Names = CatSwe ** open CommonScand, ResSwe, Prelude in {
|
||||
|
||||
lin GivenName, MaleSurname, FemaleSurname = \pn -> {
|
||||
lin GivenName = \pn -> {
|
||||
s = \\c => pn.s ! caseNP c ;
|
||||
a = agrP3 pn.g Sg ;
|
||||
a = agrP3 Utr Sg ;
|
||||
isPron = False
|
||||
} ;
|
||||
lin MaleSurname = \pn -> {
|
||||
s = \\c => pn.s ! Male ! caseNP c ;
|
||||
a = agrP3 Utr Sg ;
|
||||
isPron = False
|
||||
} ;
|
||||
lin FemaleSurname = \pn -> {
|
||||
s = \\c => pn.s ! Female ! caseNP c ;
|
||||
a = agrP3 Utr Sg ;
|
||||
isPron = False
|
||||
} ;
|
||||
lin PlSurname = \pn -> {
|
||||
s = \\c => pn.pl ! caseNP c ;
|
||||
a = agrP3 Utr Pl ;
|
||||
isPron = False
|
||||
} ;
|
||||
lin FullName gn sn = {
|
||||
s = \\c => gn.s ! Nom ++ sn.s ! caseNP c ;
|
||||
a = agrP3 gn.g Sg ;
|
||||
s = \\c => gn.s ! Nom ++ sn.s ! gn.g ! caseNP c ;
|
||||
a = agrP3 Utr Sg ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
@@ -17,6 +32,6 @@ lin FullName gn sn = {
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
InLN n = {s = n.c.s ++ n.s ! caseNP accusative} ;
|
||||
InLN n = {s = "i" ++ n.s ! caseNP accusative} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -155,12 +155,24 @@ oper
|
||||
geoPN : Str -> PN ; -- neuter, with identical genitive if ends in a vowel
|
||||
|
||||
mkLN = overload {
|
||||
mkLN : Str -> LN = \s -> lin LN (regPN s) ** {c={s="i";hasPrep=True}; n=Sg}; -- default gender utrum
|
||||
mkLN : Str -> Gender -> LN = \s,g -> lin LN (regGenPN s g) ** {c={s="i";hasPrep=True}; n=Sg} ; -- set other gender
|
||||
mkLN : Str -> Gender -> Number -> LN = \s,g,n -> lin LN (regGenPN s g) ** {c={s="i";hasPrep=True}; n=n} ; -- set other gender
|
||||
mkLN : Str -> LN = \s -> lin LN (regPN s) ** {n=Sg}; -- default gender utrum
|
||||
mkLN : Str -> Gender -> LN = \s,g -> lin LN (regGenPN s g) ** {n=Sg} ; -- set other gender
|
||||
mkLN : Str -> Gender -> Number -> LN = \s,g,n -> lin LN (regGenPN s g) ** {n=n} ; -- set other gender and number
|
||||
} ;
|
||||
|
||||
mkGN = overload {
|
||||
mkGN : Str -> GN = \s -> lin GN {s = \\c => mkCase c s ; g = Male}; -- default gender utrum
|
||||
mkGN : Str -> Sex -> GN = \s,g -> lin GN {s = \\c => mkCase c s ; g = g} ; -- set other gender
|
||||
} ;
|
||||
|
||||
mkSN = overload {
|
||||
mkSN : Str -> SN = \s -> lin SN {s = \\_,c => mkCase c s; pl = \\c => mkCase c s}; -- default gender utrum
|
||||
mkSN : Str -> Str -> Str -> SN =
|
||||
\male,female,pl -> lin SN {s = table {Male => \\c => mkCase c male;
|
||||
Female => \\c => mkCase c female} ;
|
||||
pl = \\c => mkCase c pl
|
||||
} ;
|
||||
} ;
|
||||
|
||||
prepLN : LN -> Prep -> LN = \n,p -> n ** {c = mkComplement p.s} ;
|
||||
|
||||
--2 Adjectives
|
||||
|
||||
@@ -359,6 +371,8 @@ oper
|
||||
utrum = Utr ;
|
||||
neutrum = Neutr ;
|
||||
neuter = Neutr ;
|
||||
male = Male ;
|
||||
female = Female ;
|
||||
singular = Sg ;
|
||||
plural = Pl ;
|
||||
nominative = Nom ;
|
||||
|
||||
Reference in New Issue
Block a user