Finnish determiner syntax started

This commit is contained in:
aarne
2006-02-06 15:21:55 +00:00
parent 184a4a3401
commit 1568ac53e6
2 changed files with 74 additions and 22 deletions

View File

@@ -44,12 +44,21 @@ concrete CatFin of Cat = TenseX ** open ResFin, Prelude in {
-- Noun -- Noun
CN = {s : Bool => Number => Case => Str} ; -- The $Bool$ tells if a possessive suffix is attached, which affects the case.
CN = {s : NForm => Str} ;
Pron = {s : NPForm => Str ; a : Agr} ; Pron = {s : NPForm => Str ; a : Agr} ;
NP = {s : NPForm => Str ; a : Agr ; isPron : Bool} ; NP = {s : NPForm => Str ; a : Agr ; isPron : Bool} ;
Det = {s : Case => Str ; n : Number ; isNum : Bool} ; Det = {
QuantSg, QuantPl = {s : Case => Str} ; s1 : Case => Str ; -- minun kolme
Predet, Quant, Ord = {s : Number => Case => Str} ; s2 : Str ; -- -ni
n : Number ; -- Pl (agreement feature for verb)
isNum : Bool ; -- True (a numeral is present)
isPoss : Bool -- True (a possessive suffix is present)
} ;
QuantSg, QuantPl = {s1 : Case => Str ; s2 : Str ; isPoss : Bool} ;
Predet, Ord = {s : Number => Case => Str} ;
Quant = {s1 : Number => Case => Str ; s2 : Str ; isPoss : Bool} ;
Num = {s : Number => Case => Str ; isNum : Bool} ; Num = {s : Number => Case => Str ; isNum : Bool} ;
-- Adverb -- Adverb

View File

@@ -3,44 +3,84 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
flags optimize=all_subs ; flags optimize=all_subs ;
lin lin
{-
DetCN det cn = { -- The $Number$ is subtle: "nuo autot", "nuo kolme autoa" are both plural
s = \\c => det.s ++ cn.s ! det.n ! c ; -- for verb agreement, but the noun form is singular in the latter.
a = agrP3 det.n
DetCN det cn =
let
n : Number = case det.isNum of {
True => Sg ;
_ => det.n
} ;
ncase : Case -> NForm = \c -> case <c,det.isNum,det.isPoss> of {
<Nom,True,_> => NCase Sg Part ;
_ => NCase n c ----
}
in {
s = \\c => let k = npform2case c in
det.s1 ! k ++ cn.s ! ncase k ++ det.s2 ;
a = agrP3 det.n ;
isPron = False
} ; } ;
-}
UsePN pn = { UsePN pn = {
s = \\c => pn.s ! npform2case c ; s = \\c => pn.s ! npform2case c ;
a = agrP3 Sg ; a = agrP3 Sg ;
isPron = False isPron = False
} ; } ;
UsePron p = p ** {isPron = True} ; UsePron p = p ** {isPron = True} ;
{-
PredetNP pred np = { PredetNP pred np = {
s = \\c => pred.s ++ np.s ! c ; s = \\c => pred.s ! np.a.n ! npform2case c ++ np.s ! c ;
a = np.a a = np.a ;
isPron = np.isPron -- kaikki minun - ni
} ; } ;
DetSg quant ord = { DetSg quant ord = {
s = quant.s ++ ord.s ; s1 = \\c => quant.s1 ! c ++ ord.s ! Sg ! c ;
n = Sg s2 = quant.s2 ;
n = Sg ;
isNum = False ;
isPoss = quant.isPoss
} ; } ;
DetPl quant num ord = { DetPl quant num ord = {
s = quant.s ++ num.s ++ ord.s ; s1 = \\c => quant.s1 ! c ++ num.s ! Sg ! c ++ ord.s ! Sg ! c ;
n = Pl s2 = quant.s2 ;
n = Pl ;
isNum = num.isNum ;
isPoss = quant.isPoss
} ; } ;
SgQuant quant = {s = quant.s ! Sg} ; SgQuant quant = {
PlQuant quant = {s = quant.s ! Pl} ; s1 = quant.s1 ! Sg ;
s2 = quant.s2 ;
isNum = quant.isNum ;
isPoss = quant.isPoss
} ;
PlQuant quant = {
s1 = quant.s1 ! Pl ;
s2 = quant.s2 ;
isNum = quant.isNum ;
isPoss = quant.isPoss
} ;
PossPron p = {s = \\_ => p.s ! Gen} ;
NoNum, NoOrd = {s = []} ; PossPron p = {
s1 = \\_,_ => p.s ! NPCase Gen ;
s2 = BIND ++ table Agr ["ni" ; "si" ; "nsa" ; "mme" ; "nne" ; "nsa"] ! p.a ;
isNum = False ;
isPoss = True
} ;
NumInt n = n ; NoNum = {s = \\_,_ => [] ; isNum = False} ;
OrdInt n = {s = n.s ++ "th"} ; --- NoOrd = {s = \\_,_ => []} ;
NumInt n = {s = \\_,_ => n.s ++ "." ; isNum = True} ;
OrdInt n = {s = \\_,_ => n.s ++ "."} ;
{-
NumNumeral numeral = {s = numeral.s ! NCard} ; NumNumeral numeral = {s = numeral.s ! NCard} ;
OrdNumeral numeral = {s = numeral.s ! NOrd} ; OrdNumeral numeral = {s = numeral.s ! NOrd} ;
@@ -58,8 +98,11 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
} ; } ;
MassDet = {s = [] ; n = Sg} ; MassDet = {s = [] ; n = Sg} ;
-}
UseN n = n ; UseN n = n ;
{-
UseN2 n = n ; UseN2 n = n ;
UseN3 n = n ; UseN3 n = n ;