1
0
forked from GitHub/gf-rgl

(Hun) Fresh copypaste from generic dummy template. Compiles, isn't good.

This commit is contained in:
Inari Listenmaa
2020-03-28 15:43:58 +01:00
parent 7fee10e1e0
commit e1a94a0741
22 changed files with 2195 additions and 2627 deletions

View File

@@ -1,59 +1,58 @@
concrete AdjectiveHun of Adjective = CatHun ** open ResHun, Prelude in 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 ** {
-- --
-- lin
--
-- PositA a = {
-- s = \\_ => a.s ! AAdj Posit Nom ;
-- isPre = True
-- } ; -- } ;
-- ComparA a np = {
-- s = \\_ => a.s ! AAdj Compar Nom ++ "than" ++ np.s ! npNom ; -- : A2 -> NP -> AP ; -- married to her
-- isPre = False -- 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 = []
-- } ; -- } ;
-- UseComparA a = {
-- s = \\_ => a.s ! AAdj Compar Nom ;
-- isPre = True -- : CAdv -> AP -> NP -> AP ; -- as cool as John
-- } ; -- CAdvAP adv ap np = ap ** { } ;
--
-- AdjOrd ord = { -- The superlative use is covered in $Ord$.
-- s = \\_ => ord.s ! Nom ;
-- isPre = True -- : Ord -> AP ; -- warmest
-- } ; AdjOrd ord = ord ** {
-- s = \\_ => ord.s ;
-- CAdvAP ad ap np = { } ;
-- s = \\a => ad.s ++ ap.s ! a ++ ad.p ++ np.s ! npNom ;
-- isPre = False -- Sentence and question complements defined for all adjectival
-- } ; -- phrases, although the semantics is only clear for some adjectives.
--
-- ComplA2 a np = { -- : AP -> SC -> AP ; -- good that she is here
-- s = \\_ => a.s ! AAdj Posit Nom ++ a.c2 ++ np.s ! NPAcc ; -- SentAP ap sc = ap ** {} ;
-- isPre = False
-- } ; -- An adjectival phrase can be modified by an *adadjective*, such as "very".
--
-- ReflA2 a = { -- : AdA -> AP -> AP ;
-- s = \\ag => a.s ! AAdj Posit Nom ++ a.c2 ++ reflPron ! ag ; AdAP ada ap = ap ** {s = \\af => ada.s ++ ap.s ! af} ;
-- isPre = False
-- } ;
-- -- It can also be postmodified by an adverb, typically a prepositional phrase.
-- SentAP ap sc = {
-- s = \\a => ap.s ! a ++ sc.s ; -- : AP -> Adv -> AP ; -- warm by nature
-- isPre = False -- AdvAP ap adv = ap ** {} ;
-- } ;
--
-- 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} ;
--
--}
} }

View File

@@ -1,25 +1,35 @@
concrete AdverbHun of Adverb = CatHun ** open ResHun, Prelude in concrete AdverbHun of Adverb = CatHun ** open ResHun, ParamHun, ParadigmsHun, 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} ;
--
--}
} 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 = } ;
} ;

View File

@@ -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 lincat
--
---- exception to CommonX, due to the distinction contracted/uncontracted negation --2 Sentences and clauses
-- -- Constructed in SentenceHun, and also in IdiomHun
-- Pol = {s : Str ; p : CPolarity} ;
-- S = ResHun.Sentence ;
---- Tensed/Untensed QS = SS ;
-- RS = SS ;
-- S = {s : Str} ; -- relative sentence. Tense and polarity fixed,
-- QS = {s : QForm => Str} ; -- but agreement may depend on the CN/NP it modifies.
-- RS = {s : Agr => Str ; c : NPCase} ; -- c for it clefts
-- SSlash = {s : Str ; c2 : Str} ; Cl = ResHun.ClSlash ;
-- ClSlash = ResHun.ClSlash ;
---- Sentence SSlash = ResHun.Sentence ; -- sentence missing NP; e.g. "she has looked at"
-- Imp = {s : Number => Polarity => Str} ; -- imperative e.g. "look at this"
-- Cl = {s : ResHun.Tense => Anteriority => CPolarity => Order => Str} ;
-- ClSlash = { --2 Questions and interrogatives
-- s : ResHun.Tense => Anteriority => CPolarity => Order => Str ;
-- c2 : Str -- Constructed in QuestionHun.
-- } ;
-- Imp = {s : CPolarity => ImpForm => Str} ; QCl = ResHun.QClause ;
-- IComp = SS ; -- interrogative complement of copula e.g. "where"
---- Question IDet = ResHun.Determiner ; -- interrogative determiner e.g. "how many"
-- IQuant = ResHun.Quant ; -- interrogative quantifier e.g. "which"
-- QCl = {s : ResHun.Tense => Anteriority => CPolarity => QForm => Str} ; IP = ResHun.NounPhrase ; -- interrogative pronoun e.g. "who"
-- IP = {s : NPCase => Str ; n : Number} ;
-- IComp = {s : Str} ; --2 Subord clauses and pronouns
-- IDet = {s : Str ; n : Number} ;
-- IQuant = {s : Number => Str} ; --RCl = ResHun.RClause ;
-- --RP = SS ;
---- Relative
-- --2 Verb phrases
-- RCl = {
-- s : ResHun.Tense => Anteriority => CPolarity => Agr => Str ; -- Constructed in VerbHun.
-- c : NPCase
-- } ; VP = ResHun.VerbPhrase ;
-- RP = {s : RCase => Str ; a : RAgr} ; VPSlash = ResHun.VPSlash ;
-- Comp = ResHun.VerbPhrase ;
---- Verb
--
-- VP = ResHun.VP ; --2 Adjectival phrases
-- VPSlash = ResHun.VP ** {c2 : Str} ;
-- Comp = {s : Agr => Str} ; -- Constructed in AdjectiveHun.
--
---- Adjective AP = ResHun.Adjective ;
--
-- AP = {s : Agr => Str ; isPre : Bool} ;
-- --2 Nouns and noun phrases
---- Noun
-- -- Constructed in NounHun.
N = {s : Number => Case => Str} ; -- Many atomic noun phrases e.g. "everybody"
-- NP = {s : NPCase => Str ; a : Agr} ; -- are constructed in StructuralHun.
-- Pron = {s : NPCase => Str ; sp : Case => Str ; a : Agr} ; -- The determiner structure is
-- Det = {s : Str ; sp : NPCase => Str ; n : Number ; hasNum : Bool} ; -- ``` Predet (QuantSg | QuantPl Num) Ord
-- Predet = {s : Str} ; -- as defined in NounHun.
-- Ord = { s : Case => Str } ;
-- Num = {s : Case => Str ; n : Number ; hasCard : Bool} ; CN = ResHun.Noun ;
-- Card = {s : Case => Str ; n : Number} ; NP = ResHun.NounPhrase ;
-- Quant = {s : Bool => Number => Str ; sp : Bool => Number => NPCase => Str} ; Pron = ResHun.Pronoun ; --Pronouns need enough info to turn it into NP or Quant.
-- Det = ResHun.Determiner ;
---- Numeral Predet = {s : Str} ;
-- Quant = ResHun.Quant ;
-- Numeral = {s : CardOrd => Case => Str ; n : Number} ; Num = ResHun.Num ;
-- Digits = {s : CardOrd => Case => Str ; n : Number ; tail : DTail} ; Ord = {
-- s : Str ; -- Number => Case => Str ; -- Ord can come from AP and become AP again
---- Structural n : Number -- Ord can come from Num, which has inherent number
-- } ;
-- Conj = {s1,s2 : Str ; n : Number} ; DAP = ResHun.Determiner ;
-----b Conj = {s : Str ; n : Number} ;
-----b DConj = {s1,s2 : Str ; n : Number} ;
-- Subj = {s : Str} ; --2 Numerals
-- Prep = {s : Str} ;
-- -- Constructed in NumeralHun.
---- Open lexical classes, e.g. Lexicon
-- Card = ResHun.Num ;
-- V, VS, VQ, VA = Verb ; -- = {s : VForm => Str} ; Numeral = ResHun.Numeral ;
-- V2, V2A, V2Q, V2S = Verb ** {c2 : Str} ; Digits = {s : CardOrd => Str ; n : Number} ;
-- V3 = Verb ** {c2, c3 : Str} ;
-- VV = {s : VVForm => Str ; typ : VVType} ;
-- V2V = Verb ** {c2,c3 : Str ; typ : VVType} ;
-- --2 Structural words
-- A = {s : AForm => Str} ;
-- A2 = {s : AForm => Str ; c2 : Str} ; -- Constructed in StructuralHun.
-- Conj = ResHun.Conj ;
-- N = {s : Number => Case => Str ; g : Gender} ; Subj = SS ;
-- N2 = {s : Number => Case => Str ; g : Gender} ** {c2 : Str} ; Prep = ResHun.Postposition ;
-- N3 = {s : Number => Case => Str ; g : Gender} ** {c2,c3 : Str} ;
-- PN = {s : Case => Str ; g : Gender} ;
--
--} --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 ;
} }

View File

@@ -1,58 +1,93 @@
concrete ConjunctionHun of Conjunction = concrete ConjunctionHun of Conjunction =
CatHun ** open ResHun, Coordination, Prelude in CatHun ** open ResHun, Coordination, Prelude in {
{
--{ {- Conjunction for category X needs four things:
-- lincat [X]
-- flags optimize=all_subs ; lin BaseX
-- lin ConsX
-- lin lin ConjX
--
-- ConjS = conjunctDistrSS ; For example, if X is defined as
--
-- ConjAdv = conjunctDistrSS ; lincat X = {s : Number => Str ; g : Gender} ;
--
-- ConjNP conj ss = conjunctDistrTable NPCase conj ss ** { then [X] will split its s field into two, and retain its other fields as is:
-- a = conjAgr (agrP3 conj.n) ss.a
-- } ; lincat [X] = {s1,s2 : Number => Str ; g : Gender} ;
--
-- ConjAP conj ss = conjunctDistrTable Agr conj ss ** { Let us look at a simple case: Adv is of type {s : Str}
-- isPre = ss.isPre Then [Adv] is {s1,s2 : Str}.
-- } ; BaseAdv, ConsAdv and ConjAdv can all use functions defined in prelude/Coordination:
--
-- ConjRS conj ss = conjunctDistrTable Agr conj ss ** { BaseAdv = twoSS ;
-- c = ss.c ConsAdv = consrSS comma ;
-- } ; ConjAdv = conjunctSS ;
--
-- 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} ;
--
--} --}
-- 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 ;
-}
} }

View File

@@ -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" ;
-}
} ;

View File

@@ -0,0 +1,8 @@
--# -path=.:../common:../abstract
concrete ExtendHun of Extend = CatHun
-- ** ExtendFunctor - []
-- with (Grammar=GrammarHun)
** open Prelude, ResHun, NounHun in {
} ;

View File

@@ -1,5 +1,3 @@
--# -path=.:../abstract:../common:prelude
concrete GrammarHun of Grammar = concrete GrammarHun of Grammar =
NounHun, NounHun,
VerbHun, VerbHun,
@@ -11,21 +9,12 @@ concrete GrammarHun of Grammar =
RelativeHun, RelativeHun,
ConjunctionHun, ConjunctionHun,
PhraseHun, PhraseHun,
TextX - [Pol,PPos,PNeg], TextX,
StructuralHun, StructuralHun,
IdiomHun, IdiomHun,
TenseX - [Pol,PPos,PNeg] TenseX
** open ResHun, Prelude in ** {
{
--{
--
--flags startcat = Phr ; unlexer = text ; lexer = text ;
--
--lin
-- PPos = {s = [] ; p = CPos} ;
-- PNeg = {s = [] ; p = CNeg True} ; -- contracted: don't
--
--
--} ;
} flags startcat = Phr ; unlexer = text ; lexer = text ;
} ;

View File

@@ -1,36 +1,47 @@
concrete IdiomHun of Idiom = CatHun ** open Prelude, ResHun in
{ --1 Idiom: Idiomatic Expressions
--{
-- concrete IdiomHun of Idiom = CatHun ** open Prelude, ResHun, VerbHun, NounHun, StructuralHun in {
-- flags optimize=all_subs ;
-- -- This module defines constructions that are formed in fixed ways,
-- lin -- often different even in closely related languages.
-- ImpersCl vp = mkClause "it" (agrP3 Sg) vp ;
-- GenericCl vp = mkClause "one" (agrP3 Sg) vp ; {- lin
--
-- CleftNP np rs = mkClause "it" (agrP3 Sg)
-- (insertObj (\\_ => rs.s ! np.a) -- ImpersCl : VP -> Cl ; -- it is hot
-- (insertObj (\\_ => np.s ! rs.c) (predAux auxBe))) ; -- GenericCl : VP -> Cl ; -- one sleeps
-- ImpersCl,
-- CleftAdv ad s = mkClause "it" (agrP3 Sg) GenericCl = \vp -> predVP impersNP (passVP vp) ;
-- (insertObj (\\_ => conjThat ++ s.s)
-- (insertObj (\\_ => ad.s) (predAux auxBe))) ; CleftNP : NP -> RS -> Cl ; -- it is I who did it
-- CleftAdv : Adv -> S -> Cl ; -- it is here she slept
-- ExistNP np =
-- mkClause "there" (agrP3 (fromAgr np.a).n) -- : NP -> Cl ; -- there is a house
-- (insertObj (\\_ => np.s ! NPAcc) (predAux auxBe)) ; ExistNP np =
--
-- ExistIP ip = ExistIP : IP -> QCl ; -- which houses are there
-- mkQuestion (ss (ip.s ! npNom))
-- (mkClause "there" (agrP3 ip.n) (predAux auxBe)) ; -- 7/12/2012 generalizations of these
--
-- ProgrVP vp = insertObj (\\a => vp.ad ++ vp.prp ++ vp.s2 ! a) (predAux auxBe) ; ExistNPAdv : NP -> Adv -> Cl ; -- there is a house in Paris
-- ExistIPAdv : IP -> Adv -> QCl ; -- which houses are there in Paris
-- ImpPl1 vp = {s = "let's" ++ infVP VVAux vp (AgP1 Pl)} ;
-- -- : VP -> VP ;
-- ImpP3 np vp = {s = "let" ++ np.s ! NPAcc ++ infVP VVAux vp np.a} ; 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)
-}
} }

View File

@@ -1,14 +1,4 @@
--# -path=.:../abstract:../common:../prelude
concrete LangHun of Lang = concrete LangHun of Lang =
GrammarHun, GrammarHun,
LexiconHun LexiconHun,
** ConstructionHun ;
{
--{
--
--flags startcat = Phr ; unlexer = text ; lexer = text ;
--
--} ;
}

View File

@@ -1,383 +1,418 @@
--# -path=.:prelude
concrete LexiconHun of Lexicon = CatHun ** concrete LexiconHun of Lexicon = CatHun **
open ParadigmsHun, Prelude in open ParadigmsHun 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" ; -- -- D
-- 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" ;
-- --
-- do_V2 = dirV2 (mk5V "do" "does" "did" "done" "doing") ; -- lin day_N = mkN "" ;
-- now_Adv = mkAdv "now" ; -- lin die_V = mkV "" ;
-- already_Adv = mkAdv "already" ; -- lin dig_V = mkV "" ;
-- song_N = regN "song" ; -- lin dirty_A = mkA "" ;
-- add_V3 = dirV3 (regV "add") toP ; -- lin distance_N3 = mkN "" ;
-- number_N = regN "number" ; -- lin do_V2 = mkV2 do_V ;
-- put_V2 = prepV2 (irregDuplV "put" "put" "put") noPrep ; -- lin doctor_N = mkN "" ;
-- stop_V = regDuplV "stop" ; -- lin dog_N = mkN "" ;
-- jump_V = regV "jump" ; -- 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" ; -- -- O - P
-- 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" ;
-- --
-- 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" ; -- -- Q - R
-- rule_N = regN "rule" ;
-- --
---- added 4/6/2007 -- lin queen_N = mkN "" ;
-- john_PN = mkPN (mkN masculine (mkN "John")) ; -- lin question_N = mkN "" ;
-- question_N = regN "question" ; -- lin radio_N = mkN "" ;
-- ready_A = regA "ready" ; -- lin rain_N = mkN "" ;
-- reason_N = regN "reason" ; -- lin rain_V0 = mkV "" ;
-- today_Adv = mkAdv "today" ; -- lin read_V2 = mkV2 "" ;
-- uncertain_A = regA "uncertain" ; -- lin ready_A = mkA "" ;
-- -- lin reason_N = mkN "" ;
--oper lin red_A = mkA "piros" ;
-- aboutP = mkPrep "about" ; -- lin religion_N = mkN "" ;
-- atP = mkPrep "at" ; -- lin restaurant_N = mkN "" ;
-- forP = mkPrep "for" ; -- lin river_N = mkN "" ;
-- fromP = mkPrep "from" ; -- lin road_N = mkN "" ;
-- inP = mkPrep "in" ; -- lin rock_N = mkN "" ;
-- onP = mkPrep "on" ; -- lin roof_N = mkN "" ;
-- toP = mkPrep "to" ; -- 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 "" ;
} }

View File

@@ -1,144 +1,208 @@
concrete NounHun of Noun = CatHun ** open MorphoHun, ResHun, Prelude in concrete NounHun of Noun = CatHun ** open ResHun, Prelude in {
{
--{ flags optimize=all_subs ;
--
-- flags optimize=all_subs ; lin
--
-- lin --2 Noun phrases
-- DetCN det cn = {
-- s = \\c => det.s ++ cn.s ! det.n ! npcase2case c ; -- : Det -> CN -> NP
-- a = agrgP3 det.n cn.g DetCN det cn = emptyNP ** {
s = \\c => det.s ! c ++ cn.s ! det.n ! c ;
agr = <P3,det.n> ;
} ;
{-
-- : 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 = <P3,det.n> ;
} ;
-- : CN -> NP ;
MassNP cn = emptyNP ** {
s = \\c => cn.s ! Sg ! c ;
agr = <P3,Sg> ;
} ;
-}
--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 ** {
-- } ; -- } ;
--
-- UsePN pn = {s = \\c => pn.s ! npcase2case c ; a = agrgP3 Sg pn.g} ; -- Whether the resulting determiner is singular or plural depends on the
-- UsePron p = p ; -- cardinal.
--
-- PredetNP pred np = { -- All parts of the determiner can be empty, except $Quant$, which is
-- s = \\c => pred.s ++ np.s ! c ; -- the "kernel" of a determiner. It is, however, the $Num$ that determines
-- a = np.a -- 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 ** {
-- } ; -- } ;
--
-- PPartNP np v2 = { --2 Common nouns
-- s = \\c => np.s ! c ++ v2.s ! VPPart ;
-- a = np.a -- : 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 ** {
-- } ; -- } ;
--
-- RelNP np rs = { {-
-- s = \\c => np.s ! c ++ "," ++ rs.s ! np.a ; -- : CN -> Adv -> CN ;
-- a = np.a 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 ** {
-- } ; -- } ;
--
-- AdvNP np adv = { -- : CN -> NP -> CN ; -- glass of wine / two kilos of red apples
-- s = \\c => np.s ! c ++ adv.s ; -- PartNP cn np = cn ** {
-- a = np.a
-- } ; -- } ;
--
-- DetQuant quant num = { {-
-- s = quant.s ! num.hasCard ! num.n ++ num.s ! Nom;
-- sp = \\c => case num.hasCard of { -- This is different from the partitive, as shown by many languages.
-- False => quant.sp ! num.hasCard ! num.n ! c ++ num.s ! Nom ;
-- True => quant.sp ! num.hasCard ! num.n ! npNom ++ num.s ! npcase2case c -- : Det -> NP -> NP ;
-- } ; CountNP det np = np **
-- n = num.n ; { } ; -- Nonsense for DefArt or IndefArt
-- hasNum = num.hasCard
-- } ; --3 Conjoinable determiners and ones with adjectives
--
-- DetQuantOrd quant num ord = { -- : DAP -> AP -> DAP ; -- the large (one)
-- s = quant.s ! num.hasCard ! num.n ++ num.s ! Nom ++ ord.s ! Nom; AdjDAP dap ap = dap ** { } ;
-- sp = \\c => quant.sp ! num.hasCard ! num.n ! npNom ++ num.s ! Nom ++ ord.s ! npcase2case c ;
-- n = num.n ; -- : Det -> DAP ; -- this (or that)
-- hasNum = True DetDAP det = det ;
-- } ; -}
--
-- 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 <n,hasCard> of {
-- <Sg,False> => table { NCase Gen => "its"; _ => "it" } ;
-- <Pl,False> => table { NCase Nom => "they"; NPAcc => "them"; NCase Gen => "theirs" } ;
-- _ => \\c => artDef
-- }
-- } ;
--
-- IndefArt = {
-- s = \\hasCard,n => case <n,hasCard> of {
-- <Sg,False> => artIndef ;
-- _ => []
-- } ;
-- sp = \\hasCard,n => case <n,hasCard> of {
-- <Sg,False> => table {NCase Gen => "one's"; _ => "one" };
-- <Pl,False> => 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} ;
--
--}
} }

View File

@@ -1,99 +1,91 @@
concrete NumeralHun of Numeral = CatHun [Numeral,Digits] ** open ResHun in concrete NumeralHun of Numeral = CatHun [Numeral,Digits] **
{ open Prelude, ResHun in {
--{
-- lincat
--lincat Digit,
-- Digit = {s : DForm => CardOrd => Case => Str} ; Sub10 = LinDigit ;
-- Sub10 = {s : DForm => CardOrd => Case => Str ; n : Number} ; Sub100,
-- Sub100 = {s : CardOrd => Case => Str ; n : Number} ; Sub1000,
-- Sub1000 = {s : CardOrd => Case => Str ; n : Number} ; Sub1000000 = ResHun.Numeral ;
-- Sub1000000 = {s : CardOrd => Case => Str ; n : Number} ; lin
--
--lin num x = x ; -- TODO: Add case inflection and ordinal forms to all numerals
--lin n2 = let two = mkNum "two" "twelve" "twenty" "second" in
-- {s = \\f,o => case <f,o> of { -- : Sub1000000 -> Numeral
-- <teen,NOrd> => regGenitiveS "twelfth" ; num x = x ;
-- _ => two.s ! f ! o
-- } -- : Digit
-- } ; n2 = mkNum5 "kettő" "húsz" "két" "huszon" "második" ;
-- n3 = mkNum3 "három" "harminc" "harmadik" ;
--lin n3 = mkNum "three" "thirteen" "thirty" "third" ; n4 = mkNum3 "négy" "negyven" "negyedik" ;
--lin n4 = mkNum "four" "fourteen" "forty" "fourth" ; n5 = mkNum3 "öt" "ötven" "ötödik" ;
--lin n5 = mkNum "five" "fifteen" "fifty" "fifth" ; n6 = mkNum3 "hat" "hatvan" "hatodik" ;
--lin n6 = regNum "six" ; n7 = mkNum3 "hét" "hetven" "hetedik" ;
--lin n7 = regNum "seven" ; n8 = mkNum3 "nyolc" "nyolcvan" "nyolcadik" ;
--lin n8 = mkNum "eight" "eighteen" "eighty" "eighth" ; n9 = mkNum3 "kilenc" "kilencven" "kilencedik" ;
--lin n9 = mkNum "nine" "nineteen" "ninety" "ninth" ;
-- -- : Sub10 ; -- 1
--lin pot01 = mkNum "one" "eleven" "ten" "first" ** {n = Sg} ; pot01 = mkNum3 "egy" "tíz" "első" ** {n=Sg} ;
--lin pot0 d = d ** {n = Pl} ; -- : Digit -> Sub10 ; -- d * 1
--lin pot110 = regCardOrd "ten" ** {n = Pl} ; pot0 d = d ;
--lin pot111 = regCardOrd "eleven" ** {n = Pl} ;
--lin pot1to19 d = {s = d.s ! teen} ** {n = Pl} ; -- : Sub100 ; -- 10
--lin pot0as1 n = {s = n.s ! unit} ** {n = n.n} ; pot110 = {s = table {p => "tíz"} ; n=Pl} ;
--lin pot1 d = {s = d.s ! ten} ** {n = Pl} ; -- : Sub100 ; -- 11
--lin pot1plus d e = { pot111 = {s = table {p => "tizenegy"} ; n=Pl} ;
-- s = \\o,c => d.s ! ten ! NCard ! Nom ++ "-" ++ e.s ! unit ! o ! c ; n = Pl} ; -- : Digit -> Sub100 ; -- 10 + d
--lin pot1as2 n = n ; pot1to19 d =
--lin pot2 d = {s = \\o,c => d.s ! unit ! NCard ! Nom ++ mkCard o "hundred" ! c} ** {n = Pl} ; {s = table {p => "tizen" ++ d.s ! <Unit,p>} ;
--lin pot2plus d e = { n = Pl} ;
-- s = \\o,c => d.s ! unit ! NCard ! Nom ++ "hundred" ++ "and" ++ e.s ! o ! c ; n = Pl} ; -- : Sub10 -> Sub100 ; -- coercion of 1..9
--lin pot2as3 n = n ; pot0as1 n =
--lin pot3 n = { {s = table {p => n.s ! <Unit,p>} ;
-- s = \\o,c => n.s ! NCard ! Nom ++ mkCard o "thousand" ! c ; n = Pl} ; n = Pl} ;
--lin pot3plus n m = {
-- s = \\o,c => n.s ! NCard ! Nom ++ "thousand" ++ m.s ! o ! c; n = Pl} ; -- : Digit -> Sub100 ; -- d * 10
-- pot1 d =
---- numerals as sequences of digits {s = table {p => d.s ! <Ten,p>} ;
-- n = Pl} ;
-- lincat -- : Digit -> Sub10 -> Sub100 ; -- d * 10 + n
-- Dig = TDigit ; pot1plus d e =
-- {s = table {p => (d.s ! <Ten,Attrib>) ++ e.s ! <Unit,p>} ;
-- lin n = Pl} ;
-- IDig d = d ** {tail = T1} ;
-- -- : Sub100 -> Sub1000 ; -- coercion of 1..99
-- IIDig d i = { pot1as2 n = n ;
-- s = \\o,c => d.s ! NCard ! Nom ++ commaIf i.tail ++ i.s ! o ! c ; -- : Sub10 -> Sub1000 ; -- m * 100
-- n = Pl ; pot2 d =
-- tail = inc i.tail {s = table {p => (d.s ! <Unit,Attrib>) ++ "száz"} ;
-- } ; n = Pl} ;
-- -- : Sub10 -> Sub100 -> Sub1000 ; -- m * 100 + n
-- D_0 = mkDig "0" ; pot2plus d e =
-- D_1 = mk3Dig "1" "1st" Sg ; {s = table {p => (d.s ! <Unit,Attrib>) ++ "száz" ++ e.s ! p} ;
-- D_2 = mk2Dig "2" "2nd" ; n = Pl} ;
-- D_3 = mk2Dig "3" "3rd" ;
-- D_4 = mkDig "4" ; -- : Sub1000 -> Sub1000000 ; -- coercion of 1..999
-- D_5 = mkDig "5" ; pot2as3 n = n ;
-- D_6 = mkDig "6" ; -- : Sub1000 -> Sub1000000 ; -- m * 1000
-- D_7 = mkDig "7" ; pot3 n =
-- D_8 = mkDig "8" ; {s = table {p => n.s ! Attrib ++ "ezer"} ;
-- D_9 = mkDig "9" ; n = Pl} ;
-- -- : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n
-- oper pot3plus n m =
-- commaIf : DTail -> Str = \t -> case t of { {s = table {p => n.s ! Attrib ++ "ezer" ++ m.s ! p} ;
-- T3 => BIND++","++BIND ; n = Pl} ;
-- _ => BIND
-- } ; oper
-- LinDigit : Type = {s : DForm*Place => Str ; n : Number} ;
-- inc : DTail -> DTail = \t -> case t of {
-- T1 => T2 ; mkNum3 : (x1,_,x3 : Str) -> LinDigit = \három,harminc,harmadik ->
-- T2 => T3 ; mkNum5 három harminc három harminc harmadik ;
-- T3 => T1
-- } ; mkNum5 : (x1,_,_,_,x5 : Str) -> LinDigit = \ui,ti,ua,ta,ord -> {
-- s = table {<Unit,Indep> => ui ;
-- mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ; <Ten,Indep> => ti ;
-- mkDig : Str -> TDigit = \c -> mk2Dig c (c + "th") ; <Unit,Attrib> => ua ;
-- <Ten, Attrib> => ta } ;
-- mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> { -- ord = ord ; -- TODO figure out where to use ordinal
-- s = table {NCard => regGenitiveS c ; NOrd => regGenitiveS o} ; n = Pl
-- n = n } ;
-- } ;
--
-- TDigit = {
-- n : Number ;
-- s : CardOrd => Case => Str
-- } ;
--
--}
} }

View File

@@ -1,733 +1,141 @@
--# -path=.:../abstract:../../prelude:../common resource ParadigmsHun = open CatHun, ResHun, ParamHun, NounHun, Prelude in {
--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.
--
oper oper
mkN = overload {
mkN : Str -> Noun = --2 Parameters
\s -> lin N (regNoun s) ; --
-- 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 : 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 ;
--
--
--
-- } ; -- } ;
-- 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}) ;
} ;
--------------------------------------------------------------------------------
} }

82
src/hungarian/ParamHun.gf Normal file
View File

@@ -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 <pn.p1,pn.p2> of {
<p,n> => VFin p n
} ;
--------------------------------------------------------------------------------
-- Clauses
-- param
-- ClType =
-- Statement
-- | PolarQuestion
-- | WhQuestion
-- | Subord ;
}

View File

@@ -1,32 +1,29 @@
concrete PhraseHun of Phrase = CatHun ** open Prelude, ResHun in concrete PhraseHun of Phrase = CatHun ** open Prelude, ResHun in {
{
--{ lin
-- PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
-- lin
-- PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; UttS s = s ;
-- UttQS qs = qs ;
-- UttS s = s ; UttIAdv iadv = iadv ;
-- UttQS qs = {s = qs.s ! QDir} ; {-
-- UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg False} ; UttImpSg pol imp =
-- UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Pl False} ; UttImpPl pol imp =
-- UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg True} ; UttImpPol = UttImpSg ;
--
-- UttIP ip = {s = ip.s ! npNom} ; --- Acc also UttIP ip = {s = ip.s ! } ;
-- UttIAdv iadv = iadv ; UttNP np = {s = np.s ! } ;
-- UttNP np = {s = np.s ! npNom} ; UttVP vp = {s = } ;
-- UttVP vp = {s = infVP VVInf vp (agrP3 Sg)} ; UttAdv adv = {s = } ;
-- UttAdv adv = adv ; UttCN n = {s = } ;
-- UttCN n = {s = n.s ! Sg ! Nom} ; UttCard n = {s = } ;
-- UttCard n = {s = n.s ! Nom} ; UttAP ap = { s = ap.s ! } ;
-- UttAP ap = {s = ap.s ! agrP3 Sg} ; UttInterj i = i ;
-- UttInterj i = i ; -}
-- NoPConj = {s = []} ;
-- NoPConj = {s = []} ; -- PConjConj conj = {s = conj.s1 ++ conj.s2 ! …} ;
-- PConjConj conj = {s = conj.s2} ; ---
-- NoVoc = {s = []} ;
-- NoVoc = {s = []} ; -- VocNP np = { s = "," ++ np.s ! … } ; -}
-- VocNP np = {s = "," ++ np.s ! npNom} ;
--
--}
} }

View File

@@ -1,73 +1,77 @@
concrete QuestionHun of Question = CatHun ** open ResHun, Prelude in concrete QuestionHun of Question = CatHun ** open
{ Prelude, ResHun, ParadigmsHun, (NH=NounHun) in {
--{
-- -- A question can be formed from a clause ('yes-no question') or
-- flags optimize=all_subs ; -- with an interrogative.
--
-- lin {-
-- lin
-- QuestCl cl = { -- : Cl -> QCl ;
-- s = \\t,a,p => QuestCl =
-- let cls = cl.s ! t ! a ! p
-- in table { -- : IP -> VP -> QCl ;
-- QDir => cls ! OQuest ; QuestVP ip vp =
-- QIndir => "if" ++ cls ! ODir
-- } ---- "whether" in ExtHun -- : IP -> ClSlash -> QCl ; -- whom does John love
-- } ; QuestSlash ip cls =
--
-- QuestVP qp vp = -- : IAdv -> Cl -> QCl ; -- why does John walk
-- let cl = mkClause (qp.s ! npNom) (agrP3 qp.n) vp QuestIAdv iadv cls =
-- in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ;
--
-- QuestSlash ip slash = -- : IComp -> NP -> QCl ; -- where is John?
-- mkQuestion (ss (slash.c2 ++ ip.s ! NPAcc)) slash ; QuestIComp icomp np =
-- --- stranding in ExratHun
--
-- QuestIAdv iadv cl = mkQuestion iadv cl ; -- Interrogative pronouns can be formed with interrogative
-- -- determiners, with or without a noun.
-- QuestIComp icomp np =
-- mkQuestion icomp (mkClause (np.s ! npNom) np.a (predAux auxBe)) ; -- : IDet -> CN -> IP ; -- which five songs
-- IdetCN idet cn = {…} ** NH.DetCN idet cn ;
--
-- PrepIP p ip = {s = p.s ++ ip.s ! NPAcc} ; -- : IDet -> IP ; -- which five
-- IdetIP idet = {…} ** NH.DetNP idet ;
-- AdvIP ip adv = {
-- s = \\c => ip.s ! c ++ adv.s ; -- They can be modified with adverbs.
-- n = ip.n -- : IP -> Adv -> IP ; -- who in Paris
-- } ; --AdvIP = NH.AdvNP ;
--
-- IdetCN idet cn = { -- Interrogative quantifiers have number forms and can take number modifiers.
-- s = \\c => idet.s ++ cn.s ! idet.n ! npcase2case c ;
-- n = idet.n -- : IQuant -> Num -> IDet ; -- which (five)
-- } ; IdetQuant = NH.DetQuant ;
--
-- IdetIP idet = { -- Interrogative adverbs can be formed prepositionally.
-- s = \\c => idet.s ; -- : Prep -> IP -> IAdv ; -- with whom
-- n = idet.n PrepIP prep ip = ;
-- } ;
-- -- They can be modified with other adverbs.
-- IdetQuant idet num = {
-- s = idet.s ! num.n ++ num.s ! Nom ; -- : IAdv -> Adv -> IAdv ; -- where in Paris
-- n = num.n -- AdvIAdv iadv adv =
-- } ;
-- -- Interrogative complements to copulas can be both adverbs and
-- AdvIAdv i a = ss (i.s ++ a.s) ; -- pronouns.
--
-- CompIAdv a = a ; -- : IAdv -> IComp ;
-- CompIP p = ss (p.s ! npNom) ; CompIAdv iadv = iadv ; -- where (is it)
--
-- lincat -- : IP -> IComp ;
-- QVP = ResHun.VP ; CompIP ip = {s = ip.s ! Abs} ; -- who (is it)
-- lin
-- ComplSlashIP vp np = insertObjPre (\\_ => vp.c2 ++ np.s ! NPAcc) vp ;
-- AdvQVP vp adv = insertObj (\\_ => adv.s) vp ; -- More $IP$, $IDet$, and $IAdv$ are defined in $Structural$.
-- AddAdvQVP vp adv = insertObj (\\_ => adv.s) vp ;
-- -- Wh questions with two or more question words require a new, special category.
-- QuestQVP qp vp =
-- let cl = mkClause (qp.s ! npNom) (agrP3 qp.n) vp cat
-- in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ; 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
-}
} }

View File

@@ -1,56 +1,22 @@
concrete RelativeHun of Relative = CatHun ** open ResHun in concrete RelativeHun of Relative = CatHun ** open
{ ResHun, Prelude, (NS=NounHun), (SS=StructuralHun) in {
--{
-- {-
-- flags optimize=all_subs ; lin
-- -- : Cl -> RCl ; -- such that John loves her
-- lin -- RelCl cl = ;
--
-- RelCl cl = { -- : RP -> VP -> RCl ;
-- s = \\t,a,p,_ => "such" ++ "that" ++ cl.s ! t ! a ! p ! ODir ; RelVP rp vp =
-- c = npNom
-- } ; -- : RP -> ClSlash -> RCl ; -- whom John loves
-- RelSlash rp cls =
-- RelVP rp vp = {
-- s = \\t,ant,b,ag => -- : RP ;
-- let IdRP = {s = ""} ;
-- agr = case rp.a of {
-- RNoAg => ag ; -- : Prep -> NP -> RP -> RP ; -- the mother of whom
-- RAg a => a --FunRP prep np rp = {} ;
-- } ; -}
-- 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
-- } ;
--
--}
} }

View File

@@ -4,28 +4,13 @@
-- This module contains operations that are needed to make the -- 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 ; -- Nouns
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 oper
Noun = {s : Number => Case => Str} ; Noun = {s : Number => Case => Str} ;
@@ -77,476 +62,228 @@ resource ResHun = ParamX ** open Prelude in
putHarmEnding : HarmForms -> Str -> Str = \hs,w -> putHarmEnding : HarmForms -> Str -> Str = \hs,w ->
w + useHarm (getHarm w) hs ; w + useHarm (getHarm w) hs ;
regNoun : Str -> Noun = \w -> { mkNoun : Str -> Noun = \w -> {
s = \\n,c => s = \\n,c =>
let h = getHarm w let h = getHarm w
in in
w + useHarm h (endNumber n) + useHarm h (endCase c) w + useHarm h (endNumber n) + useHarm h (endCase c)
} ; } ;
---------------------------------------------
-- NP
-- NounPhrase : Type = {
-- param s : Case => Str ;
-- Agr = AgP1 Number | AgP2 Number | AgP3Sg Gender | AgP3Pl ; agr : Person*Number ;
-- isPron : Bool ;
-- param empty : Str ; -- standard trick for pro-drop
-- Gender = Neutr | Masc | Fem ; } ;
--
-- emptyNP : NounPhrase = {
----2 For $Verb$ s = \\_ => [] ;
-- agr = <P3,Sg> ;
---- Only these five forms are needed for open-lexicon verbs. isPron = False ;
-- empty = [] ;
-- param } ;
-- VForm =
-- VInf indeclNP : Str -> NounPhrase = \s -> emptyNP ** {s = \\c => s} ;
-- | VPres
-- | VPPart --------------------------------------------------------------------------------
-- | VPresPart -- Pronouns
-- | VPast --# notpresent
-- ; Pronoun : Type = NounPhrase ** {
-- -- poss : { -- for PossPron : Pron -> Quant
---- 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} ; -- Det, Quant, Card, Ord
-- AgP3Pl => {n = Pl ; p = P3 ; g = Masc} ;
-- AgP3Sg g => {n = Sg ; p = P3 ; g = g} -- Quant has variable number:
-- } ; -- e.g. this_Quant has both "this" and "these"
-- Quant : Type = {
-- agrP3 : Number -> Agr = \n -> agrgP3 n Neutr ; s, -- form that comes before noun: "{this} car"
-- sp : Number => Case => Str ; -- independent form, "I like {this}" (DetNP)
-- agrgP3 : Number -> Gender -> Agr = \n,g -> toAgr n P3 g ; } ;
--
-- conjAgr : Agr -> Agr -> Agr = \a0,b0 -> mkQuant : (s,sp : Str) -> Quant = \s,sp -> {
-- let a = fromAgr a0 ; b = fromAgr b0 s = (mkNoun s).s ;
-- in sp = (mkNoun sp).s ;
-- toAgr } ;
-- (conjNumber a.n b.n)
-- (conjPerson a.p b.p) a.g ; -- Det is formed in DetQuant : Quant -> Num -> Det
-- -- so it has an inherent number.
---- For $Lex$. Determiner : Type = {
-- s,
---- For each lexical category, here are the worst-case constructors. sp : Case => Str ;
-- n : Number ;
-- mkNoun : (_,_,_,_ : Str) -> {s : Number => Case => Str} = -- numtype : NumType ; -- Whether its Num component is digit, numeral or Sg/Pl
-- \man,mans,men,mens -> { } ;
-- s = table {
-- Sg => table { Num : Type = {
-- Gen => mans ; s : Place => Str ; -- Independent or attribute
-- _ => man n : Number ; -- Singular or plural
-- } ; -- numtype : NumType ; -- Digit, numeral or Sg/Pl : makes a difference in many languages
-- Pl => table { } ;
-- Gen => mens ;
-- _ => men baseNum : Num = {
-- } s = \\_ => [] ;
-- } n = Sg ;
-- } ; -- numtype = NoNum
-- } ;
-- mkAdjective : (_,_,_,_ : Str) -> {s : AForm => Str; lock_A : {}} =
-- \good,better,best,well -> lin A { {- Numeral can become Num via
-- s = table { Noun.gf: NumNumeral : Numeral -> Card ;
-- AAdj Posit c => (regGenitiveS good) ! c ; Noun.gf: NumCard : Card -> Num ;
-- AAdj Compar c => (regGenitiveS better) ! c ; -}
-- AAdj Superl c => (regGenitiveS best) ! c ; Numeral : Type = Num ** {
-- AAdv => well -- TODO add ordinal
-- } } ;
-- } ;
-- --------------------------------------------------------------------------------
-- mkVerb : (_,_,_,_,_ : Str) -> Verb = -- Postpositions
-- \go,goes,went,gone,going -> {
-- s = table { Postposition : Type = {s : Str ; c : Case} ;
-- VInf => go ;
-- VPres => goes ; mkPrep : Str -> Postposition = \str -> {s=str ; c=Nom} ;
-- VPast => went ; --# notpresent
-- VPPart => gone ; emptyPP : Postposition = mkPrep [] ;
-- VPresPart => going
-- } ; ------------------
-- isRefl = False -- Conj
-- } ;
-- Conj : Type = {
-- mkIP : (i,me,my : Str) -> Number -> {s : NPCase => Str ; n : Number} = s1 : Str ;
-- \i,me,my,n -> let who = mkNP i me my n P3 Neutr in { s2 : Str ;
-- s = who.s ; n : Number ;
-- n = n } ;
-- } ;
-- --------------------------------------------------------------------------------
-- mkNP : (i,me,my : Str) -> Number -> Person -> Gender -> -- Adjectives
-- {s : NPCase => Str ; a : Agr} = \i,me,my,n,p,g ->
-- { s = table { Adjective : Type = {s : Number => Str} ;
-- NCase Nom => i ;
-- NPAcc => me ; mkAdj : Str -> Adjective = \sg -> {
-- NCase Gen => my s = \\n =>
-- } ; let h = getHarm sg
-- a = toAgr n p g ; in sg + useHarm h (endNumber n)
-- }; } ;
--
-- regNP : Str -> Number -> {s : NPCase => Str ; a : Agr} = \that,n -> --------------------------------------------------------------------------------
-- mkNP that that (that + "'s") n P3 Neutr ; -- Verbs
--
-- regGenitiveS : Str -> Case => Str = \s -> verbEndings : Person*Number => HarmForms = table {
-- table { Gen => genitiveS s; _ => s } ; <P1,Sg> => harm3 "ok" "ek" "ök" ;
-- <P2,Sg> => harm1 "sz" ;
-- genitiveS : Str -> Str = \dog -> <P3,Sg> => harm1 [] ;
-- case last dog of { <P1,Pl> => harm "unk" "ünk" ;
-- "s" => dog + "'" ; <P2,Pl> => harm3 "tok" "tek" "tök" ; -- TODO allomorphs -otok, -etek, -ötök
-- _ => dog + "'s" <P3,Pl> => harm "nak" "nek" -- TODO allomorphs -anak, -enek
-- }; } ;
--
---- We have just a heuristic definition of the indefinite article. Verb : Type = {
---- There are lots of exceptions: consonantic "e" ("euphemism"), consonantic s : VForm => Str ;
---- "o" ("one-sided"), vocalic "u" ("umbrella"). sc : Case ; -- subject case
-- } ;
-- artIndef = pre { Verb2 : Type = Verb ** {
-- "eu" | "Eu" | "uni" | "up" => "a" ; c2 : Case -- object case
-- "un" => "an" ; } ;
-- "a" | "e" | "i" | "o" | "A" | "E" | "I" | "O" => "an" ; Verb3 : Type = Verb2 ** {
-- "SMS" | "sms" => "an" ; --- c3 : Case -- indirect object case
-- _ => "a" } ;
-- } ;
-- mkVerb2 : Str -> Verb2 = \sg3 -> vtov2 (mkVerb sg3) ;
-- artDef = "the" ; mkVerb3 : Str -> Verb3 = \sg3 -> v2tov3 (mkVerb2 sg3) ;
--
---- For $Verb$. vtov2 : Verb -> Verb2 = \v -> v ** {c2 = Acc} ;
-- v2tov3 : Verb2 -> Verb3 = \v -> v ** {c3 = Dat} ;
-- Verb : Type = {
-- s : VForm => Str ; mkVerb : (sg3 : Str) -> Verb = mkVerbReg "TODO:infinitive" ; -- TODO
-- isRefl : Bool
-- } ; mkVerbReg : (inf, sg3 : Str) -> Verb = \inf,sg3 ->
-- let harmony : Harm = getHarm sg3 ;
-- param sg1 : Str = sg3 + useHarm harmony (verbEndings!<P1,Sg>) ;
-- CPolarity = sg2 : Str = sg3 + "sz" ;
-- CPos pl1 : Str = sg3 + useHarm harmony (verbEndings!<P1,Pl>) ;
-- | CNeg Bool ; -- contracted or not pl2 : Str = sg3 + useHarm harmony (verbEndings!<P2,Pl>) ;
-- pl3 : Str = sg3 + useHarm harmony (verbEndings!<P3,Pl>) ;
-- oper in mkVerbFull sg1 sg2 sg3 pl1 pl2 pl3 inf ;
-- contrNeg : Bool -> Polarity -> CPolarity = \b,p -> case p of {
-- Pos => CPos ; mkVerbFull : (x1,_,_,_,_,_,x7 : Str) -> Verb =
-- Neg => CNeg b \sg1,sg2,sg3,pl1,pl2,pl3,inf -> {
-- } ; s = table {
-- VInf => inf ;
-- VerbForms : Type = VFin P1 Sg => sg1 ;
-- Tense => Anteriority => CPolarity => Order => Agr => VFin P2 Sg => sg2 ;
-- {aux, adv, fin, inf : Str} ; -- would, not, sleeps, slept VFin P3 Sg => sg3 ;
-- VFin P1 Pl => pl1 ;
-- VP : Type = { VFin P2 Pl => pl2 ;
-- s : VerbForms ; VFin P3 Pl => pl3
-- prp : Str ; -- present participle } ;
-- ptp : Str ; -- past participle sc = Nom
-- inf : Str ; -- the infinitive form ; VerbForms would be the logical place } ;
-- ad : Str ; -- sentence adverb
-- s2 : Agr => Str -- complement copula : Verb = mkVerbFull
-- } ; "vagyok"
-- "vagy"
-- "van"
-- SlashVP = VP ** {c2 : Str} ; "vagyunk"
-- "vagytok"
-- predVc : (Verb ** {c2 : Str}) -> SlashVP = \verb -> "vannak"
-- predV verb ** {c2 = verb.c2} ; "lenni" ;
--
-- predV : Verb -> VP = \verb -> { ------------------
-- s = \\t,ant,b,ord,agr => -- VP
-- let
-- inf = verb.s ! VInf ; VerbPhrase : Type = Verb ** {
-- fin = presVerb verb agr ; obj : Str ;
-- part = verb.s ! VPPart ; adv : Str ;
-- in } ; -- TODO more fields
-- case <t,ant,b,ord> of {
-- <Pres,Simul,CPos,ODir> => vff fin [] ; VPSlash : Type = Verb2 ** {
-- <Pres,Simul,CPos,OQuest> => vf (does agr) inf ; adv : Str ;
-- <Pres,Anter,CPos,_> => vf (have agr) part ; --# notpresent } ;
-- <Pres,Anter,CNeg c,_> => vfn c (have agr) (havent agr) part ; --# notpresent
-- <Past,Simul,CPos,ODir> => vff (verb.s ! VPast) [] ; --# notpresent useV : Verb -> VerbPhrase = \v -> v ** {
-- <Past,Simul,CPos,OQuest> => vf "did" inf ; --# notpresent obj,adv = [] ;
-- <Past,Simul,CNeg c,_> => vfn c "did" "didn't" inf ; --# notpresent } ;
-- <Past,Anter,CPos,_> => vf "had" part ; --# notpresent
-- <Past,Anter,CNeg c,_> => vfn c "had" "hadn't" part ; --# notpresent useVc : Verb2 -> VPSlash = \v2 -> v2 ** {
-- <Fut, Simul,CPos,_> => vf "will" inf ; --# notpresent adv = [] ;
-- <Fut, Simul,CNeg c,_> => vfn c "will" "won't" inf ; --# notpresent } ;
-- <Fut, Anter,CPos,_> => vf "will" ("have" ++ part) ; --# notpresent
-- <Fut, Anter,CNeg c,_> => vfn c "will" "won't"("have" ++ part) ; --# notpresent insertObj : VPSlash -> NounPhrase -> VerbPhrase = \vps,np -> vps ** {
-- <Cond,Simul,CPos,_> => vf "would" inf ; --# notpresent obj = np.s ! vps.c2 ;
-- <Cond,Simul,CNeg c,_> => vfn c "would" "wouldn't" inf ; --# notpresent } ;
-- <Cond,Anter,CPos,_> => vf "would" ("have" ++ part) ; --# notpresent
-- <Cond,Anter,CNeg c,_> => vfn c "would" "wouldn't" ("have" ++ part) ; --# notpresent insertAdv : VerbPhrase -> SS -> VerbPhrase = \vp,adv -> vp ** {adv = adv.s} ;
-- <Pres,Simul,CNeg c,_> => vfn c (does agr) (doesnt agr) inf insertAdvSlash : VPSlash -> SS -> VPSlash = \vps,adv -> vps ** {adv = adv.s} ;
-- } ;
-- prp = verb.s ! VPresPart ; --------------------------------------------------------------------------------
-- ptp = verb.s ! VPPart ; -- Cl, S
-- inf = verb.s ! VInf ;
-- ad = [] ; Clause : Type = {s : Tense => Anteriority => Polarity => Str} ;
-- s2 = \\a => if_then_Str verb.isRefl (reflPron ! a) []
-- } ; {- After PredVP, we might still want to add more adverbs (QuestIAdv),
-- but we're done with verb inflection.
-- predAux : Aux -> VP = \verb -> { -}
-- s = \\t,ant,cb,ord,agr => ClSlash : Type = Clause ;
-- let
-- b = case cb of { QClause : Type = Clause ;
-- CPos => Pos ;
-- _ => Neg -- RClause : Type = {s : NForm => Tense => Anteriority => Polarity => Str} ;
-- } ;
-- inf = verb.inf ; Sentence : Type = {s : Str} ;
-- fin = verb.pres ! b ! agr ;
-- finp = verb.pres ! Pos ! agr ; predVP : NounPhrase -> VerbPhrase -> ClSlash = \np,vp -> vp ** {
-- part = verb.ppart ; s = \\t,a,p =>
-- in np.s ! vp.sc
-- case <t,ant,cb,ord> of { ++ vp.obj
-- <Pres,Anter,CPos,_> => vf (have agr) part ; --# notpresent ++ vp.adv
-- <Pres,Anter,CNeg c,_> => vfn c (have agr) (havent agr) part ; --# notpresent ++ vp.s ! agr2vf np.agr
-- <Past,Simul,CPos, _> => vf (verb.past ! b ! agr) [] ; --# notpresent } ;
-- <Past,Simul,CNeg c, _> => vfn c (verb.past!Pos!agr)(verb.past!Neg!agr) [] ; --# notpresent
-- <Past,Anter,CPos,_> => vf "had" part ; --# notpresent --------------------------------------------------------------------------------
-- <Past,Anter,CNeg c,_> => vfn c "had" "hadn't" part ; --# notpresent -- linrefs
-- <Fut, Simul,CPos,_> => vf "will" inf ; --# notpresent
-- <Fut, Simul,CNeg c,_> => vfn c "will" "won't" inf ; --# notpresent
-- <Fut, Anter,CPos,_> => vf "will" ("have" ++ part) ; --# notpresent
-- <Fut, Anter,CNeg c,_> => vfn c "will" "won't"("have" ++ part) ; --# notpresent
-- <Cond,Simul,CPos,_> => vf "would" inf ; --# notpresent
-- <Cond,Simul,CNeg c,_> => vfn c "would" "wouldn't" inf ; --# notpresent
-- <Cond,Anter,CPos,_> => vf "would" ("have" ++ part) ; --# notpresent
-- <Cond,Anter,CNeg c,_> => vfn c "would" "wouldn't" ("have" ++ part) ; --# notpresent
-- <Pres,Simul,CPos, _> => vf fin [] ;
-- <Pres,Simul,CNeg c, _> => 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 <b,a> of {
-- <Pos,AgP1 Sg> => "am" ;
-- <Neg,AgP1 Sg> => ["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
-- }
-- } ;
--
--
--}
} }

View File

@@ -1,75 +1,79 @@
concrete SentenceHun of Sentence = CatHun ** open Prelude, ResHun in concrete SentenceHun of Sentence = CatHun ** open
{ TenseX, ResHun, (AK=AdverbHun), Prelude in {
--{
-- flags optimize=all_subs ;
-- flags optimize=all_subs ;
-- lin
-- lin
-- --2 Clauses
-- PredVP np vp = mkClause (np.s ! npNom) np.a vp ;
-- -- : NP -> VP -> Cl
-- PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ; PredVP = predVP ;
--
-- ImpVP vp = { -- : SC -> VP -> Cl ; -- that she goes is good (Saeed p. 94)
-- s = \\pol,n => --PredSCVP sc vp = ;
-- let
-- agr = AgP2 (numImp n) ; --2 Clauses missing object noun phrases
-- verb = infVP VVAux vp agr ; -- : NP -> VPSlash -> ClSlash ;
-- dont = case pol of { -- SlashVP = predVP ;
-- CNeg True => "don't" ; {-
-- CNeg False => "do" ++ "not" ; -- : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today
-- _ => [] AdvSlash cls adv = cls ** insertAdv adv cls ;
-- }
-- in -- SlashPrep : Cl -> Prep -> ClSlash ; -- (with whom) he walks
-- dont ++ verb
-- } ; -- : NP -> VS -> SSlash -> ClSlash ; -- (whom) she says that he loves
-- -- SlashVS np vs ss = {} ;
-- SlashVP np vp =
-- mkClause (np.s ! npNom) np.a vp ** {c2 = vp.c2} ;
-- -- : Temp -> Pol -> ClSlash -> SSlash ; -- (that) she had not seen
-- AdvSlash slash adv = { UseSlash t p cls = {
-- s = \\t,a,b,o => slash.s ! t ! a ! b ! o ++ adv.s ; } ;
-- c2 = slash.c2
-- } ; --2 Imperatives
-- -- : VP -> Imp ;
-- SlashPrep cl prep = cl ** {c2 = prep.s} ; ImpVP vp = {s = \\num,pol => linVP (VImp num pol) Statement vp} ;
--
-- SlashVS np vs slash = --2 Embedded sentences
-- mkClause (np.s ! npNom) np.a
-- (insertObj (\\_ => conjThat ++ slash.s) (predV vs)) ** -- : S -> SC ;
-- {c2 = slash.c2} ; EmbedS s = {s = s.s ! True} ; -- choose subordinate
--
-- EmbedS s = {s = conjThat ++ s.s} ; -- : QS -> SC ;
-- EmbedQS qs = {s = qs.s ! QIndir} ; -- EmbedQS qs = { } ;
-- EmbedVP vp = {s = infVP VVInf vp (agrP3 Sg)} ; --- agr
-- -- : VP -> SC ;
-- UseCl t p cl = { EmbedVP vp = {s = infVP vp} ;
-- s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! ODir -}
-- } ; --2 Sentences
-- UseQCl t p cl = {
-- s = \\q => t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! q -- : Temp -> Pol -> Cl -> S ;
-- } ; UseCl t p cl = {
-- UseRCl t p cl = { s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p
-- s = \\r => t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! r ; } ;
-- c = cl.c
-- } ; -- : Temp -> Pol -> QCl -> QS ;
-- UseSlash t p cl = { UseQCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p} ;
-- s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! ODir ;
-- c2 = cl.c2 -- : Temp -> Pol -> RCl -> RS ;
-- } ; -- UseRCl t p cl = {s = } ;
--
-- AdvS a s = {s = a.s ++ s.s} ; -- AdvS : Adv -> S -> S ; -- then I will go home
-- ExtAdvS a s = {s = a.s ++ "," ++ s.s} ; AdvS = advS "" ;
--
-- SSubjS a s b = {s = a.s ++ s.s ++ b.s} ; -- ExtAdvS : Adv -> S -> S ; -- next week, I will go home
-- ExtAdvS = advS (SOFT_BIND ++ ",");
-- RelS s r = {s = s.s ++ "," ++ r.s ! agrP3 Sg} ;
-- -- : S -> Subj -> S -> S ;
-- oper -- SSubjS s1 subj s2 = AdvS (AK.SubjS subj s2) s1 ;
-- ctr : CPolarity -> CPolarity = \x -> x ;
----- ctr = contrNeg True ; -- contracted negations -- : 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
} ;
} }

View File

@@ -1,148 +1,168 @@
concrete StructuralHun of Structural = CatHun ** concrete StructuralHun of Structural = CatHun **
open MorphoHun, ResHun, ParadigmsHun, open Prelude, ResHun, ParadigmsHun in {
(C = ConstructX), Prelude in {-
{ -------
--{ -- Ad*
--
-- flags optimize=all ; lin almost_AdA = mkAdA "" ;
-- lin almost_AdN = ss "" ;
-- lin lin at_least_AdN = ss "" ;
-- above_Prep = mkPrep "above" ; lin at_most_AdN = ss "" ;
-- after_Prep = mkPrep "after" ; lin so_AdA = mkAdA "" ;
-- all_Predet = ss "all" ; lin too_AdA = mkAdA "" ;
-- almost_AdA = mkAdA "almost" ; lin very_AdA = mkAdA "" ;
-- almost_AdN = mkAdN "almost" ;
-- although_Subj = ss "although" ; lin as_CAdv = { s = "" ; p = [] } ;
-- always_AdV = mkAdV "always" ; lin less_CAdv = { s = "" ; p = [] } ;
-- and_Conj = mkConj "and" ; lin more_CAdv = { s = "" ; p = [] } ;
-- because_Subj = ss "because" ; lin how_IAdv = ss "" :
-- before_Prep = mkPrep "before" ;
-- behind_Prep = mkPrep "behind" ; lin how8much_IAdv = ss "" ;
-- between_Prep = mkPrep "between" ; lin when_IAdv = ss "" ;
-- both7and_DConj = mkConj "both" "and"; lin where_IAdv = ss "" :
-- but_PConj = ss "but" ; lin why_IAdv = ss "" :
-- by8agent_Prep = mkPrep "by" ;
-- by8means_Prep = mkPrep "by" ; lin always_AdV = ss "" ;
-- can8know_VV, can_VV = {
-- s = table { lin everywhere_Adv = ss "" ;
-- VVF VInf => ["be able to"] ; lin here7from_Adv = ss "" ;
-- VVF VPres => "can" ; lin here7to_Adv = ss "" ;
-- VVF VPPart => ["been able to"] ; lin here_Adv = ss "" ;
-- VVF VPresPart => ["being able to"] ; lin quite_Adv = ss "" ;
-- VVF VPast => "could" ; --# notpresent lin somewhere_Adv = ss "" ;
-- VVPastNeg => "couldn't" ; --# notpresent lin there7from_Adv = ss "" ;
-- VVPresNeg => "can't" lin there7to_Adv = ss "" ;
-- } ; lin there_Adv = ss "" ;
-- typ = VVAux
-- } ; -------
-- during_Prep = mkPrep "during" ; -- Conj
-- either7or_DConj = mkConj "either" "or" singular ;
-- everybody_NP = regNP "everybody" singular ; lin and_Conj =
-- every_Det = mkDeterminer singular "every" ; lin or_Conj =
-- everything_NP = regNP "everything" singular ; lin if_then_Conj =
-- everywhere_Adv = mkAdv "everywhere" ; lin both7and_DConj =
-- few_Det = mkDeterminer plural "few" ; lin either7or_DConj =
----- first_Ord = ss "first" ; DEPRECATED
-- for_Prep = mkPrep "for" ; lin but_PConj = ss "" ;
-- from_Prep = mkPrep "from" ; lin otherwise_PConj = ss "" ;
-- he_Pron = mkPron "he" "him" "his" "his" singular P3 masculine ; lin therefore_PConj = ss "" ;
-- here_Adv = mkAdv "here" ;
-- here7to_Adv = mkAdv ["to here"] ; -----------------
-- here7from_Adv = mkAdv ["from here"] ; -- *Det and Quant
-- how_IAdv = ss "how" ;
-- how8much_IAdv = ss "how much" ;
-- how8many_IDet = mkDeterminer plural ["how many"] ; lin how8many_IDet = ;
-- if_Subj = ss "if" ;
-- in8front_Prep = mkPrep ["in front of"] ; lin all_Predet = {s = ""} ;
-- i_Pron = mkPron "I" "me" "my" "mine" singular P1 human ; lin not_Predet = {s = ""} ;
-- in_Prep = mkPrep "in" ; lin only_Predet = {s = ""} ;
-- it_Pron = mkPron "it" "it" "its" "its" singular P3 nonhuman ; lin most_Predet = {s = ""} ;
-- less_CAdv = C.mkCAdv "less" "than" ;
-- many_Det = mkDeterminer plural "many" ;
-- more_CAdv = C.mkCAdv "more" "than" ; lin every_Det =
-- most_Predet = ss "most" ; lin few_Det =
-- much_Det = mkDeterminer singular "much" ; lin many_Det =
-- must_VV = { lin much_Det =
-- s = table {
-- VVF VInf => ["have to"] ; lin somePl_Det =
-- VVF VPres => "must" ; lin someSg_Det =
-- VVF VPPart => ["had to"] ; lin no_Quant =
-- VVF VPresPart => ["having to"] ; -}
-- VVF VPast => ["had to"] ; --# notpresent lin that_Quant = mkQuant "az" "az" ;
-- VVPastNeg => ["hadn't to"] ; --# notpresent lin this_Quant = mkQuant "ez" "ez" ;
-- VVPresNeg => "mustn't" {-lin which_IQuant =
-- } ;
-- typ = VVAux
-- } ; -----
-----b no_Phr = ss "no" ; -- NP
-- no_Utt = ss "no" ;
-- on_Prep = mkPrep "on" ; lin everybody_NP = defNP "" N.NumPl ;
------ one_Quant = mkDeterminer singular "one" ; -- DEPRECATED lin everything_NP = defNP "" N.NumSg ;
-- only_Predet = ss "only" ; lin nobody_NP = mkVerb; ""
-- or_Conj = mkConj "or" singular ; lin nothing_NP = defNP "" N.NumSg ;
-- otherwise_PConj = ss "otherwise" ; lin somebody_NP = defNP "" N.NumSg ;
-- part_Prep = mkPrep "of" ; lin something_NP = defNP "" N.NumSg ;
-- please_Voc = ss "please" ;
-- possess_Prep = mkPrep "of" ; oper
-- quite_Adv = mkAdv "quite" ; defNP : Str -> Num -> NP = {} ;
-- she_Pron = mkPron "she" "her" "her" "hers" singular P3 feminine ; -}
-- so_AdA = mkAdA "so" ;
-- somebody_NP = regNP "somebody" singular ; -------
-- someSg_Det = mkDeterminer singular "some" ; -- Prep
-- somePl_Det = mkDeterminer plural "some" ;
-- something_NP = regNP "something" singular ; -- lin above_Prep = mkPrep ""
-- somewhere_Adv = mkAdv "somewhere" ; -- lin after_Prep = mkPrep ""
-- that_Quant = mkQuant "that" "those" ; -- lin before_Prep = mkPrep "" ;
-- there_Adv = mkAdv "there" ; -- lin behind_Prep = mkPrep "" ;
-- there7to_Adv = mkAdv "there" ; -- lin between_Prep = = mkPrep "" ;
-- there7from_Adv = mkAdv ["from there"] ; -- lin by8agent_Prep = mkPrep ;
-- therefore_PConj = ss "therefore" ; -- lin by8means_Prep = mkPrep ;
-- they_Pron = mkPron "they" "them" "their" "theirs" plural P3 human ; -- lin during_Prep = mkPrep ;
-- this_Quant = mkQuant "this" "these" ; -- lin except_Prep = mkPrep ;
-- through_Prep = mkPrep "through" ; -- lin for_Prep = mkPrep "" ;
-- too_AdA = mkAdA "too" ; -- lin from_Prep = mkPrep "" ;
-- to_Prep = mkPrep "to" ; -- lin in8front_Prep = mkPrep "" ;
-- under_Prep = mkPrep "under" ; -- lin in_Prep = mkPrep "" ;
-- very_AdA = mkAdA "very" ; -- lin on_Prep = mkPrep "" ;
-- want_VV = mkVV (regV "want") ; -- lin part_Prep = mkPrep ;
-- we_Pron = mkPron "we" "us" "our" "ours" plural P1 human ; -- lin possess_Prep = mkPrep "" ;
-- whatPl_IP = mkIP "what" "what" "what's" plural ; -- lin through_Prep = mkPrep ;
-- whatSg_IP = mkIP "what" "what" "what's" singular ; -- lin to_Prep = mkPrep "";
-- when_IAdv = ss "when" ; -- lin under_Prep = mkPrep "" ;
-- when_Subj = ss "when" ; -- lin with_Prep = mkPrep "" ;
-- where_IAdv = ss "where" ; -- lin without_Prep = mkPrep "" ;
-- which_IQuant = {s = \\_ => "which"} ;
-----b whichPl_IDet = mkDeterminer plural ["which"] ;
-----b whichSg_IDet = mkDeterminer singular ["which"] ; -------
-- whoPl_IP = mkIP "who" "whom" "whose" plural ; -- Pron
-- whoSg_IP = mkIP "who" "whom" "whose" singular ;
-- why_IAdv = ss "why" ; -- Pronouns are closed class, no constructor in ParadigmsHun.
-- without_Prep = mkPrep "without" ; -- it_Pron =
-- with_Prep = mkPrep "with" ; -- i_Pron =
-----b yes_Phr = ss "yes" ; -- youPol_Pron,
-- yes_Utt = ss "yes" ; -- youSg_Pron =
-- youSg_Pron = mkPron "you" "you" "your" "yours" singular P2 human ; -- he_Pron =
-- youPl_Pron = mkPron "you" "you" "your" "yours" plural P2 human ; -- she_Pron =
-- youPol_Pron = mkPron "you" "you" "your" "yours" singular P2 human ; -- we_Pron =
-- -- youPl_Pron =
-- not_Predet = {s = "not" ; lock_Predet = <>} ; -- they_Pron =
-- no_Quant = mkQuant "no" "no" "none" "none" ;
-- if_then_Conj = mkConj "if" "then" singular ; --lin whatPl_IP = ;
-- nobody_NP = regNP "nobody" singular ; --lin whatSg_IP = :
-- nothing_NP = regNP "nothing" singular ; --lin whoPl_IP = ;
-- --lin whoSg_IP = ;
-- at_least_AdN = mkAdN "at least" ;
-- at_most_AdN = mkAdN "at most" ; -------
-- -- Subj
-- except_Prep = mkPrep "except" ;
-- -- lin although_Subj =
-- as_CAdv = C.mkCAdv "as" "as" ; -- lin because_Subj =
-- -- lin if_Subj =
-- have_V2 = dirV2 (mk5V "have" "has" "had" "had" "having") ; -- lin that_Subj =
-- that_Subj = ss "that" ; -- lin when_Subj =
-- lin language_title_Utt = ss "Hunlish" ;
--
--} ------
-- -- 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 "" ;
-}
} }

View File

@@ -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 } ;
--
--}
} }

View File

@@ -1,63 +1,138 @@
concrete VerbHun of Verb = CatHun ** open ResHun in 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 {
-- --
-- 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 ; -- : 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 ;
} }