elements of syntax for nouns phrases

This commit is contained in:
Krasimir Angelov
2026-04-13 16:05:39 +02:00
parent 5f6a8b2905
commit e3b27613fd
4 changed files with 33 additions and 13 deletions

View File

@@ -3,8 +3,8 @@ concrete CatHye of Cat = CommonX ** open Prelude,ResHye in {
lincat A2 = Adj ** {c2 : Compl} ;
lincat ACard = {s : Str} ;
lincat AP = {} ;
lincat CN = {s : Case => Number => Str; def_dat : Number => Str;
def_nom : Number => Str; poss1 : Case => Number => Str;
lincat CN = {s : Species => Case => Number => Str;
poss1 : Case => Number => Str;
poss2 : Case => Number => Str} ;
lincat Card = {s : Str} ;
lincat Cl = {s : Str} ;
@@ -13,7 +13,7 @@ concrete CatHye of Cat = CommonX ** open Prelude,ResHye in {
lincat Conj = {s : Str} ;
lincat DAP = {s : Str} ;
lincat Decimal = {s : Str} ;
lincat Det = {s : Str; n : Number} ;
lincat Det = {s : Str; n : Number; sp : Species} ;
lincat Digits = {s : Str} ;
lincat GN = {s : Str} ;
lincat IComp = {s : Str} ;
@@ -25,19 +25,17 @@ concrete CatHye of Cat = CommonX ** open Prelude,ResHye in {
lincat N = Noun ;
lincat N2 = Noun ** {c2 : Compl} ;
lincat N3 = Noun ** {c2,c3 : Compl} ;
lincat NP = {s : Case => Number => Str; def_dat : Number => Str;
def_nom : Number => Str; poss1 : Case => Number => Str;
poss2 : Case => Number => Str} ;
lincat NP = {s : Case => Str; a : Agr} ;
lincat Num = {s : Str; n : Number} ;
lincat Numeral = {s : Str} ;
lincat Ord = {s : Str} ;
lincat PN = {s : Str} ;
lincat Predet = {s : Str} ;
lincat Prep = Compl ;
lincat Pron = {s : Str} ;
lincat Pron = {s : Str; a : Agr} ;
lincat QCl = {s : Str} ;
lincat QS = {s : Str} ;
lincat Quant = {s : Str} ;
lincat Quant = {s : Str; sp : Species} ;
lincat RCl = {s : Str} ;
lincat RP = {s : Str} ;
lincat RS = {s : Str} ;

View File

@@ -1,4 +1,25 @@
concrete NounHye of Noun = CatHye ** {
lin
UseN n = n ;
concrete NounHye of Noun = CatHye ** open ResHye in {
lin AdvCN cn adv = {
s = \\sp,c,num => cn.s ! sp ! c ! num ++ adv.s ;
poss1 = \\c,num => cn.poss1 ! c ! num ++ adv.s ;
poss2 = \\c,num => cn.poss2 ! c ! num ++ adv.s
} ;
lin DefArt = {s = []; sp = Def} ;
lin DetCN det cn = {s = \\c => det.s ++ cn.s ! det.sp ! c ! det.n;
a = {n=det.n; p=P3}} ;
lin DetQuant quant num = {s = quant.s ++ num.s; n = num.n; sp=quant.sp} ;
lin IndefArt = {s = []; sp = Indef} ;
lin NumPl = {s = []; n = Pl} ;
lin NumSg = {s = []; n = Sg} ;
lin PossPron pron = {s = pron.s; sp = Poss pron.a.p} ;
lin UseN n = n ** {
s = \\sp,c,num =>
case <sp,c> of {
<Def,Nom> => n.def_nom ! num ;
<Def,Dat> => n.def_dat ! num ;
<Poss P1,_> => n.poss1 ! c ! num ;
<Poss P2,_> => n.poss2 ! c ! num ;
_ => n.s ! c ! num
}
} ;
}

View File

@@ -475,7 +475,7 @@ oper
mkIQuant : Str -> IQuant = \s -> lin IQuant {s=s} ;
mkIDet : Str -> IDet = \s -> lin IDet {s=s} ;
mkSubj : Str -> Subj = \s -> lin Subj {s=s} ;
mkQuant : Str -> Quant = \s -> lin Quant {s=s} ;
mkQuant : Str -> Quant = \s -> lin Quant {s=s; sp=Indef} ;
mkPredet : Str -> Predet = \s -> lin Predet {s=s} ;
mkCard : Str -> Card = \s -> lin Card {s=s} ;
mkConj : Str -> Conj = \s -> lin Conj {s=s} ;

View File

@@ -102,7 +102,8 @@ oper mkVerb : (_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_
}
} ;
param Species = Indef | Def | Poss Person ;
oper Agr = {n : Number; p : Person} ;
oper Noun = {s: Case => Number => Str; def_dat: Number => Str; def_nom: Number => Str; poss1: Case => Number => Str; poss2: Case => Number => Str} ; -- 4880
oper mkNoun : (_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_ : Str) -> Noun =
\f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21,f22,f23,f24,f25,f26,f27,f28,f29,f30,f31,f32,f33,f34 ->