extensions by Codex

This commit is contained in:
Krasimir Angelov committed 2026-10-19 20:27:25 +02:00
1 parent f0c12fb284
commit 7ac3d7d05d
18 files changed
+489 -265

No files matched your search

+4 -4
View File
@@ -48,9 +48,9 @@ concrete AdjectiveKor of Adjective = CatKor **
-- phrases, although the semantics is only clear for some adjectives.
-- : AP -> SC -> AP ; -- good that she is here
-- SentAP ap sc = ap ** {
-- s = \\af => ap.s ! af ++ sc.s
-- } ;
SentAP ap sc = ap ** {
compar = sc.s ++ ap.compar
} ;
-- An adjectival phrase can be modified by an *adadjective*, such as "very".
@@ -61,6 +61,6 @@ concrete AdjectiveKor of Adjective = CatKor **
-- It can also be postmodified by an adverb, typically a prepositional phrase.
-- : AP -> Adv -> AP ; -- warm by nature
-- AdvAP ap adv = ap ** {} ;
AdvAP ap adv = ap ** {compar = adv.s ++ ap.compar} ;
}
+4 -4
View File
@@ -3,7 +3,7 @@ concrete AdverbKor of Adverb = CatKor ** open ResKor, ParamKor, ParadigmsKor, Pr
lin
-- : A -> Adv ;
--PositAdvAdj adj = { } ;
PositAdvAdj adj = {s = glue (adj.s ! VStem Pos) "게"} ;
-- : CAdv -> A -> NP -> Adv ; -- more warmly than John
-- ComparAdvAdj cadv a np = { } ;
@@ -16,15 +16,15 @@ lin
-- Adverbs can be modified by 'adadjectives', just like adjectives.
--AdAdv : AdA -> Adv -> Adv ; -- very quickly
-- AdAdv ada adv = adv **
AdAdv ada adv = {s = ada.s ++ adv.s} ;
-- Like adverbs, adadjectives can be produced by adjectives.
-- : A -> AdA ; -- extremely
-- PositAdAAdj a = { } ;
PositAdAAdj a = {s = glue (a.s ! VStem Pos) "게"} ;
-- Subordinate clauses can function as adverbs.
-- : Subj -> S -> Adv ;
-- SubjS subj s =
SubjS subj s = {s = s.s ! Subord ++ subj.s} ;
-- Comparison adverbs also work as numeral adverbs.
+10 -5
View File
@@ -106,15 +106,20 @@ oper
False => glue (ap.s ! VStem Neg) (conjTable ! VStar ! conj ! ap.pNeg)
} ;
{-
lincat
[CN] = { } ;
[CN] = ResKor.CNoun ** {firstCN : ConjType => Str} ;
lin
BaseCN = {} ;
ConsCN = {} ;
ConjCN co cs = conjunctDistrTable Agr co cs ** cs ;
BaseCN x y = y ** {firstCN = \\c => glue (x.rs ++ x.s ! Bare)
(conjTable ! NStar ! c ! x.p)} ;
ConsCN x xs = xs ** {firstCN = \\c => glue (x.rs ++ x.s ! Bare)
(conjTable ! NStar ! c ! x.p) ++ xs.firstCN ! c} ;
ConjCN co xs = xs ** {
s = \\nf => co.s1 ++ xs.firstCN ! co.c ++ xs.rs ++ xs.s ! nf ;
rs = []
} ;
{-
lincat
[DAP] =
+46 -105
View File
@@ -1,4 +1,5 @@
concrete ConstructionKor of Construction = CatKor ** open ParadigmsKor in {
concrete ConstructionKor of Construction = CatKor **
open Prelude, ResKor, (P=ParadigmsKor), (G=GrammarKor) in {
lincat
Timeunit = N ;
@@ -6,114 +7,54 @@ lincat
Monthday = NP ;
Month = N ;
Year = NP ;
{-
lin
timeunitAdv n time =
let n_card : Card = n ;
n_hours_NP : NP = mkNP n_card time ;
in SyntaxKor.mkAdv for_Prep n_hours_NP | mkAdv (n_hours_NP.s ! R.npNom) ;
weekdayPunctualAdv w = ; -- on Sunday
weekdayHabitualAdv w = ; -- on Sundays
weekdayNextAdv w = -- next Sunday
weekdayLastAdv w = -- last Sunday
monthAdv m = mkAdv in_Prep (mkNP m) ;
yearAdv y = mkAdv in_Prep y ;
dayMonthAdv d m = ; -- on 17 May
monthYearAdv m y = ; -- in May 2012
dayMonthYearAdv d m y = ; -- on 17 May 2013
intYear = symb ;
intMonthday = symb ;
lincat Language = N ;
lin InLanguage l = mkAdv ???_Prep (mkNP l) ;
lin
ready_VP = useV (mkVerb "준비되다") ;
has_age_VP card =
let age = glue (card.s ! SK ! Attrib) "살" in
useV copula ** {
s = \\vf => glue age (copula.s ! vf) ;
past = \\p => glue age (copula.past ! p) ;
pastAttr = \\p => glue age (copula.pastAttr ! p) ;
futureAttr = \\p => glue age (copula.futureAttr ! p)
} ;
n_units_AP card unit adj = adj ** {
s = \\vf => card.s ! unit.c.origin ! Attrib ++ unit.s ! Bare ++ adj.s ! vf ;
compar = []
} ;
n_units_of_NP card unit np = np ** {
s = \\nf => card.s ! unit.c.origin ! Attrib ++ unit.s ! Bare ++ np.s ! nf
} ;
cup_of_CN np = useN (P.mkN "컵") ** {rs = np.s ! Bare} ;
weekdayPunctualAdv w = {s = glue (w.s ! Bare) "에"} ;
weekdayHabitualAdv w = {s = "매주" ++ glue (w.s ! Bare) "에"} ;
yearAdv y = {s = glue (y.s ! Bare) "에"} ;
intYear i = lin NP {s = \\_ => glue i.s "년" ; p = Consonant} ;
intMonthday i = lin NP {s = \\_ => glue i.s "일" ; p = Consonant} ;
weekdayN w = w ;
monthN m = m ;
weekdayPN w = mkPN w ;
monthPN m = mkPN m ;
monday_Weekday = P.mkN "월요일" ;
tuesday_Weekday = P.mkN "화요일" ;
wednesday_Weekday = P.mkN "수요일" ;
thursday_Weekday = P.mkN "목요일" ;
friday_Weekday = P.mkN "금요일" ;
saturday_Weekday = P.mkN "토요일" ;
sunday_Weekday = P.mkN "일요일" ;
languageCN l = mkCN l ;
languageNP l = mkNP l ;
oper mkLanguage : Str -> N = \s -> mkN s ;
----------------------------------------------
---- lexicon of special names
lin second_Timeunit = mkN "second" ;
lin minute_Timeunit = mkN "minute" ;
lin hour_Timeunit = mkN "hour" ;
lin day_Timeunit = mkN "day" ;
lin week_Timeunit = mkN "week" ;
lin month_Timeunit = mkN "month" ;
lin year_Timeunit = mkN "year" ;
lin monday_Weekday = mkN "Monday" ;
lin tuesday_Weekday = mkN "Tuesday" ;
lin wednesday_Weekday = mkN "Wednesday" ;
lin thursday_Weekday = mkN "Thursday" ;
lin friday_Weekday = mkN "Friday" ;
lin saturday_Weekday = mkN "Saturday" ;
lin sunday_Weekday = mkN "Sunday" ;
lin january_Month = mkN "January" ;
lin february_Month = mkN "February" ;
lin march_Month = mkN "March" ;
lin april_Month = mkN "April" ;
lin may_Month = mkN "May" ;
lin june_Month = mkN "June" ;
lin july_Month = mkN "July" ;
lin august_Month = mkN "August" ;
lin september_Month = mkN "September" ;
lin october_Month = mkN "October" ;
lin november_Month = mkN "November" ;
lin december_Month = mkN "December" ;
lin afrikaans_Language = mkLanguage "Afrikaans" ;
lin amharic_Language = mkLanguage "Amharic" ;
lin arabic_Language = mkLanguage "Arabic" ;
lin bulgarian_Language = mkLanguage "Bulgarian" ;
lin catalan_Language = mkLanguage "Catalan" ;
lin chinese_Language = mkLanguage "Chinese" ;
lin danish_Language = mkLanguage "Danish" ;
lin dutch_Language = mkLanguage "Dutch" ;
lin english_Language = mkLanguage "Euslish" ;
lin estonian_Language = mkLanguage "Estonian" ;
lin finnish_Language = mkLanguage "Finnish" ;
lin french_Language = mkLanguage "French" ;
lin german_Language = mkLanguage "German" ;
lin greek_Language = mkLanguage "Greek" ;
lin hebrew_Language = mkLanguage "Hebrew" ;
lin hindi_Language = mkLanguage "Hindi" ;
lin japanese_Language = mkLanguage "Japanese" ;
lin italian_Language = mkLanguage "Italian" ;
lin latin_Language = mkLanguage "Latin" ;
lin latvian_Language = mkLanguage "Latvian" ;
lin maltese_Language = mkLanguage "Maltese" ;
lin nepali_Language = mkLanguage "Nepali" ;
lin norwegian_Language = mkLanguage "Norwegian" ;
lin persian_Language = mkLanguage "Persian" ;
lin polish_Language = mkLanguage "Polish" ;
lin punjabi_Language = mkLanguage "Punjabi" ;
lin romanian_Language = mkLanguage "Romanian" ;
lin russian_Language = mkLanguage "Russian" ;
lin sindhi_Language = mkLanguage "Sindhi" ;
lin spanish_Language = mkLanguage "Spanish" ;
lin swahili_Language = mkLanguage "Swahili" ;
lin swedish_Language = mkLanguage "Swedish" ;
lin thai_Language = mkLanguage "Thai" ;
lin turkish_Language = mkLanguage "Turkish" ;
lin urdu_Language = mkLanguage "Urdu" ;
—}
}
-}
january_Month = P.mkN "1월" ;
february_Month = P.mkN "2월" ;
march_Month = P.mkN "3월" ;
april_Month = P.mkN "4월" ;
may_Month = P.mkN "5월" ;
june_Month = P.mkN "6월" ;
july_Month = P.mkN "7월" ;
august_Month = P.mkN "8월" ;
september_Month = P.mkN "9월" ;
october_Month = P.mkN "10월" ;
november_Month = P.mkN "11월" ;
december_Month = P.mkN "12월" ;
}
+71 -1
View File
@@ -3,7 +3,11 @@
concrete ExtendKor of Extend = CatKor
-- ** ExtendFunctor - [ApposNP]
-- with (Grammar=GrammarKor)
** open Prelude, ResKor, NounKor, Coordination, TenseX in {
** open Prelude, ResKor, NounKor, Coordination, TenseX,
(G=GrammarKor) in {
lincat
VPS, [VPS], VPI, [VPI], RNP, [Comp], [Imp] = SS ;
lin
UttAdV adv = {s = adv.s} ;
@@ -11,5 +15,71 @@ concrete ExtendKor of Extend = CatKor
-- : NP -> NP -> NP
ApposNP np1 np2 = np1 ** {s = \\nf => np1.s ! nf ++ np2.s ! nf} ;
EmptyRelSlash cl = cl ;
ReflPron = {s="자신"} ;
ReflPoss n cn = {s="자신의" ++ cn.rs ++ cn.s ! Bare} ;
AdvRNP np prep rnp = {s=np.s ! Bare ++ rnp.s ++ prep.s ! Vowel} ;
AdvRVP vp prep rnp = insertAdv vp {s=rnp.s ++ prep.s ! Vowel} ;
AdvRAP ap prep rnp = ap ** {compar=rnp.s ++ prep.s ! Vowel ++ ap.compar} ;
PossPronRNP pron n cn rnp = G.DetCN (G.DetQuant (G.PossPron pron) n)
(cn ** {rs=glue rnp.s "의" ++ cn.rs}) ;
GenModNP n np cn = G.DetCN (G.DetQuant G.DefArt n)
(cn ** {rs=glue (np.s ! Bare) "의" ++ cn.rs}) ;
CompoundN first head = head ** {
s = \\nf => first.s ! Bare ++ head.s ! nf
} ;
CompoundAP n a = a ** {s=\\vf=>n.s ! Bare ++ a.s ! vf; compar=[]} ;
PresPartAP vp = do_A ** {s=\\vf=>linVP vf vp; compar=[]} ;
PastPartAP slash = do_A ** {
s=\\vf=>slash.adv ++ slash.s ! vf; compar=[]
} ;
PastPartAgentAP slash agent = do_A ** {
s=\\vf=>glue (agent.s ! Bare) "에게" ++ slash.adv ++
slash.s ! vf; compar=[]
} ;
PassVPSlash slash = useV slash ** {adv=slash.adv} ;
PassAgentVPSlash slash agent = insertAdv (PassVPSlash slash)
{s=glue (agent.s ! Bare) "에게"} ;
ProgrVPSlash slash = slash ** {
s=\\vf=>glue (slash.s ! VStem Pos) "고" ++ have_V.s ! vf
} ;
GerundCN vp = useN (stringN (linVP (VAttr Pos) vp ++ "것")) ;
GerundNP vp = stringNP (linVP (VAttr Pos) vp ++ "것") ;
GerundAdv vp = {s=glue (linVP (VStem Pos) vp) "면서"} ;
ByVP vp = {s=linVP (VAttr Pos) vp ++ "것으로써"} ;
PositAdVAdj a = {s=glue (a.s ! VStem Pos) "게"} ;
ComplBareVS vs s = useV vs ** {adv=s.s ! Subord ++ "고"} ;
ComplSlashPartLast = G.ComplSlash ;
UttVPShort = G.UttVP ;
UseDAP d = d ** {s=d.sp} ;
UseDAPMasc = UseDAP ;
UseDAPFem = UseDAP ;
MkVPS t pol vp = {s=t.s ++ pol.s ++
vp.nObj ! DeclObj ++ vp.adv ++
tenseVP t.t t.a (Statement Formal) pol.p vp} ;
BaseVPS x y = {s=x.s ++ y.s} ;
ConsVPS x xs = {s=x.s ++ xs.s} ;
ConjVPS co xs = {s=co.s1 ++ xs.s} ;
PredVPS np vps = {s=\\_=>np.s ! Subject ++ vps.s; p=Vowel} ;
MkVPI vp = {s=linVP (VAttr Pos) vp ++ "것"} ;
BaseVPI x y = {s=x.s ++ y.s} ;
ConsVPI x xs = {s=x.s ++ xs.s} ;
ConjVPI co xs = {s=co.s1 ++ xs.s} ;
ComplVPIVV vv vpi = useV vv ** {adv=glue vpi.s "을"} ;
BaseImp x y = {s=x.s ! Pos ++ y.s ! Pos} ;
ConsImp x xs = {s=x.s ! Pos ++ xs.s} ;
ConjImp co xs = {s=\\_=>co.s1 ++ xs.s} ;
BaseComp x y = {s=x.s ! VAttr Pos ++ y.s ! VAttr Pos} ;
ConsComp x xs = {s=x.s ! VAttr Pos ++ xs.s} ;
ConjComp co xs = emptyComp ** {s=\\_=>co.s1 ++ xs.s} ;
TPastSimple = TPast ;
oper
stringNP : Str -> NounPhrase = \s -> {s=\\_=>s; p=Consonant} ;
stringN : Str -> Noun = \s -> stringNP s ** {c=baseCounter} ;
} ;
+3
View File
@@ -20,6 +20,9 @@ oper
addSuffix : Str -> Str = \stem ->
case stem of {
-- 하다 and all productive 하다 compounds contract 하+여 to 해.
start + "하" => start + "해" ;
-- Final ㅏ or ㅓ does not repeat itself.
_ + #a|#eo
=> stem ;
+15 -18
View File
@@ -6,42 +6,39 @@ concrete IdiomKor of Idiom = CatKor ** open Prelude, ResKor, VerbKor, NounKor, S
-- This module defines constructions that are formed in fixed ways,
-- often different even in closely related languages.
{- lin
lin
-- ImpersCl : VP -> Cl ; -- it is hot
-- GenericCl : VP -> Cl ; -- one sleeps
ImpersCl,
GenericCl = \vp -> predVP impersNP (passVP vp) ;
ImpersCl vp = predVP' [] vp ;
GenericCl vp = predVP' "사람이" vp ;
CleftNP : NP -> RS -> Cl ; -- it is I who did it
CleftAdv : Adv -> S -> Cl ; -- it is here she slept
-- CleftNP : NP -> RS -> Cl ; -- it is I who did it
-- CleftAdv : Adv -> S -> Cl ; -- it is here she slept
-- : NP -> Cl ; -- there is a house
ExistNP np =
ExistNP np = predVP np (useV have_V) ;
ExistIP : IP -> QCl ; -- which houses are there
-- ExistIP : IP -> QCl ; -- which houses are there
-- 7/12/2012 generalizations of these
ExistNPAdv : NP -> Adv -> Cl ; -- there is a house in Paris
ExistIPAdv : IP -> Adv -> QCl ; -- which houses are there in Paris
ExistNPAdv np adv = predVP np (insertAdv (useV have_V) adv) ;
-- ExistIPAdv : IP -> Adv -> QCl ; -- which houses are there in Paris
-- : VP -> VP ;
ProgrVP vp = vp ** {
s = \\vf => glue (vp.s ! VStem Pos) "고" ++ have_V.s ! vf
} ;
-- : VP -> Utt ; -- let's go
ImpPl1 vp = { } ;
ImpPl1 vp = {s = vp.nObj ! ImpObj ++ vp.adv ++ vp.s ! VF Polite Pos} ;
ImpP3 : NP -> VP -> Utt ; -- let John walk
-- ImpP3 : NP -> VP -> Utt ; -- let John walk
-- 3/12/2013 non-reflexive uses of "self"
SelfAdvVP : VP -> VP ; -- is at home himself
SelfAdVVP : VP -> VP ; -- is himself at home
SelfNP : NP -> NP ; -- the president himself (is at home)
-}
-- SelfAdvVP : VP -> VP ; -- is at home himself
-- SelfAdVVP : VP -> VP ; -- is himself at home
-- SelfNP : NP -> NP ; -- the president himself (is at home)
}
+3 -1
View File
@@ -1,4 +1,4 @@
concrete NamesKor of Names = CatKor ** open ResKor in {
concrete NamesKor of Names = CatKor ** open Prelude, ResKor in {
lin GivenName, MaleSurname, FemaleSurname = \n -> n ;
lin FullName gn sn = {
@@ -7,5 +7,7 @@ lin FullName gn sn = {
} ;
UseLN pn = pn ;
InLN pn = {s = glue (pn.s ! Bare) "에서"} ;
AdjLN ap pn = pn ** {s = \\nf => ap.compar ++ ap.s ! VAttr Pos ++ pn.s ! nf} ;
}
+42 -29
View File
@@ -20,6 +20,13 @@ concrete NounKor of Noun = CatKor ** open ResKor, Prelude in {
in case isNum det of {
True => cn.rs ++ cns ++ detnum ;
False => cn.rs ++ detnum ++ cns }
; p = case isNum det of {
True => cn.c.p ;
False => case det.n of {
Pl => Consonant ;
Sg => cn.p
}
}
} ;
-- : PN -> NP ;
@@ -30,13 +37,7 @@ concrete NounKor of Noun = CatKor ** open ResKor, Prelude in {
-- : Predet -> NP -> NP ; -- only the man
PredetNP predet np = np ** {s =
let sakwa = np.s ! Bare ;
man = predet.s ! np.p ;
un = table {Vowel => "는"; Consonant => "은"} ! predet.p
in table { -- TODO: do particles combine?
Topic => glue (glue sakwa man) un ;
_ => glue sakwa man
}
\\nf => predet.s ! np.p ++ np.s ! nf
} ;
-- A noun phrase can also be postmodified by the past participle of a
@@ -52,8 +53,7 @@ concrete NounKor of Noun = CatKor ** open ResKor, Prelude in {
s = \\nf => adv.s ++ np.s ! nf
} ; -- TODO test
-- : NP -> Adv -> NP ; -- boys, such as ..
-- ExtAdvNP np adv = np ** {} ;
ExtAdvNP np adv = np ** {s = \\nf => adv.s ++ np.s ! nf} ;
-- : NP -> RS -> NP ; -- Paris, which is here
-- RelNP np rs = np ** {
@@ -67,6 +67,11 @@ concrete NounKor of Noun = CatKor ** open ResKor, Prelude in {
c = baseCounter
} ;
QuantityNP dec unit = {
s = \\_ => dec.s ! NCard ++ unit.s ;
p = Consonant
} ;
-- MassNP : CN -> NP ;
MassNP cn = cn ** {
s = \\nf => cn.rs ++ cn.s ! nf
@@ -83,9 +88,11 @@ concrete NounKor of Noun = CatKor ** open ResKor, Prelude in {
} ;
-- : Quant -> Num -> Ord -> Det ; -- these five best
-- DetQuantOrd quant num ord =
-- let theseFive = DetQuant quant num in theseFive ** {
-- } ;
DetQuantOrd quant num ord =
let det = DetQuant quant num in det ** {
s = \\origin => det.s ! origin ++ ord.s ! VAttr Pos ;
sp = \\nf => ord.s ! VAttr Pos ++ det.sp ! nf
} ;
-- Whether the resulting determiner is singular or plural depends on the
-- cardinal.
@@ -116,17 +123,20 @@ concrete NounKor of Noun = CatKor ** open ResKor, Prelude in {
-- : Numeral -> Card ;
NumNumeral num = num ;
{-
-- : AdN -> Card -> Card ;
AdNum adn card = card ** { s = adn.s ++ card.s } ;
AdNum adn card = card ** {s = \\o,f => adn.s ++ card.s ! o ! f} ;
-- : Digits -> Ord ;
OrdDigits digs = digs ** { s = digs.s ! NOrd } ;
-}
OrdDigits digs = do_A ** {
s = \\_ => digs.s ! NOrd ;
n = digs.n
} ;
-- : Numeral -> Ord ;
-- OrdNumeral num = num ** {
-- s = \\_ => num.ord
-- } ;
OrdNumeral num = do_A ** {
s = \\_ => num.ord ;
n = num.n
} ;
-- : A -> Ord ;
OrdSuperl a = a ** {
@@ -153,7 +163,9 @@ concrete NounKor of Noun = CatKor ** open ResKor, Prelude in {
UseN,UseN2 = ResKor.useN ;
-- : N2 -> NP -> CN ;
-- ComplN2 n2 np =
ComplN2 n2 np = useN n2 ** {
rs = (prepNP Bare n2.p2 np).s
} ;
-- : N3 -> NP -> N2 ; -- distance from this city (to Paris)
-- ComplN3 n3 np =
@@ -202,28 +214,29 @@ concrete NounKor of Noun = CatKor ** open ResKor, Prelude in {
--2 Possessive and partitive constructs
-- : PossNP : CN -> NP -> CN ;
-- PossNP cn np = cn ** {
-- } ;
PossNP cn np = cn ** {
rs = glue (np.s ! Bare) "의" ++ cn.rs
} ;
-- : CN -> NP -> CN ; -- glass of wine / two kilos of red apples
-- PartNP cn np = cn ** {
-- } ;
{-
PartNP cn np = cn ** {
rs = np.s ! Bare ++ cn.rs
} ;
-- This is different from the partitive, as shown by many languages.
-- : Det -> NP -> NP ;
CountNP det np = np **
{ } ; -- Nonsense for DefArt or IndefArt
{s = \\nf => det.s ! NK ++ np.s ! nf} ; -- Nonsense for DefArt or IndefArt
--3 Conjoinable determiners and ones with adjectives
-- : DAP -> AP -> DAP ; -- the large (one)
AdjDAP dap ap = dap ** { } ;
AdjDAP dap ap = dap ** {
sp = \\nf => ap.compar ++ ap.s ! VAttr Pos ++ dap.sp ! nf
} ;
-- : Det -> DAP ; -- this (or that)
DetDAP det = det ;
-}
}
+26 -3
View File
@@ -75,19 +75,25 @@ lin
pot2 = potTimes "백" "백" ;
-- : Sub10 -> Sub100 -> Sub1000 ; -- m * 100 + n
pot2plus m n = TODO ;
pot2plus m n = combineNum "백" m n ;
-- : Sub1000 -> Sub1000000 ; -- coercion of 1..999
pot2as3 x = x ;
-- : Sub1000 -> Sub1000000 ; -- m * 1000
pot3 m = TODO ;
pot3 m = scaleNum "천" m ;
-- : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n
pot3plus m n = TODO ;
pot3plus m n = combineNum "천" m n ;
pot3as4 x = x ;
pot41 = fixedNum "백만" ;
pot4 m = scaleNum "백만" m ;
pot4plus m n = combineNum "백만" m n ;
pot4as5 x = x ;
pot51 = fixedNum "십억" ;
pot5 m = scaleNum "십억" m ;
pot5plus m n = combineNum "십억" m n ;
oper
LinDigit : Type = ResKor.Numeral ** {isTwo : Bool ; ten : Str} ;
@@ -128,6 +134,23 @@ oper
TODO : ResKor.Numeral = mkNum2 "TODO" "TODO" ;
fixedNum : Str -> ResKor.Numeral = \s -> {
s = \\_,_ => s ; n = numNumber ; numtype = IsNum ; ord = s ++ "번째"
} ;
scaleNum : Str -> ResKor.Numeral -> ResKor.Numeral = \unit,m -> m ** {
s = \\_,_ => m.s ! SK ! Indep ++ unit ;
n = numNumber ;
ord = m.s ! SK ! Indep ++ unit ++ "번째"
} ;
combineNum : Str -> ResKor.Numeral -> ResKor.Numeral -> ResKor.Numeral =
\unit,m,n -> n ** {
s = \\_,_ => m.s ! SK ! Indep ++ unit ++ n.s ! SK ! Indep ;
n = numNumber ;
ord = m.s ! SK ! Indep ++ unit ++ n.s ! SK ! Indep ++ "번째"
} ;
-- numerals as sequences of digits
+71 -22
View File
@@ -27,6 +27,12 @@ oper
mkN : (noun,counter : Str) -> NumOrigin -> N ; -- Noun, classifier and origin of numerals. E.g. `mkN "사람" "명" nativeKorean`
} ;
mkN2 : overload {
mkN2 : Str -> N2 ;
mkN2 : N -> N2 ;
mkN2 : N -> Prep -> N2 ;
} ;
--2 Adjectives
mkA : overload {
@@ -58,27 +64,30 @@ oper
mkV2 : overload {
mkV2 : (plain : Str) -> V2 ; -- Regular verb. Takes plain, uninflected -다 form, subject particle is 가/이 and object particle is 를/을.
mkV2 : V -> V2 ; -- Takes preconstructed V, subject particle is 가/이 and object particle is 를/을.
mkV2 : V -> CaseParticle -> V2 ; -- Takes preconstructed V and a case particle for its complement.
mkV2 : V -> Prep -> V2 ; -- Takes preconstructed V and a postposition for its complement.
mkV2 : V -> (subj,obj : CaseParticle) -> V2 ; -- Takes preconstructed V, and subject and object particles. E.g. `mkV2 좋다_V topic subject` for "as for <SUBJ>는, <OBJ>가 is good".
} ;
-- mkV3 : overload {
-- } ;
-- mkVV : overload {
-- } ;
mkVA : V -> VA ;
mkVV : overload {
mkVV : V -> VV ;
mkVV : V -> CaseParticle -> VV ;
mkVV : V -> Prep -> VV ;
} ;
mkVS : V -> VS ;
mkVQ : V -> VQ ;
mkV2A : V -> V2A ;
mkV2V : overload {
mkV2V : V -> V2V ;
mkV2V : V -> CaseParticle -> V2V ;
mkV2V : V -> Prep -> V2V ;
} ;
mkV2S : V -> V2S ;
--
-- mkVA : Str -> VA
-- = \s -> lin VA (regV s) ;
-- mkVQ : Str -> VQ
-- = \s -> lin VQ (regV s) ;
-- mkVS : Str -> VS
-- = \s -> lin VS (regV s) ;
--
-- mkV2A : Str -> V2A
-- = \s -> lin V2A (regV s ** {c2 = noPrep}) ;
-- mkV2V : Str -> V2V
-- = \s -> lin V2V (regV s ** {c2 = noPrep}) ;
-- mkV2Q : Str -> V2Q
-- = \s -> lin V2Q (regV s ** {c2 = noPrep}) ;
@@ -107,6 +116,8 @@ oper
mkAdA : Str -> AdA
= \s -> lin AdA {s = s} ;
mkAdN : Str -> AdN ;
--.
-------------------------------------------------------------------------------
@@ -135,8 +146,9 @@ oper
in lin N (noun ** {c = counter}) ;
mkN2 = overload {
mkN2 : Str -> N2 = \s -> lin N2 (mkNoun s) ;
mkN2 : N -> N2 = \n -> lin N2 n ;
mkN2 : Str -> N2 = \s -> lin N2 (mkNoun s ** {p2 = emptyPP}) ;
mkN2 : N -> N2 = \n -> lin N2 (n ** {p2 = emptyPP}) ;
mkN2 : N -> Prep -> N2 = \n,p -> lin N2 (n ** {p2 = p}) ;
} ;
-- mkPN = overload {
@@ -145,11 +157,21 @@ oper
mkA = overload {
mkA : (adj : Str) -> A = \s -> lin A (mkAdj s) ;
mkA : (kiga : Str) -> (jakda : A) -> A = \kiga,jakda ->
jakda ** {s = \\af => kiga ++ jakda.s ! af} ;
jakda ** {
s = \\af => kiga ++ jakda.s ! af ;
past = \\p => kiga ++ jakda.past ! p ;
pastAttr = \\p => kiga ++ jakda.pastAttr ! p ;
futureAttr = \\p => kiga ++ jakda.futureAttr ! p
} ;
mkA : (plain,polite,formal,attr : Str) -> A
= \x1,x2,x3,x4 -> lin A (mkAdjReg x1 x2 x3 x4) ;
mkA : (jaemi : Str) -> (itda : V) -> A
= \jaemi,itda -> lin A (itda ** {s = \\vf => jaemi ++ itda.s ! vf}) ;
= \jaemi,itda -> lin A (itda ** {
s = \\vf => jaemi ++ itda.s ! vf ;
past = \\p => jaemi ++ itda.past ! p ;
pastAttr = \\p => jaemi ++ itda.pastAttr ! p ;
futureAttr = \\p => jaemi ++ itda.futureAttr ! p
}) ;
} ;
mkA2 = overload {
@@ -164,7 +186,11 @@ oper
mkV = overload {
mkV : (plain : Str) -> V = \v -> lin V (mkVerb v) ;
mkV : (nore : Str) -> (hada : V) -> V = \nore,hada -> hada ** {
s = \\vf => nore + hada.s ! vf} ;
s = \\vf => nore + hada.s ! vf ;
past = \\p => nore + hada.past ! p ;
pastAttr = \\p => nore + hada.pastAttr ! p ;
futureAttr = \\p => nore + hada.futureAttr ! p
} ;
mkV : (plain,polite,formal,attr : Str) -> V
= \x1,x2,x3,x4 -> lin V (mkVerbReg x1 x2 x3 x4) ;
} ;
@@ -177,16 +203,39 @@ oper
mkV2 = overload {
mkV2 : (plain : Str) -> V2 = \v2 -> lin V2 (mkVerb2 v2) ;
mkV2 : V -> V2 = \v -> lin V2 (vtov2 v) ;
mkV2 : V -> CaseParticle -> V2 = \v,c2 ->
lin V2 (vtov2 v ** {c2 = c2}) ;
mkV2 : V -> (subj,obj : CaseParticle) -> V2 = \v,sc,c2 ->
lin V2 (vtov2 v ** {sc = sc ; c2 = c2}) ;
mkV2 : V -> Prep -> V2 = \v,p2 ->
lin V2 (vtov2 v ** {c2 = Bare ; p2 = p2}) ;
} ;
mkV3 = overload {
mkV3 : (plain : Str) -> V3 = \v3 -> lin V3 (mkVerb3 v3) ;
} ;
--
-- mkVV = overload {
-- } ;
mkVA = \v -> lin VA v ;
mkVV = overload {
mkVV : V -> VV = \v -> lin VV (vtov2 v) ;
mkVV : V -> CaseParticle -> VV = \v,c2 ->
lin VV (vtov2 v ** {c2 = c2}) ;
mkVV : V -> Prep -> VV = \v,p2 ->
lin VV (vtov2 v ** {c2 = Bare ; p2 = p2}) ;
} ;
mkVS = \v -> lin VS v ;
mkVQ = \v -> lin VQ v ;
mkV2A = \v -> lin V2A (v ** {c2=Object; p2={s=\\_=>""; attaches=False}}) ;
mkV2V = overload {
mkV2V : V -> V2V = \v -> lin V2V (vtov2 v) ;
mkV2V : V -> CaseParticle -> V2V = \v,c2 ->
lin V2V (vtov2 v ** {c2 = c2}) ;
mkV2V : V -> Prep -> V2V = \v,p2 ->
lin V2V (vtov2 v ** {c2 = Bare ; p2 = p2}) ;
} ;
mkV2S = \v -> lin V2S (v ** {c2=Object; p2={s=\\_=>""; attaches=False}}) ;
mkAdN = \s -> lin AdN {s=s} ;
mkPrep = overload {
mkPrep : (e : Str) -> Prep -- Particle like 에, attaches to the NP.
+1 -1
View File
@@ -25,6 +25,6 @@ concrete PhraseKor of Phrase = CatKor ** open Prelude, ResKor in {
-- PConjConj conj = {s = conj.s1 ++ conj.s2 ! …} ;
NoVoc = {s = []} ;
-- VocNP np = { s = "," ++ np.s ! … } ; -}
VocNP np = {s = SOFT_BIND ++ "," ++ np.s ! Bare} ;
}
+22
View File
@@ -74,5 +74,27 @@ concrete QuestionKor of Question = CatKor ** open
QuestQVP : IP -> QVP -> QCl ; -- who buys what where
-}
lin
QuestCl cl = cl ;
QuestVP ip vp = predVP ip vp ;
QuestSlash ip cl = cl ** {
s = \\t,a,p,c => ip.s ! Object ++ cl.s ! t ! a ! p ! c
} ;
QuestIAdv adv cl = cl ** {
s = \\t,a,p,c => adv.s ++ cl.s ! t ! a ! p ! c
} ;
QuestIComp comp np = predVP np (VS.UseComp (emptyComp ** {
s = \\_ => comp.s
})) ;
IdetCN = NS.DetCN ;
IdetIP = NS.DetNP ;
AdvIP = NS.AdvNP ;
IdetQuant = NS.DetQuant ;
PrepIP prep ip = prepNP Bare prep ip ;
AdvIAdv a b = {s = a.s ++ b.s} ;
CompIAdv adv = adv ;
CompIP ip = {s = ip.s ! Bare} ;
}
+5 -5
View File
@@ -6,12 +6,12 @@ lin
RelCl = relSlash (ss "") ;
-- : RP -> VP -> RCl ;
RelVP rp vp = vp ** { -- TODO no tenses yet in the grammar
RelVP rp vp = vp ** {
s = \\t,a,p,cltyp =>
rp.s ++ vp.adv ++ vp.nObj ! DeclObj ++
case cltyp of {
WithConj => vp.s ! VStem p ;
_ => vp.s ! VAttr p } ;
rp.s ++ vp.nObj ! DeclObj ++ vp.adv ++
tenseVP t a cltyp p (vp ** {
nObj = \\_ => [] ; adv = []
}) ;
} ;
-- : RP -> ClSlash -> RCl ; -- whom John loves
+96 -14
View File
@@ -5,17 +5,20 @@ resource ResKor = ParamKor ** open Prelude, Predef, ParamKor in {
oper
Counter : Type = {
s : Str ;
origin : NumOrigin
origin : NumOrigin ;
p : Phono
} ;
baseCounter : Counter = {
s = "개" ;
origin = NK
origin = NK ;
p = Vowel
} ;
mkCounter : Str -> NumOrigin -> Counter = \s,o -> baseCounter ** {
s = s ;
origin = o ;
p = if_then_else Phono (vowFinal s) Vowel Consonant ;
} ;
BaseNoun : Type = {
@@ -26,7 +29,7 @@ oper
Noun : Type = BaseNoun ** {
c : Counter ;
} ;
Noun2 : Type = Noun ; -- TODO eventually more parameters?
Noun2 : Type = Noun ** {p2 : Postposition} ;
Noun3 : Type = Noun ;
CNoun : Type = Noun ** {
@@ -145,6 +148,7 @@ oper
Adjective : Type = {
s : VForm => Str ; -- Adjectives are verbs
p, pNeg : Phono ; -- needed for attaching conjunction
past, pastAttr, futureAttr : Polarity => Str ;
} ;
Adjective2 : Type = Adjective ** {c2 : NForm ; p2 : Postposition} ;
@@ -172,6 +176,7 @@ oper
BaseVerb : Type = {
sc : NForm ; -- subject case
p, pNeg : Phono ; -- needed for attaching conjunction
past, pastAttr, futureAttr : Polarity => Str ;
} ;
Verb : Type = BaseVerb ** {
s : VForm => Str ;
@@ -206,7 +211,7 @@ oper
planeg = neg ++ negForms ! Plain ;
polneg = neg ++ negForms ! Polite ;
formneg = neg ++ negForms ! Formal ;
impneg = neg ++ "마새요" ;
impneg = neg ++ "마세요" ;
in mkVerbFull stem attrpos attrneg plain polite formal planeg polneg formneg impneg ;
mkVerbFull : (x1,_,_,_,_,_,_,_,_,x10 : Str) -> Verb =
@@ -225,6 +230,18 @@ oper
VImpNeg => impneg
} ;
sc = Subject ;
past = table {
Pos => pastBase stem ;
Neg => pastBase (init planeg)
} ;
pastAttr = table {
Pos => add_N stem ;
Neg => add_N (init planeg)
} ;
futureAttr = table {
Pos => futureAttrForm stem ;
Neg => futureAttrForm (init planeg)
} ;
p = if_then_else Phono (vowFinal stem) Vowel Consonant ;
pNeg = if_then_else Phono (vowFinal (init planeg)) Vowel Consonant ;
} ;
@@ -239,14 +256,17 @@ oper
"아니다"
"아니에요"
"아닙니다"
"있지마세요" ;
"있지 마세요" ;
copulaAfterVowel : Verb = copula ** {
s = \\vf => case vf of {
VAttr Pos => "는" ; -- TODO just guessing
VF Plain Pos => "다" ;
VF Polite Pos => "예요" ;
_ => copula.s ! vf }
_ => copula.s ! vf } ;
past = table {Pos => "였" ; Neg => copula.past ! Neg} ;
pastAttr = table {Pos => "였던" ; Neg => copula.pastAttr ! Neg} ;
futureAttr = table {Pos => "일" ; Neg => copula.futureAttr ! Neg}
} ;
have_V : Verb = mkVerbFull
@@ -259,7 +279,7 @@ oper
"없다"
"없어요"
"없습니다"
"없지 마새요" ;
"없지 마세요" ;
-- For building an adjective. Different attr from do_V.
do_A : Verb = mkVerbReg
@@ -312,10 +332,12 @@ oper
Complement : Type = {
s : VForm => Str ;
past, pastAttr, futureAttr : Polarity => Str ;
} ;
emptyComp : Complement = {
s = \\_ => [] ;
past, pastAttr, futureAttr = \\_ => [] ;
} ;
BaseVP : Type = {
@@ -371,15 +393,75 @@ oper
let npstr : Str = np.s ! vp.sc in predVP' npstr vp ;
predVP' : (np : Str) -> VerbPhrase -> ClSlash = \np,vp -> vp ** {
s = \\t,a,p,cltyp =>
let vf = case cltyp of {
Subord => VAttr p ;
WithConj => VStem p ;
Statement st => VF st p } -- TODO: more tenses
in np
s = \\t,a,p,cltyp => np
++ vp.nObj ! DeclObj -- an object, not copula complement
++ vp.adv
++ vp.s ! vf
++ tenseVP t a cltyp p vp
} ;
-- Korean marks tense on the final predicate. Deriving the marked forms
-- here also makes tense work for VPs assembled from auxiliaries.
tenseVP : Tense -> Anteriority -> ClType -> Polarity -> VerbPhrase -> Str =
\t,a,ct,p,vp ->
let stem = vp.s ! VStem p in
case <ct,t,a> of {
<Statement st,Pres,Simul> => vp.s ! VF st p ;
<Statement st,Fut,Simul> => finishFinite st (glue stem "겠") ;
<Statement st,Cond,Simul> => conditional st (vp.past ! p) ;
<Statement st,_,_> => finishFinite st (vp.past ! p) ;
<Subord,Pres,Simul> => vp.s ! VAttr p ;
<Subord,Fut,Simul> => vp.futureAttr ! p ;
<Subord,Cond,Simul> => glue (vp.past ! p) "을" ;
<Subord,_,_> => vp.pastAttr ! p ;
<WithConj,Pres,Simul> => stem ;
<WithConj,Fut,Simul> => glue stem "겠" ;
<WithConj,Cond,Simul> => vp.past ! p ;
<WithConj,_,_> => vp.past ! p
} ;
finishFinite : Style -> Str -> Str = \st,base -> case st of {
Formal => glue base "습니다" ;
Polite => glue base "어요" ;
Plain => glue base "다"
} ;
conditional : Style -> Str -> Str = \st,base -> case st of {
Formal => base ++ "을 것입니다" ;
Polite => base ++ "을 거예요" ;
Plain => base ++ "을 것이다"
} ;
-- Past -았/었- contracts after the common vowel-final stems. Consonant
-- stems only need the harmony-sensitive suffix and cover most regular
-- Korean verbs; 하다 compounds are by far the largest lexical class.
pastBase : Str -> Str = \stem -> case stem of {
x + "하" => x + "했" ;
x + "가" => x + "갔" ; x + "나" => x + "났" ;
x + "오" => x + "왔" ; x + "보" => x + "봤" ;
x + "주" => x + "줬" ; x + "두" => x + "뒀" ;
x + "되" => x + "됐" ; x + "돼" => x + "됐" ;
x + "서" => x + "섰" ; x + "자" => x + "잤" ;
x + "사" => x + "샀" ; x + "차" => x + "찼" ;
x + "켜" => x + "켰" ; x + "펴" => x + "폈" ;
x + "여" => x + "였" ; x + "해" => x + "했" ;
_ => case vowFinal stem of {
-- The uncontracted form (e.g. 버리었습니다, 추었습니다) is
-- grammatical and avoids producing duplicated *-어었습니다.
True => stem + "었" ;
False => case stem of {
_ + #a_o => stem + "았" ;
_ => stem + "었"
}
} } ;
futureAttrForm : Str -> Str = \stem -> case stem of {
x + "가" => x + "갈" ; x + "나" => x + "날" ;
x + "오" => x + "올" ; x + "보" => x + "볼" ;
x + "주" => x + "줄" ; x + "하" => x + "할" ;
x + "되" => x + "될" ; x + "서" => x + "설" ;
_ => stem + "을"
} ;
--------------------------------------------------------------------------------
+10 -7
View File
@@ -15,12 +15,13 @@ lin
--2 Clauses missing object noun phrases
-- : NP -> VPSlash -> ClSlash ;
-- SlashVP = predVP ;
{-
SlashVP = predVP ;
-- : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today
AdvSlash cls adv = cls ** insertAdv adv cls ;
AdvSlash cls adv = cls ** {
s = \\t,a,p,c => adv.s ++ cls.s ! t ! a ! p ! c
} ;
-- SlashPrep : Cl -> Prep -> ClSlash ; -- (with whom) he walks
SlashPrep cl prep = cl ;
-- : NP -> VS -> SSlash -> ClSlash ; -- (whom) she says that he loves
-- SlashVS np vs ss = {} ;
@@ -28,11 +29,13 @@ lin
-- : Temp -> Pol -> ClSlash -> SSlash ; -- (that) she had not seen
UseSlash t p cls = {
s = \\c => t.s ++ p.s ++ cls.s ! t.t ! t.a ! p.p ! c ;
p = case p.p of {Pos => cls.p ; Neg => cls.pNeg}
} ;
-}
--2 Imperatives
-- : VP -> Imp ;
ImpVP vp = {s = \\pol => linImp pol vp} ;
AdvImp adv imp = {s = \\pol => adv.s ++ imp.s ! pol} ;
--2 Embedded sentences
@@ -40,7 +43,7 @@ lin
EmbedS s = {s = s.s ! Subord ++ "것이"} ; -- TODO check subject case
-- : QS -> SC ;
-- EmbedQS qs = { } ;
EmbedQS qs = {s = qs.s ! Plain ++ "것이"} ;
-- : VP -> SC ;
EmbedVP vp = {s = linVP (VAttr Pos) vp ++ "것이"} ;
@@ -74,7 +77,7 @@ lin
ExtAdvS = advS (SOFT_BIND ++ ",");
-- : S -> Subj -> S -> S ;
-- SSubjS s1 subj s2 = AdvS (AK.SubjS subj s2) s1 ;
SSubjS s1 subj s2 = AdvS (AK.SubjS subj s2) s1 ;
-- : S -> RS -> S ; -- she sleeps, which is good
-- RelS sent rs = advS {s = rs.s ! Sg3 Masc ++ SOFT_BIND ++ ","} sent ;
+8 -1
View File
@@ -47,7 +47,14 @@ lin
-- : Symb -> Ord ;
SymbOrd sy =
let comp : Comp = VK.CompAdv (lin Adv sy)
in {s = comp.s ; n = Pl ; p,pNeg = Vowel} ;
in {
s = comp.s ;
past = comp.past ;
pastAttr = comp.pastAttr ;
futureAttr = comp.futureAttr ;
n = Pl ;
p,pNeg = Vowel
} ;
lincat
Symb, [Symb] = SS ;
+52 -45
View File
@@ -15,71 +15,70 @@ lin
-- ReflVP = ResKor.insertRefl ;
-- : VV -> VP -> VP ;
-- ComplVV vv vp = let vc = vp.vComp in case vv.vvtype of {
--
-- } ;
ComplVV vv vp = useV vv ** {
adv = vp.adv ;
nObj = vp.nObj ;
s = \\vf => vp.s ! VAttr Pos ++ "것을" ++ vv.s ! vf
} ;
-- : VS -> S -> VP ;
-- ComplVS vs s =
-- let vps = useV vs ;
-- subord = SubjS {s=""} s ;
-- in vps ** {} ;
ComplVS vs sent = useV vs ** {
adv = sent.s ! Subord ++ "고" ;
} ;
{-
-- : VQ -> QS -> VP ;
ComplVQ vq qs = ;
ComplVQ vq qs = useV vq ** {adv = qs.s ! Plain ++ "고"} ;
-- : VA -> AP -> VP ; -- they become red
ComplVA va ap = ResKor.insertComp (CompAP ap).s (useV va) ;
-}
ComplVA va ap = useV va ** {
adv = ap.compar ++ ap.s ! VAttr Pos
} ;
--------
-- Slash
-- : V2 -> VPSlash
SlashV2a = ResKor.useVc ;
{-
-- : V3 -> NP -> VPSlash ; -- give it (to her)
-- : V3 -> NP -> VPSlash ; -- give (it) to her
Slash2V3,
Slash3V3 = \v3 -> insertComp (useVc3 v3) ;
Slash2V3 v3 np = useVc v3 ** {
nObj = \\_ => (prepNP v3.c3 v3.p3 np).s
} ;
Slash3V3 v3 np = useVc (v3 ** {c2=v3.c3; p2=v3.p3}) ** {
nObj = \\_ => (prepNP v3.c2 v3.p2 np).s
} ;
-- : V2S -> S -> VPSlash ; -- answer (to him) that it is good
SlashV2S v2s s =
let vps = useVc v2s ;
subord = SubjS {s=""} s ;
in vps ** {obj = } ;
in vps ** {adv = s.s ! Subord ++ "고"} ;
-- : V2V -> VP -> VPSlash ; -- beg (her) to go
SlashV2V v2v vp = ;
SlashV2V v2v vp = useVc v2v ** {
adv = vp.nObj ! DeclObj ++ vp.adv ++ vp.s ! VAttr Pos ++ "것을"
} ;
-- : V2Q -> QS -> VPSlash ; -- ask (him) who came
SlashV2Q v2q qs = ;
SlashV2Q v2q qs = useVc v2q ** {adv = qs.s ! Plain ++ "고"} ;
-- : V2A -> AP -> VPSlash ; -- paint (it) red
SlashV2A v2a ap = useVc v2a ** {
aComp = \\_ => (CompAP ap).aComp ! Sg3 Masc
adv = ap.compar ++ glue (ap.s ! VStem Pos) "게"
} ;
-}
-- : VPSlash -> NP -> VP
ComplSlash = ResKor.insertComp ;
{-
-- : VV -> VPSlash -> VPSlash ;
-- Just like ComplVV except missing subject!
SlashVV vv vps = ComplVV vv vps ** { missing = vps.missing ;
post = vps.post } ;
SlashVV vv vps = vps ** {
s = \\vf => vps.s ! VAttr Pos ++ "것을" ++ vv.s ! vf
} ;
-- : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy
SlashV2VNP v2v np vps =
ComplVV v2v vps **
{ missing = vps.missing ;
post = vps.post ;
iobj = np ** { s = np.s ! Dat } } ;
-}
vps ** {
adv = (prepNP v2v.c2 v2v.p2 np).s ++ vps.adv ;
s = \\vf => vps.s ! VAttr Pos ++ "것을" ++ v2v.s ! vf
} ;
-- : Comp -> VP ;
UseComp comp = UseCopula ** comp ;
@@ -91,7 +90,7 @@ lin
-- : VP -> Adv -> VP ; -- sleep , even though ...
-- ExtAdvVP vp adv = ;
ExtAdvVP = insertAdv ;
-- : AdV -> VP -> VP ; -- always sleep
AdVVP adv vp = vp ** {adv = vp.adv ++ adv.s} ;
@@ -100,9 +99,7 @@ lin
AdVVPSlash adv vps = vps ** { adv = vps.adv ++ adv.s} ;
-- : VP -> Prep -> VPSlash ; -- live in (it)
-- VPSlashPrep vp prep =
-- let adv = prepNP prep emptyNP
-- in insertAdv vp adv ;
VPSlashPrep vp prep = vp ** {c2=Bare; p2=prep} ;
--2 Complements to copula
@@ -110,26 +107,36 @@ lin
-- : AP -> Comp ;
CompAP ap = emptyComp ** {
s = \\vf => ap.compar ++ ap.s ! vf
s = \\vf => ap.compar ++ ap.s ! vf ;
past = \\p => ap.compar ++ ap.past ! p ;
pastAttr = \\p => ap.compar ++ ap.pastAttr ! p ;
futureAttr = \\p => ap.compar ++ ap.futureAttr ! p
} ;
-- : CN -> Comp ;
-- : NP -> Comp ;
CompCN,
CompNP = \n -> emptyComp ** {
CompNP = \n ->
let cop = case n.p of {
Vowel => copulaAfterVowel ;
Consonant => copula }
in emptyComp ** {
s = \\vf =>
let cop = case n.p of {
Vowel => copulaAfterVowel.s ;
Consonant => copula.s }
in case vf of {
VF _ Neg => n.s ! Bare ++ cop ! vf ;
_ => glue (n.s ! Bare) (cop ! vf)
}
case vf of {
VF _ Neg => n.s ! Bare ++ cop.s ! vf ;
_ => glue (n.s ! Bare) (cop.s ! vf)
} ;
past = \\p => glue (n.s ! Bare) (cop.past ! p) ;
pastAttr = \\p => glue (n.s ! Bare) (cop.pastAttr ! p) ;
futureAttr = \\p => glue (n.s ! Bare) (cop.futureAttr ! p)
} ;
-- : Adv -> Comp ;
CompAdv adv = emptyComp ** {
s = \\vf => adv.s ++ have_V.s ! vf ;
past = \\p => adv.s ++ have_V.past ! p ;
pastAttr = \\p => adv.s ++ have_V.pastAttr ! p ;
futureAttr = \\p => adv.s ++ have_V.futureAttr ! p
} ;
-- : VP -- Copula alone;