forked from GitHub/gf-rgl
progress on the Names API
This commit is contained in:
@@ -110,7 +110,7 @@ concrete CatEng of Cat = CommonX - [Pol,CAdv] ** open ResEng, Prelude in {
|
||||
LN = {s : Case => Str;
|
||||
p : Str; -- preposition "in Scandinavia", "on the Balkans"
|
||||
art : Bool; -- plain name "United States" vs "the United States"
|
||||
a : Agr;
|
||||
n : Number;
|
||||
} ;
|
||||
|
||||
lindef
|
||||
|
||||
@@ -38,6 +38,23 @@ lin
|
||||
)
|
||||
} ;
|
||||
|
||||
InflectionLN = \n -> {
|
||||
t = "ln" ;
|
||||
s1 = heading1 ("Location Name" ++
|
||||
case n.n of {
|
||||
Sg => "";
|
||||
Pl => "(plural)"
|
||||
}) ;
|
||||
s2 = frameTable (
|
||||
tr (th "nom" ++ th "gen") ++
|
||||
tr (td (n.s ! Nom) ++ td (n.s ! Gen))
|
||||
) ++
|
||||
heading1 ("Adverb") ++
|
||||
paragraph (n.p ++ case n.art of {
|
||||
True => "the" ++ n.s ! Nom ;
|
||||
False => n.s ! Nom}) ;
|
||||
} ;
|
||||
|
||||
InflectionGN = \pn -> {
|
||||
t = "gn" ;
|
||||
s1 = heading1 ("Given Name" ++
|
||||
|
||||
@@ -9,12 +9,12 @@ lin UseLN n = {
|
||||
True => "the" ++ n.s ! npcase2case c ;
|
||||
False => n.s ! npcase2case c
|
||||
} ;
|
||||
a = n.a
|
||||
a = agrP3 n.n
|
||||
} ;
|
||||
|
||||
lin PlainLN n = {
|
||||
s = \\c => n.s ! npcase2case c ;
|
||||
a = n.a
|
||||
a = agrP3 n.n
|
||||
} ;
|
||||
|
||||
lin InLN n = {
|
||||
@@ -25,7 +25,7 @@ lin InLN n = {
|
||||
} ;
|
||||
|
||||
lin AdjLN ap n = n ** {
|
||||
s = \\c => preOrPost ap.isPre (ap.s ! n.a) (n.s ! c) ;
|
||||
s = \\c => preOrPost ap.isPre (ap.s ! agrP3 n.n) (n.s ! c) ;
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -135,13 +135,13 @@ oper
|
||||
lin LN {s = table {Gen => s + "'s" ; _ => s} ;
|
||||
p = "in" ;
|
||||
art = False ;
|
||||
a = agrP3 Sg} ;
|
||||
n = Sg} ;
|
||||
|
||||
mkLN : Str -> Number -> LN = \s,n ->
|
||||
lin LN {s = table {Gen => s + "'s" ; _ => s} ;
|
||||
p = "in" ;
|
||||
art = False ;
|
||||
a = agrP3 n} ;
|
||||
n = n} ;
|
||||
} ;
|
||||
|
||||
defLN : LN -> LN = \n -> n ** {art = True} ;
|
||||
|
||||
Reference in New Issue
Block a user