refactoring

This commit is contained in:
Krasimir Angelov committed 2026-10-09 21:13:50 +02:00
1 parent 7a01a8f924
commit 16a8e0e893
7 files changed
+45 -46

No files matched your search

+9 -9
View File
@@ -52,7 +52,7 @@ concrete ExtendTel of Extend =
MkVPS temp pol vp = {
s = \\agr => let f = vp.s ! pol.p !
VPTense (tenseVPH temp.t temp.a) agr
in vp.obj.s ++ vp.comp ! agr ++ f.neg ++ f.inf ++ f.fin
in vp.obj.s ++ vp.comp ! agr ++ f.neg ++ f.fin
} ;
BaseVPS first second = {s1 = first.s ; s2 = second.s} ;
@@ -66,7 +66,7 @@ concrete ExtendTel of Extend =
PredVPS np vps = {s = np.s ! NPC Dir ++ vps.s ! np.a} ;
MkVPI vp = {s = let f = vp.s ! Pos ! VPInf in
vp.obj.s ++ vp.comp ! defaultAgr ++ f.neg ++ f.inf ++ f.fin} ;
vp.obj.s ++ vp.comp ! defaultAgr ++ f.neg ++ f.fin} ;
BaseVPI first second = {s1 = first.s ; s2 = second.s} ;
ConsVPI first rest = {s1 = first.s ++ "," ++ rest.s1 ; s2 = rest.s2} ;
ConjVPI conj vpi = {s = vpi.s1 ++ conj.s2 ++ vpi.s2} ;
@@ -106,40 +106,40 @@ concrete ExtendTel of Extend =
PresPartAP vp = {
s = \\g,n,_ => let f = vp.s ! Pos ! VPPresPart in
vp.obj.s ++ vp.comp ! Ag g n P3 ++ f.neg ++ f.inf ++ f.fin
vp.obj.s ++ vp.comp ! Ag g n P3 ++ f.neg ++ f.fin
} ;
PastPartAP vps = {
s = \\g,n,_ => let f = vps.passive ! Pos ! VPPastPart in
vps.obj.s ++ vps.comp ! Ag g n P3 ++ f.neg ++ f.inf ++ f.fin
vps.obj.s ++ vps.comp ! Ag g n P3 ++ f.neg ++ f.fin
} ;
PastPartAgentAP vps np = {
s = \\g,n,_ => let f = vps.passive ! Pos ! VPPastPart in
np.s ! NPC Obl ++ "చేత" ++ vps.obj.s ++ vps.comp ! Ag g n P3 ++
f.neg ++ f.inf ++ f.fin
f.neg ++ f.fin
} ;
GerundCN vp = {
s = \\_,_ => let f = vp.s ! Pos ! VPInf in
vp.obj.s ++ vp.comp ! defaultAgr ++ f.inf ++ f.fin ;
vp.obj.s ++ vp.comp ! defaultAgr ++ f.fin ;
g = Neutr
} ;
GerundNP vp = {
s = \\_ => let f = vp.s ! Pos ! VPInf in
vp.obj.s ++ vp.comp ! defaultAgr ++ f.neg ++ f.inf ++ f.fin ;
vp.obj.s ++ vp.comp ! defaultAgr ++ f.neg ++ f.fin ;
a = defaultAgr
} ;
GerundAdv vp = {
s = let f = vp.s ! Pos ! VPInf in
vp.obj.s ++ vp.comp ! defaultAgr ++ f.inf ++ f.fin
vp.obj.s ++ vp.comp ! defaultAgr ++ f.fin
} ;
ByVP vp = {
s = let f = vp.s ! Pos ! VPInf in
vp.obj.s ++ vp.comp ! defaultAgr ++ f.neg ++ f.inf ++ f.fin ++ "ద్వారా"
vp.obj.s ++ vp.comp ! defaultAgr ++ f.neg ++ f.fin ++ "ద్వారా"
} ;
ApposNP first second = {
+1 -1
View File
@@ -18,7 +18,7 @@ concrete IdiomTel of Idiom = CatTel ** open Prelude, ResTel in {
ImpPl1 vp = {
s = let f = vp.s ! Pos ! VPHort in
vp.obj.s ++ vp.comp ! (Ag Masc Pl P1) ++ f.neg ++ f.inf ++ f.fin
vp.obj.s ++ vp.comp ! (Ag Masc Pl P1) ++ f.neg ++ f.fin
} ;
ImpersCl vp = mkClause {
+1 -1
View File
@@ -7,7 +7,7 @@ concrete PhraseTel of Phrase = CatTel ** open Prelude, ResTel in {
UttNP np = {s = np.s ! NPC Dir} ;
UttCN cn = {s = cn.s ! Sg ! Dir} ;
UttAP ap = {s = ap.s ! Masc ! Sg ! Dir} ;
UttVP vp = {s = let f = vp.s ! Pos ! VPInf in f.inf ++ f.fin} ;
UttVP vp = {s = let f = vp.s ! Pos ! VPInf in f.fin} ;
UttAdv adv = adv ;
UttIP ip = {s = ip.s ! Dir} ;
UttCard card = {s = card.s ! Neutr} ;
+1 -1
View File
@@ -6,7 +6,7 @@ concrete RelativeTel of Relative = CatTel ** open ResTel in {
VPGenPres => VPRelPresent ;
VPFut => VPRelPresent ;
_ => VPPastPart
} in vp.obj.s ++ vp.comp ! defaultAgr ++ f.neg ++ f.inf ++ f.fin
} in vp.obj.s ++ vp.comp ! defaultAgr ++ f.neg ++ f.fin
} ;
RelSlash rp slash = {
s = \\t,p => slash.s ! t ! p ++ rp.s ++ slash.c2.s
+31 -31
View File
@@ -252,7 +252,7 @@ resource ResTel = ParamX ** open Prelude in {
Neg => {fin = case tense of {
VPGenPres => negativeCopula agr ;
_ => "కాలేదు"
} ; inf = [] ; neg = []} ;
} ; neg = []} ;
Pos => {fin = case tense of {
VPGenPres => [] ;
VPContPres => [] ;
@@ -263,17 +263,17 @@ resource ResTel = ParamX ** open Prelude in {
VPPerfPast => copulaPast agr ;
VPSubj => futureFinite "అవు" Pos agr ;
VPFut => futureFinite "అవు" Pos agr
} ; inf = [] ; neg = []}
} ; neg = []}
} ;
VPInf => {fin = "అవడం" ; inf = [] ; neg = []} ;
VPStem => {fin = "అవు" ; inf = [] ; neg = []} ;
VPPresPart => {fin = "అవుతున్న" ; inf = [] ; neg = []} ;
VPRelPresent => {fin = "అయ్యే" ; inf = [] ; neg = []} ;
VPPastPart => {fin = "అయిన" ; inf = [] ; neg = []} ;
VPHort => {fin = "అవుదాం" ; inf = [] ; neg = []} ;
VPImp Sg => {fin = "అవు" ; inf = [] ; neg = []} ;
VPImp Pl => {fin = "అవండి" ; inf = [] ; neg = []} ;
VPReqFut => {fin = "అవండి" ; inf = [] ; neg = []}
VPInf => {fin = "అవడం" ; neg = []} ;
VPStem => {fin = "అవు" ; neg = []} ;
VPPresPart => {fin = "అవుతున్న" ; neg = []} ;
VPRelPresent => {fin = "అయ్యే" ; neg = []} ;
VPPastPart => {fin = "అయిన" ; neg = []} ;
VPHort => {fin = "అవుదాం" ; neg = []} ;
VPImp Sg => {fin = "అవు" ; neg = []} ;
VPImp Pl => {fin = "అవండి" ; neg = []} ;
VPReqFut => {fin = "అవండి" ; neg = []}
} ;
passive = verbForms (regVerb "అవు") ;
obj = {s = [] ; a = defaultAgr} ;
@@ -351,7 +351,7 @@ resource ResTel = ParamX ** open Prelude in {
_ => NPC Obl
} ;
FiniteForm : Type = {fin, inf, neg : Str} ;
FiniteForm : Type = {fin, neg : Str} ;
VPH : Type = {
s, passive : Polarity => VPHForm => FiniteForm ;
@@ -368,30 +368,30 @@ resource ResTel = ParamX ** open Prelude in {
case vh of {
VPTense tense agr => case b of {
Neg => case tense of {
VPFut => {fin = finiteFuture Neg verb agr ; inf = [] ; neg = []} ;
_ => {fin = verb.s ! VNegFinite ; inf = [] ; neg = []}
VPFut => {fin = finiteFuture Neg verb agr ; neg = []} ;
_ => {fin = verb.s ! VNegFinite ; neg = []}
} ;
Pos => case tense of {
VPGenPres => {fin = finiteFuture Pos verb agr ; inf = [] ; neg = []} ;
VPImpPast => {fin = finitePast verb agr ; inf = [] ; neg = []} ;
VPContPres => {fin = finitePresent verb agr ; inf = [] ; neg = []} ;
VPContPast => {fin = finitePast verb agr ; inf = [] ; neg = []} ;
VPPerf => {fin = finitePast verb agr ; inf = [] ; neg = []} ;
VPPerfPres => {fin = finitePast verb agr ; inf = [] ; neg = []} ;
VPPerfPast => {fin = finitePast verb agr ; inf = [] ; neg = []} ;
VPSubj => {fin = finiteFuture Pos verb agr ; inf = [] ; neg = []} ;
VPFut => {fin = finiteFuture Pos verb agr ; inf = [] ; neg = []}
VPGenPres => {fin = finiteFuture Pos verb agr ; neg = []} ;
VPImpPast => {fin = finitePast verb agr ; neg = []} ;
VPContPres => {fin = finitePresent verb agr ; neg = []} ;
VPContPast => {fin = finitePast verb agr ; neg = []} ;
VPPerf => {fin = finitePast verb agr ; neg = []} ;
VPPerfPres => {fin = finitePast verb agr ; neg = []} ;
VPPerfPast => {fin = finitePast verb agr ; neg = []} ;
VPSubj => {fin = finiteFuture Pos verb agr ; neg = []} ;
VPFut => {fin = finiteFuture Pos verb agr ; neg = []}
}
} ;
{- The finite cases above deliberately precede the legacy form
table. The latter remains part of the public paradigms API. -}
VPInf => {fin = verb.s ! VInf ; inf = [] ; neg = na} ;
VPStem => {fin = verb.s ! VStem ; inf = [] ; neg = na} ;
VPPresPart => {fin = verb.s ! VPresentPart ; inf = [] ; neg = na} ;
VPRelPresent => {fin = verb.s ! VRelativePresent ; inf = [] ; neg = na} ;
VPPastPart => {fin = verb.s ! VPastPart ; inf = [] ; neg = na} ;
VPHort => {fin = verb.s ! VHortative ; inf = [] ; neg = na} ;
VPImp n => {fin = verb.s ! VImp n b ; inf = [] ; neg = []}
VPInf => {fin = verb.s ! VInf ; neg = na} ;
VPStem => {fin = verb.s ! VStem ; neg = na} ;
VPPresPart => {fin = verb.s ! VPresentPart ; neg = na} ;
VPRelPresent => {fin = verb.s ! VRelativePresent ; neg = na} ;
VPPastPart => {fin = verb.s ! VPastPart ; neg = na} ;
VPHort => {fin = verb.s ! VHortative ; neg = na} ;
VPImp n => {fin = verb.s ! VImp n b ; neg = []}
} ;
predV : Verb -> VPH = \verb -> {
@@ -475,7 +475,7 @@ resource ResTel = ParamX ** open Prelude in {
agr = np.a ;
vps = vp.s ! b ! VPTense vt agr ;
in
np.s ! subj ++ vp.obj.s ++ vp.comp ! np.a ++ vps.neg ++ vps.inf ++ vps.fin
np.s ! subj ++ vp.obj.s ++ vp.comp ! np.a ++ vps.neg ++ vps.fin
} ;
+1 -1
View File
@@ -11,7 +11,7 @@ concrete SentenceTel of Sentence = CatTel ** open Prelude, ResTel in {
ImpVP vp = {
s = \\pol,num =>
let f = vp.s ! pol ! VPImp num
in vp.obj.s ++ vp.comp ! defaultAgr ++ f.neg ++ f.inf ++ f.fin
in vp.obj.s ++ vp.comp ! defaultAgr ++ f.neg ++ f.fin
} ;
AdvImp adv imp = {s = \\pol,num => adv.s ++ imp.s ! pol ! num} ;
+1 -2
View File
@@ -36,8 +36,7 @@ concrete VerbTel of Verb = CatTel ** open ResTel, Prelude in {
ComplSlash vp np = insertObject np vp ;
ComplVV v vp = predV v ** {
comp = \\agr => let f = vp.s ! Pos ! VPInf in
f.inf ++ f.fin
comp = \\agr => let f = vp.s ! Pos ! VPInf in f.fin
} ;
ComplVS v s = predV v ** {comp = \\_ => s.s ++ "అని"} ;