progress on the Names API

This commit is contained in:
Krasimir Angelov
2023-08-07 21:15:48 +02:00
parent 9fcee982e5
commit 531e2c2dd2
36 changed files with 220 additions and 22 deletions
+10 -8
View File
@@ -32,16 +32,18 @@ lin
)
} ;
InflectionPN = \pn -> {
InflectionLN = \n -> {
t = "nm" ;
s1 = heading1 ("Namn" ++ case pn.g of {
Utr => "(utr)" ;
Neutr => "(neutr)"
}) ;
s1 = heading1 ("Platsnamn" ++ case n.g of {
Utr => "(utr)" ;
Neutr => "(neutr)"
}) ;
s2 = frameTable (
tr (th "nom" ++ td (pn.s ! Nom)) ++
tr (th "gen" ++ td (pn.s ! Gen))
)
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 -> {
+8
View File
@@ -11,4 +11,12 @@ lin FullName gn sn = {
isPron = False
} ;
UseLN, PlainLN = \n -> {
s = \\c => n.s ! caseNP c ;
a = agrP3 n.g n.n ;
isPron = False
} ;
InLN n = {s = n.c.s ++ n.s ! caseNP accusative} ;
}
+8
View File
@@ -154,6 +154,14 @@ 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
} ;
prepLN : LN -> Prep -> LN = \n,p -> n ** {c = mkComplement p.s} ;
--2 Adjectives
-- Adjectives need one to seven forms.