forked from GitHub/gf-core
extended AP with Ord and compar in 1.5
This commit is contained in:
@@ -5,26 +5,33 @@ concrete AdjectiveFin of Adjective = CatFin ** open ResFin, Prelude in {
|
||||
lin
|
||||
|
||||
PositA a = {
|
||||
s = \\_ => a.s ! Posit
|
||||
s = \\_,nf => a.s ! Posit ! AN nf
|
||||
} ;
|
||||
ComparA a np = {
|
||||
s = \\isMod,af => case isMod of {
|
||||
True => np.s ! NPCase Part ++ a.s ! Compar ! af ; -- minua isompi
|
||||
_ => a.s ! Compar ! af ++ "kuin" ++ np.s ! NPCase Nom -- isompi kuin minä
|
||||
True => np.s ! NPCase Part ++ a.s ! Compar ! AN af ; -- minua isompi
|
||||
_ => a.s ! Compar ! AN af ++ "kuin" ++ np.s ! NPCase Nom -- isompi kuin minä
|
||||
}
|
||||
} ;
|
||||
UseComparA a = {
|
||||
s = \\_,nf => a.s ! Compar ! AN nf ;
|
||||
} ;
|
||||
|
||||
-- $SuperlA$ belongs to determiner syntax in $Noun$.
|
||||
AdjOrd ord = {
|
||||
s = \\_ => ord.s
|
||||
} ;
|
||||
|
||||
|
||||
ComplA2 adj np = {
|
||||
s = \\isMod,af =>
|
||||
preOrPost isMod (appCompl True Pos adj.c2 np) (adj.s ! Posit ! af)
|
||||
preOrPost isMod (appCompl True Pos adj.c2 np) (adj.s ! Posit ! AN af)
|
||||
} ;
|
||||
|
||||
ReflA2 adj = {
|
||||
s = \\isMod,af =>
|
||||
preOrPost isMod
|
||||
(appCompl True Pos adj.c2 (reflPron (agrP3 Sg))) (adj.s ! Posit ! af)
|
||||
(appCompl True Pos adj.c2 (reflPron (agrP3 Sg))) (adj.s ! Posit ! AN af)
|
||||
} ;
|
||||
|
||||
SentAP ap sc = {
|
||||
@@ -35,6 +42,8 @@ concrete AdjectiveFin of Adjective = CatFin ** open ResFin, Prelude in {
|
||||
s = \\b,af => ada.s ++ ap.s ! b ! af
|
||||
} ;
|
||||
|
||||
UseA2 a = a ;
|
||||
UseA2 a = {
|
||||
s = \\_,nf => a.s ! Posit ! AN nf
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ concrete CatFin of Cat = CommonX ** open ResFin, Prelude in {
|
||||
-- The $Bool$ tells whether usage is modifying (as opposed to
|
||||
-- predicative), e.g. "x on suurempi kuin y" vs. "y:tä suurempi luku".
|
||||
|
||||
AP = {s : Bool => AForm => Str} ;
|
||||
AP = {s : Bool => NForm => Str} ;
|
||||
|
||||
-- Noun
|
||||
|
||||
@@ -59,11 +59,11 @@ concrete CatFin of Cat = CommonX ** open ResFin, Prelude in {
|
||||
isDef : Bool -- True (verb agrees in Pl, Nom is not Part)
|
||||
} ;
|
||||
---- QuantSg, QuantPl = {s1 : Case => Str ; s2 : Str ; isPoss, isDef : Bool} ;
|
||||
Ord = {s : Number => Case => Str} ;
|
||||
Ord = {s : NForm => Str} ;
|
||||
Predet = {s : Number => NPForm => Str} ;
|
||||
Quant = {s1 : Number => Case => Str ; s2 : Str ; isPoss : Bool ; isDef : Bool} ;
|
||||
Card = {s : Number => Case => Str ; n : Number} ;
|
||||
Num = {s : Number => Case => Str ; isNum : Bool ; n : Number} ;
|
||||
Quant = {s1 : Number => Case => Str ; s2 : Str ; isPoss : Bool ; isDef : Bool} ;
|
||||
Card = {s : Number => Case => Str ; n : Number} ;
|
||||
Num = {s : Number => Case => Str ; isNum : Bool ; n : Number} ;
|
||||
|
||||
-- Numeral
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ concrete ConjunctionFin of Conjunction =
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
ConjAP conj ss = conjunctDistrTable2 Bool AForm conj ss ;
|
||||
ConjAP conj ss = conjunctDistrTable2 Bool NForm conj ss ;
|
||||
|
||||
-- These fun's are generated from the list cat's.
|
||||
|
||||
@@ -24,13 +24,13 @@ concrete ConjunctionFin of Conjunction =
|
||||
ConsAdv = consrSS comma ;
|
||||
BaseNP x y = twoTable NPForm x y ** {a = conjAgr x.a y.a} ;
|
||||
ConsNP xs x = consrTable NPForm comma xs x ** {a = conjAgr xs.a x.a} ;
|
||||
BaseAP x y = twoTable2 Bool AForm x y ;
|
||||
ConsAP xs x = consrTable2 Bool AForm comma xs x ;
|
||||
BaseAP x y = twoTable2 Bool NForm x y ;
|
||||
ConsAP xs x = consrTable2 Bool NForm comma xs x ;
|
||||
|
||||
lincat
|
||||
[S] = {s1,s2 : Str} ;
|
||||
[Adv] = {s1,s2 : Str} ;
|
||||
[NP] = {s1,s2 : NPForm => Str ; a : Agr} ;
|
||||
[AP] = {s1,s2 : Bool => AForm => Str} ;
|
||||
[AP] = {s1,s2 : Bool => NForm => Str} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -381,7 +381,7 @@ lin
|
||||
|
||||
oper
|
||||
mkOrd : N -> Ord ;
|
||||
mkOrd x = {s = \\n,c => x.s ! NCase n c; lock_Ord = <> } ;
|
||||
mkOrd x = {s = x.s ; lock_Ord = <> } ;
|
||||
cpartitive = casePrep partitive ;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -77,7 +77,7 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
|
||||
} ;
|
||||
|
||||
DetQuantOrd quant num ord = {
|
||||
s1 = \\c => quant.s1 ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! Pl ! c ;
|
||||
s1 = \\c => quant.s1 ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! NCase Pl c ;
|
||||
s2 = quant.s2 ;
|
||||
n = num.n ;
|
||||
isNum = num.isNum ;
|
||||
@@ -94,38 +94,6 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
|
||||
isDef = True
|
||||
} ;
|
||||
|
||||
|
||||
{-
|
||||
DetArtSg det cn =
|
||||
let
|
||||
n : Number = Sg ;
|
||||
ncase : Case -> NForm = \c -> NCase n c ;
|
||||
in {
|
||||
s = \\c => let k = npform2case n c in
|
||||
det.s1 ! Sg ! k ++ cn.s ! ncase k ;
|
||||
a = agrP3 Sg ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
DetArtPl det cn =
|
||||
let
|
||||
n : Number = Pl ;
|
||||
ncase : Case -> NForm = \c ->
|
||||
case <n,c,det.isDef> of {
|
||||
<Pl,Nom,False> => NCase Pl Part ; -- kytkimiä
|
||||
_ => NCase n c -- kytkin, kytkimen,...
|
||||
}
|
||||
in {
|
||||
s = \\c => let k = npform2case n c in
|
||||
det.s1 ! Pl ! k ++ cn.s ! ncase k ;
|
||||
a = agrP3 (case det.isDef of {
|
||||
False => Sg ; -- autoja menee; kolme autoa menee
|
||||
_ => Pl
|
||||
}) ;
|
||||
isPron = False
|
||||
} ;
|
||||
-}
|
||||
|
||||
PossPron p = {
|
||||
s1 = \\_,_ => p.s ! NPCase Gen ;
|
||||
s2 = BIND ++ possSuffix p.a ;
|
||||
@@ -143,20 +111,20 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
|
||||
s = \\n,c => numeral.s ! NCard (NCase n c) ;
|
||||
n = numeral.n
|
||||
} ;
|
||||
OrdDigits numeral = {s = \\n,c => numeral.s ! NOrd (NCase n c)} ;
|
||||
OrdDigits numeral = {s = \\nc => numeral.s ! NOrd nc} ;
|
||||
|
||||
NumNumeral numeral = {
|
||||
s = \\n,c => numeral.s ! NCard (NCase n c) ;
|
||||
n = numeral.n
|
||||
} ;
|
||||
OrdNumeral numeral = {s = \\n,c => numeral.s ! NOrd (NCase n c)} ;
|
||||
OrdNumeral numeral = {s = \\nc => numeral.s ! NOrd nc} ;
|
||||
|
||||
AdNum adn num = {
|
||||
s = \\n,c => adn.s ++ num.s ! n ! c ;
|
||||
n = num.n
|
||||
} ;
|
||||
|
||||
OrdSuperl a = {s = \\n,c => a.s ! Superl ! AN (NCase n c)} ;
|
||||
OrdSuperl a = {s = \\nc => a.s ! Superl ! AN nc} ;
|
||||
|
||||
DefArt = {
|
||||
s1 = \\_,_ => [] ;
|
||||
@@ -210,7 +178,7 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
|
||||
} ;
|
||||
|
||||
AdjCN ap cn = {
|
||||
s = \\nf => ap.s ! True ! AN (n2nform nf) ++ cn.s ! nf
|
||||
s = \\nf => ap.s ! True ! (n2nform nf) ++ cn.s ! nf
|
||||
} ;
|
||||
|
||||
RelCN cn rs = {s = \\nf => cn.s ! nf ++ rs.s ! agrP3 (numN nf)} ;
|
||||
|
||||
@@ -33,7 +33,7 @@ concrete VerbFin of Verb = CatFin ** open Prelude, ResFin in {
|
||||
ComplVA v ap =
|
||||
insertObj
|
||||
(\\_,b,agr =>
|
||||
ap.s ! False ! AN (NCase agr.n (npform2case agr.n v.c2.c))) --- v.cs.s ignored
|
||||
ap.s ! False ! (NCase agr.n (npform2case agr.n v.c2.c))) --- v.cs.s ignored
|
||||
(predV v) ;
|
||||
|
||||
SlashV2S v s =
|
||||
@@ -46,7 +46,7 @@ concrete VerbFin of Verb = CatFin ** open Prelude, ResFin in {
|
||||
SlashV2A v ap =
|
||||
insertObj
|
||||
(\\fin,b,_ =>
|
||||
ap.s ! False ! AN (NCase Sg (npform2case Sg v.c3.c))) ----agr to obj
|
||||
ap.s ! False ! (NCase Sg (npform2case Sg v.c3.c))) ----agr to obj
|
||||
(predV v) ** {c2 = v.c2} ;
|
||||
|
||||
ComplSlash vp np = insertObj (\\fin,b,_ => appCompl fin b vp.c2 np) vp ;
|
||||
@@ -95,7 +95,7 @@ concrete VerbFin of Verb = CatFin ** open Prelude, ResFin in {
|
||||
Sg => Nom ; -- minä olen iso
|
||||
Pl => Part -- me olemme isoja
|
||||
} --- definiteness of NP ?
|
||||
in ap.s ! False ! AN (NCase agr.n c)
|
||||
in ap.s ! False ! (NCase agr.n c)
|
||||
} ;
|
||||
CompNP np = {s = \\_ => np.s ! NPCase Nom} ;
|
||||
CompAdv a = {s = \\_ => a.s} ;
|
||||
|
||||
Reference in New Issue
Block a user