diff --git a/src/hungarian/AdjectiveHun.gf b/src/hungarian/AdjectiveHun.gf index eb4afff4..484e15d3 100644 --- a/src/hungarian/AdjectiveHun.gf +++ b/src/hungarian/AdjectiveHun.gf @@ -1,59 +1,58 @@ -concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in -{ ---{ --- --- lin --- --- PositA a = { --- s = \\_ => a.s ! AAdj Posit Nom ; --- isPre = True --- } ; --- ComparA a np = { --- s = \\_ => a.s ! AAdj Compar Nom ++ "than" ++ np.s ! npNom ; --- isPre = False --- } ; --- UseComparA a = { --- s = \\_ => a.s ! AAdj Compar Nom ; --- isPre = True --- } ; --- --- AdjOrd ord = { --- s = \\_ => ord.s ! Nom ; --- isPre = True --- } ; --- --- CAdvAP ad ap np = { --- s = \\a => ad.s ++ ap.s ! a ++ ad.p ++ np.s ! npNom ; --- isPre = False --- } ; --- --- ComplA2 a np = { --- s = \\_ => a.s ! AAdj Posit Nom ++ a.c2 ++ np.s ! NPAcc ; --- isPre = False --- } ; --- --- ReflA2 a = { --- s = \\ag => a.s ! AAdj Posit Nom ++ a.c2 ++ reflPron ! ag ; --- isPre = False --- } ; --- --- SentAP ap sc = { --- s = \\a => ap.s ! a ++ sc.s ; --- isPre = False --- } ; --- --- AdAP ada ap = { --- s = \\a => ada.s ++ ap.s ! a ; --- isPre = ap.isPre --- } ; --- --- UseA2 a = { --- s = \\_ => a.s ! AAdj Posit Nom ; --- isPre = True --- } ; --- --- AdvAP ap adv = {s = \\a => ap.s ! a ++ adv.s ; isPre = False} ; --- ---} +concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in { + + flags optimize=all_subs ; + + lin + + -- : A -> AP ; + PositA a = a ; + + -- : A -> NP -> AP ; + -- ComparA a np = a ** { + -- + -- } ; + + -- : A2 -> NP -> AP ; -- married to her + -- ComplA2 a2 np = a2 ** { } ; + + -- : A2 -> AP ; -- married to itself + -- ReflA2 a2 = a2 ** { } ; + + -- : A2 -> AP ; -- married + -- UseA2 = PositA ; + + -- : A -> AP ; -- warmer + -- UseComparA a = a ** { + -- s = \\af => "???" ++ a.s ! af ; + -- compar = [] + -- } ; + + + -- : CAdv -> AP -> NP -> AP ; -- as cool as John + -- CAdvAP adv ap np = ap ** { } ; + +-- The superlative use is covered in $Ord$. + + -- : Ord -> AP ; -- warmest + AdjOrd ord = ord ** { + s = \\_ => ord.s ; + } ; + +-- Sentence and question complements defined for all adjectival +-- phrases, although the semantics is only clear for some adjectives. + + -- : AP -> SC -> AP ; -- good that she is here + -- SentAP ap sc = ap ** {} ; + +-- An adjectival phrase can be modified by an *adadjective*, such as "very". + + -- : AdA -> AP -> AP ; + AdAP ada ap = ap ** {s = \\af => ada.s ++ ap.s ! af} ; + + +-- It can also be postmodified by an adverb, typically a prepositional phrase. + + -- : AP -> Adv -> AP ; -- warm by nature + -- AdvAP ap adv = ap ** {} ; } diff --git a/src/hungarian/AdverbHun.gf b/src/hungarian/AdverbHun.gf index 30c7864a..78a9bbb5 100644 --- a/src/hungarian/AdverbHun.gf +++ b/src/hungarian/AdverbHun.gf @@ -1,25 +1,35 @@ -concrete AdverbHun of Adverb = CatHun ** open ResHun, Prelude in -{ ---{ --- --- lin --- PositAdvAdj a = {s = a.s ! AAdv} ; --- ComparAdvAdj cadv a np = { --- s = cadv.s ++ a.s ! AAdv ++ cadv.p ++ np.s ! npNom --- } ; --- ComparAdvAdjS cadv a s = { --- s = cadv.s ++ a.s ! AAdv ++ cadv.p ++ s.s --- } ; --- --- PrepNP prep np = {s = prep.s ++ np.s ! NPAcc} ; --- --- AdAdv = cc2 ; --- PositAdAAdj a = {s = a.s ! AAdv} ; --- --- SubjS = cc2 ; --- --- AdnCAdv cadv = {s = cadv.s ++ cadv.p} ; --- ---} +concrete AdverbHun of Adverb = CatHun ** open ResHun, ParamHun, ParadigmsHun, Prelude in { -} +lin + + -- : A -> Adv ; + --PositAdvAdj adj = { } ; + + -- : CAdv -> A -> NP -> Adv ; -- more warmly than John + -- ComparAdvAdj cadv a np = { } ; + +-- ComparAdvAdjS : CAdv -> A -> S -> Adv ; -- more warmly than he runs + + -- : Prep -> NP -> Adv ; + PrepNP prep np = { + s = np.s ! prep.c ++ prep.s ; + } ; + +-- Adverbs can be modified by 'adadjectives', just like adjectives. + + --AdAdv : AdA -> Adv -> Adv ; -- very quickly + -- AdAdv ada adv = adv ** +-- Like adverbs, adadjectives can be produced by adjectives. + + -- : A -> AdA ; -- extremely +-- PositAdAAdj a = { } ; +-- Subordinate clauses can function as adverbs. + + -- : Subj -> S -> Adv ; + -- SubjS subj s = + +-- Comparison adverbs also work as numeral adverbs. + + --AdnCAdv : CAdv -> AdN ; -- less (than five) + --AdnCAdv cadv = {s = } ; +} ; diff --git a/src/hungarian/CatHun.gf b/src/hungarian/CatHun.gf index 5c654156..c19eb8a3 100644 --- a/src/hungarian/CatHun.gf +++ b/src/hungarian/CatHun.gf @@ -1,94 +1,121 @@ -concrete CatHun of Cat = CommonX ** open ResHun, Prelude in -{ +concrete CatHun of Cat = CommonX ** open ResHun, Prelude in { + + flags optimize=all_subs ; + lincat --- ----- exception to CommonX, due to the distinction contracted/uncontracted negation --- --- Pol = {s : Str ; p : CPolarity} ; --- ----- Tensed/Untensed --- --- S = {s : Str} ; --- QS = {s : QForm => Str} ; --- RS = {s : Agr => Str ; c : NPCase} ; -- c for it clefts --- SSlash = {s : Str ; c2 : Str} ; --- ----- Sentence --- --- Cl = {s : ResHun.Tense => Anteriority => CPolarity => Order => Str} ; --- ClSlash = { --- s : ResHun.Tense => Anteriority => CPolarity => Order => Str ; --- c2 : Str --- } ; --- Imp = {s : CPolarity => ImpForm => Str} ; --- ----- Question --- --- QCl = {s : ResHun.Tense => Anteriority => CPolarity => QForm => Str} ; --- IP = {s : NPCase => Str ; n : Number} ; --- IComp = {s : Str} ; --- IDet = {s : Str ; n : Number} ; --- IQuant = {s : Number => Str} ; --- ----- Relative --- --- RCl = { --- s : ResHun.Tense => Anteriority => CPolarity => Agr => Str ; --- c : NPCase --- } ; --- RP = {s : RCase => Str ; a : RAgr} ; --- ----- Verb --- --- VP = ResHun.VP ; --- VPSlash = ResHun.VP ** {c2 : Str} ; --- Comp = {s : Agr => Str} ; --- ----- Adjective --- --- AP = {s : Agr => Str ; isPre : Bool} ; --- ----- Noun --- - N = {s : Number => Case => Str} ; --- NP = {s : NPCase => Str ; a : Agr} ; --- Pron = {s : NPCase => Str ; sp : Case => Str ; a : Agr} ; --- Det = {s : Str ; sp : NPCase => Str ; n : Number ; hasNum : Bool} ; --- Predet = {s : Str} ; --- Ord = { s : Case => Str } ; --- Num = {s : Case => Str ; n : Number ; hasCard : Bool} ; --- Card = {s : Case => Str ; n : Number} ; --- Quant = {s : Bool => Number => Str ; sp : Bool => Number => NPCase => Str} ; --- ----- Numeral --- --- Numeral = {s : CardOrd => Case => Str ; n : Number} ; --- Digits = {s : CardOrd => Case => Str ; n : Number ; tail : DTail} ; --- ----- Structural --- --- Conj = {s1,s2 : Str ; n : Number} ; ------b Conj = {s : Str ; n : Number} ; ------b DConj = {s1,s2 : Str ; n : Number} ; --- Subj = {s : Str} ; --- Prep = {s : Str} ; --- ----- Open lexical classes, e.g. Lexicon --- --- V, VS, VQ, VA = Verb ; -- = {s : VForm => Str} ; --- V2, V2A, V2Q, V2S = Verb ** {c2 : Str} ; --- V3 = Verb ** {c2, c3 : Str} ; --- VV = {s : VVForm => Str ; typ : VVType} ; --- V2V = Verb ** {c2,c3 : Str ; typ : VVType} ; --- --- A = {s : AForm => Str} ; --- A2 = {s : AForm => Str ; c2 : Str} ; --- --- N = {s : Number => Case => Str ; g : Gender} ; --- N2 = {s : Number => Case => Str ; g : Gender} ** {c2 : Str} ; --- N3 = {s : Number => Case => Str ; g : Gender} ** {c2,c3 : Str} ; --- PN = {s : Case => Str ; g : Gender} ; --- ---} + +--2 Sentences and clauses +-- Constructed in SentenceHun, and also in IdiomHun + + S = ResHun.Sentence ; + QS = SS ; + RS = SS ; + -- relative sentence. Tense and polarity fixed, + -- but agreement may depend on the CN/NP it modifies. + + Cl = ResHun.ClSlash ; + ClSlash = ResHun.ClSlash ; + SSlash = ResHun.Sentence ; -- sentence missing NP; e.g. "she has looked at" + Imp = {s : Number => Polarity => Str} ; -- imperative e.g. "look at this" + +--2 Questions and interrogatives + +-- Constructed in QuestionHun. + + QCl = ResHun.QClause ; + IComp = SS ; -- interrogative complement of copula e.g. "where" + IDet = ResHun.Determiner ; -- interrogative determiner e.g. "how many" + IQuant = ResHun.Quant ; -- interrogative quantifier e.g. "which" + IP = ResHun.NounPhrase ; -- interrogative pronoun e.g. "who" + +--2 Subord clauses and pronouns + + --RCl = ResHun.RClause ; + --RP = SS ; + +--2 Verb phrases + +-- Constructed in VerbHun. + + VP = ResHun.VerbPhrase ; + VPSlash = ResHun.VPSlash ; + Comp = ResHun.VerbPhrase ; + + +--2 Adjectival phrases + +-- Constructed in AdjectiveHun. + + AP = ResHun.Adjective ; + + +--2 Nouns and noun phrases + +-- Constructed in NounHun. +-- Many atomic noun phrases e.g. "everybody" +-- are constructed in StructuralHun. +-- The determiner structure is +-- ``` Predet (QuantSg | QuantPl Num) Ord +-- as defined in NounHun. + + CN = ResHun.Noun ; + NP = ResHun.NounPhrase ; + Pron = ResHun.Pronoun ; --Pronouns need enough info to turn it into NP or Quant. + Det = ResHun.Determiner ; + Predet = {s : Str} ; + Quant = ResHun.Quant ; + Num = ResHun.Num ; + Ord = { + s : Str ; -- Number => Case => Str ; -- Ord can come from AP and become AP again + n : Number -- Ord can come from Num, which has inherent number + } ; + DAP = ResHun.Determiner ; + + +--2 Numerals + +-- Constructed in NumeralHun. + + Card = ResHun.Num ; + Numeral = ResHun.Numeral ; + Digits = {s : CardOrd => Str ; n : Number} ; + + + +--2 Structural words + +-- Constructed in StructuralHun. + Conj = ResHun.Conj ; + Subj = SS ; + Prep = ResHun.Postposition ; + + + +--2 Words of open classes + +-- These are constructed in LexiconHun and in +-- additional lexicon modules. + + VS, -- sentence-complement verb e.g. "claim" + -- TODO: eventually different lincats + VQ, -- question-complement verb e.g. "wonder" + VA, -- adjective-complement verb e.g. "look" + V = ResHun.Verb ; + + VV, -- verb-phrase-complement verb e.g. "want" + V2A, -- verb with NP and AP complement e.g. "paint" + V2V, -- verb with NP and V complement e.g. "cause" + V2S, -- verb with NP and S complement e.g. "tell" + V2Q, -- verb with NP and Q complement e.g. "ask" + V2 = ResHun.Verb2 ; + V3 = ResHun.Verb3 ; + + A = ResHun.Adjective ; + A2 = ResHun.Adjective ; + + N, + N2, + N3 = ResHun.Noun ; + PN = ResHun.NounPhrase ; } diff --git a/src/hungarian/ConjunctionHun.gf b/src/hungarian/ConjunctionHun.gf index 67b83578..8c6414ae 100644 --- a/src/hungarian/ConjunctionHun.gf +++ b/src/hungarian/ConjunctionHun.gf @@ -1,58 +1,93 @@ -concrete ConjunctionHun of Conjunction = - CatHun ** open ResHun, Coordination, Prelude in -{ ---{ --- --- flags optimize=all_subs ; --- --- lin --- --- ConjS = conjunctDistrSS ; --- --- ConjAdv = conjunctDistrSS ; --- --- ConjNP conj ss = conjunctDistrTable NPCase conj ss ** { --- a = conjAgr (agrP3 conj.n) ss.a --- } ; --- --- ConjAP conj ss = conjunctDistrTable Agr conj ss ** { --- isPre = ss.isPre --- } ; --- --- ConjRS conj ss = conjunctDistrTable Agr conj ss ** { --- c = ss.c --- } ; --- --- ConjIAdv = conjunctDistrSS ; --- --- ConjCN co ns = conjunctDistrTable2 Number Case co ns ** {g = Neutr} ; --- gender? --- ----- These fun's are generated from the list cat's. --- --- BaseS = twoSS ; --- ConsS = consrSS comma ; --- BaseAdv = twoSS ; --- ConsAdv = consrSS comma ; --- BaseNP x y = twoTable NPCase x y ** {a = conjAgr x.a y.a} ; --- ConsNP xs x = consrTable NPCase comma xs x ** {a = conjAgr xs.a x.a} ; --- BaseAP x y = twoTable Agr x y ** {isPre = andB x.isPre y.isPre} ; --- ConsAP xs x = consrTable Agr comma xs x ** {isPre = andB xs.isPre x.isPre} ; --- BaseRS x y = twoTable Agr x y ** {c = y.c} ; --- ConsRS xs x = consrTable Agr comma xs x ** {c = xs.c} ; --- BaseIAdv = twoSS ; --- ConsIAdv = consrSS comma ; --- BaseCN = twoTable2 Number Case ; --- ConsCN = consrTable2 Number Case comma ; --- --- lincat --- [S] = {s1,s2 : Str} ; --- [Adv] = {s1,s2 : Str} ; --- [IAdv] = {s1,s2 : Str} ; --- [NP] = {s1,s2 : NPCase => Str ; a : Agr} ; --- [AP] = {s1,s2 : Agr => Str ; isPre : Bool} ; --- [RS] = {s1,s2 : Agr => Str ; c : NPCase} ; --- [CN] = {s1,s2 : Number => Case => Str} ; --- ---} +concrete ConjunctionHun of Conjunction = + CatHun ** open ResHun, Coordination, Prelude in { + + {- Conjunction for category X needs four things: + lincat [X] + lin BaseX + lin ConsX + lin ConjX + + For example, if X is defined as + + lincat X = {s : Number => Str ; g : Gender} ; + + then [X] will split its s field into two, and retain its other fields as is: + + lincat [X] = {s1,s2 : Number => Str ; g : Gender} ; + + Let us look at a simple case: Adv is of type {s : Str} + Then [Adv] is {s1,s2 : Str}. + BaseAdv, ConsAdv and ConjAdv can all use functions defined in prelude/Coordination: + + BaseAdv = twoSS ; + ConsAdv = consrSS comma ; + ConjAdv = conjunctSS ; + + --} + + +-- Adverb and other simple {s : Str} types. +lincat + [Adv],[AdV],[IAdv] = {s1,s2 : Str} ; + +lin + BaseAdv, BaseAdV, BaseIAdv = twoSS ; + ConsAdv, ConsAdV, ConsIAdv = consrSS comma ; + ConjAdv, ConjAdV, ConjIAdv = conjunctDistrSS ; + +{- +-- RS depends on X, Y and Z, otherwise exactly like previous. +-- RS can modify CNs, which are open for …, and have inherent … +lincat + [RS] = {s1,s2 : … => Str} ; + +lin + BaseRS = twoTable … ; + ConsRS = consrTable … comma ; + ConjRS = conjunctDistrTable ; + +lincat + [S] = {} ; + +lin + BaseS x y = y ** { } ; + ConsS x xs = + xs ** { } ; + ConjS co xs = {} ; + +lincat + [AP] = {} ; + +lin + BaseAP x y = twoTable … x y ** y ; + ConsAP a as = consrTable … comma as a ** as ; + ConjAP co as = conjunctDistrTable … co as ** as ; + +lincat + [CN] = { } ; + +lin + BaseCN = {} ; + ConsCN = {} ; + ConjCN co cs = conjunctDistrTable … co cs ** cs ; + +lincat + [DAP] = + +lin + BaseDAP x y = x ** + ConsDAP xs x = xs ** + ConjDet conj xs = xs ** + + +-- Noun phrases +lincat + [NP] = + +lin + BaseNP x y = twoTable … x y ** y ; + ConsNP x xs = consrTable … comma as a ** as ; + ConjNP co as = conjunctDistrTable … co as ** as ; +-} } diff --git a/src/hungarian/ConstructionHun.gf b/src/hungarian/ConstructionHun.gf new file mode 100644 index 00000000..51edc500 --- /dev/null +++ b/src/hungarian/ConstructionHun.gf @@ -0,0 +1,113 @@ +concrete ConstructionHun of Construction = CatHun ** open ParadigmsHun in { + +lincat + Timeunit = N ; + Weekday = N ; + Monthday = NP ; + Month = N ; + Year = NP ; +{- +lin + + timeunitAdv n time = + 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 + weekdayN w = w ; + monthN m = m ; + + weekdayPN w = mkPN w ; + monthPN m = mkPN m ; + + 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" ; +-} + +} ; diff --git a/src/hungarian/ExtendHun.gf b/src/hungarian/ExtendHun.gf new file mode 100644 index 00000000..334eef4c --- /dev/null +++ b/src/hungarian/ExtendHun.gf @@ -0,0 +1,8 @@ +--# -path=.:../common:../abstract + +concrete ExtendHun of Extend = CatHun + -- ** ExtendFunctor - [] + -- with (Grammar=GrammarHun) + ** open Prelude, ResHun, NounHun in { + +} ; diff --git a/src/hungarian/GrammarHun.gf b/src/hungarian/GrammarHun.gf index b65226d1..325a57e9 100644 --- a/src/hungarian/GrammarHun.gf +++ b/src/hungarian/GrammarHun.gf @@ -1,8 +1,6 @@ ---# -path=.:../abstract:../common:prelude - -concrete GrammarHun of Grammar = - NounHun, - VerbHun, +concrete GrammarHun of Grammar = + NounHun, + VerbHun, AdjectiveHun, AdverbHun, NumeralHun, @@ -11,21 +9,12 @@ concrete GrammarHun of Grammar = RelativeHun, ConjunctionHun, PhraseHun, - TextX - [Pol,PPos,PNeg], + TextX, StructuralHun, IdiomHun, - TenseX - [Pol,PPos,PNeg] - ** open ResHun, Prelude in -{ ---{ --- ---flags startcat = Phr ; unlexer = text ; lexer = text ; --- ---lin --- PPos = {s = [] ; p = CPos} ; --- PNeg = {s = [] ; p = CNeg True} ; -- contracted: don't --- --- ---} ; + TenseX + ** { -} +flags startcat = Phr ; unlexer = text ; lexer = text ; + +} ; diff --git a/src/hungarian/IdiomHun.gf b/src/hungarian/IdiomHun.gf index 0710d0e4..ce9f3c6c 100644 --- a/src/hungarian/IdiomHun.gf +++ b/src/hungarian/IdiomHun.gf @@ -1,36 +1,47 @@ -concrete IdiomHun of Idiom = CatHun ** open Prelude, ResHun in -{ ---{ --- --- flags optimize=all_subs ; --- --- lin --- ImpersCl vp = mkClause "it" (agrP3 Sg) vp ; --- GenericCl vp = mkClause "one" (agrP3 Sg) vp ; --- --- CleftNP np rs = mkClause "it" (agrP3 Sg) --- (insertObj (\\_ => rs.s ! np.a) --- (insertObj (\\_ => np.s ! rs.c) (predAux auxBe))) ; --- --- CleftAdv ad s = mkClause "it" (agrP3 Sg) --- (insertObj (\\_ => conjThat ++ s.s) --- (insertObj (\\_ => ad.s) (predAux auxBe))) ; --- --- ExistNP np = --- mkClause "there" (agrP3 (fromAgr np.a).n) --- (insertObj (\\_ => np.s ! NPAcc) (predAux auxBe)) ; --- --- ExistIP ip = --- mkQuestion (ss (ip.s ! npNom)) --- (mkClause "there" (agrP3 ip.n) (predAux auxBe)) ; --- --- ProgrVP vp = insertObj (\\a => vp.ad ++ vp.prp ++ vp.s2 ! a) (predAux auxBe) ; --- --- ImpPl1 vp = {s = "let's" ++ infVP VVAux vp (AgP1 Pl)} ; --- --- ImpP3 np vp = {s = "let" ++ np.s ! NPAcc ++ infVP VVAux vp np.a} ; --- ---} --- + +--1 Idiom: Idiomatic Expressions + +concrete IdiomHun of Idiom = CatHun ** open Prelude, ResHun, VerbHun, NounHun, StructuralHun in { + +-- This module defines constructions that are formed in fixed ways, +-- often different even in closely related languages. + +{- lin + + + -- ImpersCl : VP -> Cl ; -- it is hot + -- GenericCl : VP -> Cl ; -- one sleeps + ImpersCl, + GenericCl = \vp -> predVP impersNP (passVP vp) ; + + 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 = + + 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 + + -- : VP -> VP ; + ProgrVP vp = vp ** { + } ; + + + -- : VP -> Utt ; -- let's go + ImpPl1 vp = { } ; + + 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) +-} } diff --git a/src/hungarian/LangHun.gf b/src/hungarian/LangHun.gf index a15285fc..0a311313 100644 --- a/src/hungarian/LangHun.gf +++ b/src/hungarian/LangHun.gf @@ -1,14 +1,4 @@ ---# -path=.:../abstract:../common:../prelude - -concrete LangHun of Lang = +concrete LangHun of Lang = GrammarHun, - LexiconHun - ** -{ ---{ --- ---flags startcat = Phr ; unlexer = text ; lexer = text ; --- ---} ; - -} + LexiconHun, + ConstructionHun ; diff --git a/src/hungarian/LexiconHun.gf b/src/hungarian/LexiconHun.gf index e068cdac..c305d78d 100644 --- a/src/hungarian/LexiconHun.gf +++ b/src/hungarian/LexiconHun.gf @@ -1,383 +1,418 @@ ---# -path=.:prelude +concrete LexiconHun of Lexicon = CatHun ** + open ParadigmsHun in { -concrete LexiconHun of Lexicon = CatHun ** - open ParadigmsHun, Prelude in -{ ---{ --- - flags coding = utf8 ; +---- +-- A +-- lin add_V3 = mkV3 "" ; +-- lin airplane_N = mkN "" ; +-- lin alas_Interj = mkInterj "" ; +-- lin already_Adv = mkA "" ; +-- lin animal_N = mkN "" ; +-- lin answer_V2S = mkV2S "" ; +-- lin apartment_N = mkN "" ; +lin apple_N = mkN "alma" ; +-- lin art_N = mkN "" ; +-- lin ashes_N = mkN "" ; +-- lin ask_V2Q = mkV2 "" ; + +---- +-- B + +-- lin baby_N = mkN "" ; +-- lin back_N = mkN "" ; +-- lin bad_A = mkA "" ; +-- lin bank_N = mkN "" ; +-- lin bark_N = mkN "" ; +-- lin beautiful_A = mkA "" ; +-- lin become_VA = mkVA "" ; +lin beer_N = mkN "sör" ; +-- lin beg_V2V = mkV2 "" ; +-- lin belly_N = mkN "" ; +-- lin big_A = mkA "" ; +-- lin bike_N = mkN "" ; +-- lin bird_N = mkN "" ; +-- lin bite_V2 = mkV2 "" ; +-- lin black_A = mkA "" ; +-- lin blood_N = mkN "" ; +-- lin blow_V = mkV "" ; +-- lin blue_A = mkA "" ; +-- lin boat_N = mkN "" ; +-- lin bone_N = mkN "" ; +-- lin boot_N = mkN "" ; +-- lin boss_N = mkN "" ; +-- lin book_N = mkN "" ; +-- lin boy_N = mkN "" ; +-- lin bread_N = mkN "" ; +-- lin break_V2 = mkV2 "" ; +-- lin breast_N = mkN "" ; +-- lin breathe_V = mkV "" ; +-- lin broad_A = mkA "" ; +-- lin brother_N2 = mkN "" ; +-- lin brown_A = mkA "" ; +-- lin burn_V = mkV "" ; +-- lin butter_N = mkN "" ; +-- lin buy_V2 = mkV2 "" ; + +---- +-- C + +-- lin camera_N = mkN "" ; +-- lin cap_N = mkN "" ; +-- lin car_N = mkN "" ; +-- lin carpet_N = mkN "" ; +-- lin cat_N = mkN "" ; +-- lin ceiling_N = mkN "" ; +-- lin chair_N = mkN "" ; +-- lin cheese_N = mkN "" ; +-- lin child_N = mkN "" ; +-- lin church_N = mkN "" ; +-- lin city_N = mkN "" ; +-- lin clean_A = mkA "" ; +-- lin clever_A = mkA "" ; +-- lin close_V2 = mkV2 "" ; +-- lin cloud_N = mkN "" ; +-- lin coat_N = mkN "" ; +-- lin cold_A = mkA "" ; +-- lin come_V = mkV "" ; +-- lin computer_N = mkN "" ; +-- lin correct_A = mkA "" ; +-- lin count_V2 = mkV2 "" ; +-- lin country_N = mkN "" ; +-- lin cousin_N = mkN "" ; +-- lin cow_N = mkN "" ; +-- lin cut_V2 = mkV2 "" ; -- -lin --- airplane_N = regN "airplane" ; --- alas_Interj = ss "alas" ; --- answer_V2S = mkV2S (mkV "answer" "answered") toP ; --- apartment_N = regN "apartment" ; --- apple_N = regN "apple" ; --- art_N = regN "art" ; --- ask_V2Q = mkV2Q (regV "ask") noPrep ; --- baby_N = regN "baby" ; --- bad_A = mkADeg "bad" "worse" "worst" "badly" ; --- bank_N = regN "bank" ; --- beautiful_A = compoundADeg (regA "beautiful") ; --- become_VA = mkVA (irregV "become" "became" "become") ; --- beer_N = regN "beer" ; --- beg_V2V = mkV2V (regDuplV "beg") noPrep toP ; --- -- prevent_V2V = ingV2V (mkV "prevent") noPrep (mkPrep "from") ; --- -- make_V2V = mkV2V make_V noPrep noPrep ; --- big_A = duplADeg "big" ; --- bike_N = regN "bike" ; --- bird_N = regN "bird" ; --- black_A = regADeg "black" ; --- blue_A = regADeg "blue" ; --- boat_N = regN "boat" ; --- book_N = regN "book" ; --- boot_N = regN "boot" ; --- boss_N = mkN human (regN "boss") ; --- boy_N = mkN masculine (regN "boy") ; --- bread_N = regN "bread" ; --- break_V2 = dirV2 (irregV "break" "broke" "broken") ; --- broad_A = regADeg "broad" ; --- brother_N2 = mkN2 (mkN masculine (mkN "brother")) (mkPrep "of") ; --- brown_A = regADeg "brown" ; --- butter_N = regN "butter" ; --- buy_V2 = dirV2 (irregV "buy" "bought" "bought") ; --- camera_N = regN "camera" ; --- cap_N = regN "cap" ; --- car_N = regN "car" ; --- carpet_N = regN "carpet" ; --- cat_N = regN "cat" ; --- ceiling_N = regN "ceiling" ; --- chair_N = regN "chair" ; --- cheese_N = regN "cheese" ; - child_N = mkN "gyerek" ; --- church_N = regN "church" ; --- city_N = regN "city" ; --- clean_A = regADeg "clean" ; --- clever_A = mkA "clever" "cleverer" ; --- close_V2 = dirV2 (regV "close") ; --- coat_N = regN "coat" ; --- cold_A = regADeg "cold" ; --- come_V = (irregV "come" "came" "come") ; --- computer_N = regN "computer" ; --- country_N = regN "country" ; --- cousin_N = mkN human (regN "cousin") ; --- cow_N = regN "cow" ; --- die_V = (regV "die") ; --- dirty_A = regADeg "dirty" ; --- distance_N3 = mkN3 (regN "distance") fromP toP ; --- doctor_N = mkN human (regN "doctor") ; --- dog_N = regN "dog" ; --- door_N = regN "door" ; --- drink_V2 = dirV2 (irregV "drink" "drank" "drunk") ; --- easy_A2V = mkA2V (regA "easy") forP ; --- eat_V2 = dirV2 (irregV "eat" "ate" "eaten") ; --- empty_A = regADeg "empty" ; --- enemy_N = regN "enemy" ; --- factory_N = regN "factory" ; --- father_N2 = mkN2 (mkN masculine (mkN "father")) (mkPrep "of") ; --- fear_VS = mkVS (regV "fear") ; --- find_V2 = dirV2 (irregV "find" "found" "found") ; --- fish_N = mk2N "fish" "fish" ; --- floor_N = regN "floor" ; --- forget_V2 = dirV2 (irregDuplV "forget" "forgot" "forgotten") ; --- fridge_N = regN "fridge" ; --- friend_N = mkN human (regN "friend") ; --- fruit_N = regN "fruit" ; --- fun_AV = mkAV (regA "fun") ; --- garden_N = regN "garden" ; --- girl_N = mkN feminine (regN "girl") ; --- glove_N = regN "glove" ; --- gold_N = regN "gold" ; --- good_A = mkADeg "good" "better" "best" "well" ; --- go_V = mk5V "go" "goes" "went" "gone" "going" ; --- green_A = regADeg "green" ; --- harbour_N = regN "harbour" ; --- hate_V2 = dirV2 (regV "hate") ; --- hat_N = regN "hat" ; --- hear_V2 = dirV2 (irregV "hear" "heard" "heard") ; --- hill_N = regN "hill" ; --- hope_VS = mkVS (regV "hope") ; --- horse_N = regN "horse" ; --- hot_A = duplADeg "hot" ; - house_N = mkN "ház" ; --- important_A = compoundADeg (regA "important") ; --- industry_N = regN "industry" ; --- iron_N = regN "iron" ; --- king_N = mkN masculine (regN "king") ; --- know_V2 = dirV2 (irregV "know" "knew" "known") ; --- know_VQ = mkVQ (irregV "know" "knew" "known") ; --- know_VS = mkVS (irregV "know" "knew" "known") ; --- lake_N = regN "lake" ; --- lamp_N = regN "lamp" ; --- learn_V2 = dirV2 (regV "learn") ; --- leather_N = regN "leather" ; --- leave_V2 = dirV2 (irregV "leave" "left" "left") ; --- like_V2 = dirV2 (regV "like") ; --- listen_V2 = prepV2 (regV "listen") toP ; --- live_V = (regV "live") ; --- long_A = regADeg "long" ; --- lose_V2 = dirV2 (irregV "lose" "lost" "lost") ; --- love_N = regN "love" ; --- love_V2 = dirV2 (regV "love") ; --- man_N = mkN masculine (mk2N "man" "men") ; --- married_A2 = mkA2 (regA "married") toP ; --- meat_N = regN "meat" ; --- milk_N = regN "milk" ; --- moon_N = regN "moon" ; --- mother_N2 = mkN2 (mkN feminine (mkN "mother")) (mkPrep "of") ; --- mountain_N = regN "mountain" ; --- music_N = regN "music" ; --- narrow_A = regADeg "narrow" ; --- new_A = regADeg "new" ; --- newspaper_N = regN "newspaper" ; --- oil_N = regN "oil" ; --- old_A = regADeg "old" ; --- open_V2 = dirV2 (regV "open") ; --- paint_V2A = mkV2A (regV "paint") noPrep ; --- paper_N = regN "paper" ; --- paris_PN = mkPN (mkN nonhuman (mkN "Paris")) ; --- peace_N = regN "peace" ; --- pen_N = regN "pen" ; --- planet_N = regN "planet" ; --- plastic_N = regN "plastic" ; --- play_V2 = dirV2 (regV "play") ; --- policeman_N = mkN masculine (mkN "policeman" "policemen") ; --- priest_N = mkN human (regN "priest") ; --- probable_AS = mkAS (regA "probable") ; --- queen_N = mkN feminine (regN "queen") ; --- radio_N = regN "radio" ; --- rain_V0 = mkV0 (regV "rain") ; --- read_V2 = dirV2 (irregV "read" "read" "read") ; --- red_A = duplADeg "red" ; --- religion_N = regN "religion" ; --- restaurant_N = regN "restaurant" ; --- river_N = regN "river" ; --- rock_N = regN "rock" ; --- roof_N = regN "roof" ; --- rubber_N = regN "rubber" ; --- run_V = (irregDuplV "run" "ran" "run") ; --- say_VS = mkVS (irregV "say" "said" "said") ; --- school_N = regN "school" ; --- science_N = regN "science" ; --- sea_N = regN "sea" ; --- seek_V2 = dirV2 (irregV "seek" "sought" "sought") ; --- see_V2 = dirV2 (irregV "see" "saw" "seen") ; --- sell_V3 = dirV3 (irregV "sell" "sold" "sold") toP ; --- send_V3 = dirV3 (irregV "send" "sent" "sent") toP ; --- sheep_N = mk2N "sheep" "sheep" ; --- ship_N = regN "ship" ; --- shirt_N = regN "shirt" ; --- shoe_N = regN "shoe" ; --- shop_N = regN "shop" ; --- short_A = regADeg "short" ; --- silver_N = regN "silver" ; --- sister_N = mkN feminine (mkN "sister") ; --- sleep_V = (irregV "sleep" "slept" "slept") ; --- small_A = regADeg "small" ; --- snake_N = regN "snake" ; --- sock_N = regN "sock" ; --- speak_V2 = dirV2 (irregV "speak" "spoke" "spoken") ; --- star_N = regN "star" ; --- steel_N = regN "steel" ; --- stone_N = regN "stone" ; --- stove_N = regN "stove" ; --- student_N = mkN human (regN "student") ; --- stupid_A = mkA "stupid" ; --- sun_N = regN "sun" ; --- switch8off_V2 = dirV2 (partV (regV "switch") "off") ; --- switch8on_V2 = dirV2 (partV (regV "switch") "on") ; --- table_N = regN "table" ; --- talk_V3 = mkV3 (regV "talk") toP aboutP ; --- teacher_N = mkN human (regN "teacher") ; --- teach_V2 = dirV2 (irregV "teach" "taught" "taught") ; --- television_N = regN "television" ; --- thick_A = regADeg "thick" ; --- thin_A = duplADeg "thin" ; --- train_N = regN "train" ; --- travel_V = (regDuplV "travel") ; --- tree_N = regN "tree" ; --- ---- trousers_N = regN "trousers" ; --- ugly_A = mkA "ugly" ; --- understand_V2 = dirV2 (irregV "understand" "understood" "understood") ; --- university_N = regN "university" ; --- village_N = regN "village" ; --- wait_V2 = prepV2 (regV "wait") forP ; --- walk_V = (regV "walk") ; --- warm_A = regADeg "warm" ; --- war_N = regN "war" ; --- watch_V2 = dirV2 (regV "watch") ; --- water_N = regN "water" ; --- white_A = mkA "white" ; --- window_N = regN "window" ; --- wine_N = regN "wine" ; --- win_V2 = dirV2 (irregDuplV "win" "won" "won") ; --- woman_N = mkN feminine (mk2N "woman" "women") ; --- wonder_VQ = mkVQ (mkV "wonder" "wondered") ; --- wood_N = regN "wood" ; --- write_V2 = dirV2 (irregV "write" "wrote" "written") ; --- yellow_A = mkA "yellow" ; --- young_A = regADeg "young" ; +-- ---- +-- -- D -- --- do_V2 = dirV2 (mk5V "do" "does" "did" "done" "doing") ; --- now_Adv = mkAdv "now" ; --- already_Adv = mkAdv "already" ; --- song_N = regN "song" ; --- add_V3 = dirV3 (regV "add") toP ; --- number_N = regN "number" ; --- put_V2 = prepV2 (irregDuplV "put" "put" "put") noPrep ; --- stop_V = regDuplV "stop" ; --- jump_V = regV "jump" ; +-- lin day_N = mkN "" ; +-- lin die_V = mkV "" ; +-- lin dig_V = mkV "" ; +-- lin dirty_A = mkA "" ; +-- lin distance_N3 = mkN "" ; +-- lin do_V2 = mkV2 do_V ; +-- lin doctor_N = mkN "" ; +-- lin dog_N = mkN "" ; +-- lin door_N = mkN "" ; +-- lin drink_V2 = mkV2 "" ; +-- lin dry_A = mkA "" ; +-- lin dull_A = mkA "" ; +-- lin dust_N = mkN "" ; + +---- +-- E + +-- lin ear_N = mkN "" ; +-- lin earth_N = mkN "" ; +-- lin eat_V2 = mkV2 "" ; +-- lin egg_N = mkN "" ; +-- lin empty_A = mkA "" ; +-- lin enemy_N = mkN "" ; +-- lin eye_N = mkN "" ; + +---- +-- F + +-- lin factory_N = mkN "" ; +-- lin fall_V = mkV "" ; +-- lin far_Adv = mkA "" ; +-- lin fat_N = mkN "" ; +-- lin father_N2 = mkN2 "" ; +-- lin fear_V2 = mkV2 "" ; +-- lin fear_VS = mkVS "" ; +-- lin feather_N = mkN "" ; +-- lin fight_V2 = mkV2 "" ; +-- lin find_V2 = mkV2 "" ; +-- lin fingernail_N = mkN "" ; +-- lin fire_N = mkN "" ; +-- lin fish_N = mkN "" ; +-- lin float_V = mkV "" ; +-- lin floor_N = mkN "" ; +-- lin flow_V = mkV "" ; +-- lin flower_N = mkN "" ; +-- lin fly_V = mkV "" ; +-- lin fog_N = mkN "" ; +-- lin foot_N = mkN "" ; +-- lin forest_N = mkN "" ; +-- lin forget_V2 = mkV2 "" ; +-- lin freeze_V = mkV "" ; +-- lin fridge_N = mkN "" ; +-- lin friend_N = mkN "" ; +-- lin fruit_N = mkN "" ; +-- lin full_A = mkA "" ; +-- --lin fun_AV + +---- +-- G + +-- lin garden_N = mkN "" ; +-- lin girl_N = mkN "" ; +-- lin give_V3 = mkV3 "" ; +-- lin glove_N = mkN "" ; +-- lin go_V = mkV "" ; +-- lin gold_N = mkN "" ; +-- lin good_A = mkA "" ; +-- lin grammar_N = mkN "" ; +-- lin grass_N = mkN "" ; +-- lin green_A = mkA "" ; + +---- +-- H + +-- lin hair_N = mkN "" ; +-- lin hand_N = mkN "" ; +-- lin harbour_N = mkN "" ; +-- lin hat_N = mkN "" ; +-- lin hate_V2 = mkV2 "" ; +-- lin head_N = mkN "" ; +-- lin hear_V2 = mkV2 "" ; +-- lin heart_N = mkN "" ; +-- lin heavy_A = mkA "" ; +-- lin hill_N = mkN "" ; +-- lin hit_V2 = mkV2 "" ; +-- lin hold_V2 = mkV2 "" ; +-- lin hope_VS = mkV "" ; +-- lin horn_N = mkN "" ; +-- lin horse_N = mkN "" ; +-- lin hot_A = mkA "" ; +lin house_N = mkN "ház" ; +-- lin hunt_V2 = mkV2 "" ; +-- lin husband_N = mkN "" ; + +-------- +-- I - K + +-- lin ice_N = mkN "" ; +-- lin industry_N = mkN "" ; +-- lin iron_N = mkN "" ; +-- lin john_PN = mkPN "" ; +-- lin jump_V = mkV "" ; +-- lin kill_V2 = mkV2 "" ; +-- lin king_N = mkN "" ; +-- lin knee_N = mkN "" ; +-- lin know_V2 = mkV2 "" ; +-- lin know_VQ = mkVQ "" ; +-- lin know_VS = mkV "" ; + + +---- +-- L + +-- lin lake_N = mkN "" ; +-- lin lamp_N = mkN "" ; +-- lin language_N = mkN "" ; +-- lin laugh_V = mkV "" ; +-- lin leaf_N = mkN "" ; +-- lin learn_V2 = mkV2 "" ; +-- lin leather_N = mkN "" ; +-- lin leave_V2 = mkV2 "" ; +-- lin leg_N = mkN "" ; +-- lin lie_V = mkV "" ; +-- lin like_V2 = mkV2 "" ; +-- lin listen_V2 = mkV2 "" ; +-- lin live_V = mkV ""; +-- lin liver_N = mkN "" ; +-- lin long_A = mkA "" ; +-- lin lose_V2 = mkV2 "" ; +-- lin louse_N = mkN "" ; +-- lin love_N = mkN "" ; +-- lin love_V2 = mkV2 "" ; + +---- +-- M + +lin man_N = mkN "férfi" ; +-- lin married_A2 = mkA "" ; +-- lin meat_N = mkN "" ; +-- lin milk_N = mkN "" ; +-- lin moon_N = mkN "" ; +-- lin mother_N2 = mkN2 "" ; +-- lin mountain_N = mkN "" ; +-- lin mouth_N = mkN "" ; +-- lin music_N = mkN "" ; + +---- +-- N + +lin name_N = mkN "név" ; +-- lin narrow_A = mkA "" ; +-- lin near_A = mkA "" ; +-- lin neck_N = mkN "" ; +-- lin new_A = mkA "" ; +-- lin newspaper_N = mkN "" ; +-- lin night_N = mkN "" ; +-- lin nose_N = mkN "" ; +lin now_Adv = mkAdv "most" ; +-- lin number_N = mkN "" ; -- --- left_Ord = mkOrd "left" ; --- right_Ord = mkOrd "right" ; --- far_Adv = mkAdv "far" ; --- correct_A = (regA "correct") ; --- dry_A = regA "dry" ; --- dull_A = regA "dull" ; --- full_A = regA "full" ; --- heavy_A = regA "heavy" ; --- near_A = regA "near" ; --- rotten_A = (regA "rotten") ; --- round_A = regA "round" ; --- sharp_A = regA "sharp" ; --- smooth_A = regA "smooth" ; --- straight_A = regA "straight" ; --- wet_A = regA "wet" ; ---- --- wide_A = regA "wide" ; --- animal_N = regN "animal" ; --- ashes_N = regN "ash" ; -- FIXME: plural only? --- back_N = regN "back" ; --- bark_N = regN "bark" ; --- belly_N = regN "belly" ; --- blood_N = regN "blood" ; --- bone_N = regN "bone" ; --- breast_N = regN "breast" ; --- cloud_N = regN "cloud" ; --- day_N = regN "day" ; --- dust_N = regN "dust" ; --- ear_N = regN "ear" ; --- earth_N = regN "earth" ; --- egg_N = regN "egg" ; --- eye_N = regN "eye" ; --- fat_N = regN "fat" ; --- feather_N = regN "feather" ; --- fingernail_N = regN "fingernail" ; --- fire_N = regN "fire" ; --- flower_N = regN "flower" ; --- fog_N = regN "fog" ; --- foot_N = mk2N "foot" "feet" ; --- forest_N = regN "forest" ; --- grass_N = regN "grass" ; --- guts_N = regN "gut" ; -- FIXME: no singular --- hair_N = regN "hair" ; --- hand_N = regN "hand" ; --- head_N = regN "head" ; --- heart_N = regN "heart" ; --- horn_N = regN "horn" ; --- husband_N = mkN masculine (regN "husband") ; --- ice_N = regN "ice" ; --- knee_N = regN "knee" ; --- leaf_N = mk2N "leaf" "leaves" ; --- leg_N = regN "leg" ; --- liver_N = regN "liver" ; --- louse_N = mk2N "louse" "lice" ; --- mouth_N = regN "mouth" ; --- name_N = regN "name" ; --- neck_N = regN "neck" ; --- night_N = regN "night" ; --- nose_N = regN "nose" ; --- person_N = mkN human (regN "person") ; --- rain_N = regN "rain" ; --- road_N = regN "road" ; --- root_N = regN "root" ; --- rope_N = regN "rope" ; --- salt_N = regN "salt" ; --- sand_N = regN "sand" ; --- seed_N = regN "seed" ; --- skin_N = regN "skin" ; --- sky_N = regN "sky" ; --- smoke_N = regN "smoke" ; --- snow_N = regN "snow" ; --- stick_N = regN "stick" ; --- tail_N = regN "tail" ; --- tongue_N = regN "tongue" ; --- tooth_N = mk2N "tooth" "teeth" ; --- wife_N = mkN feminine (mk2N "wife" "wives") ; --- wind_N = regN "wind" ; --- wing_N = regN "wing" ; --- worm_N = regN "worm" ; --- year_N = regN "year" ; --- blow_V = IrregHun.blow_V ; --- breathe_V = dirV2 (regV "breathe") ; --- burn_V = IrregHun.burn_V ; --- dig_V = IrregHun.dig_V ; --- fall_V = IrregHun.fall_V ; --- float_V = regV "float" ; --- flow_V = regV "flow" ; --- fly_V = IrregHun.fly_V ; --- freeze_V = IrregHun.freeze_V ; --- give_V3 = dirV3 give_V toP ; --- laugh_V = regV "laugh" ; --- lie_V = IrregHun.lie_V ; --- play_V = regV "play" ; --- sew_V = IrregHun.sew_V ; --- sing_V = IrregHun.sing_V ; --- sit_V = IrregHun.sit_V ; --- smell_V = regV "smell" ; --- spit_V = IrregHun.spit_V ; --- stand_V = IrregHun.stand_V ; --- swell_V = IrregHun.swell_V ; --- swim_V = IrregHun.swim_V ; --- think_V = IrregHun.think_V ; --- turn_V = regV "turn" ; --- vomit_V = mkV "vomit" "vomited" ; +-- -------- +-- -- O - P -- --- bite_V2 = dirV2 IrregHun.bite_V ; --- count_V2 = dirV2 (regV "count") ; --- cut_V2 = dirV2 IrregHun.cut_V ; --- fear_V2 = dirV2 (regV "fear") ; --- fight_V2 = dirV2 fight_V ; --- hit_V2 = dirV2 hit_V ; --- hold_V2 = dirV2 hold_V ; --- hunt_V2 = dirV2 (regV "hunt") ; --- kill_V2 = dirV2 (regV "kill") ; --- pull_V2 = dirV2 (regV "pull") ; --- push_V2 = dirV2 (regV "push") ; --- rub_V2 = dirV2 (regDuplV "rub") ; --- scratch_V2 = dirV2 (regV "scratch") ; --- split_V2 = dirV2 split_V ; --- squeeze_V2 = dirV2 (regV "squeeze") ; --- stab_V2 = dirV2 (regDuplV "stab") ; --- suck_V2 = dirV2 (regV "suck") ; --- throw_V2 = dirV2 throw_V ; --- tie_V2 = dirV2 (regV "tie") ; --- wash_V2 = dirV2 (regV "wash") ; --- wipe_V2 = dirV2 (regV "wipe") ; -- ----- other_A = regA "other" ; +-- lin oil_N = mkN "" ; +-- lin old_A = mkA "" ; +-- lin open_V2 = mkV2 "" ; +-- lin paint_V2A = mkV2A "" ; +-- lin paper_N = mkN "" ; +-- lin paris_PN = mkPN "Paris" ; +-- lin peace_N = mkN "" ; +-- lin pen_N = mkN "" ; +-- lin person_N = mkN "" ; +-- lin planet_N = mkN "" ; +-- lin plastic_N = mkN "" ; +-- lin play_V = mkV "" ; +-- lin policeman_N = mkN "" ; +-- lin priest_N = mkN "" ; +-- lin pull_V2 = mkV2 "" ; +-- lin push_V2 = mkV2 "" ; +-- lin put_V2 = mkV2 "" ; -- --- grammar_N = regN "grammar" ; --- language_N = regN "language" ; --- rule_N = regN "rule" ; +-- -------- +-- -- Q - R -- ----- added 4/6/2007 --- john_PN = mkPN (mkN masculine (mkN "John")) ; --- question_N = regN "question" ; --- ready_A = regA "ready" ; --- reason_N = regN "reason" ; --- today_Adv = mkAdv "today" ; --- uncertain_A = regA "uncertain" ; --- ---oper --- aboutP = mkPrep "about" ; --- atP = mkPrep "at" ; --- forP = mkPrep "for" ; --- fromP = mkPrep "from" ; --- inP = mkPrep "in" ; --- onP = mkPrep "on" ; --- toP = mkPrep "to" ; --- ---} ; +-- lin queen_N = mkN "" ; +-- lin question_N = mkN "" ; +-- lin radio_N = mkN "" ; +-- lin rain_N = mkN "" ; +-- lin rain_V0 = mkV "" ; +-- lin read_V2 = mkV2 "" ; +-- lin ready_A = mkA "" ; +-- lin reason_N = mkN "" ; +lin red_A = mkA "piros" ; +-- lin religion_N = mkN "" ; +-- lin restaurant_N = mkN "" ; +-- lin river_N = mkN "" ; +-- lin road_N = mkN "" ; +-- lin rock_N = mkN "" ; +-- lin roof_N = mkN "" ; +-- lin root_N = mkN "" ; +-- lin rope_N = mkN "" ; +-- lin rotten_A = mkA "" ; +-- lin round_A = mkA "" ; +-- lin rub_V2 = mkV2 "" ; +-- lin rubber_N = mkN "" ; +-- lin rule_N = mkN "" ; +-- lin run_V = mkV "" ; + +---- +-- S + +-- lin salt_N = mkN "" ; +-- lin sand_N = mkN "" ; +-- lin say_VS = mkVS "" ; +-- lin school_N = mkN "" ; +-- lin science_N = mkN "" ; +-- lin scratch_V2 = mkV2 "" ; +-- lin sea_N = mkN "" ; +-- lin see_V2 = mkV2 "" ; +-- lin seed_N = mkN "" ; +-- lin seek_V2 = mkV2 "" ; +-- lin sell_V3 = mkV3 "" ; +-- lin send_V3 = mkV3 "" ; +-- lin sew_V = mkV "" ; +-- lin sharp_A = mkA "" ; +-- lin sheep_N = mkN "" fem ; +-- lin ship_N = mkN "" ; +-- lin shirt_N = mkN "" ; +-- lin shoe_N = mkN "" ; +-- lin shop_N = mkN "" ; +-- lin short_A = mkA "" ; +-- lin silver_N = mkN "" ; +-- lin sing_V = mkV "" ; +-- lin sister_N = mkN "" ; +-- lin sit_V = mkV "" ; +-- lin skin_N = mkN "" ; +-- lin sky_N = mkN "" ; +-- lin sleep_V = mkV "" ; +-- lin small_A = mkA "" ; +-- lin smell_V = mkV "" ; +-- lin smoke_N = mkN "" ; +-- lin smooth_A = mkA "" ; +-- lin snake_N = mkN "" ; +-- lin snow_N = mkN "" ; +-- lin sock_N = mkN "" ; +-- lin song_N = mkN "" ; +-- lin speak_V2 = mkV2 "" ; +-- lin spit_V = mkV "" ; +-- lin split_V2 = mkV2 "" ; +-- lin squeeze_V2 = mkV2 "" ; +-- lin stab_V2 = mkV2 "" ; +-- lin stand_V = mkV "" ; +-- lin star_N = mkN "" ; +-- lin steel_N = mkN "" ; +-- lin stick_N = mkN "" ; +-- lin stone_N = mkN "" ; +-- lin stop_V = mkV "" ; +-- lin stove_N = mkN "" ; +-- lin straight_A = mkA "" ; +-- lin student_N = mkN "" ; +-- lin stupid_A = mkA "" ; +-- lin suck_V2 = mkV2 "" ; +-- lin sun_N = mkN "" ; +-- lin swell_V = mkV "" ; +-- lin swim_V = mkV "" ; + +---- +-- T + + +-- lin table_N = mkN "" ; +-- lin tail_N = mkN "" ; +-- lin talk_V3 = mkV3 "" ; +-- lin teach_V2 = mkV2 "" ; +lin teacher_N = mkN "tanár" ; +-- lin television_N = mkN "" ; +-- lin thick_A = mkA "" ; +-- lin thin_A = mkA "" ; +-- lin think_V = mkV "" ; +-- lin throw_V2 = mkV2 "" ; +-- lin tie_V2 = mkV2 "" ; +lin today_Adv = mkAdv "ma" ; +-- lin tongue_N = mkN "" ; +-- lin tooth_N = mkN "" ; +-- lin train_N = mkN "" ; +-- lin travel_V = mkV "" ; +-- lin tree_N = mkN "" ; +-- lin turn_V = mkV "" ; + +-------- +-- U - V + +-- lin ugly_A = mkA "" ; +-- lin uncertain_A = mkA "" ; +-- lin understand_V2 = mkV2 "" ; +-- lin university_N = mkN "" ; +-- lin village_N = mkN "" ; +-- lin vomit_V = mkV2 "" ; + +-------- +-- W - Y + +-- lin wait_V2 = mkV2 "" ; +-- lin walk_V = mkV "" ; +-- lin war_N = mkN "" ; +-- lin warm_A = mkA "" ; +-- lin wash_V2 = mkV2 "" ; +-- lin watch_V2 = mkV2 "" ; +-- lin water_N = mkNoun "" ; +-- lin wet_A = mkA "" ; +-- lin white_A = mkA "" ; +-- lin wide_A = mkA "" ; +-- lin wife_N = mkN "" ; +-- lin win_V2 = mkV2 "" ; +-- lin wind_N = mkN "" ; +-- lin window_N = mkN "" ; +-- lin wine_N = mkN "" ; +-- lin wing_N = mkN "" ; +-- lin wipe_V2 = mkV2 "" ; +lin woman_N = mkN "nő" ; +-- lin wonder_VQ = mkVQ "" ; +-- lin wood_N = mkN "" ; +-- lin worm_N = mkN "" ; +-- lin write_V2 = mkV2 "" ; +-- lin year_N = mkN "" ; +-- lin yellow_A = mkA "" ; +-- lin young_A = mkA "" ; } diff --git a/src/hungarian/NounHun.gf b/src/hungarian/NounHun.gf index be7cc5fe..54d10cbf 100644 --- a/src/hungarian/NounHun.gf +++ b/src/hungarian/NounHun.gf @@ -1,144 +1,208 @@ -concrete NounHun of Noun = CatHun ** open MorphoHun, ResHun, Prelude in -{ ---{ --- --- flags optimize=all_subs ; --- --- lin --- DetCN det cn = { --- s = \\c => det.s ++ cn.s ! det.n ! npcase2case c ; --- a = agrgP3 det.n cn.g --- } ; --- --- UsePN pn = {s = \\c => pn.s ! npcase2case c ; a = agrgP3 Sg pn.g} ; --- UsePron p = p ; --- --- PredetNP pred np = { --- s = \\c => pred.s ++ np.s ! c ; --- a = np.a --- } ; --- --- PPartNP np v2 = { --- s = \\c => np.s ! c ++ v2.s ! VPPart ; --- a = np.a --- } ; --- --- RelNP np rs = { --- s = \\c => np.s ! c ++ "," ++ rs.s ! np.a ; --- a = np.a --- } ; --- --- AdvNP np adv = { --- s = \\c => np.s ! c ++ adv.s ; --- a = np.a --- } ; --- --- DetQuant quant num = { --- s = quant.s ! num.hasCard ! num.n ++ num.s ! Nom; --- sp = \\c => case num.hasCard of { --- False => quant.sp ! num.hasCard ! num.n ! c ++ num.s ! Nom ; --- True => quant.sp ! num.hasCard ! num.n ! npNom ++ num.s ! npcase2case c --- } ; --- n = num.n ; --- hasNum = num.hasCard --- } ; --- --- DetQuantOrd quant num ord = { --- s = quant.s ! num.hasCard ! num.n ++ num.s ! Nom ++ ord.s ! Nom; --- sp = \\c => quant.sp ! num.hasCard ! num.n ! npNom ++ num.s ! Nom ++ ord.s ! npcase2case c ; --- n = num.n ; --- hasNum = True --- } ; --- --- DetNP det = { --- s = case det.hasNum of {True => \\_ => det.s ; _ => \\c => det.sp ! c} ; --- a = agrP3 det.n --- } ; --- --- PossPron p = { --- s = \\_,_ => p.s ! NCase Gen ; --- sp = \\_,_,c => p.sp ! npcase2case c --- } ; --- --- NumSg = {s = \\c => []; n = Sg ; hasCard = False} ; --- NumPl = {s = \\c => []; n = Pl ; hasCard = False} ; ------b NoOrd = {s = []} ; --- --- NumCard n = n ** {hasCard = True} ; --- --- NumDigits n = {s = n.s ! NCard ; n = n.n} ; --- OrdDigits n = {s = n.s ! NOrd} ; --- --- NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n} ; --- OrdNumeral numeral = {s = numeral.s ! NOrd} ; --- --- AdNum adn num = {s = \\c => adn.s ++ num.s!c ; n = num.n} ; --- --- OrdSuperl a = {s = \\c => a.s ! AAdj Superl c } ; --- --- DefArt = { --- s = \\hasCard,n => artDef ; --- sp = \\hasCard,n => case of { --- => table { NCase Gen => "its"; _ => "it" } ; --- => table { NCase Nom => "they"; NPAcc => "them"; NCase Gen => "theirs" } ; --- _ => \\c => artDef --- } --- } ; --- --- IndefArt = { --- s = \\hasCard,n => case of { --- => artIndef ; --- _ => [] --- } ; --- sp = \\hasCard,n => case of { --- => table {NCase Gen => "one's"; _ => "one" }; --- => table {NCase Gen => "ones'"; _ => "ones" } ; --- _ => \\c => [] --- } --- } ; --- --- MassNP cn = { --- s = \\c => cn.s ! Sg ! npcase2case c ; --- a = agrP3 Sg --- } ; --- --- UseN n = n ; --- UseN2 n = n ; ------b UseN3 n = n ; --- --- Use2N3 f = { --- s = \\n,c => f.s ! n ! Nom ; --- g = f.g ; --- c2 = f.c2 --- } ; --- --- Use3N3 f = { --- s = \\n,c => f.s ! n ! Nom ; --- g = f.g ; --- c2 = f.c3 --- } ; --- --- ComplN2 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! NPAcc ; g = f.g} ; --- ComplN3 f x = { --- s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! NPAcc ; --- g = f.g ; --- c2 = f.c3 --- } ; --- --- AdjCN ap cn = { --- s = \\n,c => preOrPost ap.isPre (ap.s ! agrgP3 n cn.g) (cn.s ! n ! c) ; --- g = cn.g --- } ; --- RelCN cn rs = { --- s = \\n,c => cn.s ! n ! c ++ rs.s ! agrgP3 n cn.g ; --- g = cn.g --- } ; --- AdvCN cn ad = {s = \\n,c => cn.s ! n ! c ++ ad.s ; g = cn.g} ; --- --- SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s ; g = cn.g} ; --- --- ApposCN cn np = {s = \\n,c => cn.s ! n ! Nom ++ np.s ! NCase c ; g = cn.g} ; --- ---} +concrete NounHun of Noun = CatHun ** open ResHun, Prelude in { + + flags optimize=all_subs ; + + lin + +--2 Noun phrases + +-- : Det -> CN -> NP + DetCN det cn = emptyNP ** { + s = \\c => det.s ! c ++ cn.s ! det.n ! c ; + agr = ; + } ; + +{- + -- : PN -> NP ; + UsePN pn = pn ** {} ; + + -- : Pron -> NP ; + UsePron pron = pron ; + + -- : Predet -> NP -> NP ; -- only the man + PredetNP predet np = np ** {s = } ; + +-- A noun phrase can also be postmodified by the past participle of a +-- verb, by an adverb, or by a relative clause + + + -- : NP -> V2 -> NP ; -- the man seen + PPartNP np v2 = np ** { + s = \\c => v2.s ! ??? ++ np.s ! c } ; ---- + + -- : NP -> Adv -> NP ; -- Paris today ; boys, such as .. + AdvNP,ExtAdvNP = \np,adv -> np ** {} ; + + -- : NP -> RS -> NP ; -- Paris, which is here + RelNP np rs = np ** {} ; + +-- Determiners can form noun phrases directly. + + -- : Det -> NP ; + DetNP det = emptyNP ** { + s = det.sp ; + agr = ; + } ; + + -- : CN -> NP ; + MassNP cn = emptyNP ** { + s = \\c => cn.s ! Sg ! c ; + agr = ; + } ; +-} + +--2 Determiners + +-- The determiner has a fine-grained structure, in which a 'nucleus' +-- quantifier and an optional numeral can be discerned. + + -- : Quant -> Num -> Det ; + DetQuant quant num = quant ** num ** { + s = \\c => quant.s ! num.n ! c + ++ num.s ! Attrib ; -- TODO: add inflection table in numbers + sp = \\c => quant.sp ! num.n ! c + ++ num.s ! Indep + } ; + + -- : Quant -> Num -> Ord -> Det ; -- these five best + -- DetQuantOrd quant num ord = + -- let theseFive = DetQuant quant num in theseFive ** { + -- } ; + +-- Whether the resulting determiner is singular or plural depends on the +-- cardinal. + +-- All parts of the determiner can be empty, except $Quant$, which is +-- the "kernel" of a determiner. It is, however, the $Num$ that determines +-- the inherent number. + + NumSg = baseNum ; + NumPl = baseNum ** {n = Pl} ; + + -- : Card -> Num ; + NumCard card = card ; + + -- : Digits -> Card ; + -- NumDigits dig = + + -- : Numeral -> Card ; + NumNumeral num = num ; + +{- + -- : AdN -> Card -> Card ; + AdNum adn card = card ** { s = adn.s ++ card.s } ; + + -- : Digits -> Ord ; + OrdDigits digs = digs ** { s = digs.s ! NOrd } ; + + -- : Numeral -> Ord ; + OrdNumeral num = num ** { + s = \\_ => num.ord + } ; + + -- : A -> Ord ; + OrdSuperl a = { + s = \\af => "제일" ++ a.s ! af ; + n = Sg -- ?? is this meaningful? + } ; + +-- One can combine a numeral and a superlative. + + -- : Numeral -> A -> Ord ; -- third largest + OrdNumeralSuperl num a = num ** { } ; +-} + -- : Quant + DefArt = { + s, + sp = \\_,_ => pre {"a" ; "az" / v } ; + } ; + + + -- : Quant + IndefArt = { + s, + sp = \\_,_ => "egy" ; + } ; + + -- : Pron -> Quant + -- PossPron pron = + -- let p = pron.poss ; + -- in DefArt ** { + -- } ; + +--2 Common nouns + + -- : N -> CN + -- : N2 -> CN ; + UseN,UseN2 = \n -> n ; + + -- : N2 -> NP -> CN ; + -- ComplN2 n2 np = + + -- : N3 -> NP -> N2 ; -- distance from this city (to Paris) + -- ComplN3 n3 np = + + + -- : N3 -> N2 ; -- distance (from this city) + -- Use2N3 n3 = lin N2 n3 ** { c2 = n3.c3 } ; + + -- : N3 -> N2 ; -- distance (to Paris) + -- Use3N3 n3 = lin N2 n3 ; + + -- : AP -> CN -> CN + AdjCN ap cn = cn ** { + s = \\n,c => ap.s ! Sg ++ cn.s ! n ! c + } ; + + -- : CN -> RS -> CN ; + -- RelCN cn rs = cn ** { + -- } ; + +{- + -- : CN -> Adv -> CN ; + AdvCN cn adv = cn ** { } ; + +-- Nouns can also be modified by embedded sentences and questions. +-- For some nouns this makes little sense, but we leave this for applications +-- to decide. Sentential complements are defined in VerbHun. + + -- : CN -> SC -> CN ; -- question where she sleeps + SentCN cn sc = cn ** { } ; + + +--2 Apposition + +-- This is certainly overgenerating. + + -- : CN -> NP -> CN ; -- city Paris (, numbers x and y) + ApposCN cn np = cn ** { s = } ; +-} + +--2 Possessive and partitive constructs + + -- : PossNP : CN -> NP -> CN ; + -- PossNP cn np = cn ** { + -- } ; + + -- : CN -> NP -> CN ; -- glass of wine / two kilos of red apples + -- PartNP cn np = cn ** { + -- } ; + +{- + +-- This is different from the partitive, as shown by many languages. + + -- : Det -> NP -> NP ; + CountNP det np = np ** + { } ; -- Nonsense for DefArt or IndefArt + +--3 Conjoinable determiners and ones with adjectives + + -- : DAP -> AP -> DAP ; -- the large (one) + AdjDAP dap ap = dap ** { } ; + + -- : Det -> DAP ; -- this (or that) + DetDAP det = det ; +-} } diff --git a/src/hungarian/NumeralHun.gf b/src/hungarian/NumeralHun.gf index 68091349..f2be4448 100644 --- a/src/hungarian/NumeralHun.gf +++ b/src/hungarian/NumeralHun.gf @@ -1,99 +1,91 @@ -concrete NumeralHun of Numeral = CatHun [Numeral,Digits] ** open ResHun in -{ ---{ --- ---lincat --- Digit = {s : DForm => CardOrd => Case => Str} ; --- Sub10 = {s : DForm => CardOrd => Case => Str ; n : Number} ; --- Sub100 = {s : CardOrd => Case => Str ; n : Number} ; --- Sub1000 = {s : CardOrd => Case => Str ; n : Number} ; --- Sub1000000 = {s : CardOrd => Case => Str ; n : Number} ; --- ---lin num x = x ; ---lin n2 = let two = mkNum "two" "twelve" "twenty" "second" in --- {s = \\f,o => case of { --- => regGenitiveS "twelfth" ; --- _ => two.s ! f ! o --- } --- } ; --- ---lin n3 = mkNum "three" "thirteen" "thirty" "third" ; ---lin n4 = mkNum "four" "fourteen" "forty" "fourth" ; ---lin n5 = mkNum "five" "fifteen" "fifty" "fifth" ; ---lin n6 = regNum "six" ; ---lin n7 = regNum "seven" ; ---lin n8 = mkNum "eight" "eighteen" "eighty" "eighth" ; ---lin n9 = mkNum "nine" "nineteen" "ninety" "ninth" ; --- ---lin pot01 = mkNum "one" "eleven" "ten" "first" ** {n = Sg} ; ---lin pot0 d = d ** {n = Pl} ; ---lin pot110 = regCardOrd "ten" ** {n = Pl} ; ---lin pot111 = regCardOrd "eleven" ** {n = Pl} ; ---lin pot1to19 d = {s = d.s ! teen} ** {n = Pl} ; ---lin pot0as1 n = {s = n.s ! unit} ** {n = n.n} ; ---lin pot1 d = {s = d.s ! ten} ** {n = Pl} ; ---lin pot1plus d e = { --- s = \\o,c => d.s ! ten ! NCard ! Nom ++ "-" ++ e.s ! unit ! o ! c ; n = Pl} ; ---lin pot1as2 n = n ; ---lin pot2 d = {s = \\o,c => d.s ! unit ! NCard ! Nom ++ mkCard o "hundred" ! c} ** {n = Pl} ; ---lin pot2plus d e = { --- s = \\o,c => d.s ! unit ! NCard ! Nom ++ "hundred" ++ "and" ++ e.s ! o ! c ; n = Pl} ; ---lin pot2as3 n = n ; ---lin pot3 n = { --- s = \\o,c => n.s ! NCard ! Nom ++ mkCard o "thousand" ! c ; n = Pl} ; ---lin pot3plus n m = { --- s = \\o,c => n.s ! NCard ! Nom ++ "thousand" ++ m.s ! o ! c; n = Pl} ; --- ----- numerals as sequences of digits --- --- lincat --- Dig = TDigit ; --- --- lin --- IDig d = d ** {tail = T1} ; --- --- IIDig d i = { --- s = \\o,c => d.s ! NCard ! Nom ++ commaIf i.tail ++ i.s ! o ! c ; --- n = Pl ; --- tail = inc i.tail --- } ; --- --- D_0 = mkDig "0" ; --- D_1 = mk3Dig "1" "1st" Sg ; --- D_2 = mk2Dig "2" "2nd" ; --- D_3 = mk2Dig "3" "3rd" ; --- D_4 = mkDig "4" ; --- D_5 = mkDig "5" ; --- D_6 = mkDig "6" ; --- D_7 = mkDig "7" ; --- D_8 = mkDig "8" ; --- D_9 = mkDig "9" ; --- --- oper --- commaIf : DTail -> Str = \t -> case t of { --- T3 => BIND++","++BIND ; --- _ => BIND --- } ; --- --- inc : DTail -> DTail = \t -> case t of { --- T1 => T2 ; --- T2 => T3 ; --- T3 => T1 --- } ; --- --- mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ; --- mkDig : Str -> TDigit = \c -> mk2Dig c (c + "th") ; --- --- mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> { --- s = table {NCard => regGenitiveS c ; NOrd => regGenitiveS o} ; --- n = n --- } ; --- --- TDigit = { --- n : Number ; --- s : CardOrd => Case => Str --- } ; --- ---} +concrete NumeralHun of Numeral = CatHun [Numeral,Digits] ** + open Prelude, ResHun in { -} +lincat + Digit, + Sub10 = LinDigit ; + Sub100, + Sub1000, + Sub1000000 = ResHun.Numeral ; +lin + + -- TODO: Add case inflection and ordinal forms to all numerals + + -- : Sub1000000 -> Numeral + num x = x ; + + -- : Digit + n2 = mkNum5 "kettő" "húsz" "két" "huszon" "második" ; + n3 = mkNum3 "három" "harminc" "harmadik" ; + n4 = mkNum3 "négy" "negyven" "negyedik" ; + n5 = mkNum3 "öt" "ötven" "ötödik" ; + n6 = mkNum3 "hat" "hatvan" "hatodik" ; + n7 = mkNum3 "hét" "hetven" "hetedik" ; + n8 = mkNum3 "nyolc" "nyolcvan" "nyolcadik" ; + n9 = mkNum3 "kilenc" "kilencven" "kilencedik" ; + + -- : Sub10 ; -- 1 + pot01 = mkNum3 "egy" "tíz" "első" ** {n=Sg} ; + -- : Digit -> Sub10 ; -- d * 1 + pot0 d = d ; + + -- : Sub100 ; -- 10 + pot110 = {s = table {p => "tíz"} ; n=Pl} ; + -- : Sub100 ; -- 11 + pot111 = {s = table {p => "tizenegy"} ; n=Pl} ; + -- : Digit -> Sub100 ; -- 10 + d + pot1to19 d = + {s = table {p => "tizen" ++ d.s ! } ; + n = Pl} ; + -- : Sub10 -> Sub100 ; -- coercion of 1..9 + pot0as1 n = + {s = table {p => n.s ! } ; + n = Pl} ; + + -- : Digit -> Sub100 ; -- d * 10 + pot1 d = + {s = table {p => d.s ! } ; + n = Pl} ; + -- : Digit -> Sub10 -> Sub100 ; -- d * 10 + n + pot1plus d e = + {s = table {p => (d.s ! ) ++ e.s ! } ; + n = Pl} ; + + -- : Sub100 -> Sub1000 ; -- coercion of 1..99 + pot1as2 n = n ; + -- : Sub10 -> Sub1000 ; -- m * 100 + pot2 d = + {s = table {p => (d.s ! ) ++ "száz"} ; + n = Pl} ; + -- : Sub10 -> Sub100 -> Sub1000 ; -- m * 100 + n + pot2plus d e = + {s = table {p => (d.s ! ) ++ "száz" ++ e.s ! p} ; + n = Pl} ; + + -- : Sub1000 -> Sub1000000 ; -- coercion of 1..999 + pot2as3 n = n ; + -- : Sub1000 -> Sub1000000 ; -- m * 1000 + pot3 n = + {s = table {p => n.s ! Attrib ++ "ezer"} ; + n = Pl} ; + -- : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n + pot3plus n m = + {s = table {p => n.s ! Attrib ++ "ezer" ++ m.s ! p} ; + n = Pl} ; + +oper + LinDigit : Type = {s : DForm*Place => Str ; n : Number} ; + + mkNum3 : (x1,_,x3 : Str) -> LinDigit = \három,harminc,harmadik -> + mkNum5 három harminc három harminc harmadik ; + + mkNum5 : (x1,_,_,_,x5 : Str) -> LinDigit = \ui,ti,ua,ta,ord -> { + s = table { => ui ; + => ti ; + => ua ; + => ta } ; +-- ord = ord ; -- TODO figure out where to use ordinal + n = Pl + } ; + + } diff --git a/src/hungarian/ParadigmsHun.gf b/src/hungarian/ParadigmsHun.gf index 5f3da0c5..9191ebf6 100644 --- a/src/hungarian/ParadigmsHun.gf +++ b/src/hungarian/ParadigmsHun.gf @@ -1,733 +1,141 @@ ---# -path=.:../abstract:../../prelude:../common - ---1 Hunlish Lexical Paradigms --- --- Aarne Ranta 2003--2005 --- --- This is an API for the user of the resource grammar --- for adding lexical items. It gives functions for forming --- expressions of open categories: nouns, adjectives, verbs. --- --- Closed categories (determiners, pronouns, conjunctions) are --- accessed through the resource syntax API, $Structural.gf$. --- --- The main difference with $MorphoHun.gf$ is that the types --- referred to are compiled resource grammar types. We have moreover --- had the design principle of always having existing forms, rather --- than stems, as string arguments of the paradigms. --- --- The structure of functions for each word class $C$ is the following: --- first we give a handful of patterns that aim to cover all --- regular cases. Then we give a worst-case function $mkC$, which serves as an --- escape to construct the most irregular words of type $C$. --- However, this function should only seldom be needed: we have a --- separate module [``IrregHun`` ../../english/IrregHun.gf], --- which covers irregular verbss. - -resource ParadigmsHun = open - (Predef=Predef), - Prelude, - ResHun, - CatHun - in -{ - flags optimize = noexpand ; - ---{ -----2 Parameters ----- ----- To abstract over gender names, we define the following identifiers. --- ---oper --- Gender : Type ; --- --- human : Gender ; --- nonhuman : Gender ; --- masculine : Gender ; --% --- feminine : Gender ; --% --- ----- To abstract over number names, we define the following. --- --- Number : Type ; --- --- singular : Number ; --- plural : Number ; --- ----- To abstract over case names, we define the following. --- --- Case : Type ; --% --- --- nominative : Case ; --% --- genitive : Case ; --% --- ----- Prepositions are used in many-argument functions for rection. ----- The resource category $Prep$ is used. --- ----- The number of a noun phrase can be extracted with the following ----- function. --- --- npNumber : NP -> Number ; -- exctract the number of a noun phrase --- --- -----2 Nouns --- ----- Nouns are constructed by the function $mkN$, which takes a varying ----- number of arguments. --- +resource ParadigmsHun = open CatHun, ResHun, ParamHun, NounHun, Prelude in { oper - mkN = overload { - mkN : Str -> Noun = - \s -> lin N (regNoun s) ; +--2 Parameters +-- +-- To abstract over number, valency and (some) case names, +-- we define the following identifiers. The application programmer +-- should always use these constants instead of the constructors +-- defined in $ResKor$. + + +--2 Nouns + + mkN : overload { + mkN : (noun : Str) -> N ; -- Predictable nouns + } ; + +--2 Adjectives + + mkA : overload { + mkA : (adj : Str) -> A ; -- Regular adjective, given in ??? form + -- mkA : (kiga : Str) -> (jakda : A) -> A ; -- Compound adjective, e.g. 키가 작다 'short', literally 'height (is) small'. 키가 'height' given as string, 작다 'small' given as preconstructed A. + } ; + + -- mkA2 : Str -> Prep -> A2 ; + +--2 Verbs + + -- Verbs + mkV : overload { + mkV : (sg3 : Str) -> V ; -- Predictable verb. Takes singular P3 form in present tense. + -- mkV : (nore : Str) -> (hada : V) -> V ; -- Add a prefix to an existing verb, e.g. 노래+하다 + } ; + + copula : V ; -- The copula verb '' + + mkV2 : overload { + mkV2 : (sg3 : Str) -> V2 ; -- Predictable verb. Takes singular P3 form in present tense, object case is accusative. + mkV2 : V -> V2 ; -- Takes preconstructed V, object case is accusative. } ; --- ----- The regular function captures the variants for nouns ending with ----- "s","sh","x","z" or "y": "kiss - kisses", "flash - flashes"; ----- "fly - flies" (but "toy - toys"), --- --- mkN : (flash : Str) -> N ; -- plural s, incl. flash-flashes, fly-flies --- ----- In practice the worst case is to give singular and plural nominative. --- --- mkN : (man,men : Str) -> N ; -- irregular plural --- ----- The theoretical worst case: give all four forms. --- --- mkN : (man,men,man's,men's : Str) -> N ; -- irregular genitives --- ----- Change gender from the default $nonhuman$. --- --- mkN : Gender -> N -> N ; -- default nonhuman --- -----3 Compound nouns ----- ----- A compound noun is an uninflected string attached to an inflected noun, ----- such as "baby boom", "chief executive officer". --- --- mkN : Str -> N -> N -- e.g. baby + boom --- } ; --- --- -----3 Relational nouns --- --- mkN2 : overload { --- mkN2 : Str -> N2 ; -- reg. noun, prep. "of" --% --- mkN2 : N -> N2 ; -- e.g. wife of (default prep. to) --- mkN2 : N -> Str -> N2 ; -- access to --% --- mkN2 : N -> Prep -> N2 ; -- e.g. access to --- mkN2 : Str -> Str -> N2 ; -- access to (regular noun) --% --- } ; --- ----- Use the function $mkPrep$ or see the section on prepositions below to ----- form other prepositions. ----- ----- Three-place relational nouns ("the connection from x to y") need two prepositions. --- --- mkN3 : N -> Prep -> Prep -> N3 ; -- e.g. connection from x to y --- --- --- -----3 Proper names and noun phrases ----- ----- Proper names, with a regular genitive, are formed from strings. --- --- mkPN : overload { --- --- mkPN : Str -> PN ; --- ----- Sometimes a common noun can be reused as a proper name, e.g. "Bank" --- --- mkPN : N -> PN --% --- } ; --- -----3 Determiners and quantifiers --- --- mkQuant : overload { --- mkQuant : (this, these : Str) -> Quant ; --% --- mkQuant : (no_sg, no_pl, none_sg, non_pl : Str) -> Quant ; --% --- } ; --- --- mkOrd : Str -> Ord ; --% --- -----2 Adjectives --- --- mkA : overload { --- ----- For regular adjectives, the adverbial and comparison forms are derived. This holds ----- even for cases with the variations "happy - happily - happier - happiest", ----- "free - freely - freer - freest", and "rude - rudest". --- --- mkA : (happy : Str) -> A ; -- regular adj, incl. happy-happier, rude-ruder --- ----- However, the duplication of the final consonant cannot be predicted, ----- but a separate case is used to give the comparative --- --- mkA : (fat,fatter : Str) -> A ; -- irreg. comparative --- ----- As many as four forms may be needed. --- --- mkA : (good,better,best,well : Str) -> A -- completely irreg. --- } ; --- ----- Regular comparison is formed by "more - most" for words with two vowels separated ----- and terminated by some other letters. To force this or the opposite, ----- the following can be used: --- --- compoundA : A -> A ; -- force comparison with more/most --- simpleA : A -> A ; -- force comparison with -er,-est --- irregAdv : A -> Str -> A ; -- adverb irreg, e.g. "fast" --- -----3 Two-place adjectives --- --- mkA2 : overload { --- mkA2 : A -> Prep -> A2 ; -- absent from --- mkA2 : A -> Str -> A2 ; -- absent from --% --- mkA2 : Str -> Prep -> A2 ; -- absent from --% --- mkA2 : Str -> Str -> A2 -- absent from --% --- --- } ; --- --- -----2 Adverbs --- ----- Adverbs are not inflected. Most lexical ones have position ----- after the verb. Some can be preverbal (e.g. "always"). --- --- mkAdv : Str -> Adv ; -- e.g. today --- mkAdV : Str -> AdV ; -- e.g. always --- ----- Adverbs modifying adjectives and sentences can also be formed. --- --- mkAdA : Str -> AdA ; -- e.g. quite --- ----- Adverbs modifying numerals --- --- mkAdN : Str -> AdN ; -- e.g. approximately --- -----2 Prepositions ----- ----- A preposition as used for rection in the lexicon, as well as to ----- build $PP$s in the resource API, just requires a string. --- --- mkPrep : Str -> Prep ; -- e.g. "in front of" --- noPrep : Prep ; -- no preposition --- ----- (These two functions are synonyms.) --- -----2 Conjunctions ----- --- --- mkConj : overload { --- mkConj : Str -> Conj ; -- and (plural agreement) --% --- mkConj : Str -> Number -> Conj ; -- or (agrement number given as argument) --% --- mkConj : Str -> Str -> Conj ; -- both ... and (plural) --% --- mkConj : Str -> Str -> Number -> Conj ; -- either ... or (agrement number given as argument) --% --- } ; --- -----2 Verbs ----- --- ----- Verbs are constructed by the function $mkV$, which takes a varying ----- number of arguments. --- --- mkV : overload { --- ----- The regular verb function recognizes the special cases where the last ----- character is "y" ("cry-cries" but "buy-buys") or a sibilant ----- ("kiss-"kisses", "jazz-jazzes", "rush-rushes", "munch - munches", ----- "fix - fixes"). --- --- mkV : (cry : Str) -> V ; -- regular, incl. cry-cries, kiss-kisses etc --- ----- Give the present and past forms for regular verbs where ----- the last letter is duplicated in some forms, ----- e.g. "rip - ripped - ripping". --- --- mkV : (stop, stopped : Str) -> V ; -- reg. with consonant duplication --- ----- There is an extensive list of irregular verbs in the module $IrregularHun$. ----- In practice, it is enough to give three forms, ----- e.g. "drink - drank - drunk". --- --- mkV : (drink, drank, drunk : Str) -> V ; -- ordinary irregular --- ----- Irregular verbs with duplicated consonant in the present participle. --- --- mkV : (run, ran, run, running : Str) -> V ; -- irregular with duplication --% --- ----- Except for "be", the worst case needs five forms: the infinitive and ----- the third person singular present, the past indicative, and the ----- past and present participles. --- --- mkV : (go, goes, went, gone, going : Str) -> V ; -- totally irregular --- ----- Adds a prefix to an exisiting verb. This is most useful to create ----- prefix-variants of irregular verbs from $IrregHun$, e.g. "undertake". --- --- mkV : Str -> V -> V ; -- fix compound, e.g. under+take --- }; --- ----- Verbs with a particle. ----- The particle, such as in "switch on", is given as a string. --- --- partV : V -> Str -> V ; -- with particle, e.g. switch + on --- ----- Reflexive verbs. ----- By default, verbs are not reflexive; this function makes them that. --- --- reflV : V -> V ; -- reflexive e.g. behave oneself --- -----3 Two-place verbs ----- ----- Two-place verbs need a preposition, except the special case with direct object. ----- (transitive verbs). Notice that a particle comes from the $V$. --- --- mkV2 : overload { --- mkV2 : Str -> V2 ; -- kill --% --- mkV2 : V -> V2 ; -- transitive, e.g. hit --- mkV2 : V -> Prep -> V2 ; -- with preposiiton, e.g. believe in --- mkV2 : V -> Str -> V2 ; -- believe in --% --- mkV2 : Str -> Prep -> V2 ; -- believe in --% --- mkV2 : Str -> Str -> V2 -- believe in --% --- }; --- -----3 Three-place verbs ----- ----- Three-place (ditransitive) verbs need two prepositions, of which ----- the first one or both can be absent. --- --- mkV3 : overload { --- mkV3 : V -> V3 ; -- ditransitive, e.g. give,_,_ --- mkV3 : V -> Prep -> Prep -> V3 ; -- two prepositions, e.g. speak, with, about --- mkV3 : V -> Prep -> V3 ; -- give,_,to --% --- mkV3 : V -> Str -> V3 ; -- give,_,to --% --- mkV3 : Str -> Str -> V3 ; -- give,_,to --% --- mkV3 : Str -> V3 ; -- give,_,_ --% --- }; --- -----3 Other complement patterns ----- ----- Verbs and adjectives can take complements such as sentences, ----- questions, verb phrases, and adjectives. --- --- mkV0 : V -> V0 ; --% --- mkVS : V -> VS ; -- sentence-compl e.g. say (that S) --- mkV2S : V -> Prep -> V2S ; -- e.g. tell (NP) (that S) --- mkVV : V -> VV ; -- e.g. want (to VP) --- ingVV : V -> VV ; -- e.g. start (VPing) --- mkV2V : V -> Prep -> Prep -> V2V ; -- e.g. want (noPrep NP) (to VP) --- ingV2V : V -> Prep -> Prep -> V2V ; -- e.g. prevent (noPrep NP) (from VP-ing) --- mkVA : V -> VA ; -- e.g. become (AP) --- mkV2A : V -> Prep -> V2A ; -- e.g. paint (NP) (AP) --- mkVQ : V -> VQ ; -- e.g. wonder (QS) --- mkV2Q : V -> Prep -> V2Q ; -- e.g. ask (NP) (QS) --- --- mkAS : A -> AS ; --% --- mkA2S : A -> Prep -> A2S ; --% --- mkAV : A -> AV ; --% --- mkA2V : A -> Prep -> A2V ; --% --- ----- Notice: Categories $V0, AS, A2S, AV, A2V$ are just $A$. ----- $V0$ is just $V$; the second argument is treated as adverb. --- --- V0 : Type ; --% --- AS, A2S, AV, A2V : Type ; --% --- -----2 Other categories --- ---mkSubj : Str -> Subj = \s -> lin Subj {s = s} ; --% --- -----. -----2 Definitions of paradigms ----- ----- The definitions should not bother the user of the API. So they are ----- hidden from the document. --- --- Gender = ResHun.Gender ; --- Number = ResHun.Number ; --- Case = ResHun.NPCase ; --- human = Masc ; --- nonhuman = Neutr ; --- masculine = Masc ; --- feminine = Fem ; --- singular = Sg ; --- plural = Pl ; --- nominative = npNom ; --- genitive = npGen ; --- --- npNumber np = (fromAgr np.a).n ; --- --- Preposition : Type = Str ; -- obsolete --- --- regN = \ray -> --- let rays = add_s ray --- in --- mk2N ray rays ; --- --- --- add_s : Str -> Str = \w -> case w of { --- _ + ("io" | "oo") => w + "s" ; -- radio, bamboo --- _ + ("s" | "z" | "x" | "sh" | "ch" | "o") => w + "es" ; -- bus, hero --- _ + ("a" | "o" | "u" | "e") + "y" => w + "s" ; -- boy --- x + "y" => x + "ies" ; -- fly --- _ => w + "s" -- car --- } ; --- --- duplFinal : Str -> Str = \w -> case w of { --- _ + ("a" | "e" | "o") + ("a" | "e" | "i" | "o" | "u") + ? => w ; -- waited, needed --- _ + ("a" | "e" | "i" | "o" | "u") + --- c@("b"|"d"|"g"|"m"|"n"|"p"|"r"|"t") => w + c ; -- omitted, manned --- _ => w --- } ; --- --- mk2N = \man,men -> --- let mens = case last men of { --- "s" => men + "'" ; --- _ => men + "'s" --- } --- in --- mk4N man men (man + "'s") mens ; --- --- mk4N = \man,men,man's,men's -> --- lin N (mkNoun man man's men men's ** {g = Neutr}) ; --- --- genderN g man = lin N {s = man.s ; g = g} ; --- --- compoundN s n = lin N {s = \\x,y => s ++ n.s ! x ! y ; g=n.g} ; --- --- mkPN = overload { --- mkPN : Str -> PN = regPN ; --- mkPN : N -> PN = nounPN --- } ; --- --- mkN2 = overload { --- mkN2 : N -> Prep -> N2 = prepN2 ; --- mkN2 : N -> Str -> N2 = \n,s -> prepN2 n (mkPrep s); --- mkN2 : Str -> Str -> N2 = \n,s -> prepN2 (regN n) (mkPrep s); --- mkN2 : N -> N2 = \n -> prepN2 n (mkPrep "of") ; --- mkN2 : Str -> N2 = \s -> prepN2 (regN s) (mkPrep "of") --- } ; --- --- prepN2 = \n,p -> lin N2 (n ** {c2 = p.s}) ; --- regN2 n = prepN2 (regN n) (mkPrep "of") ; --- --- mkN3 = \n,p,q -> lin N3 (n ** {c2 = p.s ; c3 = q.s}) ; --- -----3 Relational common noun phrases ----- ----- In some cases, you may want to make a complex $CN$ into a ----- relational noun (e.g. "the old town hall of"). --- --- cnN2 : CN -> Prep -> N2 ; --- cnN3 : CN -> Prep -> Prep -> N3 ; --- ----- This is obsolete. --- cnN2 = \n,p -> lin N2 (n ** {c2 = p.s}) ; --- cnN3 = \n,p,q -> lin N3 (n ** {c2 = p.s ; c3 = q.s}) ; --- --- regPN n = regGenPN n human ; --- regGenPN n g = lin PN {s = table {Gen => n + "'s" ; _ => n} ; g = g} ; --- nounPN n = lin PN {s = n.s ! singular ; g = n.g} ; --- --- mkQuant = overload { --- mkQuant : (this, these : Str) -> Quant = \sg,pl -> mkQuantifier sg pl sg pl; --- mkQuant : (no_sg, no_pl, none_sg, non_pl : Str) -> Quant = mkQuantifier; --- } ; --- --- mkQuantifier : Str -> Str -> Str -> Str -> Quant = --- \sg,pl,sg',pl' -> lin Quant { --- s = \\_ => table { Sg => sg ; Pl => pl } ; --- sp = \\_ => table { --- Sg => \\c => regGenitiveS sg' ! npcase2case c ; Pl => \\c => regGenitiveS pl' ! npcase2case c} --- } ; --- --- mkOrd : Str -> Ord = \x -> lin Ord { s = regGenitiveS x}; --- --- mk2A a b = mkAdjective a a a b ; --- regA a = case a of { --- _ + ("a" | "e" | "i" | "o" | "u" | "y") + ? + _ + --- ("a" | "e" | "i" | "o" | "u" | "y") + ? + _ => --- lin A (compoundADeg (regADeg a)) ; --- _ => lin A (regADeg a) --- } ; --- --- prepA2 a p = lin A2 (a ** {c2 = p.s}) ; --- --- ADeg = A ; ---- --- --- mkADeg a b c d = mkAdjective a b c d ; --- --- regADeg happy = --- let --- happ = init happy ; --- y = last happy ; --- happie = case y of { --- "y" => happ + "ie" ; --- "e" => happy ; --- _ => duplFinal happy + "e" --- } ; --- in mkADeg happy (happie + "r") (happie + "st") (adj2adv happy) ; --- --- adj2adv : Str -> Str = \happy -> --- case happy of { --- _ + "ble" => init happy + "y" ; --- _ + "y" => init happy + "ily" ; --- _ + "ll" => happy + "y" ; --- _ => happy + "ly" --- } ; --- --- duplADeg fat = --- mkADeg fat --- (fat + last fat + "er") (fat + last fat + "est") (adj2adv fat) ; --- --- compoundADeg a = --- let ad = (a.s ! AAdj Posit Nom) --- in mkADeg ad ("more" ++ ad) ("most" ++ ad) (a.s ! AAdv) ; --- --- adegA a = a ; --- --- mkAdv x = lin Adv (ss x) ; --- mkAdV x = lin AdV (ss x) ; --- mkAdA x = lin AdA (ss x) ; --- mkAdN x = lin AdN (ss x) ; --- --- mkPrep p = lin Prep (ss p) ; --- noPrep = mkPrep [] ; --- --- mk5V a b c d e = lin V (mkVerb a b c d e ** {s1 = []}) ; --- --- regV cry = --- let --- cries = (regN cry).s ! Pl ! Nom ; -- ! --- cried : Str = case cries of { --- _ + "es" => init cries + "d" ; --- _ => duplFinal cry + "ed" --- } ; --- crying : Str = case cry of { --- _ + "ee" => cry + "ing" ; --- d + "ie" => d + "ying" ; --- us + "e" => us + "ing" ; --- _ => duplFinal cry + "ing" --- } --- in mk5V cry cries cried cried crying ; --- --- reg2V fit fitted = --- let fitt = Predef.tk 2 fitted ; --- in --- if_then_else V (pbool2bool (Predef.eqStr (last fit) (last fitt))) --- (mk5V fit (fit + "s") (fitt + "ed") (fitt + "ed") (fitt + "ing")) --- (regV fit) ; --- --- regDuplV fit = --- case last fit of { --- ("a" | "e" | "i" | "o" | "u" | "y") => --- Predef.error (["final duplication makes no sense for"] ++ fit) ; --- t => --- let fitt = fit + t in --- mk5V fit (fit + "s") (fitt + "ed") (fitt + "ed") (fitt + "ing") --- } ; --- --- irregV x y z = let reg = (regV x).s in --- mk5V x (reg ! VPres) y z (reg ! VPresPart) ** {s1 = []} ; --- --- irreg4V x y z w = let reg = (regV x).s in --- mk5V x (reg ! VPres) y z w ** {s1 = []} ; --- --- irregDuplV fit y z = --- let --- fitting = (regDuplV fit).s ! VPresPart --- in --- mk5V fit (fit + "s") y z fitting ; --- --- partV v p = lin V {s = \\f => v.s ! f ++ p ; isRefl = v.isRefl} ; --- reflV v = lin V {s = v.s ; part = v.part ; isRefl = True} ; --- --- prepV2 v p = lin V2 {s = v.s ; s1 = v.s1 ; c2 = p.s ; isRefl = v.isRefl} ; --- dirV2 v = prepV2 v noPrep ; --- --- prepPrepV3 v p q = --- lin V3 {s = v.s ; s1 = v.s1 ; c2 = p.s ; c3 = q.s ; isRefl = v.isRefl} ; --- dirV3 v p = prepPrepV3 v noPrep p ; --- dirdirV3 v = dirV3 v noPrep ; --- --- mkVS v = lin VS v ; --- mkVV v = lin VV { --- s = table {VVF vf => v.s ! vf ; _ => v.s ! VInf} ; --- typ = VVInf --- } ; --- ingVV v = lin VV { --- s = table {VVF vf => v.s ! vf ; _ => v.s ! VInf} ; --- typ = VVPresPart --- } ; --- mkVQ v = lin VQ v ; --- --- V0 : Type = V ; ----- V2S, V2V, V2Q : Type = V2 ; --- AS, A2S, AV : Type = A ; --- A2V : Type = A2 ; --- --- mkV0 v = v ; --- mkV2S v p = lin V2S (prepV2 v p) ; --- mkV2V v p t = lin V2V (prepV2 v p ** {c3 = t.s ; typ = VVAux}) ; --- ingV2V v p t = lin V2V (prepV2 v p ** {c3 = t.s ; typ = VVPresPart}) ; --- mkVA v = lin VA v ; --- mkV2A v p = lin V2A (prepV2 v p) ; --- mkV2Q v p = lin V2Q (prepV2 v p) ; --- --- mkAS v = v ; --- mkA2S v p = lin A (prepA2 v p) ; --- mkAV v = v ; --- mkA2V v p = prepA2 v p ; --- --- ----- pre-overload API and overload definitions --- --- mk4N : (man,men,man's,men's : Str) -> N ; --- regN : Str -> N ; --- mk2N : (man,men : Str) -> N ; --- genderN : Gender -> N -> N ; --- compoundN : Str -> N -> N ; --- --- mkN = overload { --- mkN : (man,men,man's,men's : Str) -> N = mk4N ; --- mkN : Str -> N = regN ; --- mkN : (man,men : Str) -> N = mk2N ; --- mkN : Gender -> N -> N = genderN ; --- mkN : Str -> N -> N = compoundN --- } ; --- ----- Relational nouns ("daughter of x") need a preposition. --- --- prepN2 : N -> Prep -> N2 ; --- ----- The most common preposition is "of", and the following is a ----- shortcut for regular relational nouns with "of". --- --- regN2 : Str -> N2 ; --- --- mk2A : (free,freely : Str) -> A ; --- regA : Str -> A ; --- --- mkA = overload { --- mkA : Str -> A = regA ; --- mkA : (fat,fatter : Str) -> A = \fat,fatter -> --- mkAdjective fat fatter (init fatter + "st") (adj2adv fat) ; --- mkA : (good,better,best,well : Str) -> A = \a,b,c,d -> --- mkAdjective a b c d --- } ; --- --- compoundA = compoundADeg ; --- simpleA a = --- let ad = (a.s ! AAdj Posit Nom) --- in regADeg ad ; --- --- irregAdv a adv = lin A {s = table {AAdv => adv; aform => a.s ! aform}} ; --- --- prepA2 : A -> Prep -> A2 ; --- --- mkA2 = overload { --- mkA2 : A -> Prep -> A2 = prepA2 ; --- mkA2 : A -> Str -> A2 = \a,p -> prepA2 a (mkPrep p) ; --- mkA2 : Str -> Prep -> A2 = \a,p -> prepA2 (regA a) p; --- mkA2 : Str -> Str -> A2 = \a,p -> prepA2 (regA a) (mkPrep p); --- } ; --- --- mk5V : (go, goes, went, gone, going : Str) -> V ; --- regV : (cry : Str) -> V ; --- reg2V : (stop, stopped : Str) -> V; --- irregV : (drink, drank, drunk : Str) -> V ; --- irreg4V : (run, ran, run, running : Str) -> V ; --- --- -- Use reg2V instead --- regDuplV : Str -> V ; --- -- Use irreg4V instead --- irregDuplV : (get, got, gotten : Str) -> V ; --- --- mkV = overload { --- mkV : (cry : Str) -> V = regV ; --- mkV : (stop, stopped : Str) -> V = reg2V ; --- mkV : (drink, drank, drunk : Str) -> V = irregV ; --- mkV : (run, ran, run, running : Str) -> V = irreg4V ; --- mkV : (go, goes, went, gone, going : Str) -> V = mk5V ; --- mkV : Str -> V -> V = prefixV --- }; --- --- prepV2 : V -> Prep -> V2 ; --- dirV2 : V -> V2 ; --- prefixV : Str -> V -> V = \p,v -> lin V { s = \\vform => p + v.s ! vform; isRefl = v.isRefl } ; --- --- mkV2 = overload { --- mkV2 : V -> V2 = dirV2 ; --- mkV2 : Str -> V2 = \s -> dirV2 (regV s) ; --- mkV2 : V -> Prep -> V2 = prepV2 ; --- mkV2 : V -> Str -> V2 = \v,p -> prepV2 v (mkPrep p) ; --- mkV2 : Str -> Prep -> V2 = \v,p -> prepV2 (regV v) p ; --- mkV2 : Str -> Str -> V2 = \v,p -> prepV2 (regV v) (mkPrep p) --- }; --- --- prepPrepV3 : V -> Prep -> Prep -> V3 ; --- dirV3 : V -> Prep -> V3 ; --- dirdirV3 : V -> V3 ; --- --- mkV3 = overload { --- mkV3 : V -> Prep -> Prep -> V3 = prepPrepV3 ; --- mkV3 : V -> Prep -> V3 = dirV3 ; --- mkV3 : V -> Str -> V3 = \v,s -> dirV3 v (mkPrep s); --- mkV3 : Str -> Str -> V3 = \v,s -> dirV3 (regV v) (mkPrep s); --- mkV3 : V -> V3 = dirdirV3 ; --- mkV3 : Str -> V3 = \v -> dirdirV3 (regV v) ; --- } ; --- --- mkConj = overload { --- mkConj : Str -> Conj = \y -> mk2Conj [] y plural ; --- mkConj : Str -> Number -> Conj = \y,n -> mk2Conj [] y n ; --- mkConj : Str -> Str -> Conj = \x,y -> mk2Conj x y plural ; --- mkConj : Str -> Str -> Number -> Conj = mk2Conj ; --- } ; --- --- mk2Conj : Str -> Str -> Number -> Conj = \x,y,n -> --- lin Conj (sd2 x y ** {n = n}) ; --- ------- obsolete --- ----- Comparison adjectives may two more forms. --- --- ADeg : Type ; --- --- mkADeg : (good,better,best,well : Str) -> ADeg ; --- ----- The regular pattern recognizes two common variations: ----- "-e" ("rude" - "ruder" - "rudest") and ----- "-y" ("happy - happier - happiest - happily") --- --- regADeg : Str -> ADeg ; -- long, longer, longest --- ----- However, the duplication of the final consonant is nor predicted, ----- but a separate pattern is used: --- --- duplADeg : Str -> ADeg ; -- fat, fatter, fattest --- ----- If comparison is formed by "more", "most", as in general for ----- long adjective, the following pattern is used: --- --- compoundADeg : A -> ADeg ; -- -/more/most ridiculous --- ----- From a given $ADeg$, it is possible to get back to $A$. --- --- adegA : ADeg -> A ; --- --- --- regPN : Str -> PN ; --- regGenPN : Str -> Gender -> PN ; -- John, John's --- ----- Sometimes you can reuse a common noun as a proper name, e.g. "Bank". --- --- nounPN : N -> PN ; --- --- --- ---} ; + -- mkV3 : overload { + -- } ; + + -- mkVV : overload { + -- } ; + + -- + -- 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}) ; + + ----- + +--2 Structural categories + + mkPrep : overload { + mkPrep : Str -> Prep ; -- Postposition, takes nominative + mkPrep : Str -> Case -> Prep ; -- Postposition and case + } ; + + -- mkConj : (_,_ : Str) -> Number -> Conj = \s1,s2,num -> + -- lin Conj { s = s1 ; s2 = s2 } ; + + -- mkSubj : Str -> Bool -> Subj = \s,b -> + -- lin Subj { } ; + + mkAdv : Str -> Adv + = \s -> lin Adv {s = s} ; + + mkAdV : Str -> AdV + = \s -> lin AdV {s = s} ; + + mkAdA : Str -> AdA + = \s -> lin AdA {s = s} ; + + +--. +------------------------------------------------------------------------------- +-- The definitions should not bother the user of the API. So they are +-- hidden from the document. + + mkN = overload { + mkN : Str -> N = \s -> lin N (mkNoun s) ; + } ; + + + mkN2 = overload { + mkN2 : Str -> N2 = \s -> lin N2 (mkNoun s) ; + mkN2 : N -> N2 = \n -> lin N2 n ; + } ; + + -- mkPN = overload { + -- } ; + + 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} ; + } ; + + mkV = overload { + mkV : (sg3 : Str) -> V = \v -> lin V (mkVerb v) ; + -- mkV : (nore : Str) -> (hada : V) -> V = \nore,hada -> hada ** { + -- s = \\vf => nore + hada.s ! vf} ; + } ; + + copula = ResHun.copula ; + + mkV2 = overload { + mkV2 : (plain : Str) -> V2 = \v2 -> lin V2 (mkVerb2 v2) ; + mkV2 : V -> V2 = vtov2 ; + } ; + + mkV3 = overload { + mkV3 : (plain : Str) -> V3 = \v3 -> lin V3 (mkVerb3 v3) ; + } ; + -- + -- mkVV = overload { + -- } ; + + mkPrep = overload { + mkPrep : (e : Str) -> Prep + = \str -> lin Prep (ResHun.mkPrep str) ; + mkPrep : Str -> Case -> Prep + = \str,c -> lin Prep (ResHun.mkPrep str ** {c = c}) ; + } ; +-------------------------------------------------------------------------------- } diff --git a/src/hungarian/ParamHun.gf b/src/hungarian/ParamHun.gf new file mode 100644 index 00000000..efe085fe --- /dev/null +++ b/src/hungarian/ParamHun.gf @@ -0,0 +1,82 @@ +resource ParamHun = ParamX ** open Prelude in { + +-------------------------------------------------------------------------------- +-- Phonology + +oper + v : pattern Str = #("a" | "e" | "i" | "o" | "u" | "ö" | "ü" | + "á" | "é" | "í" | "ó" | "ú" | "ő" | "ű") ; + + -- not used yet + vowFinal : Str -> Bool = \str -> + case str of {_ + #v => True ; _ => False} ; + +-------------------------------------------------------------------------------- +-- Morphophonology + + + +-------------------------------------------------------------------------------- +-- Nouns + +param + Case = Nom | Acc | Dat | Ins | Ess | Tra | Cau + | Ill | Sub | All | Ine | Sup | Ade | Ela + | Del | Abl | Ter | For | Tem + ; + + Harm = H_a | H_e | H_o ; + +-------------------------------------------------------------------------------- +-- Numerals + +param + DForm = Unit | Ten ; + Place = Indep | Attrib ; + + CardOrd = NOrd | NCard ; -- Not used yet + +-- NumType = NoNum | IsDig | IsNum ; + +-- oper +-- isNum : {numtype : NumType} -> Bool = \nt -> case nt.numtype of { +-- NoNum => False ; +-- _ => True +-- } ; +-------------------------------------------------------------------------------- +-- Adjectives + + +-------------------------------------------------------------------------------- +-- Conjunctions + + + +-------------------------------------------------------------------------------- +-- Verbs +param + + -- TODO: object agreement + VForm = + VInf + | VFin Person Number ; + +oper + + agr2vf : Person*Number -> VForm = \pn -> + case of { + => VFin p n + } ; + +-------------------------------------------------------------------------------- +-- Clauses + +-- param + + -- ClType = + -- Statement + -- | PolarQuestion + -- | WhQuestion + -- | Subord ; + +} diff --git a/src/hungarian/PhraseHun.gf b/src/hungarian/PhraseHun.gf index 4f1fe813..83931ee5 100644 --- a/src/hungarian/PhraseHun.gf +++ b/src/hungarian/PhraseHun.gf @@ -1,32 +1,29 @@ -concrete PhraseHun of Phrase = CatHun ** open Prelude, ResHun in -{ ---{ --- --- lin --- PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; --- --- UttS s = s ; --- UttQS qs = {s = qs.s ! QDir} ; --- UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg False} ; --- UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Pl False} ; --- UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg True} ; --- --- UttIP ip = {s = ip.s ! npNom} ; --- Acc also --- UttIAdv iadv = iadv ; --- UttNP np = {s = np.s ! npNom} ; --- UttVP vp = {s = infVP VVInf vp (agrP3 Sg)} ; --- UttAdv adv = adv ; --- UttCN n = {s = n.s ! Sg ! Nom} ; --- UttCard n = {s = n.s ! Nom} ; --- UttAP ap = {s = ap.s ! agrP3 Sg} ; --- UttInterj i = i ; --- --- NoPConj = {s = []} ; --- PConjConj conj = {s = conj.s2} ; --- --- --- NoVoc = {s = []} ; --- VocNP np = {s = "," ++ np.s ! npNom} ; --- ---} +concrete PhraseHun of Phrase = CatHun ** open Prelude, ResHun in { + + lin + PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; + + UttS s = s ; + UttQS qs = qs ; + UttIAdv iadv = iadv ; +{- + UttImpSg pol imp = + UttImpPl pol imp = + UttImpPol = UttImpSg ; + + UttIP ip = {s = ip.s ! } ; + UttNP np = {s = np.s ! } ; + UttVP vp = {s = } ; + UttAdv adv = {s = } ; + UttCN n = {s = } ; + UttCard n = {s = } ; + UttAP ap = { s = ap.s ! } ; + UttInterj i = i ; +-} + NoPConj = {s = []} ; +-- PConjConj conj = {s = conj.s1 ++ conj.s2 ! …} ; + + NoVoc = {s = []} ; +-- VocNP np = { s = "," ++ np.s ! … } ; -} } diff --git a/src/hungarian/QuestionHun.gf b/src/hungarian/QuestionHun.gf index 1768fff4..ace6c3a7 100644 --- a/src/hungarian/QuestionHun.gf +++ b/src/hungarian/QuestionHun.gf @@ -1,73 +1,77 @@ -concrete QuestionHun of Question = CatHun ** open ResHun, Prelude in -{ ---{ --- --- flags optimize=all_subs ; --- --- lin --- --- QuestCl cl = { --- s = \\t,a,p => --- let cls = cl.s ! t ! a ! p --- in table { --- QDir => cls ! OQuest ; --- QIndir => "if" ++ cls ! ODir --- } ---- "whether" in ExtHun --- } ; --- --- QuestVP qp vp = --- let cl = mkClause (qp.s ! npNom) (agrP3 qp.n) vp --- in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ; --- --- QuestSlash ip slash = --- mkQuestion (ss (slash.c2 ++ ip.s ! NPAcc)) slash ; --- --- stranding in ExratHun --- --- QuestIAdv iadv cl = mkQuestion iadv cl ; --- --- QuestIComp icomp np = --- mkQuestion icomp (mkClause (np.s ! npNom) np.a (predAux auxBe)) ; --- --- --- PrepIP p ip = {s = p.s ++ ip.s ! NPAcc} ; --- --- AdvIP ip adv = { --- s = \\c => ip.s ! c ++ adv.s ; --- n = ip.n --- } ; --- --- IdetCN idet cn = { --- s = \\c => idet.s ++ cn.s ! idet.n ! npcase2case c ; --- n = idet.n --- } ; --- --- IdetIP idet = { --- s = \\c => idet.s ; --- n = idet.n --- } ; --- --- IdetQuant idet num = { --- s = idet.s ! num.n ++ num.s ! Nom ; --- n = num.n --- } ; --- --- AdvIAdv i a = ss (i.s ++ a.s) ; --- --- CompIAdv a = a ; --- CompIP p = ss (p.s ! npNom) ; --- --- lincat --- QVP = ResHun.VP ; --- lin --- ComplSlashIP vp np = insertObjPre (\\_ => vp.c2 ++ np.s ! NPAcc) vp ; --- AdvQVP vp adv = insertObj (\\_ => adv.s) vp ; --- AddAdvQVP vp adv = insertObj (\\_ => adv.s) vp ; --- --- QuestQVP qp vp = --- let cl = mkClause (qp.s ! npNom) (agrP3 qp.n) vp --- in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ; --- --- ---} +concrete QuestionHun of Question = CatHun ** open + Prelude, ResHun, ParadigmsHun, (NH=NounHun) in { + +-- A question can be formed from a clause ('yes-no question') or +-- with an interrogative. + +{- + lin + -- : Cl -> QCl ; + QuestCl = + + -- : IP -> VP -> QCl ; + QuestVP ip vp = + + -- : IP -> ClSlash -> QCl ; -- whom does John love + QuestSlash ip cls = + + -- : IAdv -> Cl -> QCl ; -- why does John walk + QuestIAdv iadv cls = + + + -- : IComp -> NP -> QCl ; -- where is John? + QuestIComp icomp np = + + +-- Interrogative pronouns can be formed with interrogative +-- determiners, with or without a noun. + + -- : IDet -> CN -> IP ; -- which five songs + IdetCN idet cn = {…} ** NH.DetCN idet cn ; + + -- : IDet -> IP ; -- which five + IdetIP idet = {…} ** NH.DetNP idet ; + +-- They can be modified with adverbs. + -- : IP -> Adv -> IP ; -- who in Paris + --AdvIP = NH.AdvNP ; + +-- Interrogative quantifiers have number forms and can take number modifiers. + + -- : IQuant -> Num -> IDet ; -- which (five) + IdetQuant = NH.DetQuant ; + +-- Interrogative adverbs can be formed prepositionally. + -- : Prep -> IP -> IAdv ; -- with whom + PrepIP prep ip = ; + +-- They can be modified with other adverbs. + + -- : IAdv -> Adv -> IAdv ; -- where in Paris + -- AdvIAdv iadv adv = + +-- Interrogative complements to copulas can be both adverbs and +-- pronouns. + + -- : IAdv -> IComp ; + CompIAdv iadv = iadv ; -- where (is it) + + -- : IP -> IComp ; + CompIP ip = {s = ip.s ! Abs} ; -- who (is it) + + +-- More $IP$, $IDet$, and $IAdv$ are defined in $Structural$. + +-- Wh questions with two or more question words require a new, special category. + + cat + QVP ; -- buy what where + fun + ComplSlashIP : VPSlash -> IP -> QVP ; -- buys what + AdvQVP : VP -> IAdv -> QVP ; -- lives where + AddAdvQVP : QVP -> IAdv -> QVP ; -- buys what where + + QuestQVP : IP -> QVP -> QCl ; -- who buys what where +-} } diff --git a/src/hungarian/RelativeHun.gf b/src/hungarian/RelativeHun.gf index 67316dc1..6f14093b 100644 --- a/src/hungarian/RelativeHun.gf +++ b/src/hungarian/RelativeHun.gf @@ -1,56 +1,22 @@ -concrete RelativeHun of Relative = CatHun ** open ResHun in -{ ---{ --- --- flags optimize=all_subs ; --- --- lin --- --- RelCl cl = { --- s = \\t,a,p,_ => "such" ++ "that" ++ cl.s ! t ! a ! p ! ODir ; --- c = npNom --- } ; --- --- RelVP rp vp = { --- s = \\t,ant,b,ag => --- let --- agr = case rp.a of { --- RNoAg => ag ; --- RAg a => a --- } ; --- cl = mkClause (rp.s ! RC (fromAgr agr).g npNom) agr vp --- in --- cl.s ! t ! ant ! b ! ODir ; --- c = npNom --- } ; --- ----- Pied piping: "at which we are looking". Stranding and empty ----- relative are defined in $ExtraHun.gf$ ("that we are looking at", ----- "we are looking at"). --- --- RelSlash rp slash = { --- s = \\t,a,p,agr => --- slash.c2 ++ rp.s ! RPrep (fromAgr agr).g ++ slash.s ! t ! a ! p ! ODir ; --- c = NPAcc --- } ; --- --- FunRP p np rp = { --- s = \\c => np.s ! NPAcc ++ p.s ++ rp.s ! RPrep (fromAgr np.a).g ; --- a = RAg np.a --- } ; --- --- IdRP = --- { s = table { --- RC _ (NCase Gen) => "whose" ; --- RC Neutr _ => "which" ; --- RC _ NPAcc => "whom" ; --- RC _ (NCase Nom) => "who" ; --- RPrep Neutr => "which" ; --- RPrep _ => "whom" --- } ; --- a = RNoAg --- } ; --- ---} +concrete RelativeHun of Relative = CatHun ** open + ResHun, Prelude, (NS=NounHun), (SS=StructuralHun) in { + +{- +lin + -- : Cl -> RCl ; -- such that John loves her + -- RelCl cl = ; + + -- : RP -> VP -> RCl ; + RelVP rp vp = + + -- : RP -> ClSlash -> RCl ; -- whom John loves + RelSlash rp cls = + + -- : RP ; + IdRP = {s = ""} ; + + -- : Prep -> NP -> RP -> RP ; -- the mother of whom + --FunRP prep np rp = {} ; +-} } diff --git a/src/hungarian/ResHun.gf b/src/hungarian/ResHun.gf index 81da3b47..34697040 100644 --- a/src/hungarian/ResHun.gf +++ b/src/hungarian/ResHun.gf @@ -3,58 +3,43 @@ --1 Hungarian auxiliary operations. -- This module contains operations that are needed to make the --- resource syntax work. +-- resource syntax work. +-- Some parameters, such as $Number$, are inherited from $ParamX$. +resource ResHun = ParamHun ** open Prelude, Predef, ParamHun in { -resource ResHun = ParamX ** open Prelude in { - flags - optimize=noexpand ; - coding = utf8 ; - --- Some parameters, such as $Number$, are inherited from $ParamX$. --- ---2 For $Noun$ --- --- This is case as needed when inflecting nouns. --- - param - Case = Nom | Acc | Dat | Ins | Ess | Tra | Cau - | Ill | Sub | All | Ine | Sup | Ade | Ela - | Del | Abl | Ter | For | Tem - ; - - Harm = H_a | H_e | H_o ; - - oper +-------------------------------------------------------------------------------- +-- Nouns +oper Noun = {s : Number => Case => Str} ; - endCase : Case -> HarmForms = \c -> case c of { - Nom => harm1 [] ; - Acc => harm3 "ot" "et" "öt" ; - Dat => harm "nak" "nek" ; - Ins => harm "al" "el" ; - Ess => harm "stul" "stül" ; - Tra => harm "á" "é" ; - Cau => harm1 "ért" ; - Ill => harm "ba" "be" ; - Sub => harm "ra" "re" ; - All => harm3 "hoz" "hez" "höz" ; - Ine => harm "ban" "ben" ; - Sup => harm3 "on" "en" "ön" ; - Ade => harm "nál" "nél" ; - Ela => harm "ból" "ből" ; - Del => harm "ról" "ről" ; - Abl => harm "tól" "től" ; - Ter => harm1 "ig" ; - For => harm1 "ként" ; - Tem => harm1 "kor" - } ; + endCase : Case -> HarmForms = \c -> case c of { + Nom => harm1 [] ; + Acc => harm3 "ot" "et" "öt" ; + Dat => harm "nak" "nek" ; + Ins => harm "al" "el" ; + Ess => harm "stul" "stül" ; + Tra => harm "á" "é" ; + Cau => harm1 "ért" ; + Ill => harm "ba" "be" ; + Sub => harm "ra" "re" ; + All => harm3 "hoz" "hez" "höz" ; + Ine => harm "ban" "ben" ; + Sup => harm3 "on" "en" "ön" ; + Ade => harm "nál" "nél" ; + Ela => harm "ból" "ből" ; + Del => harm "ról" "ről" ; + Abl => harm "tól" "től" ; + Ter => harm1 "ig" ; + For => harm1 "ként" ; + Tem => harm1 "kor" + } ; - endNumber : Number -> HarmForms = \n -> case n of { - Sg => harm1 [] ; - Pl => harm3 "ok" "ek" "ök" - } ; + endNumber : Number -> HarmForms = \n -> case n of { + Sg => harm1 [] ; + Pl => harm3 "ok" "ek" "ök" + } ; harm3 : Str -> Str -> Str -> HarmForms = \a,e,o -> ; harm : Str -> Str -> HarmForms = \a,e -> harm3 a e e ; @@ -71,482 +56,234 @@ resource ResHun = ParamX ** open Prelude in useHarm : Harm -> HarmForms -> Str = \h,ss -> case h of { H_a => ss.p1 ; H_e => ss.p2 ; - H_o => ss.p3 + H_o => ss.p3 } ; putHarmEnding : HarmForms -> Str -> Str = \hs,w -> w + useHarm (getHarm w) hs ; - regNoun : Str -> Noun = \w -> { - s = \\n,c => - let h = getHarm w + mkNoun : Str -> Noun = \w -> { + s = \\n,c => + let h = getHarm w in w + useHarm h (endNumber n) + useHarm h (endCase c) - } ; + } ; +--------------------------------------------- +-- NP --- --- param --- Agr = AgP1 Number | AgP2 Number | AgP3Sg Gender | AgP3Pl ; --- --- param --- Gender = Neutr | Masc | Fem ; --- --- -----2 For $Verb$ --- ----- Only these five forms are needed for open-lexicon verbs. --- --- param --- VForm = --- VInf --- | VPres --- | VPPart --- | VPresPart --- | VPast --# notpresent --- ; --- ----- Auxiliary verbs have special negative forms. --- --- VVForm = --- VVF VForm --- | VVPresNeg --- | VVPastNeg --# notpresent --- ; --- ----- The order of sentence is needed already in $VP$. --- --- Order = ODir | OQuest ; --- ----- The type of complement of a VV --- --- VVType = VVAux | VVInf | VVPresPart ; -- can do / try to do / start doing --- -----2 For $Adjective$ --- --- AForm = AAdj Degree Case | AAdv ; --- -----2 For $Relative$ --- --- RAgr = RNoAg | RAg Agr ; --- RCase = RPrep Gender | RC Gender NPCase ; --- -----2 For $Numeral$ --- --- CardOrd = NCard | NOrd ; --- DForm = unit | teen | ten ; --- -----2 Transformations between parameter types --- --- oper --- toAgr : Number -> Person -> Gender -> Agr = \n,p,g -> --- case p of { --- P1 => AgP1 n ; --- P2 => AgP2 n ; --- P3 => case n of { --- Sg => AgP3Sg g ; --- Pl => AgP3Pl --- } --- } ; --- --- fromAgr : Agr -> {n : Number ; p : Person ; g : Gender} = \a -> case a of { --- AgP1 n => {n = n ; p = P1 ; g = Masc} ; --- AgP2 n => {n = n ; p = P2 ; g = Masc} ; --- AgP3Pl => {n = Pl ; p = P3 ; g = Masc} ; --- AgP3Sg g => {n = Sg ; p = P3 ; g = g} --- } ; --- --- agrP3 : Number -> Agr = \n -> agrgP3 n Neutr ; --- --- agrgP3 : Number -> Gender -> Agr = \n,g -> toAgr n P3 g ; --- --- conjAgr : Agr -> Agr -> Agr = \a0,b0 -> --- let a = fromAgr a0 ; b = fromAgr b0 --- in --- toAgr --- (conjNumber a.n b.n) --- (conjPerson a.p b.p) a.g ; --- ----- For $Lex$. --- ----- For each lexical category, here are the worst-case constructors. --- --- mkNoun : (_,_,_,_ : Str) -> {s : Number => Case => Str} = --- \man,mans,men,mens -> { --- s = table { --- Sg => table { --- Gen => mans ; --- _ => man --- } ; --- Pl => table { --- Gen => mens ; --- _ => men --- } --- } --- } ; --- --- mkAdjective : (_,_,_,_ : Str) -> {s : AForm => Str; lock_A : {}} = --- \good,better,best,well -> lin A { --- s = table { --- AAdj Posit c => (regGenitiveS good) ! c ; --- AAdj Compar c => (regGenitiveS better) ! c ; --- AAdj Superl c => (regGenitiveS best) ! c ; --- AAdv => well --- } --- } ; --- --- mkVerb : (_,_,_,_,_ : Str) -> Verb = --- \go,goes,went,gone,going -> { --- s = table { --- VInf => go ; --- VPres => goes ; --- VPast => went ; --# notpresent --- VPPart => gone ; --- VPresPart => going --- } ; --- isRefl = False --- } ; --- --- mkIP : (i,me,my : Str) -> Number -> {s : NPCase => Str ; n : Number} = --- \i,me,my,n -> let who = mkNP i me my n P3 Neutr in { --- s = who.s ; --- n = n --- } ; --- --- mkNP : (i,me,my : Str) -> Number -> Person -> Gender -> --- {s : NPCase => Str ; a : Agr} = \i,me,my,n,p,g -> --- { s = table { --- NCase Nom => i ; --- NPAcc => me ; --- NCase Gen => my --- } ; --- a = toAgr n p g ; --- }; --- --- regNP : Str -> Number -> {s : NPCase => Str ; a : Agr} = \that,n -> --- mkNP that that (that + "'s") n P3 Neutr ; --- --- regGenitiveS : Str -> Case => Str = \s -> --- table { Gen => genitiveS s; _ => s } ; --- --- genitiveS : Str -> Str = \dog -> --- case last dog of { --- "s" => dog + "'" ; --- _ => dog + "'s" --- }; --- ----- We have just a heuristic definition of the indefinite article. ----- There are lots of exceptions: consonantic "e" ("euphemism"), consonantic ----- "o" ("one-sided"), vocalic "u" ("umbrella"). --- --- artIndef = pre { --- "eu" | "Eu" | "uni" | "up" => "a" ; --- "un" => "an" ; --- "a" | "e" | "i" | "o" | "A" | "E" | "I" | "O" => "an" ; --- "SMS" | "sms" => "an" ; --- --- _ => "a" --- } ; --- --- artDef = "the" ; --- ----- For $Verb$. --- --- Verb : Type = { --- s : VForm => Str ; --- isRefl : Bool --- } ; --- --- param --- CPolarity = --- CPos --- | CNeg Bool ; -- contracted or not --- --- oper --- contrNeg : Bool -> Polarity -> CPolarity = \b,p -> case p of { --- Pos => CPos ; --- Neg => CNeg b --- } ; --- --- VerbForms : Type = --- Tense => Anteriority => CPolarity => Order => Agr => --- {aux, adv, fin, inf : Str} ; -- would, not, sleeps, slept --- --- VP : Type = { --- s : VerbForms ; --- prp : Str ; -- present participle --- ptp : Str ; -- past participle --- inf : Str ; -- the infinitive form ; VerbForms would be the logical place --- ad : Str ; -- sentence adverb --- s2 : Agr => Str -- complement --- } ; --- --- --- SlashVP = VP ** {c2 : Str} ; --- --- predVc : (Verb ** {c2 : Str}) -> SlashVP = \verb -> --- predV verb ** {c2 = verb.c2} ; --- --- predV : Verb -> VP = \verb -> { --- s = \\t,ant,b,ord,agr => --- let --- inf = verb.s ! VInf ; --- fin = presVerb verb agr ; --- part = verb.s ! VPPart ; --- in --- case of { --- => vff fin [] ; --- => vf (does agr) inf ; --- => vf (have agr) part ; --# notpresent --- => vfn c (have agr) (havent agr) part ; --# notpresent --- => vff (verb.s ! VPast) [] ; --# notpresent --- => vf "did" inf ; --# notpresent --- => vfn c "did" "didn't" inf ; --# notpresent --- => vf "had" part ; --# notpresent --- => vfn c "had" "hadn't" part ; --# notpresent --- => vf "will" inf ; --# notpresent --- => vfn c "will" "won't" inf ; --# notpresent --- => vf "will" ("have" ++ part) ; --# notpresent --- => vfn c "will" "won't"("have" ++ part) ; --# notpresent --- => vf "would" inf ; --# notpresent --- => vfn c "would" "wouldn't" inf ; --# notpresent --- => vf "would" ("have" ++ part) ; --# notpresent --- => vfn c "would" "wouldn't" ("have" ++ part) ; --# notpresent --- => vfn c (does agr) (doesnt agr) inf --- } ; --- prp = verb.s ! VPresPart ; --- ptp = verb.s ! VPPart ; --- inf = verb.s ! VInf ; --- ad = [] ; --- s2 = \\a => if_then_Str verb.isRefl (reflPron ! a) [] --- } ; --- --- predAux : Aux -> VP = \verb -> { --- s = \\t,ant,cb,ord,agr => --- let --- b = case cb of { --- CPos => Pos ; --- _ => Neg --- } ; --- inf = verb.inf ; --- fin = verb.pres ! b ! agr ; --- finp = verb.pres ! Pos ! agr ; --- part = verb.ppart ; --- in --- case of { --- => vf (have agr) part ; --# notpresent --- => vfn c (have agr) (havent agr) part ; --# notpresent --- => vf (verb.past ! b ! agr) [] ; --# notpresent --- => vfn c (verb.past!Pos!agr)(verb.past!Neg!agr) [] ; --# notpresent --- => vf "had" part ; --# notpresent --- => vfn c "had" "hadn't" part ; --# notpresent --- => vf "will" inf ; --# notpresent --- => vfn c "will" "won't" inf ; --# notpresent --- => vf "will" ("have" ++ part) ; --# notpresent --- => vfn c "will" "won't"("have" ++ part) ; --# notpresent --- => vf "would" inf ; --# notpresent --- => vfn c "would" "wouldn't" inf ; --# notpresent --- => vf "would" ("have" ++ part) ; --# notpresent --- => vfn c "would" "wouldn't" ("have" ++ part) ; --# notpresent --- => vf fin [] ; --- => vfn c finp fin [] --- } ; --- prp = verb.prpart ; --- ptp = verb.ppart ; --- inf = verb.inf ; --- ad = [] ; --- s2 = \\_ => [] --- } ; --- --- vff : Str -> Str -> {aux, adv, fin, inf : Str} = \x,y -> --- {aux = [] ; adv = [] ; fin = x ; inf = y} ; --- --- vf : Str -> Str -> {aux, adv, fin, inf : Str} = \x,y -> vfn True x x y ; --- --- vfn : Bool -> Str -> Str -> Str -> {aux, fin, adv, inf : Str} = --- \contr,x,y,z -> --- case contr of { --- True => {aux = y ; adv = [] ; fin = [] ; inf = z} ; --- False => {aux = x ; adv = "not" ; fin = [] ; inf = z} --- } ; --- --- insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> { --- s = vp.s ; --- prp = vp.prp ; --- ptp = vp.ptp ; --- inf = vp.inf ; --- ad = vp.ad ; --- s2 = \\a => vp.s2 ! a ++ obj ! a --- } ; --- --- insertObjPre : (Agr => Str) -> VP -> VP = \obj,vp -> { --- s = vp.s ; --- prp = vp.prp ; --- ptp = vp.ptp ; --- inf = vp.inf ; --- ad = vp.ad ; --- s2 = \\a => obj ! a ++ vp.s2 ! a --- } ; --- --- insertObjc : (Agr => Str) -> SlashVP -> SlashVP = \obj,vp -> --- insertObj obj vp ** {c2 = vp.c2} ; --- ------ The adverb should be before the finite verb. --- --- insertAdV : Str -> VP -> VP = \ad,vp -> { --- s = vp.s ; --- prp = vp.prp ; --- ptp = vp.ptp ; --- inf = vp.inf ; --- ad = vp.ad ++ ad ; --- s2 = \\a => vp.s2 ! a --- } ; --- ----- --- --- predVV : {s : VVForm => Str ; typ : VVType} -> VP = \verb -> --- let verbs = verb.s --- in --- case verb.typ of { --- VVAux => predAux { --- pres = table { --- Pos => \\_ => verbs ! VVF VPres ; --- Neg => \\_ => verbs ! VVPresNeg --- } ; --- past = table { --# notpresent --- Pos => \\_ => verbs ! VVF VPast ; --# notpresent --- Neg => \\_ => verbs ! VVPastNeg --# notpresent --- } ; --# notpresent --- inf = verbs ! VVF VInf ; --- ppart = verbs ! VVF VPPart ; --- prpart = verbs ! VVF VPresPart ; --- } ; --- _ => predV {s = \\vf => verbs ! VVF vf ; isRefl = False} --- } ; --- --- presVerb : {s : VForm => Str} -> Agr -> Str = \verb -> --- agrVerb (verb.s ! VPres) (verb.s ! VInf) ; --- --- infVP : VVType -> VP -> Agr -> Str = \typ,vp,a -> --- vp.ad ++ --- case typ of { --- VVAux => vp.inf ; --- VVInf => "to" ++ vp.inf ; --- _ => vp.prp --- } ++ --- vp.s2 ! a ; --- --- agrVerb : Str -> Str -> Agr -> Str = \has,have,agr -> --- case agr of { --- AgP3Sg _ => has ; --- _ => have --- } ; --- --- have = agrVerb "has" "have" ; --- havent = agrVerb "hasn't" "haven't" ; --- does = agrVerb "does" "do" ; --- doesnt = agrVerb "doesn't" "don't" ; --- --- Aux = { --- pres : Polarity => Agr => Str ; --- past : Polarity => Agr => Str ; --# notpresent --- inf,ppart,prpart : Str --- } ; --- --- auxBe : Aux = { --- pres = \\b,a => case of { --- => "am" ; --- => ["am not"] ; --- am not I --- _ => agrVerb (posneg b "is") (posneg b "are") a --- } ; --- past = \\b,a => case a of { --# notpresent --- AgP1 Sg | AgP3Sg _ => posneg b "was" ; --# notpresent --- _ => (posneg b "were") --# notpresent --- } ; --# notpresent --- inf = "be" ; --- ppart = "been" ; --- prpart = "being" --- } ; --- --- posneg : Polarity -> Str -> Str = \p,s -> case p of { --- Pos => s ; --- Neg => s + "n't" --- } ; --- --- conjThat : Str = "that" ; --- --- reflPron : Agr => Str = table { --- AgP1 Sg => "myself" ; --- AgP2 Sg => "yourself" ; --- AgP3Sg Masc => "himself" ; --- AgP3Sg Fem => "herself" ; --- AgP3Sg Neutr => "itself" ; --- AgP1 Pl => "ourselves" ; --- AgP2 Pl => "yourselves" ; --- AgP3Pl => "themselves" --- } ; --- ----- For $Sentence$. --- --- Clause : Type = { --- s : Tense => Anteriority => CPolarity => Order => Str --- } ; --- --- mkClause : Str -> Agr -> VP -> Clause = --- \subj,agr,vp -> { --- s = \\t,a,b,o => --- let --- verb = vp.s ! t ! a ! b ! o ! agr ; --- compl = vp.s2 ! agr --- in --- case o of { --- ODir => subj ++ verb.aux ++ verb.adv ++ vp.ad ++ verb.fin ++ verb.inf ++ compl ; --- OQuest => verb.aux ++ subj ++ verb.adv ++ vp.ad ++ verb.fin ++ verb.inf ++ compl --- } --- } ; --- --- ----- For $Numeral$. --- --- mkNum : Str -> Str -> Str -> Str -> {s : DForm => CardOrd => Case => Str} = --- \two, twelve, twenty, second -> --- {s = table { --- unit => table {NCard => regGenitiveS two ; NOrd => regGenitiveS second} ; --- teen => \\c => mkCard c twelve ; --- ten => \\c => mkCard c twenty --- } --- } ; --- --- regNum : Str -> {s : DForm => CardOrd => Case => Str} = --- \six -> mkNum six (six + "teen") (six + "ty") (regOrd six) ; --- --- regCardOrd : Str -> {s : CardOrd => Case => Str} = \ten -> --- {s = table {NCard => regGenitiveS ten ; --- NOrd => regGenitiveS (regOrd ten)} } ; --- --- mkCard : CardOrd -> Str -> Case => Str = \o,ten -> --- (regCardOrd ten).s ! o ; --- --- regOrd : Str -> Str = \ten -> --- case last ten of { --- "y" => init ten + "ieth" ; --- _ => ten + "th" --- } ; --- --- mkQuestion : --- {s : Str} -> Clause -> --- {s : Tense => Anteriority => CPolarity => QForm => Str} = \wh,cl -> --- { --- s = \\t,a,p => --- let --- cls = cl.s ! t ! a ! p ; --- why = wh.s --- in table { --- QDir => why ++ cls ! OQuest ; --- QIndir => why ++ cls ! ODir --- } --- } ; --- --- ---} + NounPhrase : Type = { + s : Case => Str ; + agr : Person*Number ; + isPron : Bool ; + empty : Str ; -- standard trick for pro-drop + } ; + + emptyNP : NounPhrase = { + s = \\_ => [] ; + agr = ; + isPron = False ; + empty = [] ; + } ; + + indeclNP : Str -> NounPhrase = \s -> emptyNP ** {s = \\c => s} ; + +-------------------------------------------------------------------------------- +-- Pronouns + + Pronoun : Type = NounPhrase ** { + -- poss : { -- for PossPron : Pron -> Quant + -- } ; + } ; + +-------------------------------------------------------------------------------- +-- Det, Quant, Card, Ord + + -- Quant has variable number: + -- e.g. this_Quant has both "this" and "these" + Quant : Type = { + s, -- form that comes before noun: "{this} car" + sp : Number => Case => Str ; -- independent form, "I like {this}" (DetNP) + } ; + + mkQuant : (s,sp : Str) -> Quant = \s,sp -> { + s = (mkNoun s).s ; + sp = (mkNoun sp).s ; + } ; + + -- Det is formed in DetQuant : Quant -> Num -> Det + -- so it has an inherent number. + Determiner : Type = { + s, + sp : Case => Str ; + n : Number ; +-- numtype : NumType ; -- Whether its Num component is digit, numeral or Sg/Pl + } ; + + Num : Type = { + s : Place => Str ; -- Independent or attribute + n : Number ; -- Singular or plural + -- numtype : NumType ; -- Digit, numeral or Sg/Pl : makes a difference in many languages + } ; + + baseNum : Num = { + s = \\_ => [] ; + n = Sg ; + -- numtype = NoNum + } ; + + {- Numeral can become Num via + Noun.gf: NumNumeral : Numeral -> Card ; + Noun.gf: NumCard : Card -> Num ; + -} + Numeral : Type = Num ** { + -- TODO add ordinal + } ; + +-------------------------------------------------------------------------------- +-- Postpositions + + Postposition : Type = {s : Str ; c : Case} ; + + mkPrep : Str -> Postposition = \str -> {s=str ; c=Nom} ; + + emptyPP : Postposition = mkPrep [] ; + +------------------ +-- Conj + + Conj : Type = { + s1 : Str ; + s2 : Str ; + n : Number ; + } ; + +-------------------------------------------------------------------------------- +-- Adjectives + + Adjective : Type = {s : Number => Str} ; + + mkAdj : Str -> Adjective = \sg -> { + s = \\n => + let h = getHarm sg + in sg + useHarm h (endNumber n) + } ; + +-------------------------------------------------------------------------------- +-- Verbs + + verbEndings : Person*Number => HarmForms = table { + => harm3 "ok" "ek" "ök" ; + => harm1 "sz" ; + => harm1 [] ; + => harm "unk" "ünk" ; + => harm3 "tok" "tek" "tök" ; -- TODO allomorphs -otok, -etek, -ötök + => harm "nak" "nek" -- TODO allomorphs -anak, -enek + } ; + + Verb : Type = { + s : VForm => Str ; + sc : Case ; -- subject case + } ; + Verb2 : Type = Verb ** { + c2 : Case -- object case + } ; + Verb3 : Type = Verb2 ** { + c3 : Case -- indirect object case + } ; + + mkVerb2 : Str -> Verb2 = \sg3 -> vtov2 (mkVerb sg3) ; + mkVerb3 : Str -> Verb3 = \sg3 -> v2tov3 (mkVerb2 sg3) ; + + vtov2 : Verb -> Verb2 = \v -> v ** {c2 = Acc} ; + v2tov3 : Verb2 -> Verb3 = \v -> v ** {c3 = Dat} ; + + mkVerb : (sg3 : Str) -> Verb = mkVerbReg "TODO:infinitive" ; -- TODO + + mkVerbReg : (inf, sg3 : Str) -> Verb = \inf,sg3 -> + let harmony : Harm = getHarm sg3 ; + sg1 : Str = sg3 + useHarm harmony (verbEndings!) ; + sg2 : Str = sg3 + "sz" ; + pl1 : Str = sg3 + useHarm harmony (verbEndings!) ; + pl2 : Str = sg3 + useHarm harmony (verbEndings!) ; + pl3 : Str = sg3 + useHarm harmony (verbEndings!) ; + in mkVerbFull sg1 sg2 sg3 pl1 pl2 pl3 inf ; + + mkVerbFull : (x1,_,_,_,_,_,x7 : Str) -> Verb = + \sg1,sg2,sg3,pl1,pl2,pl3,inf -> { + s = table { + VInf => inf ; + VFin P1 Sg => sg1 ; + VFin P2 Sg => sg2 ; + VFin P3 Sg => sg3 ; + VFin P1 Pl => pl1 ; + VFin P2 Pl => pl2 ; + VFin P3 Pl => pl3 + } ; + sc = Nom + } ; + + copula : Verb = mkVerbFull + "vagyok" + "vagy" + "van" + "vagyunk" + "vagytok" + "vannak" + "lenni" ; + +------------------ +-- VP + + VerbPhrase : Type = Verb ** { + obj : Str ; + adv : Str ; + } ; -- TODO more fields + + VPSlash : Type = Verb2 ** { + adv : Str ; + } ; + + useV : Verb -> VerbPhrase = \v -> v ** { + obj,adv = [] ; + } ; + + useVc : Verb2 -> VPSlash = \v2 -> v2 ** { + adv = [] ; + } ; + + insertObj : VPSlash -> NounPhrase -> VerbPhrase = \vps,np -> vps ** { + obj = np.s ! vps.c2 ; + } ; + + insertAdv : VerbPhrase -> SS -> VerbPhrase = \vp,adv -> vp ** {adv = adv.s} ; + insertAdvSlash : VPSlash -> SS -> VPSlash = \vps,adv -> vps ** {adv = adv.s} ; + +-------------------------------------------------------------------------------- +-- Cl, S + + Clause : Type = {s : Tense => Anteriority => Polarity => Str} ; + + {- After PredVP, we might still want to add more adverbs (QuestIAdv), + but we're done with verb inflection. + -} + ClSlash : Type = Clause ; + + QClause : Type = Clause ; + + -- RClause : Type = {s : NForm => Tense => Anteriority => Polarity => Str} ; + + Sentence : Type = {s : Str} ; + + predVP : NounPhrase -> VerbPhrase -> ClSlash = \np,vp -> vp ** { + s = \\t,a,p => + np.s ! vp.sc + ++ vp.obj + ++ vp.adv + ++ vp.s ! agr2vf np.agr + } ; + +-------------------------------------------------------------------------------- +-- linrefs } diff --git a/src/hungarian/SentenceHun.gf b/src/hungarian/SentenceHun.gf index 0760d91f..8c498bd4 100644 --- a/src/hungarian/SentenceHun.gf +++ b/src/hungarian/SentenceHun.gf @@ -1,75 +1,79 @@ -concrete SentenceHun of Sentence = CatHun ** open Prelude, ResHun in -{ ---{ --- --- flags optimize=all_subs ; --- --- lin --- --- PredVP np vp = mkClause (np.s ! npNom) np.a vp ; --- --- PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ; --- --- ImpVP vp = { --- s = \\pol,n => --- let --- agr = AgP2 (numImp n) ; --- verb = infVP VVAux vp agr ; --- dont = case pol of { --- CNeg True => "don't" ; --- CNeg False => "do" ++ "not" ; --- _ => [] --- } --- in --- dont ++ verb --- } ; --- --- SlashVP np vp = --- mkClause (np.s ! npNom) np.a vp ** {c2 = vp.c2} ; --- --- AdvSlash slash adv = { --- s = \\t,a,b,o => slash.s ! t ! a ! b ! o ++ adv.s ; --- c2 = slash.c2 --- } ; --- --- SlashPrep cl prep = cl ** {c2 = prep.s} ; --- --- SlashVS np vs slash = --- mkClause (np.s ! npNom) np.a --- (insertObj (\\_ => conjThat ++ slash.s) (predV vs)) ** --- {c2 = slash.c2} ; --- --- EmbedS s = {s = conjThat ++ s.s} ; --- EmbedQS qs = {s = qs.s ! QIndir} ; --- EmbedVP vp = {s = infVP VVInf vp (agrP3 Sg)} ; --- agr --- --- UseCl t p cl = { --- s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! ODir --- } ; --- UseQCl t p cl = { --- s = \\q => t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! q --- } ; --- UseRCl t p cl = { --- s = \\r => t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! r ; --- c = cl.c --- } ; --- UseSlash t p cl = { --- s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! ODir ; --- c2 = cl.c2 --- } ; --- --- AdvS a s = {s = a.s ++ s.s} ; --- ExtAdvS a s = {s = a.s ++ "," ++ s.s} ; --- --- SSubjS a s b = {s = a.s ++ s.s ++ b.s} ; --- --- RelS s r = {s = s.s ++ "," ++ r.s ! agrP3 Sg} ; --- --- oper --- ctr : CPolarity -> CPolarity = \x -> x ; ------ ctr = contrNeg True ; -- contracted negations --- ---} --- +concrete SentenceHun of Sentence = CatHun ** open + TenseX, ResHun, (AK=AdverbHun), Prelude in { + +flags optimize=all_subs ; + +lin + +--2 Clauses + + -- : NP -> VP -> Cl + PredVP = predVP ; + + -- : SC -> VP -> Cl ; -- that she goes is good (Saeed p. 94) + --PredSCVP sc vp = ; + +--2 Clauses missing object noun phrases + -- : NP -> VPSlash -> ClSlash ; + -- SlashVP = predVP ; +{- + -- : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today + AdvSlash cls adv = cls ** insertAdv adv cls ; + +-- SlashPrep : Cl -> Prep -> ClSlash ; -- (with whom) he walks + + -- : NP -> VS -> SSlash -> ClSlash ; -- (whom) she says that he loves +-- SlashVS np vs ss = {} ; + + + -- : Temp -> Pol -> ClSlash -> SSlash ; -- (that) she had not seen + UseSlash t p cls = { + } ; + +--2 Imperatives + -- : VP -> Imp ; + ImpVP vp = {s = \\num,pol => linVP (VImp num pol) Statement vp} ; + +--2 Embedded sentences + + -- : S -> SC ; + EmbedS s = {s = s.s ! True} ; -- choose subordinate + + -- : QS -> SC ; + -- EmbedQS qs = { } ; + + -- : VP -> SC ; + EmbedVP vp = {s = infVP vp} ; +-} +--2 Sentences + + -- : Temp -> Pol -> Cl -> S ; + UseCl t p cl = { + s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p + } ; + + -- : Temp -> Pol -> QCl -> QS ; + UseQCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p} ; + + -- : Temp -> Pol -> RCl -> RS ; + -- UseRCl t p cl = {s = } ; + + -- AdvS : Adv -> S -> S ; -- then I will go home + AdvS = advS "" ; + + -- ExtAdvS : Adv -> S -> S ; -- next week, I will go home + ExtAdvS = advS (SOFT_BIND ++ ","); + + -- : S -> Subj -> S -> S ; + -- 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 ; + +oper + + advS : (comma : Str) -> SS -> S -> S = \comma,a,sent -> sent ** { + s = a.s ++ comma ++ sent.s + } ; } diff --git a/src/hungarian/StructuralHun.gf b/src/hungarian/StructuralHun.gf index 66654f5d..35a24248 100644 --- a/src/hungarian/StructuralHun.gf +++ b/src/hungarian/StructuralHun.gf @@ -1,148 +1,168 @@ -concrete StructuralHun of Structural = CatHun ** - open MorphoHun, ResHun, ParadigmsHun, - (C = ConstructX), Prelude in -{ ---{ --- --- flags optimize=all ; --- --- lin --- above_Prep = mkPrep "above" ; --- after_Prep = mkPrep "after" ; --- all_Predet = ss "all" ; --- almost_AdA = mkAdA "almost" ; --- almost_AdN = mkAdN "almost" ; --- although_Subj = ss "although" ; --- always_AdV = mkAdV "always" ; --- and_Conj = mkConj "and" ; --- because_Subj = ss "because" ; --- before_Prep = mkPrep "before" ; --- behind_Prep = mkPrep "behind" ; --- between_Prep = mkPrep "between" ; --- both7and_DConj = mkConj "both" "and"; --- but_PConj = ss "but" ; --- by8agent_Prep = mkPrep "by" ; --- by8means_Prep = mkPrep "by" ; --- can8know_VV, can_VV = { --- s = table { --- VVF VInf => ["be able to"] ; --- VVF VPres => "can" ; --- VVF VPPart => ["been able to"] ; --- VVF VPresPart => ["being able to"] ; --- VVF VPast => "could" ; --# notpresent --- VVPastNeg => "couldn't" ; --# notpresent --- VVPresNeg => "can't" --- } ; --- typ = VVAux --- } ; --- during_Prep = mkPrep "during" ; --- either7or_DConj = mkConj "either" "or" singular ; --- everybody_NP = regNP "everybody" singular ; --- every_Det = mkDeterminer singular "every" ; --- everything_NP = regNP "everything" singular ; --- everywhere_Adv = mkAdv "everywhere" ; --- few_Det = mkDeterminer plural "few" ; ------ first_Ord = ss "first" ; DEPRECATED --- for_Prep = mkPrep "for" ; --- from_Prep = mkPrep "from" ; --- he_Pron = mkPron "he" "him" "his" "his" singular P3 masculine ; --- here_Adv = mkAdv "here" ; --- here7to_Adv = mkAdv ["to here"] ; --- here7from_Adv = mkAdv ["from here"] ; --- how_IAdv = ss "how" ; --- how8much_IAdv = ss "how much" ; --- how8many_IDet = mkDeterminer plural ["how many"] ; --- if_Subj = ss "if" ; --- in8front_Prep = mkPrep ["in front of"] ; --- i_Pron = mkPron "I" "me" "my" "mine" singular P1 human ; --- in_Prep = mkPrep "in" ; --- it_Pron = mkPron "it" "it" "its" "its" singular P3 nonhuman ; --- less_CAdv = C.mkCAdv "less" "than" ; --- many_Det = mkDeterminer plural "many" ; --- more_CAdv = C.mkCAdv "more" "than" ; --- most_Predet = ss "most" ; --- much_Det = mkDeterminer singular "much" ; --- must_VV = { --- s = table { --- VVF VInf => ["have to"] ; --- VVF VPres => "must" ; --- VVF VPPart => ["had to"] ; --- VVF VPresPart => ["having to"] ; --- VVF VPast => ["had to"] ; --# notpresent --- VVPastNeg => ["hadn't to"] ; --# notpresent --- VVPresNeg => "mustn't" --- } ; --- typ = VVAux --- } ; ------b no_Phr = ss "no" ; --- no_Utt = ss "no" ; --- on_Prep = mkPrep "on" ; ------- one_Quant = mkDeterminer singular "one" ; -- DEPRECATED --- only_Predet = ss "only" ; --- or_Conj = mkConj "or" singular ; --- otherwise_PConj = ss "otherwise" ; --- part_Prep = mkPrep "of" ; --- please_Voc = ss "please" ; --- possess_Prep = mkPrep "of" ; --- quite_Adv = mkAdv "quite" ; --- she_Pron = mkPron "she" "her" "her" "hers" singular P3 feminine ; --- so_AdA = mkAdA "so" ; --- somebody_NP = regNP "somebody" singular ; --- someSg_Det = mkDeterminer singular "some" ; --- somePl_Det = mkDeterminer plural "some" ; --- something_NP = regNP "something" singular ; --- somewhere_Adv = mkAdv "somewhere" ; --- that_Quant = mkQuant "that" "those" ; --- there_Adv = mkAdv "there" ; --- there7to_Adv = mkAdv "there" ; --- there7from_Adv = mkAdv ["from there"] ; --- therefore_PConj = ss "therefore" ; --- they_Pron = mkPron "they" "them" "their" "theirs" plural P3 human ; --- this_Quant = mkQuant "this" "these" ; --- through_Prep = mkPrep "through" ; --- too_AdA = mkAdA "too" ; --- to_Prep = mkPrep "to" ; --- under_Prep = mkPrep "under" ; --- very_AdA = mkAdA "very" ; --- want_VV = mkVV (regV "want") ; --- we_Pron = mkPron "we" "us" "our" "ours" plural P1 human ; --- whatPl_IP = mkIP "what" "what" "what's" plural ; --- whatSg_IP = mkIP "what" "what" "what's" singular ; --- when_IAdv = ss "when" ; --- when_Subj = ss "when" ; --- where_IAdv = ss "where" ; --- which_IQuant = {s = \\_ => "which"} ; ------b whichPl_IDet = mkDeterminer plural ["which"] ; ------b whichSg_IDet = mkDeterminer singular ["which"] ; --- whoPl_IP = mkIP "who" "whom" "whose" plural ; --- whoSg_IP = mkIP "who" "whom" "whose" singular ; --- why_IAdv = ss "why" ; --- without_Prep = mkPrep "without" ; --- with_Prep = mkPrep "with" ; ------b yes_Phr = ss "yes" ; --- yes_Utt = ss "yes" ; --- youSg_Pron = mkPron "you" "you" "your" "yours" singular P2 human ; --- youPl_Pron = mkPron "you" "you" "your" "yours" plural P2 human ; --- youPol_Pron = mkPron "you" "you" "your" "yours" singular P2 human ; --- --- not_Predet = {s = "not" ; lock_Predet = <>} ; --- no_Quant = mkQuant "no" "no" "none" "none" ; --- if_then_Conj = mkConj "if" "then" singular ; --- nobody_NP = regNP "nobody" singular ; --- nothing_NP = regNP "nothing" singular ; --- --- at_least_AdN = mkAdN "at least" ; --- at_most_AdN = mkAdN "at most" ; --- --- except_Prep = mkPrep "except" ; --- --- as_CAdv = C.mkCAdv "as" "as" ; --- --- have_V2 = dirV2 (mk5V "have" "has" "had" "had" "having") ; --- that_Subj = ss "that" ; --- lin language_title_Utt = ss "Hunlish" ; --- ---} --- +concrete StructuralHun of Structural = CatHun ** + open Prelude, ResHun, ParadigmsHun in { +{- +------- +-- Ad* + +lin almost_AdA = mkAdA "" ; +lin almost_AdN = ss "" ; +lin at_least_AdN = ss "" ; +lin at_most_AdN = ss "" ; +lin so_AdA = mkAdA "" ; +lin too_AdA = mkAdA "" ; +lin very_AdA = mkAdA "" ; + +lin as_CAdv = { s = "" ; p = [] } ; +lin less_CAdv = { s = "" ; p = [] } ; +lin more_CAdv = { s = "" ; p = [] } ; +lin how_IAdv = ss "" : + +lin how8much_IAdv = ss "" ; +lin when_IAdv = ss "" ; +lin where_IAdv = ss "" : +lin why_IAdv = ss "" : + +lin always_AdV = ss "" ; + +lin everywhere_Adv = ss "" ; +lin here7from_Adv = ss "" ; +lin here7to_Adv = ss "" ; +lin here_Adv = ss "" ; +lin quite_Adv = ss "" ; +lin somewhere_Adv = ss "" ; +lin there7from_Adv = ss "" ; +lin there7to_Adv = ss "" ; +lin there_Adv = ss "" ; + +------- +-- Conj + +lin and_Conj = +lin or_Conj = +lin if_then_Conj = +lin both7and_DConj = +lin either7or_DConj = + +lin but_PConj = ss "" ; +lin otherwise_PConj = ss "" ; +lin therefore_PConj = ss "" ; + +----------------- +-- *Det and Quant + + +lin how8many_IDet = ; + +lin all_Predet = {s = ""} ; +lin not_Predet = {s = ""} ; +lin only_Predet = {s = ""} ; +lin most_Predet = {s = ""} ; + + +lin every_Det = +lin few_Det = +lin many_Det = +lin much_Det = + +lin somePl_Det = +lin someSg_Det = +lin no_Quant = +-} +lin that_Quant = mkQuant "az" "az" ; +lin this_Quant = mkQuant "ez" "ez" ; +{-lin which_IQuant = + + +----- +-- NP + +lin everybody_NP = defNP "" N.NumPl ; +lin everything_NP = defNP "" N.NumSg ; +lin nobody_NP = mkVerb; "" +lin nothing_NP = defNP "" N.NumSg ; +lin somebody_NP = defNP "" N.NumSg ; +lin something_NP = defNP "" N.NumSg ; + +oper + defNP : Str -> Num -> NP = {} ; +-} + +------- +-- Prep + +-- lin above_Prep = mkPrep "" +-- lin after_Prep = mkPrep "" +-- lin before_Prep = mkPrep "" ; +-- lin behind_Prep = mkPrep "" ; +-- lin between_Prep = = mkPrep "" ; +-- lin by8agent_Prep = mkPrep ; +-- lin by8means_Prep = mkPrep ; +-- lin during_Prep = mkPrep ; +-- lin except_Prep = mkPrep ; +-- lin for_Prep = mkPrep "" ; +-- lin from_Prep = mkPrep "" ; +-- lin in8front_Prep = mkPrep "" ; +-- lin in_Prep = mkPrep "" ; +-- lin on_Prep = mkPrep "" ; +-- lin part_Prep = mkPrep ; +-- lin possess_Prep = mkPrep "" ; +-- lin through_Prep = mkPrep ; +-- lin to_Prep = mkPrep ""; +-- lin under_Prep = mkPrep "" ; +-- lin with_Prep = mkPrep "" ; +-- lin without_Prep = mkPrep "" ; + + +------- +-- Pron + +-- Pronouns are closed class, no constructor in ParadigmsHun. + -- it_Pron = + -- i_Pron = + -- youPol_Pron, + -- youSg_Pron = + -- he_Pron = + -- she_Pron = + -- we_Pron = + -- youPl_Pron = + -- they_Pron = + +--lin whatPl_IP = ; +--lin whatSg_IP = : +--lin whoPl_IP = ; +--lin whoSg_IP = ; + +------- +-- Subj + +-- lin although_Subj = +-- lin because_Subj = +-- lin if_Subj = +-- lin that_Subj = +-- lin when_Subj = + + +------ +-- Utt + +lin language_title_Utt = ss "magyar" ; +lin no_Utt = ss "nem" ; +lin yes_Utt = ss "igen" ; + +{- +------- +-- Verb + +lin have_V2 = vtov2 copula ** {sc = ??}; +lin can8know_VV = can_VV ; -- can (capacity) +lin can_VV = mkVV "" ; -- can (possibility) +lin must_VV = mkVV "" ; +lin want_VV = mkVV "" subjunctive ; + +------ +-- Voc + +lin please_Voc = ss "" ; +-} } diff --git a/src/hungarian/SymbolHun.gf b/src/hungarian/SymbolHun.gf index 0866083a..6c5cadb9 100644 --- a/src/hungarian/SymbolHun.gf +++ b/src/hungarian/SymbolHun.gf @@ -1,48 +1,50 @@ ---# -path=.:../abstract:../common +--# -path=.:../abstract:../common:../prelude + +concrete SymbolHun of Symbol = CatHun ** + open Prelude, ParadigmsHun, ResHun, (NS=NounHun) in { + +lin + + -- : Symb -> PN ; -- x + SymbPN i = mkPN i.s ; + + -- : Int -> PN ; -- 27 + IntPN i = mkPN i.s ; + + -- : Float -> PN ; -- 3.14159 + FloatPN i = mkPN i.s ; + + -- : Card -> PN ; -- twelve [as proper name] + NumPN i = mkPN i.s ; + +{- +lin +-- CNIntNP cn i = {} ; + + -- : Det -> CN -> [Symb] -> NP ; -- (the) (2) numbers x and y + CNSymbNP det cn xs = + let cnSymb = cn ** { comp = cn.comp ++ xs.s } + in NS.DetCN det cnSymb ; + + -- : CN -> Card -> NP ; -- level five ; level 5 + CNNumNP cn i = NS.MassNP (cn ** { comp = cn.comp ++ i.s }) ; + + -- : Symb -> S ; + SymbS sy = {s = } ; + -- : Symb -> Card ; + SymbNum sy = { s = sy.s ; n = Pl } ; + + -- : Symb -> Ord ; + SymbOrd sy = { s =} ; +-} +lincat + Symb, [Symb] = SS ; + +lin + MkSymb s = s ; + + BaseSymb = infixSS "és" ; + ConsSymb = infixSS "," ; -concrete SymbolHun of Symbol = CatHun ** open Prelude, ResHun in -{ ---{ --- ---lin --- SymbPN i = {s = addGenitiveS i.s ; g = Neutr} ; --- IntPN i = {s = addGenitiveS i.s ; g = Neutr} ; --- FloatPN i = {s = addGenitiveS i.s ; g = Neutr} ; --- NumPN i = {s = i.s ; g = Neutr} ; --- CNIntNP cn i = { --- s = \\c => cn.s ! Sg ! Nom ++ (addGenitiveS i.s) ! npcase2case c ; --- a = agrgP3 Sg cn.g --- } ; --- CNSymbNP det cn xs = { --- s = \\c => det.s ++ cn.s ! det.n ! Nom ++ (addGenitiveS xs.s) ! npcase2case c ; --- a = agrgP3 det.n cn.g --- } ; --- CNNumNP cn i = { --- s = \\c => cn.s ! Sg ! Nom ++ i.s ! npcase2case c ; --- a = agrgP3 Sg cn.g --- } ; --- --- SymbS sy = sy ; --- --- SymbNum sy = { s = addGenitiveS sy.s ; n = Pl ; hasCard = True } ; --- SymbOrd sy = { s = \\c => sy.s ++ (regGenitiveS "th")!c} ; --- ---lincat --- --- Symb, [Symb] = SS ; --- ---lin --- MkSymb s = s ; --- --- BaseSymb = infixSS "and" ; --- ConsSymb = infixSS "," ; --- ---oper --- -- Note: this results in a space before 's, but there's --- -- not mauch we can do about that. --- addGenitiveS : Str -> Case => Str = \s -> --- table { Gen => s ++ "'s"; _ => s } ; --- ---} } diff --git a/src/hungarian/VerbHun.gf b/src/hungarian/VerbHun.gf index 215b24ed..657194fa 100644 --- a/src/hungarian/VerbHun.gf +++ b/src/hungarian/VerbHun.gf @@ -1,63 +1,138 @@ -concrete VerbHun of Verb = CatHun ** open ResHun in -{ ---{ --- --- flags optimize=all_subs ; --- --- lin --- UseV = predV ; --- --- SlashV2a v = predVc v ; --- Slash2V3 v np = --- insertObjc (\\_ => v.c2 ++ np.s ! NPAcc) (predV v ** {c2 = v.c3}) ; --- Slash3V3 v np = --- insertObjc (\\_ => v.c3 ++ np.s ! NPAcc) (predVc v) ; ---- --- --- ComplVV v vp = insertObj (\\a => infVP v.typ vp a) (predVV v) ; --- ComplVS v s = insertObj (\\_ => conjThat ++ s.s) (predV v) ; --- ComplVQ v q = insertObj (\\_ => q.s ! QIndir) (predV v) ; --- ComplVA v ap = insertObj (ap.s) (predV v) ; --- --- SlashV2V v vp = insertObjc (\\a => v.c3 ++ infVP v.typ vp a) (predVc v) ; --- SlashV2S v s = insertObjc (\\_ => conjThat ++ s.s) (predVc v) ; --- SlashV2Q v q = insertObjc (\\_ => q.s ! QIndir) (predVc v) ; --- SlashV2A v ap = insertObjc (\\a => ap.s ! a) (predVc v) ; ---- --- --- ComplSlash vp np = insertObjPre (\\_ => vp.c2 ++ np.s ! NPAcc) vp ; --- --- SlashVV vv vp = --- insertObj (\\a => infVP vv.typ vp a) (predVV vv) ** --- {c2 = vp.c2} ; --- SlashV2VNP vv np vp = --- insertObjPre (\\_ => vv.c2 ++ np.s ! NPAcc) --- (insertObjc (\\a => vv.c3 ++ infVP vv.typ vp a) (predVc vv)) ** --- {c2 = vp.c2} ; --- --- UseComp comp = insertObj comp.s (predAux auxBe) ; --- --- AdvVP vp adv = insertObj (\\_ => adv.s) vp ; --- AdVVP adv vp = insertAdV adv.s vp ; --- --- AdvVPSlash vp adv = insertObj (\\_ => adv.s) vp ** {c2 = vp.c2} ; --- AdVVPSlash adv vp = insertAdV adv.s vp ** {c2 = vp.c2} ; --- --- ReflVP v = insertObjPre (\\a => v.c2 ++ reflPron ! a) v ; --- --- PassV2 v = insertObj (\\_ => v.s ! VPPart) (predAux auxBe) ; --- ------b UseVS, UseVQ = \vv -> {s = vv.s ; c2 = [] ; isRefl = vv.isRefl} ; -- no "to" --- --- CompAP ap = ap ; --- CompNP np = {s = \\_ => np.s ! NPAcc} ; --- CompAdv a = {s = \\_ => a.s} ; --- CompCN cn = {s = \\a => case (fromAgr a).n of { --- Sg => artIndef ++ cn.s ! Sg ! Nom ; --- Pl => cn.s ! Pl ! Nom --- } --- } ; --- --- UseCopula = predAux auxBe ; --- ---} +concrete VerbHun of Verb = CatHun ** open ResHun, AdverbHun, Prelude in { + + +lin + +----- +-- VP + -- : V -> VP + UseV = ResHun.useV ; + + -- : V2 -> VP ; -- be loved + -- PassV2 = ResHun.passV2 ; + + -- : VPSlash -> VP ; + -- ReflVP = ResHun.insertRefl ; + + -- : VV -> VP -> VP ; + -- ComplVV vv vp = let vc = vp.vComp in case vv.vvtype of { + -- + -- } ; + + -- : VS -> S -> VP ; + -- ComplVS vs s = + -- let vps = useV vs ; + -- subord = SubjS {s=""} s ; + -- in vps ** {} ; + +{- + -- : VQ -> QS -> VP ; + ComplVQ vq qs = ; + + -- : VA -> AP -> VP ; -- they become red + ComplVA va ap = ResHun.insertObj (CompAP ap).s (useV va) ; + +-------- +-- Slash + -- : V2 -> VPSlash + SlashV2a = ResHun.useVc ; + + -- : V3 -> NP -> VPSlash ; -- give it (to her) + -- : V3 -> NP -> VPSlash ; -- give (it) to her + Slash2V3, + Slash3V3 = \v3 -> insertObj (useVc3 v3) ; + + -- : V2S -> S -> VPSlash ; -- answer (to him) that it is good + SlashV2S v2s s = + let vps = useVc v2s ; + subord = SubjS {s=""} s ; + in vps ** {obj = } ; + + + -- : V2V -> VP -> VPSlash ; -- beg (her) to go + SlashV2V v2v vp = ; + + -- : V2Q -> QS -> VPSlash ; -- ask (him) who came + SlashV2Q v2q qs = ; + + -- : V2A -> AP -> VPSlash ; -- paint (it) red + SlashV2A v2a ap = useVc v2a ** { + aComp = \\_ => (CompAP ap).aComp ! Sg3 Masc + } ; + + -- : VPSlash -> NP -> VP + ComplSlash = ResHun.insertComp ; + + -- : VV -> VPSlash -> VPSlash ; + -- Just like ComplVV except missing subject! + SlashVV vv vps = ComplVV vv vps ** { missing = vps.missing ; + post = vps.post } ; + + -- : 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 } } ; + +-} + + -- : Comp -> VP ; + UseComp comp = comp ; + +{- + -- : VP -> Adv -> VP ; -- sleep here + AdvVP = insertAdv ; + + -- : VPSlash -> Adv -> VPSlash ; -- use (it) here + AdvVPSlash = insertAdvSlash ; + + -- : VP -> Adv -> VP ; -- sleep , even though ... + ExtAdvVP vp adv = vp ** { } ; + + -- : AdV -> VP -> VP ; -- always sleep + AdVVP adv vp = vp ** { } ; + + -- : AdV -> VPSlash -> VPSlash ; -- always use (it) + AdVVPSlash adv vps = vps ** { } ; + + -- : VP -> Prep -> VPSlash ; -- live in (it) + VPSlashPrep vp prep = +-} + +--2 Complements to copula + +-- Adjectival phrases, noun phrases, and adverbs can be used. + + -- : AP -> Comp ; + CompAP ap = UseCopula ** { + s = \\vf => case vf of { + VFin P3 n => ap.s ! n ; + VFin _ n => ap.s ! n ++ copula.s ! vf ; + _ => ap.s ! Sg ++ copula.s ! vf} ; + } ; + + -- : CN -> Comp ; + CompCN cn = UseCopula ** { + s = \\vf => case vf of { + VFin P3 n => cn.s ! n ! Nom ; + VFin _ n => cn.s ! n ! Nom ++ copula.s ! vf ; + _ => cn.s ! Sg ! Nom ++ copula.s ! vf} ; + } ; + + -- : NP -> Comp ; + CompNP np = UseCopula ** { + s = \\vf => case vf of { + VFin P3 _ => np.s ! Nom ; + _ => np.s ! Nom ++ copula.s ! vf } ; + } ; + + -- : Adv -> Comp ; + CompAdv adv = UseCopula ** { + s = \\vf => adv.s ++ copula.s ! vf ; + } ; + + -- : VP -- Copula alone; + UseCopula = useV copula ; }