started relative clauses

This commit is contained in:
Krasimir Angelov
2024-07-25 18:23:35 +02:00
parent b1a5cf93b6
commit 5135e5c5ca
8 changed files with 54 additions and 14 deletions

View File

@@ -4,8 +4,11 @@ concrete CatTur of Cat = CommonX - [CAdv,AdN] ** open ResTur, HarmonyTur, Prelud
lincat lincat
-- Tensed/Untensed
S = {s : Str} ; S = {s : Str} ;
RS = {s : Agr => Str} ;
-- Sentence
Cl = {s : Tense => Polarity => Str} ; Cl = {s : Tense => Polarity => Str} ;
Imp = {s : Polarity => Number => Str} ; Imp = {s : Polarity => Number => Str} ;
@@ -13,6 +16,11 @@ concrete CatTur of Cat = CommonX - [CAdv,AdN] ** open ResTur, HarmonyTur, Prelud
CN = {s : Number => Case => Str; gen : Number => Agr => Str; h : Harmony} ; CN = {s : Number => Case => Str; gen : Number => Agr => Str; h : Harmony} ;
NP = {s : Case => Str ; h : Harmony; a : Agr} ; NP = {s : Case => Str ; h : Harmony; a : Agr} ;
-- Relative
RCl = {s : Tense => Polarity => Agr => Str} ;
RP = {s : Agr => Str} ;
-- Verb
VP = {s : Aspect => VForm => Str; compl : Str} ; VP = {s : Aspect => VForm => Str; compl : Str} ;
VPSlash = Verb ** {compl : Str; c : Prep} ; VPSlash = Verb ** {compl : Str; c : Prep} ;
Comp = {s : Aspect => VForm => Str; compl : Str} ; Comp = {s : Aspect => VForm => Str; compl : Str} ;

View File

@@ -1,6 +1,10 @@
concrete ExtendTur of Extend = CatTur ** open ResTur, SuffixTur, Predef in { concrete ExtendTur of Extend = CatTur ** open ResTur, SuffixTur, Predef in {
lin lin
GenRP n cn = {
s = cn.gen ! n.n
} ;
GenModNP num np cn = { GenModNP num np cn = {
s = \\c => np.s ! Nom ++ num.s ! num.n ! c ++ cn.gen ! num.n ! np.a ; s = \\c => np.s ! Nom ++ num.s ! num.n ! c ++ cn.gen ! num.n ! np.a ;
h = cn.h ; h = cn.h ;

View File

@@ -231,19 +231,16 @@ concrete NounTur of Noun = CatTur ** open ResTur, SuffixTur, HarmonyTur, ParamX,
h = cn.h h = cn.h
} ; } ;
-- TODO: currently not able to generate trees.
RelCN cn rs = { RelCN cn rs = {
s = \\n,c => "(TODO: RelCN)" ; s = \\n,c => rs.s ! {n=n; p=P3} ++ cn.s ! n ! c ;
gen = cn.gen ; gen = \\n,c => rs.s ! {n=n; p=P3} ++ cn.gen ! n ! c ;
h = cn.h h = cn.h
} ; } ;
RelNP np rs = { RelNP np rs = {
s = \\c => "(TODO: RelNP)" ; s = \\c => rs.s ! np.a ++ np.s ! c ;
gen = np.gen ;
h = np.h ; h = np.h ;
a = np.a ; a = np.a
c = np.c
} ; } ;
} }

View File

@@ -2,10 +2,19 @@ concrete RelativeTur of Relative = CatTur ** open ResTur in {
lin lin
RelCl = variants {} ; RelCl = variants {} ;
RelVP = variants {} ;
RelVP rp vp = {
s = \\t,p,agr => rp.s ! agr ++ vp.compl ++
case t of {
Fut => vp.s ! Perf ! VProspPart p ;
_ => vp.s ! Perf ! VImperfPart p
}
} ;
RelSlash = variants {} ; RelSlash = variants {} ;
FunRP = variants {} ; FunRP = variants {} ;
IdRP = variants {} ;
IdRP = {s = \\_ => []} ;
} }

View File

@@ -41,6 +41,9 @@ resource ResTur = ParamX ** open Prelude, Predef, HarmonyTur, SuffixTur in {
VForm = VForm =
VInf Polarity VInf Polarity
| VImperfPart Polarity
| VPerfPart Polarity
| VProspPart Polarity
| VImp Polarity Number | VImp Polarity Number
| VFin Tense Polarity Agr | VFin Tense Polarity Agr
; ;
@@ -126,6 +129,21 @@ resource ResTur = ParamX ** open Prelude, Predef, HarmonyTur, SuffixTur in {
Imperf => suffixStr negHar progrSuffix + Imperf => suffixStr negHar progrSuffix +
suffixStr progrHar infinitiveSuffix suffixStr progrHar infinitiveSuffix
} ; } ;
VImperfPart Pos => v.stems ! VFuture ++ BIND ++
suffixStr v.h imperfParticipleSuffix ;
VImperfPart Neg => v.stems ! VBase Hard ++ BIND ++
suffixStr v.h negativeSuffix +
suffixStr negHar imperfParticipleSuffix ;
VPerfPart Pos => v.stems ! VBase Hard ++ BIND ++
suffixStr v.h perfParticipleSuffix ;
VPerfPart Neg => v.stems ! VBase Hard ++ BIND ++
suffixStr v.h negativeSuffix +
suffixStr negHar perfParticipleSuffix ;
VProspPart Pos => v.stems ! VFuture ++ BIND ++
suffixStr v.h prospParticipleSuffix ;
VProspPart Neg => v.stems ! VBase Hard ++ BIND ++
suffixStr v.h negativeSuffix +
suffixStr negHar prospParticipleSuffix ;
VImp p n => case asp of { VImp p n => case asp of {
Perf => v.stems ! VBase Soft ++ Perf => v.stems ! VBase Soft ++
case <p,n> of { case <p,n> of {

View File

@@ -12,7 +12,7 @@ concrete SentenceTur of Sentence = CatTur ** open Prelude, ResTur in {
UseQCl _ _ = variants {} ; UseQCl _ _ = variants {} ;
UseRCl _ _ _ = variants {} ; UseRCl temp pol cl = {s = \\agr => temp.s ++ pol.s ++ cl.s ! temp.t ! pol.p ! agr} ;
SlashVP _ _ = variants {} ; SlashVP _ _ = variants {} ;
AdvSlash _ _ = variants {} ; AdvSlash _ _ = variants {} ;

View File

@@ -123,6 +123,10 @@ resource SuffixTur = open Prelude, Predef, HarmonyTur in {
passiveInSuffix : Suffix = regSuffix "in" "n" ; passiveInSuffix : Suffix = regSuffix "in" "n" ;
passiveIlSuffix : Suffix = regSuffix "il" "l" ; passiveIlSuffix : Suffix = regSuffix "il" "l" ;
imperfParticipleSuffix : Suffix = regSuffix "en" "yen" ;
perfParticipleSuffix : Suffix = regSuffix "miş" "miş" ;
prospParticipleSuffix : Suffix = regSuffix "ecek" "yecek" ;
-- Ordinal suffix for numbers -- Ordinal suffix for numbers
ordNumSuffix : Suffix = regSuffix21 "inci" "nci" ; ordNumSuffix : Suffix = regSuffix21 "inci" "nci" ;
-- Suffix for deriving adverb from a adjective -- Suffix for deriving adverb from a adjective

View File

@@ -62,8 +62,6 @@ concrete VerbTur of Verb = CatTur ** open Prelude, ResTur, SuffixTur, HarmonyTur
CompAP ap = { CompAP ap = {
s = \\asp,vform => s = \\asp,vform =>
case <asp,vform> of { case <asp,vform> of {
<_,VInf p> => ap.s ! Sg ! Nom ++
mkVerbForms olmak_V ! asp ! (VInf p) ;
<_,VImp p n> => ap.s ! n ! Nom ++ <_,VImp p n> => ap.s ! n ! Nom ++
mkVerbForms olmak_V ! asp ! (VImp p n) ; mkVerbForms olmak_V ! asp ! (VImp p n) ;
<Perf,VFin Pres p agr> => <Perf,VFin Pres p agr> =>
@@ -88,9 +86,11 @@ concrete VerbTur of Verb = CatTur ** open Prelude, ResTur, SuffixTur, HarmonyTur
Neg => suffixStr ap.h negativeSuffix Neg => suffixStr ap.h negativeSuffix
} + } +
suffixStr ap.h (alethicCopulaSuffixes ! agr) ; suffixStr ap.h (alethicCopulaSuffixes ! agr) ;
<_,VFin t p agr> => <_,VFin t p agr> =>
ap.s ! agr.n ! Nom ++ ap.s ! agr.n ! Nom ++
mkVerbForms olmak_V ! asp ! (VFin t p agr) mkVerbForms olmak_V ! asp ! (VFin t p agr) ;
_ => ap.s ! Sg ! Nom ++
mkVerbForms olmak_V ! asp ! vform
} ; } ;
compl = [] compl = []
} ; } ;