From fb678fcd6cf70b385ef68a6d1104e7418c9225b9 Mon Sep 17 00:00:00 2001 From: aarne Date: Wed, 24 Nov 2010 13:20:31 +0000 Subject: [PATCH] Hindi and Urdu as refactored to Hindustani by Shafqat --- lib/src/hindi/AdjectiveHin.gf | 38 +- lib/src/hindi/AdverbHin.gf | 22 +- lib/src/hindi/AllHin.gf | 7 +- lib/src/hindi/AllHinAbs.gf | 5 +- lib/src/hindi/BackwardHin.gf | 76 -- lib/src/hindi/CatHin.gf | 92 +-- lib/src/hindi/ConjunctionHin.gf | 39 +- lib/src/hindi/GrammarHin.gf | 46 +- lib/src/hindi/IdiomHin.gf | 69 +- lib/src/hindi/IrregHin.gf | 181 ----- lib/src/hindi/LangHin.gf | 20 +- lib/src/hindi/LexiconHin.gf | 744 +++++++++--------- lib/src/hindi/MorphoHin.gf | 656 ++++++++++----- lib/src/hindi/NounHin.gf | 123 +-- lib/src/hindi/NumeralHin.gf | 234 +++--- lib/src/hindi/ParadigmsHin.gf | 726 ++++------------- lib/src/hindi/PhraseHin.gf | 26 +- lib/src/hindi/QuestionHin.gf | 57 +- lib/src/hindi/README | 10 + lib/src/hindi/RelativeHin.gf | 56 +- lib/src/hindi/ResHin.gf | 302 +------ lib/src/hindi/SentenceHin.gf | 68 +- lib/src/hindi/StructuralHin.gf | 263 +++---- lib/src/hindi/SymbolHin.gf | 45 +- lib/src/hindi/VerbHin.gf | 52 +- lib/src/hindi/src/DiffHin.gf | 133 ++++ lib/src/hindi/src/ExtraHin.gf | 25 + lib/src/hindi/src/IdiomHin.gf | 39 + lib/src/hindi/src/LexiconHin.gf | 369 +++++++++ lib/src/hindi/src/MorphoHin.gf | 460 +++++++++++ lib/src/hindi/src/StructuralHin.gf | 129 +++ lib/src/hindi/translit.gfs | 11 + lib/src/hindustani/AdjectiveHindustani.gf | 38 + lib/src/hindustani/AdverbHindustani.gf | 20 + lib/src/hindustani/CatHindustani.gf | 92 +++ lib/src/hindustani/CommonHindustani.gf | 309 ++++++++ lib/src/hindustani/ConjunctionHindustani.gf | 44 ++ lib/src/hindustani/DiffHindustani.gf | 8 + lib/src/hindustani/ExtraHindustani.gf | 18 + lib/src/hindustani/ExtraHindustaniAbs.gf | 9 + lib/src/hindustani/NounHindustani.gf | 135 ++++ lib/src/hindustani/PhraseHindustani.gf | 29 + lib/src/hindustani/QuestionHindustani.gf | 78 ++ lib/src/hindustani/RelativeHindustani.gf | 67 ++ lib/src/hindustani/ResHindustani.gf | 400 ++++++++++ lib/src/hindustani/SentenceHindustani.gf | 105 +++ lib/src/hindustani/StringsHindustani.gf | 20 + lib/src/hindustani/SymbolHindustani.gf | 47 ++ lib/src/hindustani/VerbHindustani.gf | 41 + lib/src/urdu/AdjectiveUrd.gf | 39 +- lib/src/urdu/AdverbUrd.gf | 22 +- lib/src/urdu/AllUrd.gf | 12 +- lib/src/urdu/AllUrdAbs.gf | 8 +- lib/src/urdu/CatUrd.gf | 87 +- lib/src/urdu/ConjunctionUrd.gf | 45 +- lib/src/urdu/ExtraUrd.gf | 16 +- lib/src/urdu/ExtraUrdAbs.gf | 1 + lib/src/urdu/GrammarUrd.gf | 6 +- lib/src/urdu/IdiomUrd.gf | 9 +- lib/src/urdu/LangUrd.gf | 2 +- lib/src/urdu/LexiconUrd.gf | 46 +- lib/src/urdu/Makefile | 5 - lib/src/urdu/MorphoUrd.gf | 9 +- lib/src/urdu/NounUrd.gf | 121 +-- lib/src/urdu/NumeralUrd.gf | 245 +++--- lib/src/urdu/ParadigmsUrd.gf | 44 +- lib/src/urdu/PhraseUrd.gf | 29 +- lib/src/urdu/QuestionUrd.gf | 77 +- lib/src/urdu/README | 19 +- lib/src/urdu/RelativeUrd.gf | 68 +- lib/src/urdu/ResUrd.gf | 643 +-------------- lib/src/urdu/SentenceUrd.gf | 104 +-- lib/src/urdu/StructuralUrd.gf | 92 +-- lib/src/urdu/SymbolUrd.gf | 48 +- lib/src/urdu/VerbUrd.gf | 42 +- lib/src/urdu/src/DiffUrd.gf | 115 +++ lib/src/urdu/src/ExtraUrd.gf | 19 + .../urdu/{transliterated => src}/IdiomUrd.gf | 9 +- .../{transliterated => src}/LexiconUrd.gf | 179 ++--- .../urdu/{transliterated => src}/MorphoUrd.gf | 9 +- .../{transliterated => src}/StructuralUrd.gf | 70 +- lib/src/urdu/translit.gfs | 11 + lib/src/urdu/transliterateUrdu.gfs | 6 - lib/src/urdu/transliterated/NumeralUrd.gf | 127 --- lib/src/urdu/transliterated/ResUrd.gf | 641 --------------- 85 files changed, 4576 insertions(+), 5032 deletions(-) delete mode 100644 lib/src/hindi/BackwardHin.gf delete mode 100644 lib/src/hindi/IrregHin.gf create mode 100644 lib/src/hindi/README create mode 100644 lib/src/hindi/src/DiffHin.gf create mode 100644 lib/src/hindi/src/ExtraHin.gf create mode 100644 lib/src/hindi/src/IdiomHin.gf create mode 100644 lib/src/hindi/src/LexiconHin.gf create mode 100644 lib/src/hindi/src/MorphoHin.gf create mode 100644 lib/src/hindi/src/StructuralHin.gf create mode 100644 lib/src/hindi/translit.gfs create mode 100644 lib/src/hindustani/AdjectiveHindustani.gf create mode 100644 lib/src/hindustani/AdverbHindustani.gf create mode 100644 lib/src/hindustani/CatHindustani.gf create mode 100644 lib/src/hindustani/CommonHindustani.gf create mode 100644 lib/src/hindustani/ConjunctionHindustani.gf create mode 100644 lib/src/hindustani/DiffHindustani.gf create mode 100644 lib/src/hindustani/ExtraHindustani.gf create mode 100644 lib/src/hindustani/ExtraHindustaniAbs.gf create mode 100644 lib/src/hindustani/NounHindustani.gf create mode 100644 lib/src/hindustani/PhraseHindustani.gf create mode 100644 lib/src/hindustani/QuestionHindustani.gf create mode 100644 lib/src/hindustani/RelativeHindustani.gf create mode 100644 lib/src/hindustani/ResHindustani.gf create mode 100644 lib/src/hindustani/SentenceHindustani.gf create mode 100644 lib/src/hindustani/StringsHindustani.gf create mode 100644 lib/src/hindustani/SymbolHindustani.gf create mode 100644 lib/src/hindustani/VerbHindustani.gf delete mode 100644 lib/src/urdu/Makefile create mode 100644 lib/src/urdu/src/DiffUrd.gf create mode 100644 lib/src/urdu/src/ExtraUrd.gf rename lib/src/urdu/{transliterated => src}/IdiomUrd.gf (70%) rename lib/src/urdu/{transliterated => src}/LexiconUrd.gf (69%) rename lib/src/urdu/{transliterated => src}/MorphoUrd.gf (95%) rename lib/src/urdu/{transliterated => src}/StructuralUrd.gf (71%) create mode 100644 lib/src/urdu/translit.gfs delete mode 100644 lib/src/urdu/transliterateUrdu.gfs delete mode 100644 lib/src/urdu/transliterated/NumeralUrd.gf delete mode 100644 lib/src/urdu/transliterated/ResUrd.gf diff --git a/lib/src/hindi/AdjectiveHin.gf b/lib/src/hindi/AdjectiveHin.gf index b016a2b9d..d145047a7 100644 --- a/lib/src/hindi/AdjectiveHin.gf +++ b/lib/src/hindi/AdjectiveHin.gf @@ -1,36 +1,2 @@ -concrete AdjectiveHin of Adjective = CatHin ** open ResHin, Prelude in { - - lin - - PositA a = a ; - --- ComparA a np = { --- s = \\_ => a.s ! AAdj Compar ++ "than" ++ np.s ! Nom ; --- isPre = False --- } ; --- ----- $SuperlA$ belongs to determiner syntax in $Noun$. --- --- ComplA2 a np = { --- s = \\_ => a.s ! AAdj Posit ++ a.c2 ++ np.s ! Acc ; --- isPre = False --- } ; --- --- ReflA2 a = { --- s = \\ag => a.s ! AAdj Posit ++ a.c2 ++ reflPron ! ag ; --- isPre = False --- } ; --- --- SentAP ap sc = { --- s = \\a => ap.s ! a ++ sc.s ; --- isPre = False --- } ; --- --- AdAP ada ap = { --- s = \\a => ada.s ++ ap.s ! a ; --- isPre = ap.isPre --- } ; --- --- UseA2 a = a ; --- -} +concrete AdjectiveHin of Adjective = CatHin ** AdjectiveHindustani with + (ResHindustani = ResHin) ; diff --git a/lib/src/hindi/AdverbHin.gf b/lib/src/hindi/AdverbHin.gf index 96ac3242f..0a6ace9b8 100644 --- a/lib/src/hindi/AdverbHin.gf +++ b/lib/src/hindi/AdverbHin.gf @@ -1,20 +1,2 @@ -concrete AdverbHin of Adverb = CatHin ** open ResHin, Prelude in { --- --- lin --- PositAdvAdj a = {s = a.s ! AAdv} ; --- ComparAdvAdj cadv a np = { --- s = cadv.s ++ a.s ! AAdv ++ "than" ++ np.s ! Nom --- } ; --- ComparAdvAdjS cadv a s = { --- s = cadv.s ++ a.s ! AAdv ++ "than" ++ s.s --- } ; --- --- PrepNP prep np = {s = prep.s ++ np.s ! Acc} ; --- --- AdAdv = cc2 ; --- --- SubjS = cc2 ; --- --- AdnCAdv cadv = {s = cadv.s ++ "than"} ; --- -} +concrete AdverbHin of Adverb = CatHin ** AdverbHindustani with + (ResHindustani = ResHin) ; diff --git a/lib/src/hindi/AllHin.gf b/lib/src/hindi/AllHin.gf index e0256e481..a786751a7 100644 --- a/lib/src/hindi/AllHin.gf +++ b/lib/src/hindi/AllHin.gf @@ -1,3 +1,6 @@ ---# -path=.:../abstract:../common:prelude +--# -path=.:../abstract:../common:../prelude:../hindustani -concrete AllHin of AllHinAbs = LangHin ; +concrete AllHin of AllHinAbs = + LangHin, + ExtraHin + ** {} ; diff --git a/lib/src/hindi/AllHinAbs.gf b/lib/src/hindi/AllHinAbs.gf index 89cdaef54..248f3fb3d 100644 --- a/lib/src/hindi/AllHinAbs.gf +++ b/lib/src/hindi/AllHinAbs.gf @@ -1 +1,4 @@ -abstract AllHinAbs = Lang ; \ No newline at end of file +abstract AllHinAbs = + Lang, + ExtraHinAbs + ** {} ; diff --git a/lib/src/hindi/BackwardHin.gf b/lib/src/hindi/BackwardHin.gf deleted file mode 100644 index c880bcbfb..000000000 --- a/lib/src/hindi/BackwardHin.gf +++ /dev/null @@ -1,76 +0,0 @@ ---concrete BackwardHin of Backward = CatHin ** open ResHin in { --- --- flags optimize=all_subs ; --- --- lin --- ----- A repository of obsolete constructs, needed for backward compatibility. ----- They create spurious ambiguities if used in combination with Lang. --- ----- from Verb 19/4/2008 --- --- ComplV2 v np = insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v) ; --- ComplV3 v np np2 = --- insertObj (\\_ => v.c2 ++ np.s ! Acc ++ v.c3 ++ np2.s ! Acc) (predV v) ; --- ComplV2V v np vp = --- insertObj (\\a => infVP v.isAux vp a) --- (insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v)) ; --- ComplV2S v np s = --- insertObj (\\_ => conjThat ++ s.s) --- (insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v)) ; --- ComplV2Q v np q = --- insertObj (\\_ => q.s ! QIndir) --- (insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v)) ; --- ComplV2A v np ap = --- insertObj (\\_ => v.c2 ++ np.s ! Acc ++ ap.s ! np.a) (predV v) ; --- --- ReflV2 v = insertObj (\\a => v.c2 ++ reflPron ! a) (predV v) ; --- ----- from Sentence 19/4/2008 --- --- SlashV2 np v2 = --- mkClause (np.s ! Nom) np.a (predV v2) ** {c2 = v2.c2} ; --- --- SlashVVV2 np vv v2 = --- mkClause (np.s ! Nom) np.a --- (insertObj (\\a => infVP vv.isAux (predV v2) a) (predVV vv)) ** --- {c2 = v2.c2} ; --- ----- from Noun 19/4/2008 --- --- NumInt n = {s = n.s ; n = Pl} ; --- OrdInt n = {s = n.s ++ "th"} ; --- DEPRECATED --- --- DetSg quant ord = { --- s = quant.s ! Sg ++ ord.s ; --- n = Sg --- } ; --- --- DetPl quant num ord = { --- s = quant.s ! num.n ++ num.s ++ ord.s ; --- n = num.n --- } ; --- --- NoNum = {s = []; n = Pl } ; --- --- DefArt = {s = \\_ => artDef} ; --- --- IndefArt = { --- s = table { --- Sg => artIndef ; --- Pl => [] --- } --- } ; --- --- MassDet = {s = \\_ => []} ; --- --- --- ----- from Structural 19/4/2008 --- --- that_NP = regNP "that" Sg ; --- these_NP = regNP "these" Pl ; --- this_NP = regNP "this" Sg ; --- those_NP = regNP "those" Pl ; --- ---} diff --git a/lib/src/hindi/CatHin.gf b/lib/src/hindi/CatHin.gf index 0d32318d7..d4f48556c 100644 --- a/lib/src/hindi/CatHin.gf +++ b/lib/src/hindi/CatHin.gf @@ -1,90 +1,2 @@ -concrete CatHin of Cat = CommonX ** open ResHin, Prelude in { - - flags optimize=all_subs ; - - lincat --- ----- Tensed/Untensed --- --- S = {s : Str} ; --- QS = {s : QForm => Str} ; --- RS = {s : Agr => Str ; c : Case} ; -- c for it clefts --- SSlash = {s : Str ; c2 : Str} ; --- ----- Sentence --- - Cl = ResHin.Clause ; --- ClSlash = { --- s : ResHin.Tense => Anteriority => CPolarity => Order => Str ; --- c2 : Str --- } ; --- Imp = {s : CPolarity => ImpForm => Str} ; --- ----- Question --- --- QCl = {s : ResHin.Tense => Anteriority => CPolarity => QForm => Str} ; --- IP = {s : Case => Str ; n : Number} ; --- IComp = {s : Str} ; --- IDet = {s : Str ; n : Number} ; --- IQuant = {s : Number => Str} ; --- ----- Relative --- --- RCl = { --- s : ResHin.Tense => Anteriority => CPolarity => Agr => Str ; --- c : Case --- } ; --- RP = {s : RCase => Str ; a : RAgr} ; --- ----- Verb --- - VP = ResHin.VPH ; - VPSlash = ResHin.VPHSlash ; --- Comp = {s : Agr => Str} ; --- ----- Adjective --- - AP = ResHin.Adjective ; --- ----- Noun --- - CN = ResHin.Noun ; - NP = ResHin.NP ; - Pron = {s : PronCase => Str ; a : Agr} ; - Det = {s : Gender => Case => Str ; n : Number} ; --- Predet, Ord = {s : Str} ; - Num = {s : Str ; n : Number} ; --- Card = {s : Str; n : Number} ; - Quant = {s : Number => Gender => Case => Str} ; - Art = {s : Str} ; --- ----- Numeral --- --- Numeral = {s : CardOrd => Str ; n : Number} ; --- Digits = {s : CardOrd => Str ; n : Number ; tail : DTail} ; --- ----- Structural --- --- Conj = {s1,s2 : Str ; n : Number} ; ------b Conj = {s : Str ; n : Number} ; ------b DConj = {s1,s2 : Str ; n : Number} ; --- Subj = {s : Str} ; --- Prep = {s : Str} ; --- ----- Open lexical classes, e.g. Lexicon --- - V, VS, VQ, VA = Verb ; -- = {s : VForm => Str} ; - V2, V2A, V2Q, V2S = Verb ** {c2 : Compl} ; --- V3 = Verb ** {c2, c3 : Str} ; --- VV = {s : VVForm => Str ; isAux : Bool} ; --- V2V = Verb ** {c2 : Str ; isAux : Bool} ; --- - A = ResHin.Adjective ; --- {s : Gender => Number => Case => Str} ; --- A2 = {s : AForm => Str ; c2 : Str} ; --- - N = {s : Number => Case => Str ; g : Gender} ; --- N2 = {s : Number => Case => Str ; g : Gender} ** {c2 : Str} ; --- N3 = {s : Number => Case => Str ; g : Gender} ** {c2,c3 : Str} ; - PN = {s : Case => Str ; g : Gender} ; --- -} +concrete CatHin of Cat = CommonX - [Adv,AdN] ** CatHindustani with + (ResHindustani = ResHin) ; diff --git a/lib/src/hindi/ConjunctionHin.gf b/lib/src/hindi/ConjunctionHin.gf index 4a2e56096..e7ebd8eec 100644 --- a/lib/src/hindi/ConjunctionHin.gf +++ b/lib/src/hindi/ConjunctionHin.gf @@ -1,37 +1,2 @@ -concrete ConjunctionHin of Conjunction = - CatHin ** open ResHin, Coordination, Prelude in { --- --- flags optimize=all_subs ; --- --- lin --- --- ConjS = conjunctDistrSS ; --- --- ConjAdv = conjunctDistrSS ; --- --- ConjNP conj ss = conjunctDistrTable Case conj ss ** { --- a = conjAgr (agrP3 conj.n) ss.a --- } ; --- --- ConjAP conj ss = conjunctDistrTable Agr conj ss ** { --- isPre = ss.isPre --- } ; --- ----- These fun's are generated from the list cat's. --- --- BaseS = twoSS ; --- ConsS = consrSS comma ; --- BaseAdv = twoSS ; --- ConsAdv = consrSS comma ; --- BaseNP x y = twoTable Case x y ** {a = conjAgr x.a y.a} ; --- ConsNP xs x = consrTable Case 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} ; --- --- lincat --- [S] = {s1,s2 : Str} ; --- [Adv] = {s1,s2 : Str} ; --- [NP] = {s1,s2 : Case => Str ; a : Agr} ; --- [AP] = {s1,s2 : Agr => Str ; isPre : Bool} ; --- -} +concrete ConjunctionHin of Conjunction = CatHin ** ConjunctionHindustani with + (ResHindustani = ResHin) ; diff --git a/lib/src/hindi/GrammarHin.gf b/lib/src/hindi/GrammarHin.gf index 484f367b0..3ab8653b6 100644 --- a/lib/src/hindi/GrammarHin.gf +++ b/lib/src/hindi/GrammarHin.gf @@ -1,22 +1,24 @@ ---# -path=.:../abstract:../common:prelude - -concrete GrammarHin of Grammar = - NounHin, - VerbHin, - AdjectiveHin, - AdverbHin, - NumeralHin, - SentenceHin, - QuestionHin, - RelativeHin, - ConjunctionHin, - PhraseHin, - TextX, - StructuralHin, - IdiomHin, - TenseX - ** { - -flags startcat = Phr ; unlexer = text ; lexer = text ; - -} +--# -path=.:../abstract:../common:../prelude:c:/gf_unicoded/hindustani + + concrete GrammarHin of Grammar = + NounHin, + VerbHin, + AdjectiveHin, + AdverbHin, + NumeralHin, + SentenceHin, + QuestionHin, + RelativeHin, + ConjunctionHin, + PhraseHin, + TextX - [Adv,AdN], + StructuralHin, + TenseX - [Adv,AdN], + IdiomHin + ** { + +flags startcat = Phr ; unlexer = text ; lexer = text ; + +} + + diff --git a/lib/src/hindi/IdiomHin.gf b/lib/src/hindi/IdiomHin.gf index 3f012f514..24fbcf4ea 100644 --- a/lib/src/hindi/IdiomHin.gf +++ b/lib/src/hindi/IdiomHin.gf @@ -1,30 +1,39 @@ -concrete IdiomHin of Idiom = CatHin ** open Prelude, ResHin in { --- --- flags optimize=all_subs ; --- --- lin --- ImpersCl vp = mkClause "it" (agrP3 Sg) vp ; --- GenericCl vp = mkClause "one" (agrP3 Sg) vp ; --- --- CleftNP np rs = mkClause "it" (agrP3 Sg) --- (insertObj (\\_ => rs.s ! np.a) --- (insertObj (\\_ => np.s ! rs.c) (predAux auxBe))) ; --- --- CleftAdv ad s = mkClause "it" (agrP3 Sg) --- (insertObj (\\_ => optStr conjThat ++ s.s) --- (insertObj (\\_ => ad.s) (predAux auxBe))) ; --- --- ExistNP np = --- mkClause "there" (agrP3 (fromAgr np.a).n) --- (insertObj (\\_ => np.s ! Acc) (predAux auxBe)) ; --- --- ExistIP ip = --- mkQuestion (ss (ip.s ! Nom)) --- (mkClause "there" (agrP3 ip.n) (predAux auxBe)) ; --- --- ProgrVP vp = insertObj (\\a => vp.ad ++ vp.prp ++ vp.s2 ! a) (predAux auxBe) ; --- --- ImpPl1 vp = {s = "let's" ++ infVP True vp (AgP1 Pl)} ; --- -} - +concrete IdiomHin of Idiom = CatHin ** open Prelude,Predef, ResHin,ParamX,CommonHindustani in { + + flags optimize=all_subs ; + flags coding = utf8; + + lin + ImpersCl vp = mkSClause " " (agrP3 Masc Sg) vp ; + GenericCl vp = mkSClause "कwय" (agrP3 Masc Sg) vp ; + + CleftNP np rs = + let cl = mkSClause (np.s ! NPC rs.c) (np.a) (predAux auxBe); + in + {s = \\t,p,o => cl.s ! t ! p ! o ++ rs.s ! np.a }; + +-- CleftAdv ad ss = { s = \\t,b,o => ad.s ! Masc ++ ss.s}; + +-- ExistNP np = +-- mkSClause "wहं" (agrP3 (fromAgr np.a).g (fromAgr np.a).n) +-- (insertObj (\\_ => np.s ! NPC Obl) (predAux auxBe)) ; + + ExistIP ip = + let cl = mkSClause ("wहं" ++ ip.s ! Dir) (agrP3 ip.g ip.n) (predAux auxBe); + in { + s = \\t,p,qf => case qf of { + QDir => cl.s ! t ! p ! ODir; + QIndir => cl.s ! t! p ! ODir + } + }; + +-- ProgrVP vp = insertObj (\\a => vp.obj.s ++ vp.ad ++ vp.comp ! a ++ (vp.s ! VPStem).inf ++ raha (fromAgr a).g (fromAgr a).n ) (predAux auxBe) ; + ProgrVP vp = (predProg vp) ; + + + ImpPl1 vp = {s = "ाw" ++ infVP True vp (agrP1 Masc Pl)} ; + ImpP3 np vp = {s = np.s!NPC Dir ++ "कw" ++ (vp.s ! VPImp ).inf ++ "दw"}; + + +} + diff --git a/lib/src/hindi/IrregHin.gf b/lib/src/hindi/IrregHin.gf deleted file mode 100644 index ed8ccd392..000000000 --- a/lib/src/hindi/IrregHin.gf +++ /dev/null @@ -1,181 +0,0 @@ -----# -path=.:prelude:../abstract:../common --- ---concrete IrregHin of IrregHinAbs = CatHin ** open ParadigmsHin in { --- ---flags optimize=values ; --- --- lin --- awake_V = irregV "awake" "awoke" "awoken" ; --- bear_V = irregV "bear" "bore" "born" ; --- beat_V = irregV "beat" "beat" "beat" ; --- become_V = irregV "become" "became" "become" ; --- begin_V = irregV "begin" "began" "begun" ; --- bend_V = irregV "bend" "bent" "bent" ; --- beset_V = irregV "beset" "beset" "beset" ; --- bet_V = irregDuplV "bet" "bet" "bet" ; --- bid_V = irregDuplV "bid" (variants {"bid" ; "bade"}) (variants {"bid" ; "bidden"}) ; --- bind_V = irregV "bind" "bound" "bound" ; --- bite_V = irregV "bite" "bit" "bitten" ; --- bleed_V = irregV "bleed" "bled" "bled" ; --- blow_V = irregV "blow" "blew" "blown" ; --- break_V = irregV "break" "broke" "broken" ; --- breed_V = irregV "breed" "bred" "bred" ; --- bring_V = irregV "bring" "brought" "brought" ; --- broadcast_V = irregV "broadcast" "broadcast" "broadcast" ; --- build_V = irregV "build" "built" "built" ; --- burn_V = irregV "burn" (variants {"burned" ; "burnt"}) (variants {"burned" ; "burnt"}) ; --- burst_V = irregV "burst" "burst" "burst" ; --- buy_V = irregV "buy" "bought" "bought" ; --- cast_V = irregV "cast" "cast" "cast" ; --- catch_V = irregV "catch" "caught" "caught" ; --- choose_V = irregV "choose" "chose" "chosen" ; --- cling_V = irregV "cling" "clung" "clung" ; --- come_V = irregV "come" "came" "come" ; --- cost_V = irregV "cost" "cost" "cost" ; --- creep_V = irregV "creep" "crept" "crept" ; --- cut_V = irregDuplV "cut" "cut" "cut" ; --- deal_V = irregV "deal" "dealt" "dealt" ; --- dig_V = irregDuplV "dig" "dug" "dug" ; --- dive_V = irregV "dive" (variants {"dived" ; "dove"}) "dived" ; --- do_V = mk5V "do" "does" "did" "done" "doing" ; --- draw_V = irregV "draw" "drew" "drawn" ; --- dream_V = irregV "dream" (variants {"dreamed" ; "dreamt"}) (variants {"dreamed" ; "dreamt"}) ; --- drive_V = irregV "drive" "drove" "driven" ; --- drink_V = irregV "drink" "drank" "drunk" ; --- eat_V = irregV "eat" "ate" "eaten" ; --- fall_V = irregV "fall" "fell" "fallen" ; --- feed_V = irregV "feed" "fed" "fed" ; --- feel_V = irregV "feel" "felt" "felt" ; --- fight_V = irregV "fight" "fought" "fought" ; --- find_V = irregV "find" "found" "found" ; --- fit_V = irregDuplV "fit" "fit" "fit" ; --- flee_V = irregV "flee" "fled" "fled" ; --- fling_V = irregV "fling" "flung" "flung" ; --- fly_V = irregV "fly" "flew" "flown" ; --- forbid_V = irregDuplV "forbid" "forbade" "forbidden" ; --- forget_V = irregDuplV "forget" "forgot" "forgotten" ; --- forgive_V = irregV "forgive" "forgave" "forgiven" ; --- forsake_V = irregV "forsake" "forsook" "forsaken" ; --- freeze_V = irregV "freeze" "froze" "frozen" ; --- get_V = irregDuplV "get" "got" "gotten" ; --- give_V = irregV "give" "gave" "given" ; --- go_V = mk5V "go" "goes" "went" "gone" "going" ; --- grind_V = irregV "grind" "ground" "ground" ; --- grow_V = irregV "grow" "grew" "grown" ; --- hang_V = irregV "hang" "hung" "hung" ; --- have_V = mk5V "have" "has" "had" "had" "having" ; --- hear_V = irregV "hear" "heard" "heard" ; --- hide_V = irregV "hide" "hid" "hidden" ; --- hit_V = irregDuplV "hit" "hit" "hit" ; --- hold_V = irregV "hold" "held" "held" ; --- hurt_V = irregV "hurt" "hurt" "hurt" ; --- keep_V = irregV "keep" "kept" "kept" ; --- kneel_V = irregV "kneel" "knelt" "knelt" ; --- knit_V = irregDuplV "knit" "knit" "knit" ; --- know_V = irregV "know" "knew" "know" ; --- lay_V = irregV "lay" "laid" "laid" ; --- lead_V = irregV "lead" "led" "led" ; --- leap_V = irregV "leap" (variants {"leaped" ; "lept"}) (variants {"leaped" ; "lept"}) ; --- learn_V = irregV "learn" (variants {"learned" ; "learnt"}) (variants {"learned" ; "learnt"}) ; --- leave_V = irregV "leave" "left" "left" ; --- lend_V = irregV "lend" "lent" "lent" ; --- let_V = irregDuplV "let" "let" "let" ; --- lie_V = irregV "lie" "lay" "lain" ; --- light_V = irregV "light" (variants {"lighted" ; "lit"}) "lighted" ; --- lose_V = irregV "lose" "lost" "lost" ; --- make_V = irregV "make" "made" "made" ; --- mean_V = irregV "mean" "meant" "meant" ; --- meet_V = irregV "meet" "met" "met" ; --- misspell_V = irregV "misspell" (variants {"misspelled" ; "misspelt"}) (variants {"misspelled" ; "misspelt"}) ; --- mistake_V = irregV "mistake" "mistook" "mistaken" ; --- mow_V = irregV "mow" "mowed" (variants {"mowed" ; "mown"}) ; --- overcome_V = irregV "overcome" "overcame" "overcome" ; --- overdo_V = mk5V "overdo" "overdoes" "overdid" "overdone" "overdoing" ; --- overtake_V = irregV "overtake" "overtook" "overtaken" ; --- overthrow_V = irregV "overthrow" "overthrew" "overthrown" ; --- pay_V = irregV "pay" "paid" "paid" ; --- plead_V = irregV "plead" "pled" "pled" ; --- prove_V = irregV "prove" "proved" (variants {"proved" ; "proven"}) ; --- put_V = irregDuplV "put" "put" "put" ; --- quit_V = irregDuplV "quit" "quit" "quit" ; --- read_V = irregV "read" "read" "read" ; --- rid_V = irregDuplV "rid" "rid" "rid" ; --- ride_V = irregV "ride" "rode" "ridden" ; --- ring_V = irregV "ring" "rang" "rung" ; --- rise_V = irregV "rise" "rose" "risen" ; --- run_V = irregDuplV "run" "ran" "run" ; --- saw_V = irregV "saw" "sawed" (variants {"sawed" ; "sawn"}) ; --- say_V = irregV "say" "said" "said" ; --- see_V = irregV "see" "saw" "seen" ; --- seek_V = irregV "seek" "sought" "sought" ; --- sell_V = irregV "sell" "sold" "sold" ; --- send_V = irregV "send" "sent" "sent" ; --- set_V = irregDuplV "set" "set" "set" ; --- sew_V = irregV "sew" "sewed" (variants {"sewed" ; "sewn"}) ; --- shake_V = irregV "shake" "shook" "shaken" ; --- shave_V = irregV "shave" "shaved" (variants {"shaved" ; "shaven"}) ; --- shear_V = irregV "shear" "shore" "shorn" ; --- shed_V = irregDuplV "shed" "shed" "shed" ; --- shine_V = irregV "shine" "shone" "shone" ; --- shoe_V = irregV "shoe" "shoed" (variants {"shoed" ; "shod"}) ; --- shoot_V = irregV "shoot" "shot" "shot" ; --- show_V = irregV "show" "showed" (variants {"showed" ; "shown"}) ; --- shrink_V = irregV "shrink" "shrank" "shrunk" ; --- shut_V = irregDuplV "shut" "shut" "shut" ; --- sing_V = irregV "sing" "sang" "sung" ; --- sink_V = irregV "sink" "sank" "sunk" ; --- sit_V = irregDuplV "sit" "sat" "sat" ; --- sleep_V = irregV "sleep" "slept" "slept" ; --- slay_V = irregV "slay" "slew" "slain" ; --- slide_V = irregV "slide" "slid" "slid" ; --- sling_V = irregV "sling" "slung" "slung" ; --- slit_V = irregDuplV "slit" "slit" "slit" ; --- smite_V = irregV "smite" "smote" "smitten" ; --- sow_V = irregV "sow" "sowed" (variants {"sowed" ; "sown"}) ; --- speak_V = irregV "speak" "spoke" "spoken" ; --- speed_V = irregV "speed" "sped" "sped" ; --- spend_V = irregV "spend" "spent" "spent" ; --- spill_V = irregV "spill" (variants {"spilled" ; "spilt"}) (variants {"spilled" ; "spilt"}) ; --- spin_V = irregDuplV "spin" "spun" "spun" ; --- spit_V = irregDuplV "spit" (variants {"spit" ; "spat"}) "spit" ; --- split_V = irregDuplV "split" "split" "split" ; --- spread_V = irregV "spread" "spread" "spread" ; --- spring_V = irregV "spring" (variants {"sprang" ; "sprung"}) "sprung" ; --- stand_V = irregV "stand" "stood" "stood" ; --- steal_V = irregV "steal" "stole" "stolen" ; --- stick_V = irregV "stick" "stuck" "stuck" ; --- sting_V = irregV "sting" "stung" "stung" ; --- stink_V = irregV "stink" "stank" "stunk" ; --- stride_V = irregV "stride" "strod" "stridden" ; --- strike_V = irregV "strike" "struck" "struck" ; --- string_V = irregV "string" "strung" "strung" ; --- strive_V = irregV "strive" "strove" "striven" ; --- swear_V = irregV "swear" "swore" "sworn" ; --- sweep_V = irregV "sweep" "swept" "swept" ; --- swell_V = irregV "swell" "swelled" (variants {"swelled" ; "swollen"}) ; --- swim_V = irregDuplV "swim" "swam" "swum" ; --- swing_V = irregV "swing" "swung" "swung" ; --- take_V = irregV "take" "took" "taken" ; --- teach_V = irregV "teach" "taught" "taught" ; --- tear_V = irregV "tear" "tore" "torn" ; --- tell_V = irregV "tell" "told" "told" ; --- think_V = irregV "think" "thought" "thought" ; --- thrive_V = irregV "thrive" (variants {"thrived" ; "throve"}) "thrived" ; --- throw_V = irregV "throw" "threw" "thrown" ; --- thrust_V = irregV "thrust" "thrust" "thrust" ; --- tread_V = irregV "tread" "trod" "trodden" ; --- understand_V = irregV "understand" "understood" "understood" ; --- uphold_V = irregV "uphold" "upheld" "upheld" ; --- upset_V = irregDuplV "upset" "upset" "upset" ; --- wake_V = irregV "wake" "woke" "woken" ; --- wear_V = irregV "wear" "wore" "worn" ; --- weave_V = irregV "weave" (variants {"weaved" ; "wove"}) (variants {"weaved" ; "woven"}) ; --- wed_V = irregDuplV "wed" "wed" "wed" ; --- weep_V = irregV "weep" "wept" "wept" ; --- wind_V = irregV "wind" "wound" "wound" ; --- win_V = irregDuplV "win" "won" "won" ; --- withhold_V = irregV "withhold" "withheld" "withheld" ; --- withstand_V = irregV "withstand" "withstood" "withstood" ; --- wring_V = irregV "wring" "wrung" "wrung" ; --- write_V = irregV "write" "wrote" "written" ; ---} diff --git a/lib/src/hindi/LangHin.gf b/lib/src/hindi/LangHin.gf index f2eb8b104..dd78ee10c 100644 --- a/lib/src/hindi/LangHin.gf +++ b/lib/src/hindi/LangHin.gf @@ -1,10 +1,10 @@ ---# -path=.:../abstract:../common:../prelude - -concrete LangHin of Lang = - GrammarHin, - LexiconHin - ** { - -flags startcat = Phr ; unlexer=unwords ; lexer=words ; - -} +--# -path=.:../abstract:../common:../hindustani + +concrete LangHin of Lang = + GrammarHin, + LexiconHin + ** { + +flags startcat = Phr ; unlexer=unwords ; lexer=words ; + +} diff --git a/lib/src/hindi/LexiconHin.gf b/lib/src/hindi/LexiconHin.gf index dfa32d661..4209d6c8f 100644 --- a/lib/src/hindi/LexiconHin.gf +++ b/lib/src/hindi/LexiconHin.gf @@ -1,375 +1,369 @@ ---# -path=.:prelude - -concrete LexiconHin of Lexicon = CatHin ** - open ParadigmsHin, Prelude in { - - flags - optimize=values ; - - lin --- airplane_N = regN "airplane" ; --- answer_V2S = mkV2S (regV "answer") toP ; --- apartment_N = regN "apartment" ; - apple_N = mkN "seb" ; --- 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 ; - big_A = mkA "baRA" ; --- 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 "lar.kA" ; - bread_N = mkN "rot.I" ; --- 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 = mk2N "child" "children" ; --- church_N = regN "church" ; --- city_N = regN "city" ; --- clean_A = regADeg "clean" ; --- clever_A = regADeg "clever" ; --- 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 = mkV2 "KA" ; --- 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 "lar.kI" ; --- glove_N = regN "glove" ; --- gold_N = regN "gold" ; - good_A = mkA "a-cCA" ; - go_V = mkV "cal" ; --- green_A = regADeg "green" ; --- harbour_N = regN "harbour" ; --- hate_V2 = dirV2 (regV "hate") ; --- hat_N = regN "hat" ; --- have_V2 = dirV2 (mk5V "have" "has" "had" "had" "having") ; --- 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 = regN "house" ; --- 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") ; --- 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 = mkV "CU" ; ---- touch --- 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 = mkA "lAl" ; --- 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 = mkN2 (mkN feminine (mkN "sister")) (mkPrep "of") ; --- 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 = regADeg "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 = regADeg "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 = regADeg "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 (regV "wonder") ; --- wood_N = regN "wood" ; --- write_V2 = dirV2 (irregV "write" "wrote" "written") ; --- yellow_A = regADeg "yellow" ; --- young_A = regADeg "young" ; --- --- do_V2 = dirV2 (mk5V "do" "does" "did" "done" "doing") ; --- now_Adv = mkAdv "now" ; --- already_Adv = mkAdv "already" ; --- song_N = regN "song" ; --- add_V3 = dirV3 (regV "add") toP ; --- number_N = regN "number" ; --- put_V2 = prepV2 (irregDuplV "put" "put" "put") noPrep ; --- stop_V = regDuplV "stop" ; --- jump_V = regV "jump" ; --- --- left_Ord = ss "left" ; --- right_Ord = ss "right" ; --- far_Adv = mkAdv "far" ; --- correct_A = (regA "correct") ; --- dry_A = regA "dry" ; --- dull_A = regA "dull" ; --- full_A = regA "full" ; --- heavy_A = regA "heavy" ; --- near_A = regA "near" ; --- rotten_A = (regA "rotten") ; --- round_A = regA "round" ; --- sharp_A = regA "sharp" ; --- smooth_A = regA "smooth" ; --- straight_A = regA "straight" ; --- wet_A = regA "wet" ; ---- --- wide_A = regA "wide" ; --- animal_N = regN "animal" ; --- ashes_N = regN "ash" ; -- FIXME: plural only? --- back_N = regN "back" ; --- bark_N = regN "bark" ; --- belly_N = regN "belly" ; --- blood_N = regN "blood" ; --- bone_N = regN "bone" ; --- breast_N = regN "breast" ; --- cloud_N = regN "cloud" ; --- day_N = regN "day" ; --- dust_N = regN "dust" ; --- ear_N = regN "ear" ; --- earth_N = regN "earth" ; --- egg_N = regN "egg" ; --- eye_N = regN "eye" ; --- fat_N = regN "fat" ; --- feather_N = regN "feather" ; --- fingernail_N = regN "fingernail" ; --- fire_N = regN "fire" ; --- flower_N = regN "flower" ; --- fog_N = regN "fog" ; --- foot_N = mk2N "foot" "feet" ; --- forest_N = regN "forest" ; --- grass_N = regN "grass" ; --- guts_N = regN "gut" ; -- FIXME: no singular --- hair_N = regN "hair" ; --- hand_N = regN "hand" ; --- head_N = regN "head" ; --- heart_N = regN "heart" ; --- horn_N = regN "horn" ; --- husband_N = mkN masculine (regN "husband") ; --- ice_N = regN "ice" ; --- knee_N = regN "knee" ; --- leaf_N = mk2N "leaf" "leaves" ; --- leg_N = regN "leg" ; --- liver_N = regN "liver" ; --- louse_N = mk2N "louse" "lice" ; --- mouth_N = regN "mouth" ; --- name_N = regN "name" ; --- neck_N = regN "neck" ; --- night_N = regN "night" ; --- nose_N = regN "nose" ; --- person_N = mkN human (regN "person") ; --- rain_N = regN "rain" ; --- road_N = regN "road" ; --- root_N = regN "root" ; --- rope_N = regN "rope" ; --- salt_N = regN "salt" ; --- sand_N = regN "sand" ; --- seed_N = regN "seed" ; --- skin_N = regN "skin" ; --- sky_N = regN "sky" ; --- smoke_N = regN "smoke" ; --- snow_N = regN "snow" ; --- stick_N = regN "stick" ; --- tail_N = regN "tail" ; --- tongue_N = regN "tongue" ; --- tooth_N = mk2N "tooth" "teeth" ; --- wife_N = mkN feminine (mk2N "wife" "wives") ; --- wind_N = regN "wind" ; --- wing_N = regN "wing" ; --- worm_N = regN "worm" ; --- year_N = regN "year" ; --- blow_V = IrregHin.blow_V ; --- breathe_V = dirV2 (regV "breathe") ; --- burn_V = IrregHin.burn_V ; --- dig_V = IrregHin.dig_V ; --- fall_V = IrregHin.fall_V ; --- float_V = regV "float" ; --- flow_V = regV "flow" ; --- fly_V = IrregHin.fly_V ; --- freeze_V = IrregHin.freeze_V ; --- give_V3 = dirV3 give_V toP ; --- laugh_V = regV "laugh" ; --- lie_V = IrregHin.lie_V ; --- play_V = regV "play" ; - sew_V = mkV "sI" ; --- sing_V = IrregHin.sing_V ; --- sit_V = IrregHin.sit_V ; --- smell_V = regV "smell" ; --- spit_V = IrregHin.spit_V ; --- stand_V = IrregHin.stand_V ; --- swell_V = IrregHin.swell_V ; --- swim_V = IrregHin.swim_V ; --- think_V = IrregHin.think_V ; --- turn_V = regV "turn" ; --- vomit_V = regV "vomit" ; --- --- bite_V2 = dirV2 IrregHin.bite_V ; --- count_V2 = dirV2 (regV "count") ; --- cut_V2 = dirV2 IrregHin.cut_V ; --- fear_V2 = dirV2 (regV "fear") ; --- fight_V2 = dirV2 fight_V ; - hit_V2 = mkV2 (mkV "mAr") "ko" ; --- 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" ; --- --- grammar_N = regN "grammar" ; --- language_N = regN "language" ; --- rule_N = regN "rule" ; --- ----- added 4/6/2007 - john_PN = mkPN "jon" ; --- question_N = regN "question" ; --- ready_A = regA "ready" ; --- reason_N = regN "reason" ; --- today_Adv = mkAdv "today" ; --- uncertain_A = regA "uncertain" ; --- ---oper --- aboutP = mkPrep "about" ; --- atP = mkPrep "at" ; --- forP = mkPrep "for" ; --- fromP = mkPrep "from" ; --- inP = mkPrep "in" ; --- onP = mkPrep "on" ; --- toP = mkPrep "to" ; --- -} +--# -path=.:prelude + +concrete LexiconHin of Lexicon = CatHin ** +--open ResHin, Prelude in { + open ParadigmsHin, Prelude in { + + flags + optimize=values ; + coding = utf8; + + lin + airplane_N = mkN "जHज" ; +-- answer_V2S = mkV2 (compoundV "जwब" (mkV "दयन")) ; +-- apartment_N = mkN "कमरह" ; + apple_N = mkN "सयब" ; +-- art_N = mkN "fन" ; + ask_V2Q = mkV2 (mkV "पwचHन") ; +-- baby_N = mkN "बचH" ; + bad_A = mkA "बर" ; + bank_N = mkN "बयनक" ; + beautiful_A = mkA "सनदर" ; + become_VA = mkV "बनन"; + beer_N = mkN "बेेर" ; +-- beg_V2V = mkV2V (compoundV "लतज" (mkV "करन")) "सै" "कह" False; + big_A = mkA "बृ" ; +-- bike_N = mkN "सयचल" feminine ; +-- bird_N = mkN "परनदह" ; + black_A = mkA "कल" ; + blue_A = mkA "नयल" ; + boat_N = mkN "नw" ; + book_N = mkN "कतब" feminine ; +-- boot_N = mkN "जwत" ; + boss_N = mkN "मलक" ; + boy_N = mkN "लृक" ; + bread_N = mkN "रwतय" ; + break_V2 = mkV2 (mkV "तwृन") ; + broad_A = mkA "चwृ" ; + brother_N2 = mkN2 (mkN "बHय") (mkPrep "क" "क") "कै" ; --not correct + brown_A = mkA "बHwर" ; +-- butter_N = mkN "मकh-न" ; + buy_V2 = mkV2 (mkV "खरयदन"); + camera_N = mkN "कयमरH" ; + cap_N = mkN "तwपय" ; + car_N = mkN "कर" ; +-- carpet_N = mkN "तपy^य" ; + cat_N = mkN "बलय" feminine; +-- ceiling_N = mkN "चh-त" feminine ; + chair_N = mkN "करसय" ; +-- cheese_N = mkN "पनयर" feminine ; + child_N = mkN "बचH" ; + church_N = mkN "गरज" ; + city_N = mkN "XHर" ; + clean_A = mkA "सf" ; + clever_A = mkA "चतर" ; + close_V2 = mkV2 (compoundV "बनद" do_V2); + coat_N = mkN "कwथ" ; + cold_A = mkA "सरद" ; + come_V = mkV "ान" ; + computer_N = mkN "कमपयwथर" ; + country_N = mkN "दयX" ; +-- cousin_N = mkCmpdNoun "चच" (mkN "ज़द") ; -- a compund noun made of two nouns + cow_N = mkN "गै" feminine ; + die_V = mkV "मरन" ; + dirty_A = mkA "गनद" ; +-- distance_N3 = mkN3 (mkN "fशलह") (mkPrep "क") "कै" "सै" ; + doctor_N = mkN "दकतर" ; + dog_N = mkN "कत" ; + door_N = mkN "दरwज़" ; + drink_V2 = mkV2 (mkV "पयन"); + easy_A2V = mkA "ासन" "" ; -- chek for A or a + eat_V2 = mkV2 (mkV "कHन") "" ; + empty_A = mkA "खलय" ; + enemy_N = mkN "दXमन" ; + factory_N = mkN "करखन" ; +-- father_N2 = mkN2 (mkN "पत" irregular) (mkPrep "क") "कै" ; + fear_VS = mkV "दृन"; + find_V2 = mkV2 (mkV "दHwनद") ; + fish_N = mkN "मचHलय" ; + floor_N = mkN "fरX" ; + forget_V2 = mkV2 (mkV "बHwलन") ; +-- fridge_N = mkN "fरयग" ; + friend_N = mkN "दwसत" masculine ; + fruit_N = mkN "पHल" ; +-- fun_AV = mkAV (regA "fुन") ; + garden_N = mkN "बघ" ; -- chek for G + girl_N = mkN "लृकय" ; + glove_N = mkN "दसतन" ; + gold_N = mkN "सwन" ; + good_A = mkA "चH" ; + go_V = mkV "जन" ; + green_A = mkA "Hर" ; +-- harbour_N = mkCmpdNoun "बनदर" (mkN "गह") ; + hate_V2 = mkV2 (compoundV "नfरत" do_V2) ; + hat_N = mkN "थwपय" ; +-- have_V2 = dirV2 (mk5V "हवे" "हस" "हद" "हद" "हविनग") ; + hear_V2 = mkV2 (mkV "सनन") ; +-- hill_N = mkN "पहृय" ; +-- hope_VS = (compoundV "मयद" do_V2); + horse_N = mkN "गHwृ" ; + hot_A = mkA "गरम" ; + house_N = mkN "गHर" ; + important_A = mkA "ज़रwरय" ; -- check about z +-- industry_N = mkN "शनेत" feminine ; + iron_N = mkN "लwH" ; + king_N = mkN "रज" ; + know_V2 = mkV2 (mkV "जनन") ; + know_VS = mkV "जनन"; +-- lake_N = mkN "जh-यल" feminine ; + lamp_N = mkN "दय" ; + learn_V2 = mkV2 (mkV "सयकHन") ; +-- leather_N = mkN "चमृ" ; + leave_V2 = mkV2 (mkV "चलन") ; + like_V2 = mkV2 (compoundV "पसनद" do_V2); + listen_V2 = mkV2 (mkV "सनन") ; + live_V = mkV "रहन" ; ---- touch + long_A = mkA "लमब" ; + lose_V2 = mkV2 (compoundV "कHw" do_V2) ; + love_N = mkN "परयम" ; + love_V2 = mkV2 (compoundV "पयर" do_V2) "कw"; + man_N = mkN "ादमय" ; +-- married_A2 = mkA "Xदय " "सै" ; + meat_N = mkN "मस" ; + milk_N = mkN "दwदH" ; + moon_N = mkN "चनद" ; + mother_N2 = mkN2 (mkN "मत" feminine) (mkPrep "कय" "कय") "कै"; -- not covered need to be discussed +-- mountain_N = mkN "पहृय" ; + music_N = mkN "सनगयत" ; +-- narrow_A = mkA "बरयक" ; + new_A = mkA "नय" ; + newspaper_N = mkN "खबर" ; + oil_N = mkN "तयल" ; + old_A = mkA "बwृH" ; + open_V2 = mkV2 (mkV "कHwलन") ; +-- paint_V2A = mkV2 (compoundV "रनग" do_V2) ; + paper_N = mkN "कघज़" ; + paris_PN = mkPN "पयरस" ; + peace_N = mkN "मन" ; + pen_N = mkN "qलम" ; +-- planet_N = mkN "सयरह" ; +-- plastic_N = mkN "पलसथक" ; + play_V2 = mkV2 (mkV "कHयलन") ; +-- policeman_N = mkCmpdNoun "पwलयस" (mkN "wल") ; +-- priest_N = (mkN "पयघमबर") ; +-- probable_AS = mkAS (regA "परॉबबले") ; +-- queen_N = mkN "Xहज़दय" ; +-- radio_N = mkN "रयधयw" ; + rain_V0 = compoundV "बरX" (mkV "Hwन" ) ; + read_V2 = mkV2 (mkV "पृHन"); + red_A = mkA "लल" ; + religion_N = mkN "दHरम" ; +-- restaurant_N = mkN "हwथल" ; + river_N = mkN "दरय" masculine ; + rock_N = mkN "चथन" ; + roof_N = mkN "चh-त" masculine ; +-- rubber_N = mkN "रबृ" ; + run_V = mkV "दwृन" ; + say_VS = mkV "कHन" ; + school_N = mkN "मकतब" ; +-- science_N = mkN "सनस" ; -- vgyan + sea_N = mkN "समनदर" ; +-- seek_V2 = mkV2 (compoundV "तलX" do_V2) ; + see_V2 = mkV2 (mkV "दयकHन") ; + sell_V3 = mkV3 (mkV "बयचन") "कw" ""; + send_V3 = mkV3 (mkV "बHयजन") "कw" ""; + sheep_N = mkN "बHयृ" feminine ; + ship_N = mkN "जHज़" ; + shirt_N = mkN "करत" feminine; + shoe_N = mkN "जwत" ; + shop_N = mkN "दwकन" feminine ; + short_A = mkA "चHwथ" ; + silver_N = mkN "चनदय" ; + sister_N = mkN "बHन" feminine ; + sleep_V = mkV "सwन" ; + small_A = mkA "चHwथ" ; + snake_N = mkN "सनप" ; +-- sock_N = mkN "जरब" feminine ; + speak_V2 = mkV2 (mkV "बwलन") ; + star_N = mkN "तर" ; +-- steel_N = mkN "सतयल" ; -- something like ispat + stone_N = mkN "पतHर" ; +-- stove_N = mkN "चwलह" ; +-- student_N = mkCmpdNoun "t-लब" (mkN "ेलम") ; -- something vidrati + stupid_A = mkA "बैwqwf" ; +-- sun_N = mkN "सwरज" ; -- swrya + switch8off_V2 = mkV2 (compoundV "बनद" do_V2) ; + switch8on_V2 = mkV2 (mkV "चलन") ; + table_N = mkN "मयज़" feminine ; + talk_V3 = mkV3 (mkV "बwलन") "सै" "कै बरै में"; +-- teacher_N = mkN "िसतद" ; -- adyapak + teach_V2 = mkV2 (mkV "पृHन") ; + television_N = mkN "तयwय" ; + thick_A = mkA "मwथ" ; + thin_A = mkA "पतल" ; + train_N = mkN "रयल गृय" ; + travel_V = (compoundV "सfर" do_V2) ; +-- tree_N = mkN "पयृ" masculine ; +-- ---- trousers_N = mkN "तरॉुसेरस" ; + ugly_A = mkA "बदसwरत" ; + understand_V2 = mkV2 (mkV "समजHन") ; +-- university_N = mkN "यwनयwरसथय" ; + village_N = mkN "गwं" ; -- check for n or N +-- wait_V2 = mkV2 (compoundV "नतz-र" do_V2) "क" ; -- something prtkXa + walk_V = mkV "चलन" ; +-- warm_A = mkA "गरम" ; something gngna +-- war_N = mkN "जनग" ; + watch_V2 = mkV2 (mkV "दयकHन") ; +-- water_N = mkN "पनय" masculine ; -- not covered masculine ending with y + white_A = mkA "सfयद" ; + window_N = mkN "रwXनदन" ; +-- wine_N = mkN "Xरब" feminine ; + win_V2 = mkV2 (mkV "जयतन") ; + woman_N = mkN "ेwरत" feminine ; +-- wonder_VQ = compoundV "Hेरन" (mkV "हwन") ; + wood_N = mkN "लकृय" ; + write_V2 = mkV2 (mkV "लकh-न") ; + yellow_A = mkA "पयल" ; + young_A = mkA "जwन" ; + do_V2 = mkV2 (mkV "करन") ; +-- now_Adv = mkAdv "ब" ; +-- already_Adv = mkAdv "पहलै हय" ; + song_N = mkN "गयत" ; + add_V3 = mkV3 (compoundV "जमे" do_V2) "" "" ; +-- number_N = mkN "हनदसह" ; +-- put_V2 = mkV2 (mkV "धलन") ; + stop_V = mkV "रकन" ; +-- jump_V = compoundV "चHलनग" (mkV "लगन") feminine ; + +-- left_Ord = {s = "बयं" ; n = singular}; +-- right_Ord = {s= "दयं" ; n = singular}; +-- far_Adv = mkAdv "दwर" ; + correct_A = mkA "सयH" ; + dry_A = mkA "सwकH" ; +-- dull_A = mkA "नलिक" ; +-- full_A = mkA "मकमल" ; + heavy_A = mkA "बHरय" ; + near_A = mkA "पस" ; +-- rotten_A = mkA "खरब" ; + round_A = mkA "गwल" ; + sharp_A = mkA "तयज़" ; + smooth_A = mkA "चकन" ; + straight_A = mkA "सयदH" ; + wet_A = mkA "गयल" ; ---- + wide_A = mkA "चwृ" ; + animal_N = mkN "जनwर" ; + ashes_N = mkN "रकh-" feminine; -- FIXME: plural only? +-- back_N = mkN "qमर" feminine ; +-- bark_N = mkN "बरक" ; +-- belly_N = mkN "दh-नय" ; +-- blood_N = mkN "खwन" ; + bone_N = mkN "Hधय" feminine ; +-- breast_N = mkN "चh-तय" ; --stan + cloud_N = mkN "बदल" ; + day_N = mkN "दन" ; + dust_N = mkN "दHwल" ; + ear_N = mkN "कन" ; +-- earth_N = mkN "ज़मयन" feminine ; + egg_N = mkN "नधH" ; + eye_N = mkN "ानकH" feminine ; + fat_N = mkN "मwत" ; + feather_N = mkN "पनकH" ; +-- fingernail_N = mkN "नखन" ; + fire_N = mkN "ाग" feminine ; + flower_N = mkN "पHwल" ; + fog_N = mkN "दHनद" feminine ; + foot_N = mkN "पwं" ; -- not properly covered need to be discussed + forest_N = mkN "जनगल" ; + grass_N = mkN "गHस" feminine ; +-- guts_N = mkN "गुत" ; -- FIXME: no singular + hair_N = mkN "बल" ; + hand_N = mkN "HतH" ; + head_N = mkN "सर" ; + heart_N = mkN "दल" ; +-- horn_N = mkN "गh-नतय" ; + husband_N = mkN "पतय" ; + ice_N = mkN "बरf" feminine ; + knee_N = mkN "गHतनH" ; + leaf_N = mkN "पतH" ; + leg_N = mkN "तनग" feminine ; + liver_N = mkN "कलयजH" ; +-- louse_N = mkN "" ; -- jwN + mouth_N = mkN "मनH" ; + name_N = mkN "नम" ; + neck_N = mkN "गरदन" feminine ; + night_N = mkN "रत" feminine ; + nose_N = mkN "नक" ; +-- person_N = mkN "Xखश" ; + rain_N = mkN "बरX" feminine ; + road_N = mkN "सृक" ; + root_N = mkN "गृ" feminine ; + rope_N = mkN "रसय" ; + salt_N = mkN "नमक" feminine ; + sand_N = mkN "रयत" feminine ; + seed_N = mkN "बयज" ; +-- skin_N = mkN "जलद" feminine ; -- crm + sky_N = mkN "मबर" ; + smoke_N = mkN "दHwं"; -- singular masc nouns ending with aN,wN yet to be implemented + snow_N = mkN "बरf" feminine ; + stick_N = mkN "सॉथय" ; + tail_N = mkN "दम" ; +-- tongue_N = mkN "ज़बन" feminine ; +-- tooth_N = mkN "दनत" masculine; + wife_N = mkN "पतनय" ; + wind_N = mkN "Hw" ; +-- wing_N = mkN "पर" ; + worm_N = mkN "कयृ" ; + year_N = mkN "सल" ; +-- blow_V = mkV "चलन" ; + breathe_V = compoundV "सनस" (mkV "लयन" ) ; + burn_V = mkV "जलन" ; + dig_V = mkV "कHwदन" ; + fall_V = mkV "गरन" ; +-- float_V = mkV "तयरन" ; + flow_V = mkV "चलन" ; + fly_V = mkV "ृन" ; +-- freeze_V = mkV "जमन"; + give_V3 = mkV3 (mkV "दयन") "कw" ""; + laugh_V = mkV "हनसन" ; +-- lie_N = mkN "जh-wत" masculine ; + lie_V = compoundV "जHwत" (mkV "बwलन" ); + play_V = mkV "कHयलन" ; + sew_V = mkV "सयन" ; + sing_V = mkV "गन" ; + sit_V = mkV "बयथHन" ; + smell_V = mkV "सwनगन" ; + spit_V = mkV "तHwकन" ; + stand_V = compoundV "कHृै" (mkV "हwन" ); -- a type of compound verb made of two verbs i.e 'kHRa' also inflects, rather than a string and verb should be fixed +-- swell_V = mkV "सwजh-न" ; + swim_V = mkV "तयरन" ; + think_V = mkV "सwचन" ; + turn_V = mkV "मृन"; +-- vomit_V = compoundV "लतय" (mkV "करन") feminine ; + bite_V2 = mkV2 (mkV "कतन") ; + count_V2 = mkV2 (mkV "गनन") ; + cut_V2 = mkV2 (mkV "कतन") ; + fear_V2 = mkV2 (mkV "धरन") ; + fight_V2 = mkV2 (mkV "लृन") ; +-- hit_V2 = mkV2 (compoundV "तh-wकर" (mkV "मरन" )); + hold_V2 = mkV2 (mkV "पकृन") ; +-- hunt_V2 = mkV2 (compoundV "Xकर" do_V2); + kill_V2 = mkV2 (compoundV "मर" (mkV "धलन" )) ; + pull_V2 = mkV2 (mkV "कHनचन"); +-- push_V2 = mkV2 (mkV "दh-कयलन") "कw" ; +-- rub_V2 = mkV2 (mkV "रगृन") ; +-- scratch_V2 = mkV2 (mkV "कh-रचन") "कw" ; +-- split_V2 = mkV2 (mkV "बनत") "कw" ; +-- squeeze_V2 = dirV2 (regV "सqुेेज़े") ; +-- stab_V2 = dirV2 (regDuplV "सतब") ; +-- suck_V2 = mkV2 (mkV "चwसन") ; + throw_V2 = mkV2 (mkV "पHयनकन") ; + tie_V2 = mkV2 (mkV "बनदHन") ; + wash_V2 = mkV2 (mkV "दHwन") ; + wipe_V2 = mkV2 (compoundV "शf" (mkV "करन" )); + +---- other_A = regA "ॉतहेर" ; + +-- grammar_N = mkN "गरदन" ; +-- language_N = mkN "ज़बन" feminine ; +-- rule_N = mkN "शwल" ; + +---- added 4/6/2007 + john_PN = mkPN "जॉन" ; +-- question_N = mkN "सwल" ; +-- ready_A = regA "रेदय" ; +-- reason_N = mkN "wजह" feminine ; +-- today_Adv = mkAdv "ाज" ; +-- uncertain_A = mkA ["घयर यqयनय"] ; + + +} diff --git a/lib/src/hindi/MorphoHin.gf b/lib/src/hindi/MorphoHin.gf index 0cb00fde5..63523392b 100644 --- a/lib/src/hindi/MorphoHin.gf +++ b/lib/src/hindi/MorphoHin.gf @@ -1,196 +1,460 @@ ---# -path=.:../../prelude --- -----1 A Simple Hindi Resource Morphology ----- ----- Aarne Ranta 2002 -- 2005 ----- ----- This resource morphology contains definitions needed in the resource ----- syntax. To build a lexicon, it is better to use $ParadigmsHin$, which ----- gives a higher-level access to this module. --- -resource MorphoHin = ResHin ** open Prelude, (Predef=Predef) in { --- --- flags optimize=all ; --- -----2 Phonology ----- ----- To regulate the use of endings for both nouns, adjectives, and verbs: --- ---oper --- y2ie : Str -> Str -> Str = \fly,s -> --- let y = last (init fly) in --- case y of { --- "a" => fly + s ; --- "e" => fly + s ; --- "o" => fly + s ; --- "u" => fly + s ; --- _ => init fly + "ie" + s --- } ; --- --- -----2 Nouns ----- ----- For conciseness and abstraction, we define a worst-case macro for ----- noun inflection. It is used for defining special case that ----- only need one string as argument. --- ---oper --- CommonNoun : Type = {s : Number => Case => Str} ; --- --- nounGen : Str -> CommonNoun = \dog -> case last dog of { --- "y" => nounY "dog" ; --- "s" => nounS (init "dog") ; --- _ => nounReg "dog" --- } ; --- ----- These are auxiliaries to $nounGen$. --- --- nounReg : Str -> CommonNoun = \dog -> --- mkNoun dog (dog + "s") (dog + "'s") (dog + "s'"); --- nounS : Str -> CommonNoun = \kiss -> --- mkNoun kiss (kiss + "es") (kiss + "'s") (kiss + "es'") ; --- nounY : Str -> CommonNoun = \fl -> --- mkNoun (fl + "y") (fl + "ies") (fl + "y's") (fl + "ies'") ; --- --- -----3 Proper names ----- ----- Regular proper names are inflected with "'s" in the genitive. --- --- nameReg : Str -> Gender -> {s : Case => Str} = \john,g -> --- {s = table {Gen => john + "'s" ; _ => john} ; g = g} ; --- -----2 Determiners --- --- mkDeterminer : Number -> Str -> {s : Str ; n : Number} = \n,s -> --- {s = s ; n = n} ; --- -----2 Pronouns ----- ----- Here we define personal pronouns. ----- ----- We record the form "mine" and the gender for later use. --- --- Pronoun : Type = --- {s : Case => Str ; a : Agr} ; --- --- mkPronoun : (_,_,_,_ : Str) -> Number -> Person -> Gender -> Pronoun = --- \I,me,my,mine,n,p,g -> --- {s = table {Nom => I ; Acc => me ; Gen => my} ; --- a = toAgr n p g --- } ; --- --- human : Gender = Masc ; --- doesn't matter --- --- pronI = mkPronoun "I" "me" "my" "mine" Sg P1 human ; --- pronYouSg = mkPronoun "you" "you" "your" "yours" Sg P2 human ; -- verb agr OK --- pronHe = mkPronoun "he" "him" "his" "his" Sg P3 Masc ; --- pronShe = mkPronoun "she" "her" "her" "hers" Sg P3 Fem ; --- pronIt = mkPronoun "it" "it" "its" "it" Sg P3 Neutr ; --- --- pronWe = mkPronoun "we" "us" "our" "ours" Pl P1 human ; --- pronYouPl = mkPronoun "you" "you" "your" "yours" Pl P2 human ; --- pronThey = mkPronoun "they" "them" "their" "theirs" Pl P3 human ; --- --- --- -----2 Adjectives ----- ----- To form the adjectival and the adverbial forms, two strings are needed ----- in the worst case. (First without degrees.) --- --- Adjective = {s : AForm => Str} ; --- ----- However, most adjectives can be inflected using the final character. ----- N.B. this is not correct for "shy", but $mkAdjective$ has to be used. --- --- regAdjective : Str -> Adjective = \free -> --- let --- e = last free ; --- fre = init free ; --- freely = case e of { --- "y" => fre + "ily" ; --- _ => free + "ly" --- } ; --- fre = case e of { --- "e" => fre ; --- "y" => fre + "i" ; --- _ => free --- } --- in --- mkAdjective free (fre + "er") (fre + "est") freely ; --- ----- Many adjectives are 'inflected' by adding a comparison word. --- --- adjDegrLong : Str -> Adjective = \ridiculous -> --- mkAdjective --- ridiculous --- ("more" ++ ridiculous) --- ("most" ++ ridiculous) --- ((regAdjective ridiculous).s ! AAdv) ; --- --- -----3 Verbs ----- ----- The worst case needs five forms. (The verb "be" is treated separately.) --- --- mkVerb4 : (_,_,_,_: Str) -> Verb = \go,goes,went,gone -> --- let going = case last go of { --- "e" => init go + "ing" ; --- _ => go + "ing" --- } --- in --- mkVerb go goes went gone going ; --- ----- This is what we use to derive the irregular forms in almost all cases --- --- mkVerbIrreg : (_,_,_ : Str) -> Verb = \bite,bit,bitten -> --- let bites = case last bite of { --- "y" => y2ie bite "s" ; --- "s" => init bite + "es" ; --- _ => bite + "s" --- } --- in mkVerb4 bite bites bit bitten ; --- ----- This is used to derive regular forms. --- --- mkVerbReg : Str -> Verb = \soak -> --- let --- soaks = case last soak of { --- "y" => y2ie soak "s" ; --- "s" => init soak + "es" ; --- _ => soak + "s" --- } ; --- soaked = case last soak of { --- "e" => init soak + "s" ; --- _ => soak + "ed" --- } --- in --- mkVerb4 soak soaks soaked soaked ; --- --- verbGen : Str -> Verb = \kill -> case last kill of { --- "y" => verbP3y (init kill) ; --- "e" => verbP3e (init kill) ; --- "s" => verbP3s (init kill) ; --- _ => regVerbP3 kill --- } ; --- ----- These are just auxiliary to $verbGen$. --- --- regVerbP3 : Str -> Verb = \walk -> --- mkVerbIrreg walk (walk + "ed") (walk + "ed") ; --- verbP3s : Str -> Verb = \kiss -> --- mkVerb4 kiss (kiss + "es") (kiss + "ed") (kiss + "ed") ; --- verbP3e : Str -> Verb = \love -> --- mkVerb4 love (love + "s") (love + "d") (love + "d") ; --- verbP3y : Str -> Verb = \cr -> --- mkVerb4 (cr + "y") (cr + "ies") (cr + "ied") (cr + "ied") ; --- ------ The particle always appears right after the verb. --- --- verbPart : Verb -> Str -> Verb = \v,p -> --- {s = \\f => v.s ! f ++ p ; isRefl = v.isRefl} ; --- --- verbNoPart : Verb -> Verb = \v -> verbPart v [] ; --- --- -} +--# -path=.:../../prelude:../abstract:../common:../../prelude +-- +----1 A Simple Hinu Resource Morphology +---- +---- Shafqat Virk, Aarne Ranta,2009 +---- +---- This resource morphology contains definitions needed in the resource +---- syntax. To build a lexicon, it is better to use $ParadigmsHin$, which +---- gives a higher-level access to this module. +-- +resource MorphoHin = ResHin ** open Prelude,Predef,ParamX,CommonHindustani in { + flags optimize=all ; + coding = utf8; + +----2 Nouns +oper + mkNoun : (x1,_,_,_,_,x6 : Str) -> Gender -> Noun = + \sd,so,sv,pd,po,pv,g -> { + s = table { + Sg => table { + Dir => sd ; + Obl => so ; + Voc => sv + } ; + Pl => table { + Dir => pd ; + Obl => po ; + Voc => pv + } + } ; + + g = g + } ; + + + + regNoun : Str -> Noun ; + regNoun s = case s of { + _ + "य" => mkN05 (s); + _ + (""|"े"|"ह") => mkN01 (s); + _ + "य" => mkN03 (s); + _ + ("ं"|"wं") => mkN04 (s); + _ + "w^" => mkN12 (s); + _ => regNoun2 (s) + }; + regNoun2 : Str -> Noun; + regNoun2 s = let c = if_then_else Bool (eq (last s) "" ) True (if_then_else Bool (eq (last s) "ह") True (if_then_else Bool (eq (last s) "े") True False)) + in case c of { + False => mkN02 (s); + True => mkN01 (s) + }; + + reggNoun : Str -> Gender -> Noun ; + reggNoun s g = let c = if_then_else Bool (eq (last s) "" ) True (if_then_else Bool (eq (dp 2 s) "ं") True (if_then_else Bool (eq (dp 2 s) "wं") True False)) + in case of { + <_ + "त",Fem,_> => mkN10 (s); + <_ + "त",Masc,_> => mkN02 (s); + <_ + "w",Masc,_> => mkN11 (s); + <_ + "w",Fem,_> => mkN07 (s); + <_ + "य",Fem,_> => mkN05 (s); + <_ + "य",Masc,_> => mkN02 (s); + <_,Fem,False> => mkN08 (s); + <_,Fem,_> => mkN09 (s) + + }; + +-- masculine nouns end with alif, choTi_hay, ain Translitration: (a, h, e) +-- Arabic nouns ends with h. also taken as Masc + + mkN01 : Str -> Noun ; + mkN01 lRka = let end = last (lRka) ; + lRk = if_then_else Str (eq end "े") lRka (tk 1 lRka) + in mkNoun (lRka) (lRk+"ै") (lRk+"ै") + (lRk+"ै") (lRk+"wं") (lRk+"w") + Masc ; + +-- masculine nouns does not end with a, h, e, an + + mkN02 : Str -> Noun ; + mkN02 mrd = let mrdwN = mrd+"wं" ; + mrdw = tk 1 mrdwN + in mkNoun mrd mrd mrd + mrd mrdwN mrdw + Masc ; + +-- feminine Nouns end with y + + mkN03 : Str -> Noun ; + mkN03 krsy = let krsyaN = krsy+"ं" ; + krsywN = krsy+"wं" ; + krsyw = tk 1 krsywN + in mkNoun krsy krsy krsy + krsyaN krsywN krsyw + Fem ; + +-- feminine nouns end with a, aN, wN + mkN04 : Str -> Noun ; + mkN04 n = case last n of { + "" => let bla = n + in mkNoun bla bla bla + (bla+"y^यं") (bla+"w^ं") (bla+"w^") + Fem ; + _ => let maN = n ; -- ends with aN and wN + ma = tk 1 maN + in mkNoun maN maN maN + (ma+"y^यं") (ma+"w^ं") (ma+"w^ं") + Fem + + }; + --feminine nouns end with ya + + mkN05 : Str -> Noun ; + mkN05 gRya = let gRy = (tk 1 gRya) + in mkNoun gRya gRya gRya + (gRya+"ं") (gRy+"wं") (gRy+"w") + Fem ; + +-- feminine nouns end with w + + mkN07 : Str -> Noun ; + mkN07 khshbw = mkNoun khshbw khshbw khshbw + (khshbw + "y^यं") (khshbw + "w^ं") (khshbw + "w^") + Fem ; + +-- Loan arabic feminine nouns end with t +-- this is a noun that shows state, condition + + mkN10 : Str -> Noun ; + mkN10 ndamt = mkNoun ndamt ndamt ndamt + (ndamt+"यं") (ndamt+"wं") (ndamt+"w") + Fem ; +-- Worst case function + mkN : (_,_,_,_,_,_ : Str) -> Gender -> Noun ; + mkN sgNom sgObl sgVoc plNom plObl plVoc g = + mkNoun sgNom sgObl sgVoc plNom plObl plVoc g ; + + mkN06 : Str -> Noun ; + mkN06 rya = mkNoun rya rya rya + (rya+"y^यं") (rya+"w^ं") rya + Fem ; + +-- feminine nouns that do not end with a, N, w, wN + + mkN08 : Str -> Noun ; + mkN08 ktab = mkNoun ktab ktab ktab + (ktab+"यं") (ktab+"wं") (ktab+"w") + Fem ; + +-- Loan arabic feminine nouns + + mkN09 : Str -> Noun ; + mkN09 ahsan = mkNoun ahsan ahsan ahsan + (ahsan+"त") (ahsan+"त") (ahsan+"w") + Fem ; +-- (variants{ahsan+"त";ahsan+"wं"}) +-- Loan persian maculine nouns end with w + + mkN11 : Str -> Noun ; + mkN11 alw = mkNoun alw alw alw + alw (alw+"w^ं") (alw+"w^") + Masc ; + + +-- Loan persian maculine nouns end with w^ + + mkN12 : Str -> Noun ; + mkN12 bhao = mkNoun (bhao) (bhao) (bhao) + (bhao) (bhao) (bhao) + Masc ; +----2 Determiners + IDeterminer = {s:Gender => Str ; n : Number}; + makeDet : Str -> Str -> Str -> Str -> Number -> Determiner = \s1,s2,s3,s4,n -> { + s = table { + Sg => table { + Masc => s1 ; + Fem => s2 + } ; + Pl => table { + Masc => s3 ; + Fem => s4 + } + } ; + + n = n + }; + + makeIDet : Str -> Str -> Number -> IDeterminer = \s1,s2,n -> { + s = table { + Masc => s1; + Fem => s2 + }; + n = n + }; + +-- Proposition + + makePrep : Str -> Str -> Preposition = \s1,s2 -> {s = table { Masc => s1 ; Fem => s2 } } ** { lock_Prep = <>}; + +----2 Pronouns + PronForm = {s:Pronoun => Str}; + makeDemPron : (x1,x2,x3,x4,x5,x6:Str) -> PronForm = + \y1,y2,y3,y4,y5,y6 -> { + s = table { + P Sg _ Dir _ => y1; + P Sg _ Obl _ => y2; + P Sg _ Voc _ => y3; + P Pl _ Dir _ => y4; + P Pl _ Obl _ => y5; + P Pl _ Voc _ => y6 + }; + }; + +-- DemonPronForm = {s:DemPronForm => Str}; + mkDemonPronForm : (x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12:Str) -> DemPronForm = + \y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12 -> { + s = table { + Sg => table { + Masc => table { + Dir => y1 ; + Obl => y2 ; + Voc => y3 + }; + Fem => table { + Dir => y4 ; + Obl => y5 ; + Voc => y6 + } + }; + Pl => table { + Masc => table { + Dir => y7 ; + Obl => y8 ; + Voc => y9 + }; + Fem => table { + Dir => y10 ; + Obl => y11 ; + Voc => y12 + } + } + } + }; + makeDemonPronForm : Str -> Str -> Str -> DemPronForm ; + makeDemonPronForm yeh is inn = mkDemonPronForm yeh is "" yeh is "" yeh inn "" yeh inn ""; +-- makePossPronForm myra myry hmara hmary = mkDemonPronForm myra myra myra myry myry myry hmara hmara hmara hmary hmary hmary; + + PersPron = {s: PersPronForm => Str}; + + mkPersPron:(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20,x21,x22,x23,x24,x25,x26,x27,x28,x29,x30,x31,x32,x33,x34,x35,x36:Str) -> PersPron = + \y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13,y14,y15,y16,y17,y18,y19,y20,y21,y22,y23,y24,y25,y26,y27,y28,y29,y30,y31,y32,y33,y34,y35,y36 -> { + s = + table { + PPF Sg Pers1 Dir => y1; + PPF Sg Pers1 Obl => y2; + PPF Sg Pers1 Voc => y3; + PPF Sg Pers2_Casual Dir => y4; + PPF Sg Pers2_Casual Obl => y5; + PPF Sg Pers2_Casual Voc => y6; + PPF Sg Pers2_Familiar Dir => y7; + PPF Sg Pers2_Familiar Obl => y8; + PPF Sg Pers2_Familiar Voc => y9; + PPF Sg Pers2_Respect Dir => y10; + PPF Sg Pers2_Respect Obl => y11; + PPF Sg Pers2_Respect Voc => y12; + PPF Sg Pers3_Near Dir => y13; + PPF Sg Pers3_Near Obl => y14; + PPF Sg Pers3_Near Voc => y15; + PPF Sg Pers3_Distant Dir => y16; + PPF Sg Pers3_Distant Obl => y17; + PPF Sg Pers3_Distant Voc => y18; + PPF Pl Pers1 Dir => y19; + PPF Pl Pers1 Obl => y20; + PPF Pl Pers1 Voc => y21; + PPF Pl Pers2_Casual Dir => y22; + PPF Pl Pers2_Casual Obl => y23; + PPF Pl Pers2_Casual Voc => y24; + PPF Pl Pers2_Familiar Dir => y25; + PPF Pl Pers2_Familiar Obl => y26; + PPF Pl Pers2_Familiar Voc => y27; + PPF Pl Pers2_Respect Dir => y28; + PPF Pl Pers2_Respect Obl => y29; + PPF Pl Pers2_Respect Voc => y30; + PPF Pl Pers3_Near Dir => y31; + PPF Pl Pers3_Near Obl => y32; + PPF Pl Pers3_Near Voc => y33; + PPF Pl Pers3_Distant Dir => y34; + PPF Pl Pers3_Distant Obl => y35; + PPF Pl Pers3_Distant Voc => y36 + }; + }; + + makePersPron : PersPron; + makePersPron = mkPersPron "m(a)यं" "m(o)j'|ह" "" "t(o)w " "t(o)j|ह" "t(o)w " "t(o)म" "t(o)म" "t(o)म" "ाप" "ाप" "ाप" "y(i)ह" "a(i)स" "" "w(o)ह" "a(o)स" "" + "h(a)म" "h(a)म" "" "t(o)म" "t(o)म" "t(o)म" "t(o)म" "t(o)म" "t(o)म" "ाप" "ाप" "ाप" "y(i)ह" "a(i)न" "" "w(o)ह" "a(o)न" "" ; + + mkPron : (x1,x2,x3:Str) -> {s:Case => Str} = + \y1,y2,y3 -> { s = + table { + Dir => y1; + Obl => y2; + Voc => y3 + } + }; + + ------- PossPronForm yet to be implemented + +-- IntPronForm = {s:InterrPronForm => Str}; + IntPronForm = {s: Case => Str}; + mkIntPronForm : (x1,x2,x3:Str) -> IntPronForm = + \y1,y2,y3 -> { + s = + table { + Dir => y1; + Obl => y2; + Voc => y3 + } + }; + +----2 Adjectives +-- defined in ResUrd + +----3 Verbs + CommonVF = {s : VTense => UPerson => Number => Gender => Str} ; + + mkVerb : (x1: Str) -> Verb = \inf -> + let root = (tk 2 inf); inf_obl = ((tk 1 inf) + "ै"); inf_fem = ((tk 1 inf) + "य") + in { s = table { + + VF tense person number gender => (mkCmnVF root tense person number gender).s ; + Inf => inf ; + Root => root ; + Inf_Obl => inf_obl ; + Inf_Fem => inf_fem + + + } + } ; + rem_y : Str -> Str; + rem_y str = let b = take 1 str; yth = drop 1 str; a1 = take 4 yth; a2 = take 1 yth; th= if_then_else Str (eq a1 "(a)य") (drop 5 str) (drop 2 str); st = if_then_else Str (eq a1 "(a)य") (b ++ "(i)"++th) (if_then_else Str (eq a2 "य") (b ++ th) str) + in rt st; + rt: Str -> Str; + rt r = r; + mkCmnVF : Str -> VTense -> UPerson -> Number -> Gender -> {s:Str} = + \root,t,p,n,g -> + {s = + let form1 = case (last root) of { + ""|"ा"|"w" => root + "w^ं" ; + _ => root + "wं" + }; + form2 = case (last root) of { + ""|"ा"|"w" => root + "y^ं" ; + _ => root + "यं" + }; + in + case of { + => form1 ; + => form2 ; + => (mkImpert root p n g).s ; + => case root of { + "हw" => (mkPastInd root p n g).s ; + "ज" => (mkPastInd "गय" p n g).s ; + "कर" => (mkPastInd "क" p n g).s ; + "दै" => (mkPastInd "द" p n g).s ; + "लै" => (mkPastInd "ल" p n g).s ; + _ => (mkPastInd root p n g).s }; + => root + "तै"; + => root + "तय"; --variants{root+"तय" ; root+"तयं"}; + => root + "तै"; + => root+"तयं"; + => root + "तै"; + => root + "तय"; --variants{root+"तय" ; root+"तयं"}; + => root + "तै"; + => root+"तयं"; + => root+"त"; + => root+"तय"; + => root+"ते"; + => root+"तयं" + } + + } ; + + mkPastInd : Str -> UPerson -> Number -> Gender -> {s:Str} = \root,p,n,g -> + {s = let roo = root ; + a = case (last root) of { + ""|"ा"|"w"|"क" => "य" ; + _ => "" + } ; + y = case (last root) of { + ""|"ा"|"w" => "y^य" ; + _ => "य" + } ; + e = case (last root) of { + ""|"ा"|"w"|"क" => "y^ै" ; + _ => "ै" + } ; + yN = case (last root) of { + ""|"ा"|"w" => "y^यं" ; + _ => "यं" + } ; + + in + case of { + => roo+a ; + => roo+y ; + => roo+e ; + => roo+yN ; + + => roo+a ; + => roo+y ; + => roo+e ; + => roo+yN ; + + => roo+e ; + => roo+y; --variants{roo+y ; roo+yN} ; + => roo+e ; + => roo+yN ; + + => roo+e ; + => roo+yN; --variants{roo+yN ; roo+y} ; + => roo+e ; + => roo+yN ; + <_,Sg,Masc> => roo + a; + <_,Sg,Fem> => roo+y ; + <_,Pl,Masc> => roo + e; + <_,Pl,Fem> => roo+yN + + } ; + } ; + + mkImpert : Str -> UPerson -> Number -> Gender -> {s:Str} = \root,p,n,g -> + {s = let roo = root ; + w = case (last root) of { + ""|"ा"|"w" => "w^" ; + _ => "w" + } ; + yN = case (last root) of { + ""|"ा"|"w" => "y^यं" ; + _ => "यं" + } ; + yE = case (last root) of { + ""|"ा"|"w" => "y^यै" ; + _ => "यै" + } ; + e = case (last root) of { + ""|"ा"|"w" => "y^ै" ; + _ => "ै" + } in + case of { + => ""; --nonExist ; + => root ; + => roo+w ; + => roo+w ; + => roo+w; --variants{roo+w; roo+yN; roo+yE} ; + => roo+yN; --variants{roo+yN; roo+yE} ; + <_,Sg,_> => roo+e ; + <_,Pl,_> => roo+yN + }; + }; + +} diff --git a/lib/src/hindi/NounHin.gf b/lib/src/hindi/NounHin.gf index 6db90c867..541521488 100644 --- a/lib/src/hindi/NounHin.gf +++ b/lib/src/hindi/NounHin.gf @@ -1,121 +1,2 @@ -concrete NounHin of Noun = CatHin ** open ResHin, Prelude in { - - flags optimize=all_subs ; - - lin - DetCN det cn = { - s = \\c => det.s ! cn.g ! npcase2case c ++ toNP (cn.s ! det.n) c ; - a = agrP3 cn.g det.n - } ; - - UsePN pn = {s = \\c => toNP pn.s c ; a = agrP3 pn.g Sg} ; - UsePron p = {s = \\c => p.s ! np2pronCase c ; a = p.a} ; --- --- PredetNP pred np = { --- s = \\c => pred.s ++ np.s ! c ; --- a = np.a --- } ; --- --- PPartNP np v2 = { --- s = \\c => np.s ! c ++ v2.s ! VPPart ; --- a = np.a --- } ; --- --- RelNP np rs = { --- s = \\c => np.s ! c ++ "," ++ rs.s ! np.a ; --- a = np.a --- } ; --- --- AdvNP np adv = { --- s = \\c => np.s ! c ++ adv.s ; --- a = np.a --- } ; --- --- DetQuantOrd quant num ord = { --- s = quant.s ! num.n ++ num.s ++ ord.s ; --- n = num.n --- } ; - - DetQuant quant num = { - s = \\g,c => quant.s ! num.n ! g ! c ++ num.s ; - n = num.n - } ; - --- DetNP det = { --- s = \\c => det.s ; ---- case --- a = agrP3 det.n --- } ; --- - PossPron p = {s = \\_,_,_ => p.s ! PPoss} ; - - NumSg = {s = []; n = Sg} ; - NumPl = {s = []; n = Pl} ; - --- 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 = adn.s ++ num.s ; n = num.n} ; --- --- OrdSuperl a = {s = a.s ! AAdj Superl} ; --- --- DetArtOrd art num ord = { --- s = art.s ! num.hasCard ! num.n ++ num.s ++ ord.s ; --- n = num.n --- } ; --- --- DetArtCard art card = { --- s = art.s ! True ! card.n ++ card.s ; --- n = card.n --- } ; - - DefArt = {s = \\_,_,_ => []} ; - IndefArt = {s = \\_,_,_ => []} ; - --- MassNP cn = { --- s = cn.s ! Sg ; --- a = agrP3 Sg --- } ; - - UseN n = n ; --- UseN2 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 ! c ; g = f.g} ; --- ComplN3 f x = { --- s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c ; --- g = f.g ; --- c2 = f.c3 --- } ; - - AdjCN ap cn = { - s = \\n,c => ap.s ! cn.g ! n ! c ++ 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 ! c ; g = cn.g} ; --- -} +concrete NounHin of Noun = CatHin ** NounHindustani with + (ResHindustani = ResHin) ; diff --git a/lib/src/hindi/NumeralHin.gf b/lib/src/hindi/NumeralHin.gf index e3dcbcd31..0516fdf36 100644 --- a/lib/src/hindi/NumeralHin.gf +++ b/lib/src/hindi/NumeralHin.gf @@ -1,107 +1,127 @@ -concrete NumeralHin of Numeral = CatHin ** open ResHin in { --- By Harald Hammarstrm --- flags coding=devanagari ; ---- still old Devanagari coding - - -param DForm = unit | ten ; -param DSize = sg | r2 | r3 | r4 | r5 | r6 | r7 | r8 | r9 ; -param Size = sing | less100 | more100 ; - -oper LinDigit = {s : DForm => Str ; size : DSize} ; - ---lincat Numeral = { s : Str } ; -lincat Digit = LinDigit ; -lincat Sub10 = {s : DForm => Str ; size : DSize} ; -lincat Sub100 = {s : Str ; size : Size} ; -lincat Sub1000 = {s : Str ; s2 : Str ; size : Size } ; -lincat Sub1000000 = { s : Str } ; - -lin num x0 = - {s = "/&" ++ x0.s ++ "&/"} ; -- the Devana:gari environment - - --- H is for aspiration (h is a sepaarate letter) --- M is anusvara --- ~ is candrabindhu --- c is is Eng. ch in e.g chop --- cH is chH --- _: is length --- T, D, R are the retroflexes - -oper mkNum : Str -> Str -> DSize -> LinDigit = - \do -> \bis -> \sz -> - {s = table {unit => do ; ten => bis } ; - size = sz } ; - --- lin n1 mkNum "ek" "gya:rah" "das" -lin n2 = mkNum "do" "bi:s" r2 ; -lin n3 = mkNum "ti:n" "ti:s" r3 ; -lin n4 = mkNum "ca:r" "ca:li:s" r4 ; -lin n5 = mkNum "pa:~nc" "paca:s" r5 ; -lin n6 = mkNum (variants {"cHah" ; "cHa;" ; "cHai"}) "sa:TH" r6 ; -lin n7 = mkNum "sa:t" "sattar" r7; -lin n8 = mkNum "a:TH" "assi:" r8; -lin n9 = mkNum "nau" (variants {"navve" ; "nabbe" }) r9 ; - -oper mkR : Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> DSize => Str = \a1 -> \a2 -> \a3 -> \a4 -> \a5 -> \a6 -> \a7 -> \a8 -> \a9 -> table { - sg => a1 + "ah" ; - r2 => a2 + "i:s" ; - r3 => a3 + "ti:s" ; - r4 => a4 + "a:li:s" ; - r5 => a5 + "an" ; - r6 => a6 + "saTH" ; - r7 => a7 + "hattar" ; - r8 => a8 + "a:si:" ; - r9 => a9 + "a:nave" -} ; - -oper rows : DSize => DSize => Str = table { - sg => mkR "gya:r" "ikk" "ikat" "ekt" "ikya:v" "ik" "ik" "iky" "iky" ; - r2 => mkR "ba:r" "ba:" "bat" "bay" "ba:v" "ba:" "ba" "bay" "b" ; - r3 => mkR "ter" "te" "taiM" "taiMt" "tirp" "tir" "ti" "tir" "tir" ; - r4 => mkR "caud" "caub" "cauM" "cav" "caup" "cauM" "cau" "caur" "caur" ; - r5 => mkR "paMdr" "pacc" "paiM" "paiMt" "pacp" "paiM" "pac" "pac" "pac" ; - r6 => mkR "sol" "cHabb" "cHat" "cHiy" "cHapp" "cHiya:" "cHi" "cHiy" "cHiy" ; - r7 => mkR (variants { "sattr" ; "satr"}) "satta:v" "saiM" "saiMt" "satta:" "sar" "sat" (variants {"satt" ; "sat" }) "satt" ; - r8 => mkR "aTHa:r" "aTTHa:" "aR" "aRt" "aTTHa:v" "aR" "aTH" (variants { "aTTH" ; "aTH" }) "aTTH" ; - r9 => table {sg => "unni:s" ; r2 => "unati:s" ; r3 => "unata:li:s" ; - r4 => "unaca:s" ; r5 => "unasaTH" ; r6 => "unahattar" ; - r7 => (variants{"unna:si:" ; "unya:si:"}) ; - r8 => "nava:si:" ; r9 => "ninya:nave" } -} ; - -oper ss : Str -> {s : Str} = \s -> {s = s} ; - -lin pot01 = {s = table {unit => "ek" ; _ => "dummy" } ; size = sg} ; -lin pot0 d = d ; -lin pot110 = {s = "das" ; size = less100} ; -lin pot111 = {s = rows ! sg ! sg ; size = less100} ; -lin pot1to19 d = {s = rows ! d.size ! sg ; size = less100} ; -lin pot0as1 n = {s = n.s ! unit ; size = table {sg => sing ; _ => less100} ! n.size } ; - -lin pot1 d = {s = d.s ! ten ; size = less100} ; -lin pot1plus d e = {s = rows ! e.size ! d.size ; size = less100} ; - -lin pot1as2 n = {s = n.s ; s2 = "dummy" ; size = n.size } ; -lin pot2 d = {s = (mksau (d.s ! unit) d.size) ; - s2 = d.s ! unit ++ "la:kH" ; size = more100} ; -lin pot2plus d e = - {s = (mksau (d.s ! unit) d.size) ++ e.s ; - s2 = (d.s ! unit) ++ "la:kH" ++ (mkhazar e.s e.size) ; - size = more100} ; - -lin pot2as3 n = {s = n.s } ; -lin pot3 n = {s = table { sing => ekhazar ; - less100 => n.s ++ "haza:r" ; - more100 => n.s2 } ! n.size} ; -lin pot3plus n m = - {s = table {sing => ekhazar ; - less100 => n.s ++ "haza:r" ; - more100 => n.s2 } ! n.size ++ m.s} ; - - -oper ekhazar : Str = variants {"haza:r" ; "ek" ++ "haza:r"} ; -oper mkhazar : Str -> Size -> Str = \s -> \sz -> table {sing => ekhazar ; _ => s ++ "haza:r"} ! sz ; -oper mksau : Str -> DSize -> Str = \s -> \sz -> table {sg => "sau" ; _ => s ++ "sau"} ! sz ; -} +concrete NumeralHin of Numeral = CatHin ** open ResHin,Prelude,ParamX in { +-- By Harald Hammarström +-- Modification for Hinu Shafqat Virk + flags coding=utf8 ; +--- still old Devanagari coding + + +param DForm = unit | ten ; +param DSize = sg | r2 | r3 | r4 | r5 | r6 | r7 | r8 | r9 ; +param Size = singl | less100 | more100 ; + +oper LinDigit = {s : DForm => Str ; size : DSize ; n : Number} ; + + +lincat Dig = { s:Str ; n : Number}; +lincat Digit = LinDigit ; +lincat Sub10 = {s : DForm => Str ; size : DSize ; n : Number} ; +lincat Sub100 = {s : Str ; size : Size ; n : Number} ; +lincat Sub1000 = {s : Str ; s2 : Str ; size : Size ; n : Number } ; +lincat Sub1000000 = { s : Str ; n : Number } ; + +lin num x0 = + {s = table { + NCard => x0.s ; + NOrd => x0.s ++ "واں" -- need to use mkOrd which will make irregular ordinals but it gives path error + }; + n = x0.n + } ; +oper mkOrd : Str -> Str = + \s -> case s of { + "عك" => "پہلا"; + "دo" => "دوسرا"; + "تi:ن" => "تعسرا"; + "چa:ر" => "چوتh-ا"; + ("چحاہ"|"چحا"|"چحاi") => "چh-ٹا"; + _ => s ++ "واں" + }; +-- {s = \\_ => x0.s ; n = x0.n} ; + + +oper mkNum : Str -> Str -> DSize -> LinDigit = + \do -> \bis -> \sz -> + {s = table {unit => do ; ten => bis } ; + size = sz ; n = Pl} ; + +lin n2 = mkNum "دو" "بیس" r2 ; +lin n3 = mkNum "تین" "تیس" r3 ; +lin n4 = mkNum "چار" "چالیس" r4 ; +lin n5 = mkNum "پانچ" "پچاس" r5 ; +lin n6 = mkNum "چh-" "ساتh-" r6 ; +lin n7 = mkNum "سات" "ستر" r7; +lin n8 = mkNum "آتh-" "اسی" r8; +lin n9 = mkNum "نو" "نوے" r9 ; + +oper mkR : Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> DSize => Str = \a1 -> \a2 -> \a3 -> \a4 -> \a5 -> \a6 -> \a7 -> \a8 -> \a9 -> table { + sg => a1 + "اہ" ; + r2 => a2 + "i:س" ; + r3 => a3 + "تi:س" ; + r4 => a4 + "a:لi:س" ; + r5 => a5 + "ان" ; + r6 => a6 + "ساٹح" ; + r7 => a7 + "ہاتتار" ; + r8 => a8 + "a:سi:" ; + r9 => a9 + "a:ناvع" +} ; + +oper rows : DSize => DSize => Str = table { + sg => mkR "گیارہ" "iكك" "iكات" "عكت" "iكیاو" "iك" "iك" "iكی" "iكی" ; + r2 => mkR "بارہ" "بای" "بات" "بای" "باو" "با" "با" "بای" "ب" ; + r3 => mkR "تیر" "تی" "تین" "تنت" "ترپ" "تری" "ت" "تر" "تر" ; + r4 => mkR "چود" "چوب" "چون" "چوا" "چوو" "چون" "چوہ" "چور" "چور" ; + r5 => mkR "پند" "پچی" "پین" "پنتا" "پچپ" "پین" "پہ" "پچ" "پچ" ; + r6 => mkR "سول" "چh-ب" "چh-ت" "چh-ی" "چh-پ" "چh-یا" "چh-" "چh-ی" "چh-ی" ; + r7 => mkR "ستر" "ستا" "سین" "سنت" "ستاو" "ستا" "سر" "ست" "ستا" ; + r8 => mkR "اتh-ار" "اتh-ای" "اڑ" "اڑت" "اتh-او" "اڑ" "اتh-" "اتh-" "اتh-" ; + r9 => table {sg => "انیس" ; r2 => "انتیس" ; r3 => "انتالیس" ; + r4 => "انچاس" ; r5 => "انستh-" ; r6 => "انہتر" ; + r7 => "اناسی" ; + r8 => "انانوے" ; r9 => "ننانوے" } +} ; + +oper ss : Str -> {s : Str} = \s -> {s = s} ; + +lin pot01 = {s = table {unit => "ایك" ; _ => "دuممی" } ; size = sg ; n = Sg} ; +lin pot0 d = d ; +lin pot110 = {s = "داس" ; size = less100 ; n = Pl} ; +lin pot111 = {s = rows ! sg ! sg ; size = less100 ; n = Pl} ; +lin pot1to19 d = {s = rows ! d.size ! sg ; size = less100 ; n = d.n} ; +lin pot0as1 n = {s = n.s ! unit ; size = table {sg => singl ; _ => less100} ! n.size ; n = n.n } ; + +lin pot1 d = {s = d.s ! ten ; size = less100 ; n = d.n} ; +lin pot1plus d e = {s = rows ! e.size ! d.size ; size = less100 ; n = d.n} ; + +lin pot1as2 n = {s = n.s ; s2 = "دuممی" ; size = n.size ; n = n.n} ; +lin pot2 d = {s = (mksau (d.s ! unit) d.size) ; + s2 = d.s ! unit ++ "لاكh-" ; size = more100 ; n = d.n} ; +lin pot2plus d e = + {s = (mksau (d.s ! unit) d.size) ++ e.s ; + s2 = (d.s ! unit) ++ "لاكh-" ++ (mkhazar e.s e.size) ; + size = more100 ; n = d.n} ; + +lin pot2as3 n = {s = n.s ; n = n.n} ; +lin pot3 n = {s = table { singl => ekhazar ; + less100 => n.s ++ "ہزار" ; + more100 => n.s2 } ! n.size ; n = n.n} ; +lin pot3plus n m = + {s = table {singl => ekhazar ; + less100 => n.s ++ "ہزار" ; + more100 => n.s2 } ! n.size ++ m.s ; n = n.n} ; + +lin D_0 = { s = "0" ; n = Sg}; +lin D_1 = { s = "1" ; n = Sg}; +lin D_2 = { s = "2" ; n = Pl}; +lin D_3 = { s = "3" ; n = Pl}; +lin D_4 = { s = "4" ; n = Pl}; +lin D_5 = { s = "5" ; n = Pl}; +lin D_6 = { s = "6" ; n = Pl}; +lin D_7 = { s = "7" ; n = Pl}; +lin D_8 = { s = "8" ; n = Pl}; +lin D_9 = { s = "9" ; n = Pl}; +lin IDig d = { s = \\_ => d.s ; n = d.n} ; +lin IIDig d dg = { s = \\df => Prelude.glue (dg.s ! df) d.s ; n = Pl }; + +oper ekhazar : Str = variants {"ہزار" ; "ایك" ++ "ہزار"} ; +oper mkhazar : Str -> Size -> Str = \s -> \sz -> table {singl => ekhazar ; _ => s ++ "ہزار"} ! sz ; +oper mksau : Str -> DSize -> Str = \s -> \sz -> table {sg => "سو" ; _ => s ++ "سو"} ! sz ; +} diff --git a/lib/src/hindi/ParadigmsHin.gf b/lib/src/hindi/ParadigmsHin.gf index 7844caf6e..3125f0e58 100644 --- a/lib/src/hindi/ParadigmsHin.gf +++ b/lib/src/hindi/ParadigmsHin.gf @@ -1,556 +1,170 @@ ---# -path=.:../abstract:../../prelude:../common --- -----1 Hindi Lexical Paradigms - -resource ParadigmsHin = open - (Predef=Predef), - Prelude, - MorphoHin, - CatHin - in { - ---2 Parameters - -oper - masculine : Gender ; - feminine : Gender ; - - masculine = Masc ; feminine = Fem ; --i - - ---2 Nouns - - mkN = overload { - mkN : Str -> N - = \s -> regNoun s ** {lock_N = <>} ; - mkN : Str -> Gender -> N - = \s,g -> reggNoun s g ** {lock_N = <>} ; - mkN : (x1,_,_,_,_,x6 : Str) -> Gender -> N - = \sd,so,sv,pd,po,pv,g -> mkNoun sd so sv pd po pv g ** {lock_N = <>} ; - } ; - - mkPN = overload { - mkPN : Str -> PN = \s -> let n = regNoun s in {s = n.s ! Sg ; g = n.g ; lock_PN = <>} ; - mkPN : N -> Gender -> PN = \n,g -> {s = n.s ! Sg ; g = g ; lock_PN = <>} ; - } ; - ---2 Adjectives - - mkA = overload { - mkA : Str -> A - = \s -> regAdjective s ** {lock_A = <>} ; - mkA : (x1,_,x3 : Str) -> A - = \msd,m,f -> mkAdjective msd m f ** {lock_A = <>} ; - } ; - ---2 Verbs - - mkV = overload { - mkV : Str -> V - = \s -> regVerb s ** {lock_V = <>} ; - mkV : (x1,_,_,_,_,_,_,_,_,_,_,_,_,_,x15 : Str) -> V - = \inf,stem,ims,imp,ifs,ifp,pms,pmp,pfs,pfp,ss1,ss2,sp2,sp3,r -> - mkVerb inf stem ims imp ifs ifp pms pmp pfs pfp ss1 ss2 sp2 sp3 r ** - {lock_V = <>} ; - } ; - - - mkV2 = overload { - mkV2 : Str -> V2 - = \s -> regVerb s ** {c2 = {s = [] ; c = VTrans} ; lock_V2 = <>} ; - mkV2 : V -> V2 - = \v -> v ** {c2 = {s = [] ; c = VTrans} ; lock_V2 = <>} ; - mkV2 : V -> Str -> V2 - = \v,p -> v ** {c2 = {s = p ; c = VTransPost} ; lock_V2 = <>} ; - } ; - - -----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 --- } ; --- --- -----3 Relational nouns ----- ----- Relational nouns ("daughter of x") need a preposition. --- --- mkN2 : N -> Prep -> N2 ; --- ----- The most common preposition is "of", and the following is a ----- shortcut for regular relational nouns with "of". --- --- regN2 : Str -> N2 ; --- ----- 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 ; --- --- --- -----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 --- } ; --- --- -----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 ; --- ----- 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 ; --- ----- As many as four forms may be needed. --- --- mkA : (good,better,best,well : Str) -> A --- } ; --- ----- To force comparison to be formed by "more - most", ----- the following function is used: --- --- compoundA : A -> A ; -- -/more/most ridiculous --- --- --- -----3 Two-place adjectives ----- ----- Two-place adjectives need a preposition for their second argument. --- --- mkA2 : A -> Prep -> A2 ; --- --- --- -----2 Adverbs --- ----- Adverbs are not inflected. Most lexical ones have position ----- after the verb. Some can be preverbal (e.g. "always"). --- --- mkAdv : Str -> Adv ; --- mkAdV : Str -> AdV ; --- ----- Adverbs modifying adjectives and sentences can also be formed. --- --- mkAdA : Str -> AdA ; --- -----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 ; --- noPrep : Prep ; --- ----- (These two functions are synonyms.) --- -----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 ; --- ----- 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 ; --- ----- There is an extensive list of irregular verbs in the module $IrregularHin$. ----- In practice, it is enough to give three forms, ----- e.g. "drink - drank - drunk". --- --- mkV : (drink, drank, drunk : Str) -> V ; --- ----- Irregular verbs with duplicated consonant in the present participle. --- --- mkV : (run, ran, run, running : Str) -> V ; --- ----- 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 --- }; --- ----- Verbs with a particle. ----- The particle, such as in "switch on", is given as a string. --- --- partV : V -> Str -> V ; --- ----- Reflexive verbs. ----- By default, verbs are not reflexive; this function makes them that. --- --- reflV : V -> V ; --- -----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 : V -> Prep -> V2 ; -- believe in --- mkV2 : V -> V2 -- kill --- }; --- -----3 Three-place verbs ----- ----- Three-place (ditransitive) verbs need two prepositions, of which ----- the first one or both can be absent. --- --- mkV3 : V -> Prep -> Prep -> V3 ; -- speak, with, about --- dirV3 : V -> Prep -> V3 ; -- give,_,to --- dirdirV3 : V -> 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 ; --- mkV2S : V -> Prep -> V2S ; --- mkVV : V -> VV ; --- mkV2V : V -> Prep -> Prep -> V2V ; --- mkVA : V -> VA ; --- mkV2A : V -> Prep -> V2A ; --- mkVQ : V -> VQ ; --- mkV2Q : V -> Prep -> V2Q ; --- --- 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 Definitions of paradigms ----- ----- The definitions should not bother the user of the API. So they are ----- hidden from the document. --- --- Gender = MorphoHin.Gender ; --- Number = MorphoHin.Number ; --- Case = MorphoHin.Case ; --- human = Masc ; --- nonhuman = Neutr ; --- masculine = Masc ; --- feminine = Fem ; --- singular = Sg ; --- plural = Pl ; --- nominative = Nom ; --- genitive = Gen ; --- --- 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 --- } ; --- --- 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 -> --- mkNoun man man's men men's ** {g = Neutr ; lock_N = <>} ; --- --- genderN g man = {s = man.s ; g = g ; lock_N = <>} ; --- --- compoundN s n = {s = \\x,y => s ++ n.s ! x ! y ; g=n.g ; lock_N = <>} ; --- --- mkPN = overload { --- mkPN : Str -> PN = regPN ; --- mkPN : N -> PN = nounPN --- } ; --- --- --- mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p.s} ; --- regN2 n = mkN2 (regN n) (mkPrep "of") ; --- mkN3 = \n,p,q -> n ** {lock_N3 = <> ; 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 -> n ** {lock_N2 = <> ; c2 = p.s} ; --- cnN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p.s ; c3 = q.s} ; --- --- regPN n = regGenPN n human ; --- regGenPN n g = nameReg n g ** {g = g ; lock_PN = <>} ; --- nounPN n = {s = n.s ! singular ; g = n.g ; lock_PN = <>} ; --- --- mk2A a b = mkAdjective a a a b ** {lock_A = <>} ; --- regA a = regADeg a ** {lock_A = <>} ; --- --- mkA2 a p = a ** {c2 = p.s ; lock_A2 = <>} ; --- --- ADeg = A ; ---- --- --- mkADeg a b c d = mkAdjective a b c d ** {lock_A = <>} ; --- --- regADeg happy = --- let --- happ = init happy ; --- y = last happy ; --- happie = case y of { --- "y" => happ + "ie" ; --- "e" => happy ; --- _ => happy + "e" --- } ; --- happily : Str = case happy of { --- _ + "y" => happ + "ily" ; --- _ + "ll" => happy + "y" ; --- _ => happy + "ly" --- } ; --- in mkADeg happy (happie + "r") (happie + "st") happily ; --- --- duplADeg fat = --- mkADeg fat --- (fat + last fat + "er") (fat + last fat + "est") (fat + "ly") ; --- --- compoundADeg a = --- let ad = (a.s ! AAdj Posit) --- in mkADeg ad ("more" ++ ad) ("most" ++ ad) (a.s ! AAdv) ; --- --- adegA a = a ; --- --- mkAdv x = ss x ** {lock_Adv = <>} ; --- mkAdV x = ss x ** {lock_AdV = <>} ; --- mkAdA x = ss x ** {lock_AdA = <>} ; --- --- mkPrep p = ss p ** {lock_Prep = <>} ; --- noPrep = mkPrep [] ; --- --- mk5V a b c d e = mkVerb a b c d e ** {s1 = [] ; lock_V = <>} ; --- --- regV cry = --- let --- cr = init cry ; --- y = last cry ; --- cries = (regN cry).s ! Pl ! Nom ; -- ! --- crie = init cries ; --- cried = case last crie of { --- "e" => crie + "d" ; --- _ => crie + "ed" --- } ; --- crying = case y of { --- "e" => case last cr of { --- "e" => cry + "ing" ; --- _ => cr + "ing" --- } ; --- _ => cry + "ing" --- } --- in mk5V cry cries cried cried crying ; --- --- reg2V fit fitted = --- let fitt = Predef.tk 2 fitted ; --- in mk5V fit (fit + "s") (fitt + "ed") (fitt + "ed") (fitt + "ing") ; --- --- 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 = [] ; lock_V = <>} ; --- --- irreg4V x y z w = let reg = (regV x).s in --- mk5V x (reg ! VPres) y z w ** {s1 = [] ; lock_V = <>} ; --- --- irregDuplV fit y z = --- let --- fitting = (regDuplV fit).s ! VPresPart --- in --- mk5V fit (fit + "s") y z fitting ; --- --- partV v p = verbPart v p ** {lock_V = <>} ; --- reflV v = {s = v.s ; part = v.part ; lock_V = v.lock_V ; isRefl = True} ; --- --- prepV2 v p = v ** {s = v.s ; s1 = v.s1 ; c2 = p.s ; lock_V2 = <>} ; --- dirV2 v = prepV2 v noPrep ; --- --- mkV3 v p q = v ** {s = v.s ; s1 = v.s1 ; c2 = p.s ; c3 = q.s ; lock_V3 = <>} ; --- dirV3 v p = mkV3 v noPrep p ; --- dirdirV3 v = dirV3 v noPrep ; --- --- mkVS v = v ** {lock_VS = <>} ; --- mkVV v = { --- s = table {VVF vf => v.s ! vf ; _ => variants {}} ; --- isAux = False ; lock_VV = <> --- } ; --- mkVQ v = v ** {lock_VQ = <>} ; --- --- V0 : Type = V ; ----- V2S, V2V, V2Q : Type = V2 ; --- AS, A2S, AV : Type = A ; --- A2V : Type = A2 ; --- --- mkV0 v = v ** {lock_V = <>} ; --- mkV2S v p = prepV2 v p ** {lock_V2S = <>} ; --- mkV2V v p t = prepV2 v p ** {isAux = False ; lock_V2V = <>} ; --- mkVA v = v ** {lock_VA = <>} ; --- mkV2A v p = prepV2 v p ** {lock_V2A = <>} ; --- mkV2Q v p = prepV2 v p ** {lock_V2Q = <>} ; --- --- mkAS v = v ** {lock_A = <>} ; --- mkA2S v p = mkA2 v p ** {lock_A = <>} ; --- mkAV v = v ** {lock_A = <>} ; --- mkA2V v p = mkA2 v p ** {lock_A2 = <>} ; --- --- ----- 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 --- } ; --- --- --- 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") (fat + "ly") ** {lock_A = <>} ; --- mkA : (good,better,best,well : Str) -> A = \a,b,c,d -> --- mkAdjective a b c d ** {lock_A = <>} --- } ; --- --- compoundA = compoundADeg ; --- --- --- 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 --- }; --- --- prepV2 : V -> Prep -> V2 ; --- dirV2 : V -> V2 ; --- --- mkV2 = overload { --- mkV2 : V -> Prep -> V2 = prepV2; --- mkV2 : V -> V2 = dirV2 --- }; --- --- ------- 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 ; --- --- --- -} +--# -path=.:../abstract:../../prelude:../common +-- +----1 Hinu Lexical Paradigms + +resource ParadigmsHin = open + Predef, + Prelude, + MorphoHin, + CatHin, + CommonHindustani, + ParamX + in { +--2 Parameters + +oper + masculine : Gender ; + feminine : Gender ; + singular : Number; + plural : Number; + + singular = Sg ; plural = Pl; + + masculine = Masc ; feminine = Fem ; --i + + +--2 Nouns + + mkN = overload { + mkN : Str -> N + = \s -> regNoun s ** {lock_N = <>} ; + mkN : Str -> Gender -> N + = \s,g -> reggNoun s g ** {lock_N = <>} ; + mkN : (x1,_,_,_,_,x6 : Str) -> Gender -> N + = \sd,so,sv,pd,po,pv,g -> mkNoun sd so sv pd po pv g ** {lock_N = <>} ; + } ; + mkN2 : N -> Prep -> Str -> N2; + mkN2 = \n,p,c -> n ** {lock_N2 = <> ; c2 = p.s ! n.g ; c3 = c } ; + + mkN3 : N -> Prep -> Str -> Str-> N3 ; + mkN3 = \n,p,q,r -> n ** {lock_N3 = <> ; c2 = p.s ! n.g ; c3 = q ; c4 = r} ; + +-- Compound Nouns + + mkCmpdNoun : Str -> N -> N + = \s,noun -> {s =\\n,c => s ++ noun.s ! n ! c ; g = noun.g ; lock_N = <>}; + + +-- Proper names + mkPN : Str -> PN = \s -> let n = regNoun s in {s = n.s ! Sg ; g = n.g ; lock_PN = <>} ; + personalPN : Str -> Str -> Str -> Str -> Number -> Gender -> UPerson -> Pron = \s1,s2,s3,sp,nn,g,p -> let n = mkPron s1 s2 s3 in {s = n.s ; a = toAgr nn p g ; ps = sp ; lock_Pron = <>}; + demoPN : Str -> Str -> Str -> Quant = \s1,s2,s3 -> let n = makeDemonPronForm s1 s2 s3 in {s = n.s ; a = defaultAgr ; lock_Quant = <>}; + mkDet : Str -> Str -> Str -> Str -> Number -> Det = \s1,s2,s3,s4,nb -> let dt = makeDet s1 s2 s3 s4 nb in {s = dt.s ; n = nb ; lock_Det = <>}; + mkIP : (x1,x2,x3:Str) -> Number -> Gender -> IP = \s1,s2,s3,n,g -> let p = mkIntPronForm s1 s2 s3 in { s = p.s ; n = n ; g = g ; lock_IP = <>}; + +-- AdN + mkAdN : Str -> AdN = \s -> { s = s ; p = False ; lock_AdN = <> } ; +--2 Adjectives + + mkA = overload { + mkA : Str-> A + = \s -> regAdjective s ** {lock_A = <>} ; + mkA : Str -> Str -> A2 + = \a,c -> let n = regAdjective a in {s = n.s; c2 = c} ** {lock_A2 = <>} ; + } ; + +--2 Verbs + + mkV : Str -> V + = \s -> mkVerb s ** {lock_V = <>} ; + + mkV2 = overload { + mkV2 : Str -> V2 + = \s -> mkVerb s ** {c2 = {s = [] ; c = VTrans} ; lock_V2 = <>} ; + mkV2 : V -> V2 + = \v -> v ** {c2 = {s = [] ; c = VTrans} ; lock_V2 = <>} ; + mkV2 : V -> Str -> V2 + = \v,p -> v ** {c2 = {s = p ; c = VTrans} ; lock_V2 = <>} ; + } ; + + mkV3 : V -> Str -> Str -> V3; + mkV3 v p q = v ** { c2 = p ; c3 = q ; lock_V3 = <>} ; + mkV2V : V -> Str -> Str -> Bool -> V2V ; + mkV2V v s1 s2 b = v ** {isAux = b ; c1 = s1 ; c2 = s2 ; lock_V2V = <>} ; + +-- compund verbs + compoundV = overload { + compoundV : Str -> V -> V = \s,v -> {s = \\vf => s ++ v.s ! vf ; lock_V = <>} ; + compoundV : Str -> V2 -> V = \s,v -> {s = \\vf => s ++ v.s ! vf ; lock_V = <>} ; + }; + + +----2 Adverbs + mkAdv : Str -> Adv = \str -> {s = \\_ => str ; lock_Adv = <>}; + +----2 Prepositions + + mkPrep : Str -> Str -> Prep ; + mkPrep s1 s2 = makePrep s1 s2 ** {lock_Prep = <>}; + +--3 Determiners and quantifiers + +-- mkQuant : overload { + mkQuant : Pron -> Quant ; +-- mkQuant : (no_sg, no_pl, none_sg, non_pl : Str) -> Quant ; +-- } ; + +-- mkQuant = overload { + mkQuant : Pron -> Quant = \p -> {s = \\_,_,c => p.s!c ;a = p.a ; lock_Quant = <>}; +-- mkQuant : (no_sg, no_pl, none_sg, non_pl : Str) -> Quant = mkQuantifier; +-- } ; + +--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) + } ; + 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}) ; + +-- mkV0 : V -> V0 ; +-- mkVS : V -> VS ; +-- mkV2S : V -> Prep -> V2S ; + mkVV : V -> VV = \v -> lin VV (v ** {isAux = False}); + + +-- mkV2V : V -> Prep -> Prep -> V2V ; +-- mkVA : V -> VA ; +-- mkV2A : V -> Prep -> V2A ; +-- mkVQ : V -> VQ ; +-- mkV2Q : V -> Prep -> V2Q ; +-- +-- 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 Definitions of paradigms +---- +---- The definitions should not bother the user of the API. So they are +---- hidden from the document. +-- +-- Gender = MorphoHin.Gender ; +-- Number = MorphoHin.Number ; +-- Case = MorphoHin.Case ; +-- human = Masc ; +-- nonhuman = Neutr ; +-- masculine = Masc ; +-- feminine = Fem ; +-- singular = Sg ; +-- plural = Pl ; +-- nominative = Nom ; +-- genitive = Gen ; + +} diff --git a/lib/src/hindi/PhraseHin.gf b/lib/src/hindi/PhraseHin.gf index 16a492029..1e4bf1000 100644 --- a/lib/src/hindi/PhraseHin.gf +++ b/lib/src/hindi/PhraseHin.gf @@ -1,24 +1,2 @@ -concrete PhraseHin of Phrase = CatHin ** open Prelude, ResHin in { --- --- lin --- PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; --- --- UttS s = s ; --- UttQS qs = {s = qs.s ! QDir} ; --- UttImpSg pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Sg False} ; --- UttImpPl pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Pl False} ; --- UttImpPol pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Sg True} ; --- --- UttIP ip = {s = ip.s ! Nom} ; --- Acc also --- UttIAdv iadv = iadv ; --- UttNP np = {s = np.s ! Nom} ; --- UttVP vp = {s = infVP False vp (agrP3 Sg)} ; --- UttAdv adv = adv ; --- --- NoPConj = {s = []} ; --- PConjConj conj = {s = conj.s2} ; --- --- --- NoVoc = {s = []} ; --- VocNP np = {s = "," ++ np.s ! Nom} ; --- -} +concrete PhraseHin of Phrase = CatHin ** PhraseHindustani with + (ResHindustani = ResHin) ; diff --git a/lib/src/hindi/QuestionHin.gf b/lib/src/hindi/QuestionHin.gf index e35c2c3d3..02d72e9fc 100644 --- a/lib/src/hindi/QuestionHin.gf +++ b/lib/src/hindi/QuestionHin.gf @@ -1,55 +1,2 @@ -concrete QuestionHin of Question = CatHin ** open ResHin, Prelude in { --- --- flags optimize=all_subs ; --- --- lin --- --- QuestCl cl = { --- s = \\t,a,p => --- let cls = cl.s ! t ! a ! p --- in table { --- QDir => cls ! OQuest ; --- QIndir => "if" ++ cls ! ODir --- } ---- "whether" in ExtHin --- } ; --- --- QuestVP qp vp = --- let cl = mkClause (qp.s ! Nom) (agrP3 qp.n) vp --- in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ; --- --- QuestSlash ip slash = --- mkQuestion (ss (slash.c2 ++ ip.s ! Acc)) slash ; --- --- stranding in ExratHin --- --- QuestIAdv iadv cl = mkQuestion iadv cl ; --- --- QuestIComp icomp np = --- mkQuestion icomp (mkClause (np.s ! Nom) np.a (predAux auxBe)) ; --- --- --- PrepIP p ip = {s = p.s ++ ip.s ! Acc} ; --- --- AdvIP ip adv = { --- s = \\c => ip.s ! c ++ adv.s ; --- n = ip.n --- } ; --- --- IdetCN idet cn = { --- s = \\c => idet.s ++ cn.s ! idet.n ! c ; --- n = idet.n --- } ; --- --- IdetIP idet = { --- s = \\c => idet.s ; --- n = idet.n --- } ; --- --- IdetQuant idet num = { --- s = idet.s ! num.n ++ num.s ; --- n = num.n --- } ; --- --- CompIAdv a = a ; --- CompIP p = ss (p.s ! Nom) ; --- -} +concrete QuestionHin of Question = CatHin ** QuestionHindustani with + (ResHindustani = ResHin) ; diff --git a/lib/src/hindi/README b/lib/src/hindi/README new file mode 100644 index 000000000..bd7d42006 --- /dev/null +++ b/lib/src/hindi/README @@ -0,0 +1,10 @@ +Some of the sources are transliterated, in + + ./src + ../hindustani + +Before compilation, do + + gf -s "such" ++ "that" ++ cl.s ! t ! a ! p ! ODir ; --- c = Nom --- } ; --- --- RelVP rp vp = { --- s = \\t,ant,b,ag => --- let --- agr = case rp.a of { --- RNoAg => ag ; --- RAg a => a --- } ; --- cl = mkClause (rp.s ! RC (fromAgr agr).g Nom) agr vp --- in --- cl.s ! t ! ant ! b ! ODir ; --- c = Nom --- } ; --- ----- Pied piping: "at which we are looking". Stranding and empty ----- relative are defined in $ExtraHin.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 = Acc --- } ; --- --- FunRP p np rp = { --- s = \\c => np.s ! Acc ++ p.s ++ rp.s ! RPrep (fromAgr np.a).g ; --- a = RAg np.a --- } ; --- --- IdRP = --- let varr : Str -> Str = \x -> variants {x ; "that"} --- for bwc --- in { --- s = table { --- RC _ Gen => "whose" ; --- RC Neutr _ => varr "which" ; --- RC _ Acc => varr "whom" ; --- RC _ Nom => varr "who" ; --- RPrep Neutr => "which" ; --- RPrep _ => "whom" --- } ; --- a = RNoAg --- } ; --- -} +concrete RelativeHin of Relative = CatHin ** RelativeHindustani with + (ResHindustani = ResHin) ; diff --git a/lib/src/hindi/ResHin.gf b/lib/src/hindi/ResHin.gf index 17ef91235..1bb326211 100644 --- a/lib/src/hindi/ResHin.gf +++ b/lib/src/hindi/ResHin.gf @@ -1,300 +1,2 @@ ---# -path=.:../abstract:../common:../../prelude --- ---1 Hindi auxiliary operations. --- --- This module contains operations that are needed to make the --- resource syntax work. - -resource ResHin = ParamX ** open Prelude in { - - flags optimize=all ; - - param - Case = Dir | Obl | Voc ; - Gender = Masc | Fem ; - - oper - Noun = {s : Number => Case => Str ; g : Gender} ; - - mkNoun : (x1,_,_,_,_,x6 : Str) -> Gender -> Noun = - \sd,so,sv,pd,po,pv,g -> { - s = table Number [table Case [sd;so;sv] ; table Case [pd;po;pv]] ; - g = g - } ; - - reggNoun : Str -> Gender -> Noun = \s,g -> case of { - <-(_ + ("A" | "I")), Fem> => - mkNoun s s s (s + "eM") (s + "oM") (s + "o") Fem ; - _ => regNoun s ** {g = g} - } ; - - regNoun : Str -> Noun = \s -> case s of { - x + "iyA" => - mkNoun s s s (x + "iyAM") (x + "iyoN") (x + "iyo") Fem ; - x + "A" => - mkNoun s (x + "e") (x + "e") (x + "e") (x + "oN") (x + "o") Masc ; - x + "I" => - mkNoun s s s (x + "iyAM") (x + "iyoN") (x + "iyo") Fem ; - _ => - mkNoun s s s s (s + "oN") (s + "o") Masc - } ; - - - Adjective = {s : Gender => Number => Case => Str} ; - - mkAdjective : (x1,x2,x3 : Str) -> Adjective = \smd,sm,f -> { - s = \\g,n,c => case of { - => smd ; - => sm ; - _ => f - } - } ; - - regAdjective : Str -> Adjective = \s -> case s of { - acch + "A" => mkAdjective s (acch + "e") (acch + "I") ; - _ => mkAdjective s s s - } ; - - param - VForm = - VInf - | VStem - | VImpf Gender Number - | VPerf Gender Number - | VSubj Number Person - | VFut Number Person Gender - | VAbs - | VReq - | VImp - | VReqFut - ; - - oper - Verb = {s : VForm => Str} ; - - mkVerb : (x1,_,_,_,_,_,_,_,_,_,_,_,_,_,x15 : Str) -> Verb = - \inf,stem,ims,imp,ifs,ifp,pms,pmp,pfs,pfp,ss1,ss2,sp2,sp3,r -> { - s = - let ga : Number -> Gender -> Str = \n,g -> - (regAdjective "gA").s ! g ! n ! Dir - in table { - VInf => inf ; - VStem => stem ; - VImpf Masc Sg => ims ; - VImpf Masc Pl => imp ; - VImpf Fem Sg => ifs ; - VImpf Fem Pl => ifp ; - VPerf Masc Sg => pms ; - VPerf Masc Pl => pmp ; - VPerf Fem Sg => pfs ; - VPerf Fem Pl => pfp ; - VSubj Sg P1 => ss1 ; - VSubj Sg _ => ss2 ; - VSubj Pl P2 => sp2 ; - VSubj Pl _ => sp3 ; - VFut Sg P1 g => ss1 + ga Sg g ; - VFut Sg _ g => ss2 + ga Sg g ; - VFut Pl P2 g => sp2 + ga Pl g ; - VFut Pl _ g => sp3 + ga Pl g ; - VAbs => stem + "kar" ; --- ke - VReq => r ; - VImp => sp2 ; - VReqFut => stem + "ie-gA" - } - } ; - - regVerb : Str -> Verb = \cal -> - let caly : Str = case cal of { - _ + ("A" | "e") => cal + "y" ; - c + "U" => c + "uy" ; - c + "I" => c + "iy" ; - _ => cal - } - in - mkVerb - (cal + "nA") cal - (cal + "tA") (cal + "te") (cal + "tI") (cal + "tI") - (caly + "A") (caly + "e") (caly + "I") (caly + "IN") - (caly + "UM") (caly + "e") (caly + "o") (caly + "eN") - (caly + "ie-") ; - - param - CTense = CPresent | CPast | CFuture ; - oper - copula : CTense -> Number -> Person -> Gender -> Str = \t,n,p,g -> - case of { - => "hUM" ; - => "hE" ; - => "hE" ; - => "hEN" ; - => "ho" ; - => "hEN" ; - => "TA" ; - => "TI" ; - => "Te" ; - => "TIN" ; - => "hUNgA" ; - => "hUNgI" ; - => "hogA" ; - => "hogI" ; - => "hoge" ; - => "hoNge" ; - => "hogi:" ; - => "hoNgi:" - } ; - - param - PronCase = PC Case | PObj | PPoss ; - oper - personalPronoun : Person -> Number -> {s : PronCase => Str} = \p,n -> - case of { - => {s = table PronCase ["mEN" ; "muJ" ; "muJ" ; "muJe" ; "merA"]} ; - => {s = table PronCase ["ham" ; "ham" ; "ham" ; "hameN" ; "hamArA"]} ; - => {s = table PronCase ["tU" ; "tuJ" ; "tuJ" ; "tuJe" ; "terA"]} ; - => {s = table PronCase ["tum" ; "tum" ; "tum" ; "tum" ; "tumhArA"]} ; - => {s = table PronCase ["vah" ; "u-s" ; "u-s" ; "u-se" ; "u-skA"]} ; - => {s = table PronCase ["ve" ; "u-n" ; "u-n" ; "u-nheN" ; "u-nkA"]} - } ; - ---- the third is the vocative - is it really this way? - - -- the Hindi verb phrase - ---- CTense = CPresent | CPast | CFuture ; - - - - param - VPHTense = - VPGenPres -- impf hum nahim "I go" - | VPImpPast -- impf Ta nahim "I went" - | VPContPres -- stem raha hum nahim "I am going" - | VPContPast -- stem raha Ta nahim "I was going" - | VPPerf -- perf na/nahim "I went" - | VPPerfPres -- perf hum na/nahim "I have gone" - | VPPerfPast -- perf Ta na/nahim "I had gone" - | VPSubj -- subj na "I may go" - | VPFut -- fut na/nahim "I shall go" - ; - - VPHForm = - VPTense VPHTense Agr -- 9 * 12 - | VPReq - | VPImp - | VPReqFut - | VPInf - | VPStem - ; - - VType = VIntrans | VTrans | VTransPost ; - - oper - objVType : VType -> NPCase = \vt -> case vt of { - VTrans => NPObj ; - _ => NPC Obl - } ; - - VPH : Type = { - s : Bool => VPHForm => {fin, inf, neg : Str} ; - obj : {s : Str ; a : Agr} ; - subj : VType ; - comp : Agr => Str - } ; - - predV : Verb -> VPH = \verb -> { - s = \\b,vh => - let - na = if_then_Str b [] "na" ; - nahim = if_then_Str b [] "nahIN" ; - in - case vh of { - VPTense VPGenPres (Ag g n p) => - {fin = copula CPresent n p g ; inf = verb.s ! VImpf g n ; neg = nahim} ; - VPTense VPImpPast (Ag g n p) => - {fin = copula CPast n p g ; inf = verb.s ! VImpf g n ; neg = nahim} ; - VPTense VPContPres (Ag g n p) => - {fin = copula CPresent n p g ; - inf = verb.s ! VStem ++ raha g n ; neg = nahim} ; - VPTense VPContPast (Ag g n p) => - {fin = copula CPast n p g ; - inf = verb.s ! VStem ++ raha g n ; neg = nahim} ; - VPTense VPPerf (Ag g n _) => - {fin = verb.s ! VPerf g n ; inf = [] ; neg = nahim} ; - VPTense VPPerfPres (Ag g n p) => - {fin = copula CPresent n p g ; inf = verb.s ! VPerf g n ; neg = nahim} ; - VPTense VPPerfPast (Ag g n p) => - {fin = copula CPast n p g ; inf = verb.s ! VPerf g n ; neg = nahim} ; - VPTense VPSubj (Ag _ n p) => {fin = verb.s ! VSubj n p ; inf = [] ; neg = na} ; - VPTense VPFut (Ag g n p) => {fin = verb.s ! VFut n p g ; inf = [] ; neg = na} ; - VPInf => {fin = verb.s ! VStem ; inf = [] ; neg = na} ; - _ => {fin = verb.s ! VStem ; inf = [] ; neg = na} ---- - } ; - obj = {s = [] ; a = defaultAgr} ; - subj = VIntrans ; - comp = \\_ => [] - } ; - - raha : Gender -> Number -> Str = \g,n -> - (regAdjective "rahA").s ! g ! n ! Dir ; - - VPHSlash = VPH ** {c2 : Compl} ; - - Clause : Type = {s : VPHTense => Bool => Str} ; - - Compl : Type = {s : Str ; c : VType} ; - - insertObject : NP -> VPHSlash -> VPH = \np,vps -> { - s = vps.s ; - obj = {s = vps.obj.s ++ np.s ! objVType vps.c2.c ++ vps.c2.s ; a = np.a} ; - subj = vps.c2.c ; - comp = vps.comp - } ; - - param - Agr = Ag Gender Number Person ; - NPCase = NPC Case | NPObj | NPErg ; - - oper - agrP3 : Gender -> Number -> Agr = \g,n -> Ag g n P3 ; - - defaultAgr : Agr = agrP3 Masc Sg ; - - npcase2case : NPCase -> Case = \npc -> case npc of { - NPC c => c ; - NPObj => Obl ; - NPErg => Obl - } ; - - np2pronCase : NPCase -> PronCase = \np -> case np of { - NPC c => PC c ; - NPObj => PObj ; - NPErg => PC Obl - } ; - - toNP : (Case => Str) -> NPCase -> Str = \pn, npc -> case npc of { - NPC c => pn ! c ; - NPObj => pn ! Obl ; - NPErg => pn ! Obl ++ "ne" - } ; - - NP : Type = {s : NPCase => Str ; a : Agr} ; - - mkClause : NP -> VPH -> Clause = \np,vp -> { - s = \\vt,b => - let - subjagr : NPCase * Agr = case vt of { - VPPerf => case vp.subj of { - VTrans => ; - VTransPost => ; - _ => - } ; - _ => - } ; - subj = subjagr.p1 ; - agr = subjagr.p2 ; - vps = vp.s ! b ! VPTense vt agr ; - in - np.s ! subj ++ vp.obj.s ++ vp.comp ! np.a ++ vps.neg ++ vps.inf ++ vps.fin - } ; - - -} +instance ResHin of ResHindustani = DiffHin ** open CommonHindustani, Prelude, Predef in { +} ; diff --git a/lib/src/hindi/SentenceHin.gf b/lib/src/hindi/SentenceHin.gf index d4930c9af..0017720c2 100644 --- a/lib/src/hindi/SentenceHin.gf +++ b/lib/src/hindi/SentenceHin.gf @@ -1,66 +1,2 @@ -concrete SentenceHin of Sentence = CatHin ** open Prelude, ResHin in { - - flags optimize=all_subs ; - - lin - - PredVP np vp = mkClause np vp ; - --- PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ; --- --- ImpVP vp = { --- s = \\pol,n => --- let --- agr = AgP2 (numImp n) ; --- verb = infVP True vp agr ; --- dont = case pol of { --- CNeg True => "don't" ; --- CNeg False => "do" ++ "not" ; --- _ => [] --- } --- in --- dont ++ verb --- } ; --- --- SlashVP np vp = --- mkClause (np.s ! Nom) np.a vp ** {c2 = vp.c2} ; --- --- AdvSlash slash adv = { --- s = \\t,a,b,o => slash.s ! t ! a ! b ! o ++ adv.s ; --- c2 = slash.c2 --- } ; --- --- SlashPrep cl prep = cl ** {c2 = prep.s} ; --- --- SlashVS np vs slash = --- mkClause (np.s ! Nom) np.a --- (insertObj (\\_ => conjThat ++ slash.s) (predV vs)) ** --- {c2 = slash.c2} ; --- --- EmbedS s = {s = conjThat ++ s.s} ; --- EmbedQS qs = {s = qs.s ! QIndir} ; --- EmbedVP vp = {s = infVP False vp (agrP3 Sg)} ; --- agr --- --- UseCl t a p cl = { --- s = t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! ctr p.p ! ODir --- } ; --- UseQCl t a p cl = { --- s = \\q => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! ctr p.p ! q --- } ; --- UseRCl t a p cl = { --- s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! ctr p.p ! r ; --- c = cl.c --- } ; --- UseSlash t a p cl = { --- s = t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! ctr p.p ! ODir ; --- c2 = cl.c2 --- } ; --- --- AdvS a s = {s = a.s ++ "," ++ s.s} ; --- --- RelS s r = {s = s.s ++ "," ++ r.s ! agrP3 Sg} ; --- --- oper --- ctr = contrNeg True ; -- contracted negations --- -} +concrete SentenceHin of Sentence = CatHin ** SentenceHindustani with + (ResHindustani = ResHin) ; diff --git a/lib/src/hindi/StructuralHin.gf b/lib/src/hindi/StructuralHin.gf index 2e99ee80b..179fa7aa6 100644 --- a/lib/src/hindi/StructuralHin.gf +++ b/lib/src/hindi/StructuralHin.gf @@ -1,134 +1,129 @@ -concrete StructuralHin of Structural = CatHin ** - open MorphoHin, (P = ParadigmsHin), Prelude in { - - flags optimize=all ; - - lin --- above_Prep = ss "above" ; --- after_Prep = ss "after" ; --- all_Predet = ss "all" ; --- almost_AdA, almost_AdN = ss "almost" ; --- although_Subj = ss "although" ; --- always_AdV = ss "always" ; --- and_Conj = sd2 [] "and" ** {n = Pl} ; ------b and_Conj = ss "and" ** {n = Pl} ; --- because_Subj = ss "because" ; --- before_Prep = ss "before" ; --- behind_Prep = ss "behind" ; --- between_Prep = ss "between" ; --- both7and_DConj = sd2 "both" "and" ** {n = Pl} ; --- but_PConj = ss "but" ; --- by8agent_Prep = ss "by" ; --- by8means_Prep = ss "by" ; --- can8know_VV, can_VV = { --- s = table { --- VVF VInf => ["be able to"] ; --- VVF VPres => "can" ; --- VVF VPPart => ["been able to"] ; --- VVF VPresPart => ["being able to"] ; --- VVF VPast => "could" ; --# notpresent --- VVPastNeg => "couldn't" ; --# notpresent --- VVPresNeg => "can't" --- } ; --- isAux = True --- } ; --- during_Prep = ss "during" ; --- either7or_DConj = sd2 "either" "or" ** {n = Sg} ; --- everybody_NP = regNP "everybody" Sg ; --- every_Det = mkDeterminer Sg "every" ; --- everything_NP = regNP "everything" Sg ; --- everywhere_Adv = ss "everywhere" ; --- few_Det = mkDeterminer Pl "few" ; ------ first_Ord = ss "first" ; DEPRECATED --- for_Prep = ss "for" ; --- from_Prep = ss "from" ; - he_Pron = personalPronoun P3 Sg ** {a = Ag Masc Sg P3} ; --- here_Adv = ss "here" ; --- here7to_Adv = ss ["to here"] ; --- here7from_Adv = ss ["from here"] ; --- how_IAdv = ss "how" ; --- how8many_IDet = mkDeterminer Pl ["how many"] ; --- if_Subj = ss "if" ; --- in8front_Prep = ss ["in front of"] ; - i_Pron = personalPronoun P1 Sg ** {a = Ag Masc Sg P1} ; - in_Prep = ss "meN" ; --- it_Pron = mkNP "it" "it" "its" Sg P3 Neutr ; --- less_CAdv = ss "less" ; --- many_Det = mkDeterminer Pl "many" ; --- more_CAdv = ss "more" ; --- most_Predet = ss "most" ; --- much_Det = mkDeterminer Sg "much" ; --- must_VV = { --- s = table { --- VVF VInf => ["have to"] ; --- VVF VPres => "must" ; --- VVF VPPart => ["had to"] ; --- VVF VPresPart => ["having to"] ; --- VVF VPast => ["had to"] ; --# notpresent --- VVPastNeg => ["hadn't to"] ; --# notpresent --- VVPresNeg => "mustn't" --- } ; --- isAux = True --- } ; ------b no_Phr = ss "no" ; --- no_Utt = ss "no" ; --- on_Prep = ss "on" ; ------- one_Quant = mkDeterminer Sg "one" ; -- DEPRECATED --- only_Predet = ss "only" ; --- or_Conj = sd2 [] "or" ** {n = Sg} ; --- otherwise_PConj = ss "otherwise" ; --- part_Prep = ss "of" ; --- please_Voc = ss "please" ; --- possess_Prep = ss "of" ; --- quite_Adv = ss "quite" ; --- she_Pron = mkNP "she" "her" "her" Sg P3 Fem ; --- so_AdA = ss "so" ; --- somebody_NP = regNP "somebody" Sg ; --- someSg_Det = mkDeterminer Sg "some" ; --- somePl_Det = mkDeterminer Pl "some" ; --- something_NP = regNP "something" Sg ; --- somewhere_Adv = ss "somewhere" ; --- that_Quant = mkQuant "that" "those" ; --- there_Adv = ss "there" ; --- there7to_Adv = ss "there" ; --- there7from_Adv = ss ["from there"] ; --- therefore_PConj = ss "therefore" ; --- they_Pron = mkNP "they" "them" "their" Pl P3 Masc ; ---- --- this_Quant = mkQuant "this" "these" ; --- through_Prep = ss "through" ; --- too_AdA = ss "too" ; --- to_Prep = ss "to" ; --- under_Prep = ss "under" ; --- very_AdA = ss "very" ; --- want_VV = P.mkVV (P.regV "want") ; - we_Pron = personalPronoun P1 Pl ** {a = Ag Masc Pl P1} ; - --- whatPl_IP = mkIP "what" "what" "what's" Sg ; --- whatSg_IP = mkIP "what" "what" "what's" Sg ; --- when_IAdv = ss "when" ; --- when_Subj = ss "when" ; --- where_IAdv = ss "where" ; --- which_IQuant = {s = \\_ => "which"} ; ------b whichPl_IDet = mkDeterminer Pl ["which"] ; ------b whichSg_IDet = mkDeterminer Sg ["which"] ; --- whoSg_IP = mkIP "who" "whom" "whose" Sg ; --- whoPl_IP = mkIP "who" "whom" "whose" Pl ; --- why_IAdv = ss "why" ; --- without_Prep = ss "without" ; --- with_Prep = ss "with" ; ------b yes_Phr = ss "yes" ; --- yes_Utt = ss "yes" ; --- youSg_Pron = mkNP "you" "you" "your" Sg P2 Masc ; --- youPl_Pron = mkNP "you" "you" "your" Pl P2 Masc ; --- youPol_Pron = mkNP "you" "you" "your" Sg P2 Masc ; --- --- ---oper --- mkQuant : Str -> Str -> {s : Number => Str} = \x,y -> { --- s = table Number [x ; y] --- } ; --- - - -} --- +concrete StructuralHin of Structural = CatHin ** + open MorphoHin, ParadigmsHin, Prelude, NounHin,ParamX,CommonHindustani in { + + flags optimize=all ; + coding = utf8; + + lin + above_Prep = mkPrep "wपर" "wपर" ; + after_Prep = mkPrep ["कै बेद"] ["कै बेद"] ; + all_Predet = ss "तमम" ; + almost_AdA, almost_AdN = mkAdN "तqरयब" ; + although_Subj = ss "गरचh-" ; + always_AdV = ss "हमयXह" ; + and_Conj = sd2 [] "wर" ** {n = Pl} ; + because_Subj = ss "कयwनकh-" ; + before_Prep = mkPrep "पहलै" "पहलै" ; + behind_Prep = mkPrep "पयचh-ै" "पयचh-ै" ; + between_Prep = mkPrep "दरमयं" "दरमयं" ; + both7and_DConj = sd2 "दwनwं" "wर" ** {n = Pl} ; + but_PConj = ss "लयकन" ; + by8agent_Prep = mkPrep "" "" ; + by8means_Prep = mkPrep "" "" ; +-- can8know_VV,can_VV = mkV "सकन" ** { isAux = True} ; + during_Prep = mkPrep ["कै दरमयं"] ["कै दरमयं"] ; + either7or_DConj = sd2 "कwय यक" "य" ** {n = Sg} ; + everybody_NP = MassNP (UseN (ParadigmsHin.mkN "हर कwय" "हर कwय" "हर कwय" "हर कwय" "हर कwय" "हर कwय" Masc )); -- not a good way coz need to include NounHin +-- every_Det = mkDet "हर" Sg; + everything_NP = MassNP (UseN (ParadigmsHin.mkN "हर चयज़" "हर चयज़" "हर चयज़w" "सब चयज़यं" "सब चयज़wं" "सब चयज़w" Masc )); + everywhere_Adv = mkAdv "हर जगह" ; +-- few_Det = mkDet "चनद" Pl ; + first_Ord = {s = "पेहल" ; n = Sg} ; --DEPRECATED + for_Prep = mkPrep "कयलयै" "कयलयै" ; + from_Prep = mkPrep "सै" "सै" ; + he_Pron = personalPN "wह" "स" "" "स क" Sg Masc Pers3_Distant ; + here_Adv = mkAdv "यहं" ; + here7to_Adv = mkAdv "यहं पर" ; + here7from_Adv = mkAdv "यहं सै" ; + how_IAdv = ss "कयसै" ; + how8many_IDet = makeIDet "कतनै" "कतनय" Pl ; + if_Subj = ss "गर" ; + in8front_Prep = mkPrep ["कै समनै"] ["कै समनै"] ; + i_Pron = personalPN "मयं" "मजh-" "" "मयर" Sg Masc Pers1; + in_Prep = mkPrep "में" "में" ; + it_Pron = personalPN "यह" "यह" "यह" "स क" Sg Masc Pers3_Near; + less_CAdv = {s = "कम" ; p = ""} ; +-- many_Det = mkDet "बहत ज़यदह" Pl ; + more_CAdv = {s = "ज़यदh-" ; p = "" } ; + most_Predet = ss "ज़यदह तर" ; + --much_Det = mkDet "बहत" Pl ; +-- must_VV = { +-- s = table { +-- VVF VInf => ["हवे तॉ"] ; +-- VVF VPres => "मुसत" ; +-- VVF VPPart => ["हद तॉ"] ; +-- VVF VPresPart => ["हविनग तॉ"] ; +-- VVF VPast => ["हद तॉ"] ; --# notpresent +-- VVPastNeg => ["हदn'त तॉ"] ; --# notpresent +-- VVPresNeg => "मुसतn'त" +-- } ; +-- isAux = True +-- } ; +-----b no_Phr = ss "नॉ" ; + no_Utt = ss "नहयं" ; + on_Prep = mkPrep "पर" "पर" ; +-- one_Quant = demoPN "यक" "यक" "यक" ; -- DEPRECATED + only_Predet = ss "सरf" ; + or_Conj = sd2 [] "य" ** {n = Sg} ; + otherwise_PConj = ss "य पh-र" ; + part_Prep = mkPrep "" "" ; + please_Voc = ss "महरबनि" ; + possess_Prep = mkPrep "क" "कय" ; + quite_Adv = ss "कहमॉसह" ; + she_Pron = personalPN "wह" "स" "wह" "स कय" Sg Fem Pers3_Distant ; + so_AdA = ss "सॉ" ; + somebody_NP = MassNP (UseN (ParadigmsHin.mkN "कwय" "कwय" "कwय" "कwय" "कwय" "कwय" Masc )); + --someSg_Det = mkDet "कचh-" Sg ; + --somePl_Det = mkDet "कचh-" Pl ; + something_NP = MassNP (UseN (ParadigmsHin.mkN "कwय चयज़" "कwय चयज़" "कwय चयज़" "कh- चयज़यं" "कh- चयज़wं" "कh- चयज़w" Masc )); + somewhere_Adv = mkAdv "कहिन पर" ; + that_Quant = demoPN "wह" "स" "न" ; + that_Subj = ss "कह"; + there_Adv = mkAdv "wहं" ; + there7to_Adv = mkAdv "wहं पर" ; + there7from_Adv = mkAdv ["wहं सै"] ; + therefore_PConj = ss "स लयै" ; + they_Pron = personalPN "wह" "wह" "wह" "न क" Pl Masc Pers3_Distant ; ---- + this_Quant = demoPN "यह" "स" "न"; + through_Prep = mkPrep ["मयं सै"] ["मयं सै"] ; + too_AdA = ss "बहत" ; + to_Prep = mkPrep "कw" "कw" ; + under_Prep = mkPrep "नयचै" "नयचै" ; + very_AdA = ss "बहत" ; +-- want_VV = mkV "चहन" ** { isAux = False} ; + we_Pron = personalPN "हम" "हम" "हम" "हमर" Pl Masc Pers1 ; + whatSg_IP = mkIP "कय" "किस" "किस" Sg Masc ; + whatPl_IP = mkIP "कय" "किन" "किन" Pl Masc ; + when_IAdv = ss "कब" ; + when_Subj = ss "कब" ; + where_IAdv = ss "कहं" ; + which_IQuant = {s = \\_ => "कwन सय"} ; +-- whichPl_IDet = makeDet "कwन स" "कwन सय" "कwन सै" "कwन सय" ; +-- whichSg_IDet = makeDet "कwन स" "कwन सय" "कwन सै" "कwन सय" ; + whoSg_IP = mkIP "कwन" "किस" "किस" Sg Masc ; + whoPl_IP = mkIP "कwन" "कन" "कनहwं" Pl Masc ; + why_IAdv = ss "कयwं" ; + without_Prep = mkPrep ["कै बघयर"] ["कै बघयर"] ; + with_Prep = mkPrep ["कै सतh-"] ["कै सतh-"] ; +-- yes_Phr = ss "हं" ; + yes_Utt = ss "हं" ; + youSg_Pron = personalPN "तम" "तम" "तम" "तमh-र" Sg Masc Pers2_Casual ; + youPl_Pron = personalPN "तम" "तम" "तम" "तमh-र" Pl Masc Pers2_Casual ; + youPol_Pron = personalPN "ाप" "ाफ" "ाफ" "ाप क" Sg Masc Pers2_Respect ; + no_Quant = demoPN " कwय नहयं" "कwय नहयं" "कwय नहयं" ; + not_Predet = {s="नहयं"} ; + if_then_Conj = sd2 "गर" "तw" ** {n = Sg} ; + at_least_AdN = mkAdN ["कम ज़ कम"] ; + at_most_AdN = mkAdN ["ज़यदह सै ज़यदह"]; + nothing_NP = MassNP (UseN (ParadigmsHin.mkN "कwय चयज़ नहयं" "कwय चयज़ नहयं" "कwय चयज़ नहयं" "कwय चयज़ नहयं" "कwय चयज़ नहयं" "कwय चयज़ नहयं" Masc )); + except_Prep = mkPrep "सwै" "सwै" ; + nobody_NP = MassNP (UseN (ParadigmsHin.mkN "कwय नहयं" "कwय नहयं" "कwय नहयं" "कwय नहयं" "कwय नहयं" "कwय नहयं" Masc )); + + as_CAdv = {s = "ेतन" ; p = "जतन"} ; + + have_V2 = mkV2 (mkV "रकh-न") "" ; + + language_title_Utt = ss "रदw" ; + +} + diff --git a/lib/src/hindi/SymbolHin.gf b/lib/src/hindi/SymbolHin.gf index 621c6d68b..15089d8d8 100644 --- a/lib/src/hindi/SymbolHin.gf +++ b/lib/src/hindi/SymbolHin.gf @@ -1,41 +1,4 @@ ---# -path=.:../abstract:../common - -concrete SymbolHin of Symbol = CatHin ** open Prelude, ResHin in { - -{- TODO! -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) ! c ; - a = agrgP3 Sg cn.g - } ; - CNSymbNP det cn xs = { - s = \\c => det.s ++ cn.s ! det.n ! Nom ++ (addGenitiveS xs.s) ! c ; - a = agrgP3 det.n cn.g - } ; - CNNumNP cn i = { - s = \\c => cn.s ! Sg ! Nom ++ i.s ! 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 "," ; - - -} +--# -path=.:../hindustani:../abstract:../common + +concrete SymbolHin of Symbol = CatHin ** SymbolHindustani with + (ResHindustani = ResHin) ; diff --git a/lib/src/hindi/VerbHin.gf b/lib/src/hindi/VerbHin.gf index c2abf824d..c0ee6b185 100644 --- a/lib/src/hindi/VerbHin.gf +++ b/lib/src/hindi/VerbHin.gf @@ -1,50 +1,2 @@ -concrete VerbHin of Verb = CatHin ** open ResHin in { - - flags optimize=all_subs ; - - lin - UseV = predV ; - - SlashV2a v = predV v ** {c2 = v.c2} ; - --- Slash2V3 v np = --- insertObjc (\\_ => v.c2 ++ np.s ! Acc) (predV v ** {c2 = v.c3}) ; --- Slash3V3 v np = --- insertObjc (\\_ => v.c3 ++ np.s ! Acc) (predVc v) ; ---- --- --- ComplVV v vp = insertObj (\\a => infVP v.isAux 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 => infVP v.isAux 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 = insertObject np vp ; - --- SlashVV vv vp = --- insertObj (\\a => infVP vv.isAux vp a) (predVV vv) ** --- {c2 = vp.c2} ; --- SlashV2VNP vv np vp = --- insertObjPre (\\_ => vp.c2 ++ np.s ! Acc) --- (insertObjc (\\a => infVP vv.isAux vp a) (predVc vv)) ** --- {c2 = vp.c2} ; --- --- UseComp comp = insertComplement comp.s (predAux auxBe) ; --- --- AdvVP vp adv = insertObj (\\_ => adv.s) vp ; --- --- AdVVP adv vp = insertAdV adv.s vp ; --- --- ReflVP v = insertObjPre (\\a => v.c2 ++ reflPron ! a) v ; --- --- PassV2 v = insertObj (\\_ => v.s ! VPPart) (predAux auxBe) ; --- --- --- CompAP ap = ap ; --- CompNP np = {s = \\_ => np.s ! Acc} ; --- CompAdv a = {s = \\_ => a.s} ; --- -} +concrete VerbHin of Verb = CatHin ** VerbHindustani with + (ResHindustani = ResHin) ; diff --git a/lib/src/hindi/src/DiffHin.gf b/lib/src/hindi/src/DiffHin.gf new file mode 100644 index 000000000..57215c97b --- /dev/null +++ b/lib/src/hindi/src/DiffHin.gf @@ -0,0 +1,133 @@ +instance DiffHin of DiffHindustani = open CommonHindustani, Prelude in { +oper +Clause : Type = {s : VPHTense => Polarity => Order => Str} ; + mkClause : NP -> VPH -> Clause = \np,vp -> { + s = \\vt,b,ord => + let + subjagr : NPCase * Agr = case vt of { + VPImpPast => case vp.subj of { + VTrans => ; + VTransPost => ; + _ => + } ; + _ => + } ; + subj = subjagr.p1 ; + agr = subjagr.p2 ; + n = (fromAgr agr).n; + p = (fromAgr agr).p; + g = (fromAgr agr).g; + vps = case vt of { + + VPGenPres => vp.s ! VPTense VPPres agr ; + VPImpPast => vp.s ! VPTense VPPast agr ; + VPFut => case vp.prog of { True => {fin = [] ;inf = Prelude.glue ((vp.s ! VPTense VPFutr agr).inf ++ hw p n) ((vp.s ! VPTense VPFutr agr).fin) } ; + _ => {fin = [] ; inf = Prelude.glue (vp.s ! VPTense VPFutr agr).inf (vp.s ! VPTense VPFutr agr).fin }} ; + VPContPres => {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; + VPContPast => {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; + VPContFut => {fin = [] ; inf = Prelude.glue ((vp.s ! VPStem).inf ++ raha g n ++ hw p n) (copula CFuture n p g) } ; + VPPerfPres => {fin = copula CPresent n p g ; inf = (vp.s ! VPTense VPPerf agr).inf } ; + VPPerfPast => {fin = copula CPast n p g ; inf = (vp.s ! VPTense VPPerf agr).inf } ; + VPPerfFut => {fin = [] ; inf = Prelude.glue ((vp.s ! VPTense VPPerf agr).inf ++ hw p n) (copula CFuture n p g) } ; + VPPerfPresCont => {fin = copula CPresent n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n } ; + VPPerfPastCont => {fin = copula CPast n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n } ; + VPPerfFutCont => {fin = [] ; inf = Prelude.glue ((vp.s ! VPTense VPPres agr).inf ++ raha g n ++ hw p n) (copula CFuture n p g )} ; + VPSubj => case vp.prog of { True => {fin = (vp.s ! VPTense VPFutr agr).inf ++ hw p n ; inf = "Xayd" } ; + _ => {fin = (vp.s ! VPTense VPFutr agr).inf ; inf = "Xayd" } } + + }; + + + quest = + case ord of + { ODir => []; + OQuest => "kya" }; + na = + case b of + { Pos => []; + Neg => "na" }; + nahim = + case b of + { Pos => []; + Neg => "nhyN" }; + in + case vt of { + VPSubj => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ na ++ vps.inf ++ vps.fin ++ vp.embComp ; + _ => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp}; + + } ; + + mkSClause : Str -> Agr -> VPH -> Clause = + \subj,agr,vp -> { + s = \\t,b,ord => + let + n = (fromAgr agr).n; + p = (fromAgr agr).p; + g = (fromAgr agr).g; + vps = case t of { + VPGenPres => vp.s ! VPTense VPPres agr ; + VPImpPast => vp.s ! VPTense VPPast agr ; + VPFut => {fin = [] ; inf = Prelude.glue (vp.s ! VPTense VPFutr agr).inf ((vp.s ! VPTense VPFutr agr).fin) } ; + VPContPres => {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; + VPContPast => {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; + VPContFut => {fin = [] ; inf = Prelude.glue ((vp.s ! VPStem).inf ++ raha g n ++ hw p n) (copula CFuture n p g) } ; + VPPerfPres => {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ cka g n } ; + VPPerfPast => {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ cka g n } ; + VPPerfFut => {fin = [] ; inf = Prelude.glue ((vp.s ! VPStem).inf ++ cka g n ++ hw p n) (copula CFuture n p g) } ; + VPPerfPresCont => {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; + VPPerfPastCont => {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; + VPPerfFutCont => {fin = [] ; inf = Prelude.glue ((vp.s ! VPStem).inf ++ raha g n ++ hw p n) (copula CFuture n p g ) } ; + VPSubj => {fin = insertSubj p (vp.s ! VPStem).inf ; inf = "xayd" } + + }; + + quest = + case ord of + { ODir => []; + OQuest => "kya" }; + na = + case b of + { Pos => []; + Neg => "na" }; + nahim = + case b of + { Pos => []; + Neg => "nhyN" }; + in + case t of { + VPSubj => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ na ++ vps.inf ++ vps.fin ++ vp.embComp; + _ => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp}; + } ; + +{- Verb : Type = {s : VerbForm => Str} ; + + + predV v = { + s = \\vh => + case vh of { + VPTense VPPres (Ag g n p) => {fin = copula CPresent n p g ; inf = v.s ! VF Imperf p n g } ; + VPTense VPPast (Ag g n p) => {fin = [] ; inf =v.s ! VF Perf p n g} ; + VPTense VPFutr (Ag g n p) => {fin = [] ; inf = Prelude.glue (v.s ! VF Subj p n g) (copula CFuture n p g)} ; + VPTense VPPerf (Ag g n p) => { fin = [] ; inf = v.s ! Root ++ cka g n } ; + VPStem => {fin = [] ; inf = v.s ! Root}; + _ => {fin = [] ; inf = v.s ! Root} + }; + obj = {s = [] ; a = defaultAgr} ; + subj = VIntrans ; + inf = v.s ! Inf; + ad = []; + embComp = []; + prog = False ; + comp = \\_ => [] + } ; +-} + np2pronCase ppf npc a = case npc of { + NPC c => ppf ! c; + NPObj => ppf ! Obl ; + NPErg =>case (fromAgr a).p of { + (Pers3_Near|Pers3_Distant) => Prelude.glue (ppf ! Obl) "nE" ; -- in hindi in case of pronouns nE is tagged to pron rather than a separate word + _ => Prelude.glue (ppf ! Dir) "nE" + } + } ; + +} \ No newline at end of file diff --git a/lib/src/hindi/src/ExtraHin.gf b/lib/src/hindi/src/ExtraHin.gf new file mode 100644 index 000000000..15445444f --- /dev/null +++ b/lib/src/hindi/src/ExtraHin.gf @@ -0,0 +1,25 @@ +--# -path=.:../abstract:../common:../prelude:/Users/virk/gf_1/lib/src/hindustani +concrete ExtraHin of ExtraHinAbs = CatHin ** + open ResHin, Coordination, Prelude, MorphoHin, ParadigmsHin in { + + lin +-- GenNP np = {s = \\_,_,_ => np.s ! NPC Obl ++ "ka" ; a = np.a} ; + +-- each_Det = mkDet "hr kwy" "hr kwy" "hr kwy" "hr kwy" Sg ; + have_V = mkV "rakh-na"; +-- IAdvAdv adv = {s = "ktny" ++ adv.s} ; +-- ICompAP ap = {s = "ktnE" ++ ap.s ! Sg ! Masc ! Dir ! Posit} ; +-- CompoundCN cn1 cn2 = {s = \\n,c => cn1.s ! n ! c ++ cn2.s ! n ! c ; g = cn2.g } ; +-- ImperfAP verb = {s = \\n,g,_,_ => verb.s ! VF Habitual Pers3_Distant n g ++ hwa n g } ; +-- SlashVP vp = { +-- s = vp.s ; +-- obj = vp.obj ; +-- inf = vp.inf ; +-- subj = vp.subj ; +-- ad = vp.ad ; +-- embComp = vp.embComp; +-- comp = vp.comp +-- } ; + +-- for VP conjunction +} diff --git a/lib/src/hindi/src/IdiomHin.gf b/lib/src/hindi/src/IdiomHin.gf new file mode 100644 index 000000000..21a273592 --- /dev/null +++ b/lib/src/hindi/src/IdiomHin.gf @@ -0,0 +1,39 @@ +concrete IdiomHin of Idiom = CatHin ** open Prelude,Predef, ResHin,ParamX,CommonHindustani in { + + flags optimize=all_subs ; + flags coding = utf8; + + lin + ImpersCl vp = mkSClause " " (agrP3 Masc Sg) vp ; + GenericCl vp = mkSClause "kwy" (agrP3 Masc Sg) vp ; + + CleftNP np rs = + let cl = mkSClause (np.s ! NPC rs.c) (np.a) (predAux auxBe); + in + {s = \\t,p,o => cl.s ! t ! p ! o ++ rs.s ! np.a }; + +-- CleftAdv ad ss = { s = \\t,b,o => ad.s ! Masc ++ ss.s}; + +-- ExistNP np = +-- mkSClause "whaN" (agrP3 (fromAgr np.a).g (fromAgr np.a).n) +-- (insertObj (\\_ => np.s ! NPC Obl) (predAux auxBe)) ; + + ExistIP ip = + let cl = mkSClause ("whaN" ++ ip.s ! Dir) (agrP3 ip.g ip.n) (predAux auxBe); + in { + s = \\t,p,qf => case qf of { + QDir => cl.s ! t ! p ! ODir; + QIndir => cl.s ! t! p ! ODir + } + }; + +-- ProgrVP vp = insertObj (\\a => vp.obj.s ++ vp.ad ++ vp.comp ! a ++ (vp.s ! VPStem).inf ++ raha (fromAgr a).g (fromAgr a).n ) (predAux auxBe) ; + ProgrVP vp = (predProg vp) ; + + + ImpPl1 vp = {s = "Aw" ++ infVP True vp (agrP1 Masc Pl)} ; + ImpP3 np vp = {s = np.s!NPC Dir ++ "kw" ++ (vp.s ! VPImp ).inf ++ "dw"}; + + +} + diff --git a/lib/src/hindi/src/LexiconHin.gf b/lib/src/hindi/src/LexiconHin.gf new file mode 100644 index 000000000..b091f27c7 --- /dev/null +++ b/lib/src/hindi/src/LexiconHin.gf @@ -0,0 +1,369 @@ +--# -path=.:prelude + +concrete LexiconHin of Lexicon = CatHin ** +--open ResHin, Prelude in { + open ParadigmsHin, Prelude in { + + flags + optimize=values ; + coding = utf8; + + lin + airplane_N = mkN "jHaj" ; +-- answer_V2S = mkV2 (compoundV "jwab" (mkV "dyna")) ; +-- apartment_N = mkN "kmrh" ; + apple_N = mkN "syb" ; +-- art_N = mkN "fn" ; + ask_V2Q = mkV2 (mkV "pwcHna") ; +-- baby_N = mkN "bcH" ; + bad_A = mkA "bra" ; + bank_N = mkN "bynk" ; + beautiful_A = mkA "sndr" ; + become_VA = mkV "bnna"; + beer_N = mkN "beer" ; +-- beg_V2V = mkV2V (compoundV "altja" (mkV "krna")) "sE" "kh" False; + big_A = mkA "bRa" ; +-- bike_N = mkN "saycl" feminine ; +-- bird_N = mkN "prndh" ; + black_A = mkA "kala" ; + blue_A = mkA "nyla" ; + boat_N = mkN "naw" ; + book_N = mkN "ktab" feminine ; +-- boot_N = mkN "jwta" ; + boss_N = mkN "malk" ; + boy_N = mkN "lRka" ; + bread_N = mkN "rwty" ; + break_V2 = mkV2 (mkV "twRna") ; + broad_A = mkA "cwRa" ; + brother_N2 = mkN2 (mkN "bHay") (mkPrep "ka" "ka") "kE" ; --not correct + brown_A = mkA "bHwra" ; +-- butter_N = mkN "mkh-n" ; + buy_V2 = mkV2 (mkV "Krydna"); + camera_N = mkN "kymrH" ; + cap_N = mkN "twpy" ; + car_N = mkN "kar" ; +-- carpet_N = mkN "tpay^y" ; + cat_N = mkN "bly" feminine; +-- ceiling_N = mkN "ch-t" feminine ; + chair_N = mkN "krsy" ; +-- cheese_N = mkN "pnyr" feminine ; + child_N = mkN "bcH" ; + church_N = mkN "grja" ; + city_N = mkN "XHr" ; + clean_A = mkA "saf" ; + clever_A = mkA "catr" ; + close_V2 = mkV2 (compoundV "bnd" do_V2); + coat_N = mkN "kwT" ; + cold_A = mkA "srd" ; + come_V = mkV "Ana" ; + computer_N = mkN "kmpywTr" ; + country_N = mkN "dyX" ; +-- cousin_N = mkCmpdNoun "cca" (mkN "zad") ; -- a compund noun made of two nouns + cow_N = mkN "gaE" feminine ; + die_V = mkV "mrna" ; + dirty_A = mkA "gnda" ; +-- distance_N3 = mkN3 (mkN "faSlh") (mkPrep "ka") "kE" "sE" ; + doctor_N = mkN "daktr" ; + dog_N = mkN "kta" ; + door_N = mkN "drwza" ; + drink_V2 = mkV2 (mkV "pyna"); + easy_A2V = mkA "Asan" "" ; -- chek for A or a + eat_V2 = mkV2 (mkV "kHana") "" ; + empty_A = mkA "Kaly" ; + enemy_N = mkN "dXmn" ; + factory_N = mkN "karKana" ; +-- father_N2 = mkN2 (mkN "pta" irregular) (mkPrep "ka") "kE" ; + fear_VS = mkV "dRna"; + find_V2 = mkV2 (mkV "dHwnda") ; + fish_N = mkN "mcHly" ; + floor_N = mkN "frX" ; + forget_V2 = mkV2 (mkV "bHwlna") ; +-- fridge_N = mkN "fryg" ; + friend_N = mkN "dwst" masculine ; + fruit_N = mkN "pHl" ; +-- fun_AV = mkAV (regA "fun") ; + garden_N = mkN "baG" ; -- chek for G + girl_N = mkN "lRky" ; + glove_N = mkN "dstana" ; + gold_N = mkN "swna" ; + good_A = mkA "acHa" ; + go_V = mkV "jana" ; + green_A = mkA "Hra" ; +-- harbour_N = mkCmpdNoun "bndr" (mkN "gah") ; + hate_V2 = mkV2 (compoundV "nfrt" do_V2) ; + hat_N = mkN "Twpy" ; +-- have_V2 = dirV2 (mk5V "have" "has" "had" "had" "having") ; + hear_V2 = mkV2 (mkV "snna") ; +-- hill_N = mkN "phaRy" ; +-- hope_VS = (compoundV "amyd" do_V2); + horse_N = mkN "gHwRa" ; + hot_A = mkA "grm" ; + house_N = mkN "gHr" ; + important_A = mkA "zrwry" ; -- check about z +-- industry_N = mkN "Snet" feminine ; + iron_N = mkN "lwHa" ; + king_N = mkN "raja" ; + know_V2 = mkV2 (mkV "janna") ; + know_VS = mkV "janna"; +-- lake_N = mkN "jh-yl" feminine ; + lamp_N = mkN "dya" ; + learn_V2 = mkV2 (mkV "sykHna") ; +-- leather_N = mkN "cmRa" ; + leave_V2 = mkV2 (mkV "clna") ; + like_V2 = mkV2 (compoundV "psnd" do_V2); + listen_V2 = mkV2 (mkV "snna") ; + live_V = mkV "rhna" ; ---- touch + long_A = mkA "lmba" ; + lose_V2 = mkV2 (compoundV "kHw" do_V2) ; + love_N = mkN "prym" ; + love_V2 = mkV2 (compoundV "pyar" do_V2) "kw"; + man_N = mkN "Admy" ; +-- married_A2 = mkA "Xady " "sE" ; + meat_N = mkN "mas" ; + milk_N = mkN "dwdH" ; + moon_N = mkN "cand" ; + mother_N2 = mkN2 (mkN "mata" feminine) (mkPrep "ky" "ky") "kE"; -- not covered need to be discussed +-- mountain_N = mkN "phaRy" ; + music_N = mkN "sngyt" ; +-- narrow_A = mkA "baryk" ; + new_A = mkA "nya" ; + newspaper_N = mkN "aKbar" ; + oil_N = mkN "tyl" ; + old_A = mkA "bwRHa" ; + open_V2 = mkV2 (mkV "kHwlna") ; +-- paint_V2A = mkV2 (compoundV "rng" do_V2) ; + paper_N = mkN "kaGz" ; + paris_PN = mkPN "pyrs" ; + peace_N = mkN "amn" ; + pen_N = mkN "qlm" ; +-- planet_N = mkN "syarh" ; +-- plastic_N = mkN "plasTk" ; + play_V2 = mkV2 (mkV "kHylna") ; +-- policeman_N = mkCmpdNoun "pwlys" (mkN "wala") ; +-- priest_N = (mkN "pyGmbr") ; +-- probable_AS = mkAS (regA "probable") ; +-- queen_N = mkN "Xhzady" ; +-- radio_N = mkN "ryDyw" ; + rain_V0 = compoundV "barX" (mkV "Hwna" ) ; + read_V2 = mkV2 (mkV "pRHna"); + red_A = mkA "lal" ; + religion_N = mkN "dHrm" ; +-- restaurant_N = mkN "hwTl" ; + river_N = mkN "drya" masculine ; + rock_N = mkN "cTan" ; + roof_N = mkN "ch-t" masculine ; +-- rubber_N = mkN "rbR" ; + run_V = mkV "dwRna" ; + say_VS = mkV "kHna" ; + school_N = mkN "mktb" ; +-- science_N = mkN "sans" ; -- vgyan + sea_N = mkN "smndr" ; +-- seek_V2 = mkV2 (compoundV "tlaX" do_V2) ; + see_V2 = mkV2 (mkV "dykHna") ; + sell_V3 = mkV3 (mkV "bycna") "kw" ""; + send_V3 = mkV3 (mkV "bHyjna") "kw" ""; + sheep_N = mkN "bHyR" feminine ; + ship_N = mkN "jHaz" ; + shirt_N = mkN "krta" feminine; + shoe_N = mkN "jwta" ; + shop_N = mkN "dwkan" feminine ; + short_A = mkA "cHwTa" ; + silver_N = mkN "candy" ; + sister_N = mkN "bHn" feminine ; + sleep_V = mkV "swna" ; + small_A = mkA "cHwTa" ; + snake_N = mkN "sanp" ; +-- sock_N = mkN "jrab" feminine ; + speak_V2 = mkV2 (mkV "bwlna") ; + star_N = mkN "tara" ; +-- steel_N = mkN "styl" ; -- something like ispat + stone_N = mkN "ptHr" ; +-- stove_N = mkN "cwlha" ; +-- student_N = mkCmpdNoun "t-alb" (mkN "elm") ; -- something vidrati + stupid_A = mkA "bEwqwf" ; +-- sun_N = mkN "swrj" ; -- swrya + switch8off_V2 = mkV2 (compoundV "bnd" do_V2) ; + switch8on_V2 = mkV2 (mkV "clana") ; + table_N = mkN "myz" feminine ; + talk_V3 = mkV3 (mkV "bwlna") "sE" "kE barE meN"; +-- teacher_N = mkN "istad" ; -- adyapak + teach_V2 = mkV2 (mkV "pRHna") ; + television_N = mkN "tywy" ; + thick_A = mkA "mwTa" ; + thin_A = mkA "ptla" ; + train_N = mkN "ryl gaRy" ; + travel_V = (compoundV "sfr" do_V2) ; +-- tree_N = mkN "pyR" masculine ; +-- ---- trousers_N = mkN "trousers" ; + ugly_A = mkA "bdswrt" ; + understand_V2 = mkV2 (mkV "smjHna") ; +-- university_N = mkN "ywnywrsTy" ; + village_N = mkN "gawN" ; -- check for n or N +-- wait_V2 = mkV2 (compoundV "antz-ar" do_V2) "ka" ; -- something prtkXa + walk_V = mkV "clna" ; +-- warm_A = mkA "grm" ; something gngna +-- war_N = mkN "jng" ; + watch_V2 = mkV2 (mkV "dykHna") ; +-- water_N = mkN "pany" masculine ; -- not covered masculine ending with y + white_A = mkA "sfyd" ; + window_N = mkN "rwXndan" ; +-- wine_N = mkN "Xrab" feminine ; + win_V2 = mkV2 (mkV "jytna") ; + woman_N = mkN "ewrt" feminine ; +-- wonder_VQ = compoundV "Heran" (mkV "hwna") ; + wood_N = mkN "lkRy" ; + write_V2 = mkV2 (mkV "lkh-na") ; + yellow_A = mkA "pyla" ; + young_A = mkA "jwan" ; + do_V2 = mkV2 (mkV "krna") ; +-- now_Adv = mkAdv "ab" ; +-- already_Adv = mkAdv "phlE hy" ; + song_N = mkN "gyt" ; + add_V3 = mkV3 (compoundV "jme" do_V2) "" "" ; +-- number_N = mkN "hndsh" ; +-- put_V2 = mkV2 (mkV "Dalna") ; + stop_V = mkV "rkna" ; +-- jump_V = compoundV "cHlang" (mkV "lgana") feminine ; + +-- left_Ord = {s = "bayaN" ; n = singular}; +-- right_Ord = {s= "dayaN" ; n = singular}; +-- far_Adv = mkAdv "dwr" ; + correct_A = mkA "syH" ; + dry_A = mkA "swkHa" ; +-- dull_A = mkA "nalik" ; +-- full_A = mkA "mkml" ; + heavy_A = mkA "bHary" ; + near_A = mkA "pas" ; +-- rotten_A = mkA "Krab" ; + round_A = mkA "gwl" ; + sharp_A = mkA "tyz" ; + smooth_A = mkA "ckna" ; + straight_A = mkA "sydHa" ; + wet_A = mkA "gyla" ; ---- + wide_A = mkA "cwRa" ; + animal_N = mkN "janwr" ; + ashes_N = mkN "rakh-" feminine; -- FIXME: plural only? +-- back_N = mkN "qmr" feminine ; +-- bark_N = mkN "bark" ; +-- belly_N = mkN "dh-ny" ; +-- blood_N = mkN "Kwn" ; + bone_N = mkN "HDy" feminine ; +-- breast_N = mkN "ch-aty" ; --stan + cloud_N = mkN "badl" ; + day_N = mkN "dn" ; + dust_N = mkN "dHwl" ; + ear_N = mkN "kan" ; +-- earth_N = mkN "zmyn" feminine ; + egg_N = mkN "anDH" ; + eye_N = mkN "AnkH" feminine ; + fat_N = mkN "mwta" ; + feather_N = mkN "pnkH" ; +-- fingernail_N = mkN "naKn" ; + fire_N = mkN "Ag" feminine ; + flower_N = mkN "pHwl" ; + fog_N = mkN "dHnd" feminine ; + foot_N = mkN "pawN" ; -- not properly covered need to be discussed + forest_N = mkN "jngl" ; + grass_N = mkN "gHs" feminine ; +-- guts_N = mkN "gut" ; -- FIXME: no singular + hair_N = mkN "bal" ; + hand_N = mkN "HatH" ; + head_N = mkN "sr" ; + heart_N = mkN "dl" ; +-- horn_N = mkN "gh-nty" ; + husband_N = mkN "pty" ; + ice_N = mkN "brf" feminine ; + knee_N = mkN "gHtnH" ; + leaf_N = mkN "ptH" ; + leg_N = mkN "tang" feminine ; + liver_N = mkN "klyjH" ; +-- louse_N = mkN "" ; -- jwN + mouth_N = mkN "mnH" ; + name_N = mkN "nam" ; + neck_N = mkN "grdn" feminine ; + night_N = mkN "rat" feminine ; + nose_N = mkN "nak" ; +-- person_N = mkN "XKS" ; + rain_N = mkN "barX" feminine ; + road_N = mkN "sRk" ; + root_N = mkN "gR" feminine ; + rope_N = mkN "rsy" ; + salt_N = mkN "nmk" feminine ; + sand_N = mkN "ryt" feminine ; + seed_N = mkN "byj" ; +-- skin_N = mkN "jld" feminine ; -- crm + sky_N = mkN "ambr" ; + smoke_N = mkN "dHwaN"; -- singular masc nouns ending with aN,wN yet to be implemented + snow_N = mkN "brf" feminine ; + stick_N = mkN "soTy" ; + tail_N = mkN "dm" ; +-- tongue_N = mkN "zban" feminine ; +-- tooth_N = mkN "dant" masculine; + wife_N = mkN "ptny" ; + wind_N = mkN "Hwa" ; +-- wing_N = mkN "pr" ; + worm_N = mkN "kyRa" ; + year_N = mkN "sal" ; +-- blow_V = mkV "clna" ; + breathe_V = compoundV "sans" (mkV "lyna" ) ; + burn_V = mkV "jlana" ; + dig_V = mkV "kHwdna" ; + fall_V = mkV "grna" ; +-- float_V = mkV "tyrna" ; + flow_V = mkV "clna" ; + fly_V = mkV "aRna" ; +-- freeze_V = mkV "jmna"; + give_V3 = mkV3 (mkV "dyna") "kw" ""; + laugh_V = mkV "hnsna" ; +-- lie_N = mkN "jh-wt" masculine ; + lie_V = compoundV "jHwt" (mkV "bwlna" ); + play_V = mkV "kHylna" ; + sew_V = mkV "syna" ; + sing_V = mkV "gana" ; + sit_V = mkV "byTHna" ; + smell_V = mkV "swngna" ; + spit_V = mkV "tHwkna" ; + stand_V = compoundV "kHRE" (mkV "hwna" ); -- a type of compound verb made of two verbs i.e 'kHRa' also inflects, rather than a string and verb should be fixed +-- swell_V = mkV "swjh-na" ; + swim_V = mkV "tyrna" ; + think_V = mkV "swcna" ; + turn_V = mkV "mRna"; +-- vomit_V = compoundV "alty" (mkV "krna") feminine ; + bite_V2 = mkV2 (mkV "katna") ; + count_V2 = mkV2 (mkV "gnna") ; + cut_V2 = mkV2 (mkV "katna") ; + fear_V2 = mkV2 (mkV "Drna") ; + fight_V2 = mkV2 (mkV "lRna") ; +-- hit_V2 = mkV2 (compoundV "th-wkr" (mkV "marna" )); + hold_V2 = mkV2 (mkV "pkRna") ; +-- hunt_V2 = mkV2 (compoundV "Xkar" do_V2); + kill_V2 = mkV2 (compoundV "mar" (mkV "Dalna" )) ; + pull_V2 = mkV2 (mkV "kHncna"); +-- push_V2 = mkV2 (mkV "dh-kylna") "kw" ; +-- rub_V2 = mkV2 (mkV "rgRna") ; +-- scratch_V2 = mkV2 (mkV "kh-rcna") "kw" ; +-- split_V2 = mkV2 (mkV "banta") "kw" ; +-- squeeze_V2 = dirV2 (regV "squeeze") ; +-- stab_V2 = dirV2 (regDuplV "stab") ; +-- suck_V2 = mkV2 (mkV "cwsna") ; + throw_V2 = mkV2 (mkV "pHynkna") ; + tie_V2 = mkV2 (mkV "bandHna") ; + wash_V2 = mkV2 (mkV "dHwna") ; + wipe_V2 = mkV2 (compoundV "Saf" (mkV "krna" )); + +---- other_A = regA "other" ; + +-- grammar_N = mkN "grdan" ; +-- language_N = mkN "zban" feminine ; +-- rule_N = mkN "aSwl" ; + +---- added 4/6/2007 + john_PN = mkPN "jon" ; +-- question_N = mkN "swal" ; +-- ready_A = regA "ready" ; +-- reason_N = mkN "wjh" feminine ; +-- today_Adv = mkAdv "Aj" ; +-- uncertain_A = mkA ["Gyr yqyny"] ; + + +} diff --git a/lib/src/hindi/src/MorphoHin.gf b/lib/src/hindi/src/MorphoHin.gf new file mode 100644 index 000000000..1ca05c5c9 --- /dev/null +++ b/lib/src/hindi/src/MorphoHin.gf @@ -0,0 +1,460 @@ +--# -path=.:../../prelude:../abstract:../common:../../prelude +-- +----1 A Simple Hinu Resource Morphology +---- +---- Shafqat Virk, Aarne Ranta,2009 +---- +---- This resource morphology contains definitions needed in the resource +---- syntax. To build a lexicon, it is better to use $ParadigmsHin$, which +---- gives a higher-level access to this module. +-- +resource MorphoHin = ResHin ** open Prelude,Predef,ParamX,CommonHindustani in { + flags optimize=all ; + coding = utf8; + +----2 Nouns +oper + mkNoun : (x1,_,_,_,_,x6 : Str) -> Gender -> Noun = + \sd,so,sv,pd,po,pv,g -> { + s = table { + Sg => table { + Dir => sd ; + Obl => so ; + Voc => sv + } ; + Pl => table { + Dir => pd ; + Obl => po ; + Voc => pv + } + } ; + + g = g + } ; + + + + regNoun : Str -> Noun ; + regNoun s = case s of { + _ + "ya" => mkN05 (s); + _ + ("a"|"e"|"h") => mkN01 (s); + _ + "y" => mkN03 (s); + _ + ("aN"|"wN") => mkN04 (s); + _ + "w^" => mkN12 (s); + _ => regNoun2 (s) + }; + regNoun2 : Str -> Noun; + regNoun2 s = let c = if_then_else Bool (eq (last s) "a" ) True (if_then_else Bool (eq (last s) "h") True (if_then_else Bool (eq (last s) "e") True False)) + in case c of { + False => mkN02 (s); + True => mkN01 (s) + }; + + reggNoun : Str -> Gender -> Noun ; + reggNoun s g = let c = if_then_else Bool (eq (last s) "a" ) True (if_then_else Bool (eq (dp 2 s) "aN") True (if_then_else Bool (eq (dp 2 s) "wN") True False)) + in case of { + <_ + "t",Fem,_> => mkN10 (s); + <_ + "t",Masc,_> => mkN02 (s); + <_ + "w",Masc,_> => mkN11 (s); + <_ + "w",Fem,_> => mkN07 (s); + <_ + "ya",Fem,_> => mkN05 (s); + <_ + "ya",Masc,_> => mkN02 (s); + <_,Fem,False> => mkN08 (s); + <_,Fem,_> => mkN09 (s) + + }; + +-- masculine nouns end with alif, choTi_hay, ain Translitration: (a, h, e) +-- Arabic nouns ends with h. also taken as Masc + + mkN01 : Str -> Noun ; + mkN01 lRka = let end = last (lRka) ; + lRk = if_then_else Str (eq end "e") lRka (tk 1 lRka) + in mkNoun (lRka) (lRk+"E") (lRk+"E") + (lRk+"E") (lRk+"wN") (lRk+"w") + Masc ; + +-- masculine nouns does not end with a, h, e, an + + mkN02 : Str -> Noun ; + mkN02 mrd = let mrdwN = mrd+"wN" ; + mrdw = tk 1 mrdwN + in mkNoun mrd mrd mrd + mrd mrdwN mrdw + Masc ; + +-- feminine Nouns end with y + + mkN03 : Str -> Noun ; + mkN03 krsy = let krsyaN = krsy+"aN" ; + krsywN = krsy+"wN" ; + krsyw = tk 1 krsywN + in mkNoun krsy krsy krsy + krsyaN krsywN krsyw + Fem ; + +-- feminine nouns end with a, aN, wN + mkN04 : Str -> Noun ; + mkN04 n = case last n of { + "a" => let bla = n + in mkNoun bla bla bla + (bla+"y^yN") (bla+"w^N") (bla+"w^") + Fem ; + _ => let maN = n ; -- ends with aN and wN + ma = tk 1 maN + in mkNoun maN maN maN + (ma+"y^yN") (ma+"w^N") (ma+"w^N") + Fem + + }; + --feminine nouns end with ya + + mkN05 : Str -> Noun ; + mkN05 gRya = let gRy = (tk 1 gRya) + in mkNoun gRya gRya gRya + (gRya+"N") (gRy+"wN") (gRy+"w") + Fem ; + +-- feminine nouns end with w + + mkN07 : Str -> Noun ; + mkN07 khshbw = mkNoun khshbw khshbw khshbw + (khshbw + "y^yN") (khshbw + "w^N") (khshbw + "w^") + Fem ; + +-- Loan arabic feminine nouns end with t +-- this is a noun that shows state, condition + + mkN10 : Str -> Noun ; + mkN10 ndamt = mkNoun ndamt ndamt ndamt + (ndamt+"yN") (ndamt+"wN") (ndamt+"w") + Fem ; +-- Worst case function + mkN : (_,_,_,_,_,_ : Str) -> Gender -> Noun ; + mkN sgNom sgObl sgVoc plNom plObl plVoc g = + mkNoun sgNom sgObl sgVoc plNom plObl plVoc g ; + + mkN06 : Str -> Noun ; + mkN06 rya = mkNoun rya rya rya + (rya+"y^yN") (rya+"w^N") rya + Fem ; + +-- feminine nouns that do not end with a, N, w, wN + + mkN08 : Str -> Noun ; + mkN08 ktab = mkNoun ktab ktab ktab + (ktab+"yN") (ktab+"wN") (ktab+"w") + Fem ; + +-- Loan arabic feminine nouns + + mkN09 : Str -> Noun ; + mkN09 ahsan = mkNoun ahsan ahsan ahsan + (ahsan+"at") (ahsan+"at") (ahsan+"w") + Fem ; +-- (variants{ahsan+"at";ahsan+"wN"}) +-- Loan persian maculine nouns end with w + + mkN11 : Str -> Noun ; + mkN11 alw = mkNoun alw alw alw + alw (alw+"w^N") (alw+"w^") + Masc ; + + +-- Loan persian maculine nouns end with w^ + + mkN12 : Str -> Noun ; + mkN12 bhao = mkNoun (bhao) (bhao) (bhao) + (bhao) (bhao) (bhao) + Masc ; +----2 Determiners + IDeterminer = {s:Gender => Str ; n : Number}; + makeDet : Str -> Str -> Str -> Str -> Number -> Determiner = \s1,s2,s3,s4,n -> { + s = table { + Sg => table { + Masc => s1 ; + Fem => s2 + } ; + Pl => table { + Masc => s3 ; + Fem => s4 + } + } ; + + n = n + }; + + makeIDet : Str -> Str -> Number -> IDeterminer = \s1,s2,n -> { + s = table { + Masc => s1; + Fem => s2 + }; + n = n + }; + +-- Proposition + + makePrep : Str -> Str -> Preposition = \s1,s2 -> {s = table { Masc => s1 ; Fem => s2 } } ** { lock_Prep = <>}; + +----2 Pronouns + PronForm = {s:Pronoun => Str}; + makeDemPron : (x1,x2,x3,x4,x5,x6:Str) -> PronForm = + \y1,y2,y3,y4,y5,y6 -> { + s = table { + P Sg _ Dir _ => y1; + P Sg _ Obl _ => y2; + P Sg _ Voc _ => y3; + P Pl _ Dir _ => y4; + P Pl _ Obl _ => y5; + P Pl _ Voc _ => y6 + }; + }; + +-- DemonPronForm = {s:DemPronForm => Str}; + mkDemonPronForm : (x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12:Str) -> DemPronForm = + \y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12 -> { + s = table { + Sg => table { + Masc => table { + Dir => y1 ; + Obl => y2 ; + Voc => y3 + }; + Fem => table { + Dir => y4 ; + Obl => y5 ; + Voc => y6 + } + }; + Pl => table { + Masc => table { + Dir => y7 ; + Obl => y8 ; + Voc => y9 + }; + Fem => table { + Dir => y10 ; + Obl => y11 ; + Voc => y12 + } + } + } + }; + makeDemonPronForm : Str -> Str -> Str -> DemPronForm ; + makeDemonPronForm yeh is inn = mkDemonPronForm yeh is "" yeh is "" yeh inn "" yeh inn ""; +-- makePossPronForm myra myry hmara hmary = mkDemonPronForm myra myra myra myry myry myry hmara hmara hmara hmary hmary hmary; + + PersPron = {s: PersPronForm => Str}; + + mkPersPron:(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20,x21,x22,x23,x24,x25,x26,x27,x28,x29,x30,x31,x32,x33,x34,x35,x36:Str) -> PersPron = + \y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13,y14,y15,y16,y17,y18,y19,y20,y21,y22,y23,y24,y25,y26,y27,y28,y29,y30,y31,y32,y33,y34,y35,y36 -> { + s = + table { + PPF Sg Pers1 Dir => y1; + PPF Sg Pers1 Obl => y2; + PPF Sg Pers1 Voc => y3; + PPF Sg Pers2_Casual Dir => y4; + PPF Sg Pers2_Casual Obl => y5; + PPF Sg Pers2_Casual Voc => y6; + PPF Sg Pers2_Familiar Dir => y7; + PPF Sg Pers2_Familiar Obl => y8; + PPF Sg Pers2_Familiar Voc => y9; + PPF Sg Pers2_Respect Dir => y10; + PPF Sg Pers2_Respect Obl => y11; + PPF Sg Pers2_Respect Voc => y12; + PPF Sg Pers3_Near Dir => y13; + PPF Sg Pers3_Near Obl => y14; + PPF Sg Pers3_Near Voc => y15; + PPF Sg Pers3_Distant Dir => y16; + PPF Sg Pers3_Distant Obl => y17; + PPF Sg Pers3_Distant Voc => y18; + PPF Pl Pers1 Dir => y19; + PPF Pl Pers1 Obl => y20; + PPF Pl Pers1 Voc => y21; + PPF Pl Pers2_Casual Dir => y22; + PPF Pl Pers2_Casual Obl => y23; + PPF Pl Pers2_Casual Voc => y24; + PPF Pl Pers2_Familiar Dir => y25; + PPF Pl Pers2_Familiar Obl => y26; + PPF Pl Pers2_Familiar Voc => y27; + PPF Pl Pers2_Respect Dir => y28; + PPF Pl Pers2_Respect Obl => y29; + PPF Pl Pers2_Respect Voc => y30; + PPF Pl Pers3_Near Dir => y31; + PPF Pl Pers3_Near Obl => y32; + PPF Pl Pers3_Near Voc => y33; + PPF Pl Pers3_Distant Dir => y34; + PPF Pl Pers3_Distant Obl => y35; + PPF Pl Pers3_Distant Voc => y36 + }; + }; + + makePersPron : PersPron; + makePersPron = mkPersPron "m(a)yN" "m(o)j'|h" "" "t(o)w " "t(o)j|h" "t(o)w " "t(o)m" "t(o)m" "t(o)m" "Ap" "Ap" "Ap" "y(i)h" "a(i)s" "" "w(o)h" "a(o)s" "" + "h(a)m" "h(a)m" "" "t(o)m" "t(o)m" "t(o)m" "t(o)m" "t(o)m" "t(o)m" "Ap" "Ap" "Ap" "y(i)h" "a(i)n" "" "w(o)h" "a(o)n" "" ; + + mkPron : (x1,x2,x3:Str) -> {s:Case => Str} = + \y1,y2,y3 -> { s = + table { + Dir => y1; + Obl => y2; + Voc => y3 + } + }; + + ------- PossPronForm yet to be implemented + +-- IntPronForm = {s:InterrPronForm => Str}; + IntPronForm = {s: Case => Str}; + mkIntPronForm : (x1,x2,x3:Str) -> IntPronForm = + \y1,y2,y3 -> { + s = + table { + Dir => y1; + Obl => y2; + Voc => y3 + } + }; + +----2 Adjectives +-- defined in ResUrd + +----3 Verbs + CommonVF = {s : VTense => UPerson => Number => Gender => Str} ; + + mkVerb : (x1: Str) -> Verb = \inf -> + let root = (tk 2 inf); inf_obl = ((tk 1 inf) + "E"); inf_fem = ((tk 1 inf) + "y") + in { s = table { + + VF tense person number gender => (mkCmnVF root tense person number gender).s ; + Inf => inf ; + Root => root ; + Inf_Obl => inf_obl ; + Inf_Fem => inf_fem + + + } + } ; + rem_y : Str -> Str; + rem_y str = let b = take 1 str; yth = drop 1 str; a1 = take 4 yth; a2 = take 1 yth; th= if_then_else Str (eq a1 "(a)y") (drop 5 str) (drop 2 str); st = if_then_else Str (eq a1 "(a)y") (b ++ "(i)"++th) (if_then_else Str (eq a2 "y") (b ++ th) str) + in rt st; + rt: Str -> Str; + rt r = r; + mkCmnVF : Str -> VTense -> UPerson -> Number -> Gender -> {s:Str} = + \root,t,p,n,g -> + {s = + let form1 = case (last root) of { + "a"|"A"|"w" => root + "w^N" ; + _ => root + "wN" + }; + form2 = case (last root) of { + "a"|"A"|"w" => root + "y^N" ; + _ => root + "yN" + }; + in + case of { + => form1 ; + => form2 ; + => (mkImpert root p n g).s ; + => case root of { + "hw" => (mkPastInd root p n g).s ; + "ja" => (mkPastInd "gy" p n g).s ; + "kr" => (mkPastInd "k" p n g).s ; + "dE" => (mkPastInd "d" p n g).s ; + "lE" => (mkPastInd "l" p n g).s ; + _ => (mkPastInd root p n g).s }; + => root + "tE"; + => root + "ty"; --variants{root+"ty" ; root+"tyN"}; + => root + "tE"; + => root+"tyN"; + => root + "tE"; + => root + "ty"; --variants{root+"ty" ; root+"tyN"}; + => root + "tE"; + => root+"tyN"; + => root+"ta"; + => root+"ty"; + => root+"te"; + => root+"tyN" + } + + } ; + + mkPastInd : Str -> UPerson -> Number -> Gender -> {s:Str} = \root,p,n,g -> + {s = let roo = root ; + a = case (last root) of { + "a"|"A"|"w"|"k" => "ya" ; + _ => "a" + } ; + y = case (last root) of { + "a"|"A"|"w" => "y^y" ; + _ => "y" + } ; + e = case (last root) of { + "a"|"A"|"w"|"k" => "y^E" ; + _ => "E" + } ; + yN = case (last root) of { + "a"|"A"|"w" => "y^yN" ; + _ => "yN" + } ; + + in + case of { + => roo+a ; + => roo+y ; + => roo+e ; + => roo+yN ; + + => roo+a ; + => roo+y ; + => roo+e ; + => roo+yN ; + + => roo+e ; + => roo+y; --variants{roo+y ; roo+yN} ; + => roo+e ; + => roo+yN ; + + => roo+e ; + => roo+yN; --variants{roo+yN ; roo+y} ; + => roo+e ; + => roo+yN ; + <_,Sg,Masc> => roo + a; + <_,Sg,Fem> => roo+y ; + <_,Pl,Masc> => roo + e; + <_,Pl,Fem> => roo+yN + + } ; + } ; + + mkImpert : Str -> UPerson -> Number -> Gender -> {s:Str} = \root,p,n,g -> + {s = let roo = root ; + w = case (last root) of { + "a"|"A"|"w" => "w^" ; + _ => "w" + } ; + yN = case (last root) of { + "a"|"A"|"w" => "y^yN" ; + _ => "yN" + } ; + yE = case (last root) of { + "a"|"A"|"w" => "y^yE" ; + _ => "yE" + } ; + e = case (last root) of { + "a"|"A"|"w" => "y^E" ; + _ => "E" + } in + case of { + => ""; --nonExist ; + => root ; + => roo+w ; + => roo+w ; + => roo+w; --variants{roo+w; roo+yN; roo+yE} ; + => roo+yN; --variants{roo+yN; roo+yE} ; + <_,Sg,_> => roo+e ; + <_,Pl,_> => roo+yN + }; + }; + +} diff --git a/lib/src/hindi/src/StructuralHin.gf b/lib/src/hindi/src/StructuralHin.gf new file mode 100644 index 000000000..7177a0b8e --- /dev/null +++ b/lib/src/hindi/src/StructuralHin.gf @@ -0,0 +1,129 @@ +concrete StructuralHin of Structural = CatHin ** + open MorphoHin, ParadigmsHin, Prelude, NounHin,ParamX,CommonHindustani in { + + flags optimize=all ; + coding = utf8; + + lin + above_Prep = mkPrep "awpr" "awpr" ; + after_Prep = mkPrep ["kE bed"] ["kE bed"] ; + all_Predet = ss "tmam" ; + almost_AdA, almost_AdN = mkAdN "tqryba" ; + although_Subj = ss "agrch-" ; + always_AdV = ss "hmyXh" ; + and_Conj = sd2 [] "awr" ** {n = Pl} ; + because_Subj = ss "kywnkh-" ; + before_Prep = mkPrep "phlE" "phlE" ; + behind_Prep = mkPrep "pych-E" "pych-E" ; + between_Prep = mkPrep "drmyaN" "drmyaN" ; + both7and_DConj = sd2 "dwnwN" "awr" ** {n = Pl} ; + but_PConj = ss "lykn" ; + by8agent_Prep = mkPrep "" "" ; + by8means_Prep = mkPrep "" "" ; +-- can8know_VV,can_VV = mkV "skna" ** { isAux = True} ; + during_Prep = mkPrep ["kE drmyaN"] ["kE drmyaN"] ; + either7or_DConj = sd2 "kwy ayk" "ya" ** {n = Sg} ; + everybody_NP = MassNP (UseN (ParadigmsHin.mkN "hr kwy" "hr kwy" "hr kwy" "hr kwy" "hr kwy" "hr kwy" Masc )); -- not a good way coz need to include NounHin +-- every_Det = mkDet "hr" Sg; + everything_NP = MassNP (UseN (ParadigmsHin.mkN "hr cyz" "hr cyz" "hr cyzw" "sb cyzyN" "sb cyzwN" "sb cyzw" Masc )); + everywhere_Adv = mkAdv "hr jgh" ; +-- few_Det = mkDet "cnd" Pl ; + first_Ord = {s = "pehla" ; n = Sg} ; --DEPRECATED + for_Prep = mkPrep "kylyE" "kylyE" ; + from_Prep = mkPrep "sE" "sE" ; + he_Pron = personalPN "wh" "as" "" "as ka" Sg Masc Pers3_Distant ; + here_Adv = mkAdv "yhaN" ; + here7to_Adv = mkAdv "yhaN pr" ; + here7from_Adv = mkAdv "yhaN sE" ; + how_IAdv = ss "kysE" ; + how8many_IDet = makeIDet "ktnE" "ktny" Pl ; + if_Subj = ss "agr" ; + in8front_Prep = mkPrep ["kE samnE"] ["kE samnE"] ; + i_Pron = personalPN "myN" "mjh-" "" "myra" Sg Masc Pers1; + in_Prep = mkPrep "meN" "meN" ; + it_Pron = personalPN "yh" "yh" "yh" "as ka" Sg Masc Pers3_Near; + less_CAdv = {s = "km" ; p = ""} ; +-- many_Det = mkDet "bht zyadh" Pl ; + more_CAdv = {s = "zyadh-" ; p = "" } ; + most_Predet = ss "zyadh tr" ; + --much_Det = mkDet "bht" Pl ; +-- must_VV = { +-- s = table { +-- VVF VInf => ["have to"] ; +-- VVF VPres => "must" ; +-- VVF VPPart => ["had to"] ; +-- VVF VPresPart => ["having to"] ; +-- VVF VPast => ["had to"] ; --# notpresent +-- VVPastNeg => ["hadn't to"] ; --# notpresent +-- VVPresNeg => "mustn't" +-- } ; +-- isAux = True +-- } ; +-----b no_Phr = ss "no" ; + no_Utt = ss "nhyN" ; + on_Prep = mkPrep "pr" "pr" ; +-- one_Quant = demoPN "ayk" "ayk" "ayk" ; -- DEPRECATED + only_Predet = ss "srf" ; + or_Conj = sd2 [] "ya" ** {n = Sg} ; + otherwise_PConj = ss "ya ph-r" ; + part_Prep = mkPrep "" "" ; + please_Voc = ss "mhrbani" ; + possess_Prep = mkPrep "ka" "ky" ; + quite_Adv = ss "khamosh" ; + she_Pron = personalPN "wh" "as" "wh" "as ky" Sg Fem Pers3_Distant ; + so_AdA = ss "so" ; + somebody_NP = MassNP (UseN (ParadigmsHin.mkN "kwy" "kwy" "kwy" "kwy" "kwy" "kwy" Masc )); + --someSg_Det = mkDet "kch-" Sg ; + --somePl_Det = mkDet "kch-" Pl ; + something_NP = MassNP (UseN (ParadigmsHin.mkN "kwy cyz" "kwy cyz" "kwy cyz" "kh- cyzyN" "kh- cyzwN" "kh- cyzw" Masc )); + somewhere_Adv = mkAdv "khin pr" ; + that_Quant = demoPN "wh" "as" "an" ; + that_Subj = ss "kh"; + there_Adv = mkAdv "whaN" ; + there7to_Adv = mkAdv "whaN pr" ; + there7from_Adv = mkAdv ["whaN sE"] ; + therefore_PConj = ss "as lyE" ; + they_Pron = personalPN "wh" "wh" "wh" "an ka" Pl Masc Pers3_Distant ; ---- + this_Quant = demoPN "yh" "as" "an"; + through_Prep = mkPrep ["myN sE"] ["myN sE"] ; + too_AdA = ss "bht" ; + to_Prep = mkPrep "kw" "kw" ; + under_Prep = mkPrep "nycE" "nycE" ; + very_AdA = ss "bht" ; +-- want_VV = mkV "cahna" ** { isAux = False} ; + we_Pron = personalPN "hm" "hm" "hm" "hmara" Pl Masc Pers1 ; + whatSg_IP = mkIP "kya" "kis" "kis" Sg Masc ; + whatPl_IP = mkIP "kya" "kin" "kin" Pl Masc ; + when_IAdv = ss "kb" ; + when_Subj = ss "kb" ; + where_IAdv = ss "khaN" ; + which_IQuant = {s = \\_ => "kwn sy"} ; +-- whichPl_IDet = makeDet "kwn sa" "kwn sy" "kwn sE" "kwn sy" ; +-- whichSg_IDet = makeDet "kwn sa" "kwn sy" "kwn sE" "kwn sy" ; + whoSg_IP = mkIP "kwn" "kis" "kis" Sg Masc ; + whoPl_IP = mkIP "kwn" "kn" "knhwN" Pl Masc ; + why_IAdv = ss "kywN" ; + without_Prep = mkPrep ["kE bGyr"] ["kE bGyr"] ; + with_Prep = mkPrep ["kE sath-"] ["kE sath-"] ; +-- yes_Phr = ss "haN" ; + yes_Utt = ss "haN" ; + youSg_Pron = personalPN "tm" "tm" "tm" "tmh-ara" Sg Masc Pers2_Casual ; + youPl_Pron = personalPN "tm" "tm" "tm" "tmh-ara" Pl Masc Pers2_Casual ; + youPol_Pron = personalPN "Ap" "AP" "AP" "Ap ka" Sg Masc Pers2_Respect ; + no_Quant = demoPN " kwy nhyN" "kwy nhyN" "kwy nhyN" ; + not_Predet = {s="nhyN"} ; + if_then_Conj = sd2 "agr" "tw" ** {n = Sg} ; + at_least_AdN = mkAdN ["km az km"] ; + at_most_AdN = mkAdN ["zyadh sE zyadh"]; + nothing_NP = MassNP (UseN (ParadigmsHin.mkN "kwy cyz nhyN" "kwy cyz nhyN" "kwy cyz nhyN" "kwy cyz nhyN" "kwy cyz nhyN" "kwy cyz nhyN" Masc )); + except_Prep = mkPrep "swaE" "swaE" ; + nobody_NP = MassNP (UseN (ParadigmsHin.mkN "kwy nhyN" "kwy nhyN" "kwy nhyN" "kwy nhyN" "kwy nhyN" "kwy nhyN" Masc )); + + as_CAdv = {s = "etna" ; p = "jtna"} ; + + have_V2 = mkV2 (mkV "rakh-na") "" ; + + language_title_Utt = ss "ardw" ; + +} + diff --git a/lib/src/hindi/translit.gfs b/lib/src/hindi/translit.gfs new file mode 100644 index 000000000..4cf3e7585 --- /dev/null +++ b/lib/src/hindi/translit.gfs @@ -0,0 +1,11 @@ +rf -file=../hindustani/CommonHindustani.gf | ps -env=quotes -to_devanagari | wf -file=CommonHindustani.gf +rf -file=../hindustani/ExtraHindustani.gf | ps -env=quotes -to_devanagari | wf -file=ExtraHindustani.gf +rf -file=../hindustani/ResHindustani.gf | ps -env=quotes -to_devanagari | wf -file=ResHindustani.gf +rf -file=../hindustani/StringsHindustani.gf | ps -env=quotes -to_devanagari | wf -file=StringsHindustani.gf +rf -file=src/DiffHin.gf | ps -env=quotes -to_devanagari | wf -file=DiffHin.gf +rf -file=src/ExtraHin.gf | ps -env=quotes -to_devanagari | wf -file=ExtraHin.gf +rf -file=src/IdiomHin.gf | ps -env=quotes -to_devanagari | wf -file=IdiomHin.gf +rf -file=src/LexiconHin.gf | ps -env=quotes -to_devanagari | wf -file=LexiconHin.gf +rf -file=src/MorphoHin.gf | ps -env=quotes -to_devanagari | wf -file=MorphoHin.gf +rf -file=src/StructuralHin.gf | ps -env=quotes -to_devanagari | wf -file=StructuralHin.gf + diff --git a/lib/src/hindustani/AdjectiveHindustani.gf b/lib/src/hindustani/AdjectiveHindustani.gf new file mode 100644 index 000000000..cb677d9f4 --- /dev/null +++ b/lib/src/hindustani/AdjectiveHindustani.gf @@ -0,0 +1,38 @@ +incomplete concrete AdjectiveHindustani of Adjective = CatHindustani ** open CommonHindustani,ResHindustani, StringsHindustani, Prelude in { + + lin + + PositA a = a ; + UseComparA a = a; + + ComparA a np = { + s = \\n,g,c,d => np.s ! NPC Obl ++ sE ++ a.s ! n ! g ! c ! d ; + } ; + +---- $SuperlA$ belongs to determiner syntax in $Noun$. + + ComplA2 a np = { + s = \\n,g,c,d => np.s ! NPC Obl ++ a.c2 ++ a.s ! n ! g ! c ! d ; + } ; + + ReflA2 a = { + s = \\n,g,c,d => a.s ! n ! g ! c ! d ++ RefPron ++ sE ; + } ; + + SentAP ap sc = { + s = \\n,g,c,d => ap.s ! n ! g ! c ! d ++ sc.s ; + } ; + + AdAP ada ap = { + s = \\n,g,c,d => ada.s ++ ap.s ! n ! g ! c ! d ; + } ; + + UseA2 a = a ; + + CAdvAP cadv ap np = { + s = \\n,g,c,d => cadv.s ++ ap.s ! n ! g ! c ! d ++ cadv.p ++ np.s ! NPC Dir ; + }; + + AdjOrd ord = { s = \\_,_,_,_ => ord.s ; }; + +} diff --git a/lib/src/hindustani/AdverbHindustani.gf b/lib/src/hindustani/AdverbHindustani.gf new file mode 100644 index 000000000..7873c1286 --- /dev/null +++ b/lib/src/hindustani/AdverbHindustani.gf @@ -0,0 +1,20 @@ +incomplete concrete AdverbHindustani of Adverb = CatHindustani ** open CommonHindustani, ResHindustani, StringsHindustani, Prelude in { + + lin + PositAdvAdj a = {s = \\g => a.s ! Sg ! g ! Obl ! Posit} ; + ComparAdvAdj cadv a np = { + s = \\g => np.s ! NPObj ++ cadv.p ++ cadv.s ++ a.s ! Sg ! g ! Obl ! Posit; + } ; + ComparAdvAdjS cadv a s = { + s = \\g => cadv.p ++ cadv.s ++ a.s ! Sg ! g ! Obl ! Posit ++ s.s; + } ; + + PrepNP prep np = {s = \\g => np.s ! NPObj ++ prep.s ! g } ; + + AdAdv ada adv = { s = \\g => ada.s ++ adv.s ! g} ; + + SubjS sub s = {s = \\_ => sub.s ++ s.s } ; + + AdnCAdv cadv = {s = sE ++ cadv.s ; p = True} ; + +} diff --git a/lib/src/hindustani/CatHindustani.gf b/lib/src/hindustani/CatHindustani.gf new file mode 100644 index 000000000..fd2922bc3 --- /dev/null +++ b/lib/src/hindustani/CatHindustani.gf @@ -0,0 +1,92 @@ +--concrete CatUrd of Cat = CommonX - [Adv,AdN] ** open ResUrd, Prelude in { +incomplete concrete CatHindustani of Cat = + CommonX - [Adv,AdN]** open ResHindustani, Prelude, CommonHindustani, (R = ParamX) in { + + flags optimize=all_subs ; + + lincat +------ Tensed/Untensed + + S = {s : Str} ; + QS = {s : QForm => Str} ; + RS = {s : Agr => Str ; c : Case} ; -- c for it clefts + SSlash = {s : Str ; c2 : ResHindustani.Compl} ; + +---- Sentence + + Cl = ResHindustani.Clause ; + ClSlash = { + s : CommonHindustani.VPHTense => Polarity => Order => Str ; + c2 : ResHindustani.Compl + } ; + Imp = {s : CPolarity => ImpForm => Str} ; + +---- Question + QCl = {s : CommonHindustani.VPHTense => Polarity => QForm => Str} ; + IP = {s: Case => Str ; g : Gender ; n : Number}; + IDet = {s :Gender => Str ; n : Number} ; + IQuant = {s : Number => Str} ; + +---- Relative + + RCl = { + s : CommonHindustani.VPHTense => Polarity => Order => Agr => Str ; + c : Case + } ; + RP = {s: Number => Case => Str ; a:RAgr}; + +---- Verb + + VP = VPH ; + VPSlash = ResHindustani.VPHSlash ; + Comp = {s : Agr => Str} ; +---- Adverb + Adv = {s : Gender => Str } ; + +----- AdN + AdN = {s : Str ; p : Bool} ; + +---- Adjective + + AP = CommonHindustani.Adjective ; + +---- Noun + + CN = ResHindustani.Noun ; + NP = CommonHindustani.NP ; + Pron = {s : Case => Str ; ps : Str ; a : Agr}; + Det = ResHindustani.Determiner ; + Predet = {s : Str} ; + Num = {s : Str ; n : Number} ; + Card = {s : Str; n : Number} ; + Ord = {s : Str; n : Number} ; + Quant = {s:Number => Gender => Case => Str ; a:Agr}; + Art = {s : Str} ; + +---- Numeral + + Numeral = {s : CardOrd => Str ; n : Number} ; + Digits = {s : CardOrd => Str ; n : Number } ; + +---- Structural + + Conj = {s1,s2 : Str ; n : Number} ; +-----b Conj = {s : Str ; n : Number} ; +-----b DConj = {s1,s2 : Str ; n : Number} ; + Subj = {s : Str} ; + Prep = ResHindustani.Preposition; +---- Open lexical classes, e.g. Lexicon + + V, VS, VQ, VA = Verb ; -- = {s : VForm => Str} ; + V2, V2A, V2Q, V2S = Verb ** {c2 : Compl} ; + V3 = Verb ** {c2, c3 : Str} ; + VV = Verb ** { isAux : Bool} ; + V2V = Verb ** {c1 : Str ; c2 : Str ; isAux : Bool} ; + A = CommonHindustani.Adjective ; --- {s : Gender => Number => Case => Str} ; + A2 = {s : Number => Gender => Case => Degree => Str ; c2 : Str} ; + N = {s : Number => Case => Str ; g : Gender} ; + N2 = {s : Number => Case => Str ; g : Gender} ** {c2 : Str ; c3 : Str } ; + N3 = {s : Number => Case => Str ; g : Gender} ** {c2 : Str ; c3 : Str ; c4 : Str} ; + PN = {s : Case => Str ; g : Gender} ; + +} diff --git a/lib/src/hindustani/CommonHindustani.gf b/lib/src/hindustani/CommonHindustani.gf new file mode 100644 index 000000000..6314cc091 --- /dev/null +++ b/lib/src/hindustani/CommonHindustani.gf @@ -0,0 +1,309 @@ +--# -path=.:../abstract:../common:../../prelude +-- +--1 Hindustaniu auxiliary operations. +-- +-- This module contains operations that are needed to make the +-- resource syntax work. +resource CommonHindustani = ParamX ** open Prelude,Predef in { + + flags coding = utf8 ; + + oper + + VPH = { + s : VPHForm => {fin, inf : Str} ; + obj : {s : Str ; a : Agr} ; + subj : VType ; + comp : Agr => Str; + inf : Str; + ad : Str; + embComp : Str ; + prog : Bool ; + } ; + NP : Type = {s : NPCase => Str ; a : Agr} ; + param + VPHForm = + VPTense VPPTense Agr -- 9 * 12 + | VPReq + | VPImp + | VPReqFut + | VPInf + | VPStem + ; + VPPTense = + VPPres + |VPPast + |VPFutr + |VPPerf; + + VPHTense = + VPGenPres -- impf hum nahim "I go" + | VPImpPast -- impf Ta nahim "I went" + | VPFut -- fut na/nahim "I shall go" + | VPContPres -- stem raha hum nahim "I am going" + | VPContPast -- stem raha Ta nahim "I was going" + | VPContFut + | VPPerfPres -- perf hum na/nahim "I have gone" + | VPPerfPast -- perf Ta na/nahim "I had gone" + | VPPerfFut + | VPPerfPresCont + | VPPerfPastCont + | VPPerfFutCont + | VPSubj -- subj na "I may go" + ; + Agr = Ag Gender Number UPerson ; + Gender = Masc | Fem ; + Case = Dir | Obl | Voc ; + UPerson = Pers1 + | Pers2_Casual + | Pers2_Familiar + | Pers2_Respect + | Pers3_Near + | Pers3_Distant; + VType = VIntrans | VTrans | VTransPost ; + VerbForm = VF VTense UPerson Number Gender + | Inf + | Root + | Inf_Obl + | Inf_Fem; + VTense = Subj | Perf | Imperf; + CTense = CPresent | CPast | CFuture ; + NPCase = NPC Case | NPObj | NPErg ; + Order = ODir | OQuest ; + + + oper + copula : CTense -> Number -> UPerson -> Gender -> Str = \t,n,p,g -> + case of { + => "hwN" ; + => "hE" ; + => "hw" ; + => "hyN" ; + => "hE" ; + => "hE" ; + => "hyN" ; + => "hw" ; + => "hw" ; + => "hyN" ; + => "hyN" ; + => "hyN" ; + => "th-a" ; + => "th-y" ; + => "th-a" ; + => "th-y" ; + => "th-a" ; + => "th-y" ; + => "th-E" ; + => "th-yN" ; + => "th-a" ; + => "th-y" ; + => "th-a" ; + => "th-y" ; + => "th-E" ; + => "th-yN" ; + => "th-E" ; + => "th-yN" ; + => "th-E" ; + => "th-yN" ; + => "th-E" ; + => "th-yN" ; + => "th-E" ; + => "th-yN" ; + => "th-E" ; + => "th-yN" ; + => "ga" ; + => "gy" ; + => "ga" ; + => "gy" ; + => "gE" ; + => "gy" ; + => "gE" ; + => "gy" ; + => "ga" ; + => "gy" ; + => "ga" ; + => "gy" ; + => "gE" ; + => "gy" ; + => "gE" ; + => "gy" ; + => "gE" ; + => "gy" ; + => "gE" ; + => "gy" ; + => "gE" ; + => "gE" ; + => "gE" ; + => "gy" + + + } ; + raha : Gender -> Number -> Str = \g,n -> + (regAdjective "rha").s ! n ! g ! Dir ! Posit ; + + cka : Gender -> Number -> Str = \g,n -> + (regAdjective "cka").s ! n ! g ! Dir ! Posit ; + + hw : UPerson -> Number -> Str = \pp,n -> + case of { + => "hwN"; + <_,Pl> => "hwN"; + <_,_> => "hw" + }; + + ----------------------------------------------- + -- Hindustani Adjectives + ----------------------------------------------- + + Adjective = { s: Number => Gender => Case => Degree => Str }; + regAdjective : Str -> Adjective; + regAdjective x = case x of { + acch + ("a"|"aN") => mkAdjective x ("bht" ++ x) ("sab sE" ++ x) (acch + "E") ("bht" ++ acch + "E") ("sab sE" ++ acch + "E") (acch + "E") ("bht" ++ acch + "E") ("sab sE" ++ acch + "E") + (acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y") (acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y") (acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y") + (acch +"E") ("bht" ++ acch + "E") ("sab sE" ++ acch + "E") (acch + "E") ("bht" ++ acch + "E") ("sab sE" ++ acch + "E") (acch + "E") ("bht" ++ acch + "E") ("sab sE" ++ acch + "E") + (acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y") (acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y") (acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y"); + + _ => mkAdjective x x x x x x x x x + x x x x x x x x x + x x x x x x x x x + x x x x x x x x x + }; + + + mkAdjective : (x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20,x21,x22,x23,x24,x25,x26,x27,x28,x29,x30,x31,x32,x33,x34,x35,x36:Str) -> Adjective = + \y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13,y14,y15,y16,y17,y18,y19,y20,y21,y22,y23,y24,y25,y26,y27,y28,y29,y30,y31,y32,y33,y34,y35,y36 -> { + s = table { + Sg => table { + Masc => table { + Dir => table { + Posit => y1 ; + Compar => y2 ; + Superl => y3 + }; + Obl => table { + Posit => y4 ; + Compar => y5 ; + Superl => y6 + }; + Voc => table { + Posit => y7 ; + Compar => y8 ; + Superl => y9 + } + }; + Fem => table { + Dir => table { + Posit => y10 ; + Compar => y11 ; + Superl => y12 + }; + Obl => table { + Posit => y13 ; + Compar => y14 ; + Superl => y15 + }; + Voc => table { + Posit => y16 ; + Compar => y17 ; + Superl => y18 + } + } + }; + Pl => table { + Masc => table { + Dir => table { + Posit => y19 ; + Compar => y20 ; + Superl => y21 + }; + Obl => table { + Posit => y22 ; + Compar => y23 ; + Superl => y24 + }; + Voc => table { + Posit => y25 ; + Compar => y26 ; + Superl => y27 + } + }; + Fem => table { + Dir => table { + Posit => y28 ; + Compar => y29 ; + Superl => y30 + }; + Obl => table { + Posit => y31 ; + Compar => y32 ; + Superl => y33 + }; + Voc => table { + Posit => y34 ; + Compar => y35 ; + Superl => y36 + } + } + } + } + }; + + Verb : Type = {s : VerbForm => Str} ; + + predV : Verb -> VPH ; + predV v = { + s = \\vh => + case vh of { + VPTense VPPres (Ag g n p) => {fin = copula CPresent n p g ; inf = v.s ! VF Imperf p n g } ; + VPTense VPPast (Ag g n p) => {fin = [] ; inf =v.s ! VF Perf p n g} ; + VPTense VPFutr (Ag g n p) => {fin = copula CFuture n p g ; inf = v.s ! VF Subj p n g } ; + VPTense VPPerf (Ag g n p) => { fin = [] ; inf = v.s ! Root ++ cka g n } ; + VPStem => {fin = [] ; inf = v.s ! Root}; + _ => {fin = [] ; inf = v.s ! Root} + }; + obj = {s = [] ; a = defaultAgr} ; + subj = VIntrans ; + inf = v.s ! Inf; + ad = []; + embComp = []; + prog = False ; + comp = \\_ => [] + } ; + + defaultAgr : Agr = agrP3 Masc Sg ; + agrP3 : Gender -> Number -> Agr = \g,n -> Ag g n Pers3_Distant ; + toAgr : Number -> UPerson -> Gender -> Agr = \n,p,g -> + Ag g n p; + + + fromAgr : Agr -> {n : Number ; p : UPerson ; g : Gender} = \a -> case a of { + Ag g n p => {n = n ; p = p ; g = g} + } ; + + conjAgr : Agr -> Agr -> Agr = \a0,b0 -> + let a = fromAgr a0 ; b = fromAgr b0 + in + toAgr + (conjNumber a.n b.n) + b.p a.g; + + giveNumber : Agr -> Number =\a -> case a of { + Ag _ n _ => n + }; + giveGender : Agr -> Gender =\a -> case a of { + Ag g _ _ => g + }; + insertSubj : UPerson -> Str -> Str = \p,s -> + case p of { Pers1 => s ++ "wN" ; _ => s ++ "E"}; + + mkOrd : Str -> Str = + \s -> case s of { + "ayk" => "phla"; + "dw" => "dwsra"; + "tyN" => "tesra"; + "car" => "cwth'a"; + "ch'" => "ch'Ta"; + _ => s ++ "waN" + }; +} + diff --git a/lib/src/hindustani/ConjunctionHindustani.gf b/lib/src/hindustani/ConjunctionHindustani.gf new file mode 100644 index 000000000..237f3d0e1 --- /dev/null +++ b/lib/src/hindustani/ConjunctionHindustani.gf @@ -0,0 +1,44 @@ + +incomplete concrete ConjunctionHindustani of Conjunction = + CatHindustani ** open CommonHindustani, ResHindustani, Coordination, Prelude in { + +--concrete ConjunctionUrd of Conjunction = +-- CatUrd ** open ResUrd, Coordination, Prelude in { + + + flags optimize=all_subs ; + + lin + + ConjS = conjunctDistrSS ; + + ConjAdv conj advs = conjunctDistrTable Gender conj advs ; + + ConjNP conj ss = conjunctDistrTable NPCase conj ss ** { + a = conjAgr (agrP3 Masc conj.n) ss.a + } ; + + ConjAP conj ss = conjunctDistrTable4 Number Gender Case Degree conj ss ; + ConjRS conj rs = conjunctDistrTable Agr conj rs ** { c = rs.c}; + +---- These fun's are generated from the list cat's. + + BaseS = twoSS ; + ConsS = consrSS comma ; + BaseAdv x y = twoTable Gender x y ; + ConsAdv xs x = consrTable Gender comma xs x ; + BaseNP x y = twoTable NPCase x y ** {a = conjAgr x.a y.a} ; + BaseRS x y = twoTable Agr x y ** {c = x.c}; + ConsNP xs x = consrTable NPCase comma xs x ** {a = conjAgr xs.a x.a} ; + ConsRS xs x = consrTable Agr comma xs x ** { c = xs.c}; + BaseAP x y = twoTable4 Number Gender Case Degree x y ; -- ** {isPre = andB x.isPre y.isPre} ; + ConsAP xs x = consrTable4 Number Gender Case Degree comma xs x ;-- ** {isPre = andB xs.isPre x.isPre} ; + + lincat + [S] = {s1,s2 : Str} ; + [Adv] = {s1,s2 : Gender => Str} ; + [NP] = {s1,s2 : NPCase => Str ; a : Agr} ; + [AP] = {s1,s2 : Number => Gender => Case => Degree => Str} ; + [RS] = {s1,s2 : Agr => Str ; c : Case}; + +} diff --git a/lib/src/hindustani/DiffHindustani.gf b/lib/src/hindustani/DiffHindustani.gf new file mode 100644 index 000000000..ec162d43a --- /dev/null +++ b/lib/src/hindustani/DiffHindustani.gf @@ -0,0 +1,8 @@ +interface DiffHindustani = open CommonHindustani, Prelude in { + oper + + mkClause : NP -> VPH -> Clause ; + mkSClause : Str -> Agr -> VPH -> Clause ; + + np2pronCase : (Case => Str) -> NPCase -> Agr -> Str ; +} \ No newline at end of file diff --git a/lib/src/hindustani/ExtraHindustani.gf b/lib/src/hindustani/ExtraHindustani.gf new file mode 100644 index 000000000..03549c693 --- /dev/null +++ b/lib/src/hindustani/ExtraHindustani.gf @@ -0,0 +1,18 @@ +--concrete ExtraUrd of ExtraUrdAbs = CatUrd ** +-- open ResUrd, Coordination, Prelude, MorphoUrd, ParadigmsUrd in { +incomplete concrete ExtraHindustani of ExtraHindustaniAbs = CatHindustani ** + open CommonHindustani,Coordination,ResHindustani, ParamX in { + lin + GenNP np = {s = \\_,_,_ => np.s ! NPC Obl ++ "ka" ; a = np.a} ; + + each_Det = mkDet "hr kwy" "hr kwy" "hr kwy" "hr kwy" Sg ; + have_V = mkV "rakh-na"; + IAdvAdv adv = {s = "ktny" ++ adv.s} ; + ICompAP ap = {s = "ktnE" ++ ap.s ! Sg ! Masc ! Dir ! Posit} ; + cost_V = mkV "qymt" ; + + -- added for causitives + make_CV = mkVerb "nothing" ** {c2 = "" }; + +-- for VP conjunction +} diff --git a/lib/src/hindustani/ExtraHindustaniAbs.gf b/lib/src/hindustani/ExtraHindustaniAbs.gf new file mode 100644 index 000000000..948cf53c7 --- /dev/null +++ b/lib/src/hindustani/ExtraHindustaniAbs.gf @@ -0,0 +1,9 @@ +abstract ExtraHindustaniAbs = Extra ** { + +-- uncontracted negations; contracted are the default + fun + + each_Det : Det ; + have_V : V; + cost_V : V; +} diff --git a/lib/src/hindustani/NounHindustani.gf b/lib/src/hindustani/NounHindustani.gf new file mode 100644 index 000000000..4b0184ac0 --- /dev/null +++ b/lib/src/hindustani/NounHindustani.gf @@ -0,0 +1,135 @@ +--concrete NounUrd of Noun = CatUrd ** open ResUrd, Prelude in { +incomplete concrete NounHindustani of Noun = + CatHindustani ** open CommonHindustani, ResHindustani, StringsHindustani, Prelude in { + + flags optimize=all_subs ; + + lin + DetCN det cn = { + s = \\c => detcn2NP det cn c det.n ; + a = agrP3 cn.g det.n + } ; + + UsePN pn = {s = \\c => toNP pn.s c ; a = agrP3 pn.g Sg} ; + UsePron p = {s = \\c => np2pronCase p.s c p.a ; a = p.a} ; + + PredetNP pred np = { + s = \\c => pred.s ++ np.s ! c ; + a = np.a + } ; + + PPartNP np v2 = { + s = \\c => v2.s ! VF Imperf Pers1 Sg Fem ++ np.s ! c ; + a = np.a + } ; + + RelNP np rs = { + s = \\c => np.s ! c ++ comma ++ rs.s ! np.a ; + a = np.a + } ; + + AdvNP np adv = { +-- s = \\c => np.s ! c ++ adv.s ! (fromAgr np.a).g ; -- jan ka bh'ay so order is changed + s = \\c => adv.s ! (fromAgr np.a).g ++ np.s ! c ; + a = np.a + } ; + + DetQuantOrd quant num ord = { +-- s = \\ c => detquant2det quant.s num.s c ++ ord.s ; + s = \\n,g => quant.s!n!g!Dir ++ num.s ++ ord.s ; + n = num.n + } ; + + DetQuant quant num = { +-- s = \\c => detquant2det quant.s num.s c; + s = \\n,g => quant.s!n!g!Dir ++ num.s; + n = num.n + } ; + + DetNP det = { + s = \\c => det2NP det c ; ---- case + a = agrP3 Masc Sg + } ; + + PossPron p = {s = \\_,_,_ => p.ps ; a = p.a} ; + + NumSg = {s = []; n = Sg} ; + NumPl = {s = []; n = Pl} ; + + NumCard n = n ** {hasCard = True} ; + + NumDigits n = {s = n.s ! NCard ; n = n.n} ; + OrdDigits n = {s = n.s ! NOrd; n = n.n} ; + + NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n} ; + OrdNumeral numeral = {s = numeral.s ! NOrd ; n = numeral.n} ; + + AdNum adn num = {s = case adn.p of {False => adn.s ++ num.s ; True => num.s ++ adn.s}; n = num.n} ; + + OrdSuperl a = {s = a.s ! Sg ! Masc ! Dir ! Superl ; n = Sg} ; + + + + DetArtSg art cn = { + s = \\c => art.s ++ toNP (cn.s ! Sg) c ; + a = agrP3 cn.g Sg + } ; + + DetArtPl art cn = { + s = \\c => art.s ++ toNP (cn.s ! Pl) c ; + a = agrP3 cn.g Pl + } ; + + DefArt = {s = \\_,_,_ => [] ; a = defaultAgr} ; + IndefArt = {s = \\_,_,_ => [] ; a =defaultAgr } ; + + MassNP cn = {s = \\c => toNP (cn.s ! Sg) c ; a = agrP3 cn.g Sg} ; + + UseN n = n ; + UseN2 n = { s = n.s ; g = n.g }; + + Use2N3 f = { + s = f.s; + g = f.g ; + c2 = f.c2; + c3 = f.c3 + } ; + + Use3N3 f = { + s = f.s ; + g = f.g ; + c2 = f.c2; + c3 = f.c3 + } ; + + ComplN2 f x = {s = \\n,c => case c of { + Dir => x.s ! NPC c ++ f.c2 ++ f.s ! n ! c ; + Obl => x.s ! NPC c ++ f.c3 ++ f.s ! n ! c ; + CommonHindustani.Voc => x.s ! NPC c ++ f.c3 ++ f.s ! n ! c + }; + g = f.g; + }; + ComplN3 f x = { + s = \\n,c => x.s ! NPObj ++ f.c4 ++ f.s ! n ! Dir ; + g = f.g ; + c2 = f.c2; + c3 = f.c3 + } ; + + AdjCN ap cn = { + s = \\n,c => ap.s ! n ! cn.g ! c ! Posit ++ cn.s ! n ! c ; + g = cn.g + } ; + + RelCN cn rs = { + s = \\n,c => cn.s ! n ! c ++ rs.s ! agrP3 cn.g n ; + g = cn.g + } ; +-- AdvCN cn ad = {s = \\n,c => cn.s ! n ! c ++ ad.s ; g = cn.g} ; -- changed during WebAlt adver comes before noun like phaRy pr gh-r (house on the hill) + AdvCN cn ad = {s = \\n,c => ad.s ! cn.g ++ cn.s ! n ! c ; 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 ! Dir ++ np.s ! NPC c ; g = cn.g} ; + +} diff --git a/lib/src/hindustani/PhraseHindustani.gf b/lib/src/hindustani/PhraseHindustani.gf new file mode 100644 index 000000000..f6c25b5b9 --- /dev/null +++ b/lib/src/hindustani/PhraseHindustani.gf @@ -0,0 +1,29 @@ +--concrete PhraseUrd of Phrase = CatUrd ** open Prelude, ResUrd in { +incomplete concrete PhraseHindustani of Phrase = + CatHindustani ** open CommonHindustani, ResHindustani, Prelude in { + + lin + PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; + + UttS s = s ; + UttQS qs = {s = qs.s ! QDir} ; + UttImpSg pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Sg False} ; + UttImpPl pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Pl False} ; + UttImpPol pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Sg True} ; + + UttIP ip = {s = ip.s ! Dir} ; --- Acc also + UttIAdv iadv = iadv ; + UttNP np = {s = np.s ! NPC Dir} ; + UttVP vp = {s = infVP False vp (agrP3 Masc Sg)} ; + UttAdv adv = {s = adv.s ! Masc} ; + UttCN cn = {s = cn.s ! Sg ! Dir}; + UttCard n = n ; + UttAP ap = {s = ap.s ! Sg ! Masc ! Dir ! Posit} ; + + NoPConj = {s = []} ; + PConjConj conj = {s = conj.s2} ; --- + + NoVoc = {s = []} ; + VocNP np = {s = np.s ! NPC Dir} ; + +} diff --git a/lib/src/hindustani/QuestionHindustani.gf b/lib/src/hindustani/QuestionHindustani.gf new file mode 100644 index 000000000..a13c78836 --- /dev/null +++ b/lib/src/hindustani/QuestionHindustani.gf @@ -0,0 +1,78 @@ +--concrete QuestionUrd of Question = CatUrd ** open ResUrd, StringsHindustani, Prelude in { +incomplete concrete QuestionHindustani of Question = + CatHindustani ** open CommonHindustani, ResHindustani, StringsHindustani, Prelude in { + + flags optimize=all_subs ; + coding = utf8; + + lin + + QuestCl cl = { + s = \\t,p,qf => case qf of { + QDir => cl.s ! t ! p ! OQuest; + QIndir => agr ++ cl.s ! t! p ! ODir + } + }; + + QuestVP qp vp = + let cl = mkSClause [] (Ag qp.g qp.n Pers3_Near) vp; + qp1 = qp.s ! Dir; + qp2 = qp.s ! Obl ++ nE + in { s = \\t,p,o => case t of { + VPImpPast => qp2 ++ cl.s ! t ! p ! ODir; + _ => qp1 ++ cl.s ! t ! p ! ODir + } + }; + QuestSlash ip slash = + let ip1 = ip.s ! Dir; + ip2 = ip.s ! Obl ++ nE + in { + s = \\t,p,o => case t of { + VPImpPast => ip2 ++ slash.s ! t ! p ! ODir; + _ => ip1 ++ slash.s ! t ! p ! ODir + } + }; + + QuestIAdv iadv cl = { + s = \\t,p,_ => iadv.s ++ cl.s ! t ! p ! ODir; + }; + + QuestIComp icomp np = + let cl = mkSClause (np.s ! NPC Dir ++ icomp.s) np.a (predAux auxBe); + in { + s = \\t,p,qf => case qf of { + QDir => cl.s ! t ! p ! ODir; + QIndir => cl.s ! t! p ! ODir + } + }; + + PrepIP p ip = {s = ip.s ! Voc ++ p.s ! ip.g} ; + + AdvIP ip adv = { + s = \\c => adv.s ! ip.g ++ ip.s ! c ; + n = ip.n; + g = ip.g; + } ; + + IdetCN idet cn = { + s = \\c => idet.s ! cn.g ++ cn.s ! idet.n ! c ; + g = cn.g; + n = idet.n; + } ; + + IdetIP idet = { + s = \\_ => idet.s ! Masc ; + n = idet.n; + g = Masc; + } ; + + IdetQuant iqant num = { + s = \\g => iqant.s ! num.n ++ num.s ; + n = num.n + } ; + + CompIAdv a = a ; + CompIP p = ss (p.s ! CommonHindustani.Dir) ; + AdvIAdv i a = {s = i.s ++ a.s ! Masc} ; + +} diff --git a/lib/src/hindustani/RelativeHindustani.gf b/lib/src/hindustani/RelativeHindustani.gf new file mode 100644 index 000000000..cd6e98f4a --- /dev/null +++ b/lib/src/hindustani/RelativeHindustani.gf @@ -0,0 +1,67 @@ +--concrete RelativeUrd of Relative = CatUrd ** open ResUrd, StringsHindustani in { +incomplete concrete RelativeHindustani of Relative = + CatHindustani ** open CommonHindustani, ResHindustani, StringsHindustani, Prelude in { + + flags optimize=all_subs ; + coding = utf8; + + lin + + RelCl cl = { + s = \\t,p,o,agr => case of { + => js ++ cl.s ! t ! p ! o ; + => jn ++ cl.s ! t ! p ! o ; + <_,_> => "jw" ++ cl.s ! t ! p ! o + }; + c = Dir + } ; + +{- RelVP rp vp = { + s = \\t,p,o,ag => + let + agr = case rp.a of { + RNoAg => ag ; + RAg a => a + } ; + cl = mkSClause (rp.s ! (giveNumber agr) ! Dir) agr vp; + +-- cl = case t of { +-- VPImpPast => mkSClause (rp.s ! (giveNumber agr) ! Obl) agr vp; +-- _ => mkSClause (rp.s ! (giveNumber agr) ! Dir) agr vp +-- }; + in + cl.s ! t ! p ! ODir ; + c = Dir + } ; + + RelSlash rp slash = { + s = \\t,p,o,agr => rp.s ! (giveNumber agr) ! Dir ++ slash.c2.s ++ slash.s ! t ! p ! o ;--case t of { +-- VPImpPast => rp.s ! (giveNumber agr) Obl ++ slash.c2.s ++ slash.s ! t ! p ! o ; +-- _ => rp.s ! (giveNumber agr) Dir ++ slash.c2.s ++ slash.s ! t ! p ! o +-- }; + c = Dir + } ; +-} + FunRP p np rp = { + s = \\n,c => rp.s ! n ! c ++ np.s ! NPC c ++ p.s ! Masc ; + a = RAg np.a + } ; + + IdRP = { + s = table { + Sg => table { + + CommonHindustani.Dir => jw ; + CommonHindustani.Obl => js ; + CommonHindustani.Voc => js + }; + Pl => table { + CommonHindustani.Dir => jw ; + CommonHindustani.Obl => jn ; + CommonHindustani.Voc => jn + } + }; + a = RNoAg + } ; + +} diff --git a/lib/src/hindustani/ResHindustani.gf b/lib/src/hindustani/ResHindustani.gf new file mode 100644 index 000000000..e12992d31 --- /dev/null +++ b/lib/src/hindustani/ResHindustani.gf @@ -0,0 +1,400 @@ +--# -path=.:../abstract:../common:../../prelude +-- +--1 Hindustaniu auxiliary operations. +-- +-- This module contains operations that are needed to make the +-- resource syntax work. + +--resource ResHindustani = ParamX ** open Prelude,Predef in { +interface ResHindustani = DiffHindustani ** open CommonHindustani, Prelude, Predef in { + + + flags optimize=all ; + coding = utf8; + +param + + +-- Order = ODir | OQuest ; + +--2 For $Relative$ + + RAgr = RNoAg | RAg Agr ; + RCase = RC Number Case ; + +-- for Numerial + + CardOrd = NCard | NOrd ; + + ----------------------------------------- + -- Hindustani Pronouns + ----------------------------------------- + + Pronoun = P Number Gender Case UPerson; + PersPronForm = PPF Number UPerson Case; + +------------------------------------------- +--Verbs +------------------------------------------- + + + oper + Noun = {s : Number => Case => Str ; g : Gender} ; + + Preposition = {s : Gender => Str}; + DemPronForm = {s : Number => Gender => Case => Str}; + PossPronForm = {s : Number => Gender => Case => Str}; + Determiner = {s : Number => Gender => Str ; n : Number}; + +-- a useful oper + eq : Str -> Str -> Bool = \s1,s2-> (pbool2bool (eqStr s1 s2)) ; + + RefPron : Str; + RefPron = "Kwd"; + + ---------------------------------------------------------- + -- Grammar part + ---------------------------------------------------------- + + + toNP : ( Case => Str) -> NPCase -> Str = \pn, npc -> case npc of { + NPC c => pn ! c ; + NPObj => pn ! Dir ; + NPErg => pn ! Obl ++ "nE" + } ; + detcn2NP : (Determiner) -> Noun -> NPCase -> Number -> Str = \dt,cn,npc,nn -> case npc of { + NPC c => dt.s ! Sg ! Masc ++ cn.s ! nn ! c ; + NPObj => dt.s ! Sg ! Masc ++ cn.s ! nn ! Dir ; + NPErg => dt.s ! Sg ! Masc ++ cn.s ! nn ! Obl ++ "nE" + } ; + det2NP : (Determiner) -> NPCase -> Str = \dt,npc -> case npc of { + NPC c => dt.s ! Sg ! Masc ; + NPObj => dt.s ! Sg ! Masc ; + NPErg => dt.s ! Sg ! Masc ++ "nE" + } ; + +------------------------------------------ +-- Agreement transformations +----------------------------------------- +{- toAgr : Number -> UPerson -> Gender -> Agr = \n,p,g -> + Ag g n p; + + + fromAgr : Agr -> {n : Number ; p : UPerson ; g : Gender} = \a -> case a of { + Ag g n p => {n = n ; p = p ; g = g} + } ; + + conjAgr : Agr -> Agr -> Agr = \a0,b0 -> + let a = fromAgr a0 ; b = fromAgr b0 + in + toAgr + (conjNumber a.n b.n) + b.p a.g; + + giveNumber : Agr -> Number =\a -> case a of { + Ag _ n _ => n + }; + giveGender : Agr -> Gender =\a -> case a of { + Ag g _ _ => g + }; +-} +-- defaultAgr : Agr = agrP3 Masc Sg ; +-- agrP3 : Gender -> Number -> Agr = \g,n -> Ag g n Pers3_Distant ; + personalAgr : Agr = agrP1 Masc Sg ; + agrP1 : Gender -> Number -> Agr = \g,n -> Ag g n Pers1 ; + + param + CPolarity = + CPos + | CNeg Bool ; -- contracted or not + + oper + contrNeg : Bool -> Polarity -> CPolarity = \b,p -> case p of { + Pos => CPos ; + Neg => CNeg b + } ; + +-- NP : Type = {s : NPCase => Str ; a : Agr} ; + + oper + + objVType : VType -> NPCase = \vt -> case vt of { + VTrans => NPObj ; + _ => NPC Obl + } ; + + VPHSlash = VPH ** {c2 : Compl} ; + + Compl : Type = {s : Str ; c : VType} ; + + + predVc : (Verb ** {c2,c1 : Str}) -> VPHSlash = \verb -> + predV verb ** {c2 = {s = verb.c1 ; c = VTrans} } ; +{- +------------------------- +-- added for cauitives + predVcc : (Verb **{c2:Compl}) -> VPHSlash = \verb -> + predV verb ** {c2 = {s = "" ; c = VTrans} } ; +------------------------ +-} + predAux : Aux -> VPH = \verb -> { + s = \\vh => + let + + inf = verb.inf ; + part = verb.ppart ; + + in + case vh of { + VPTense VPPres (Ag g n p) => {fin = copula CPresent n p g ; inf = part } ; + VPTense VPPast (Ag g n p) => {fin = copula CPast n p g ; inf = part } ; + VPTense VPFutr (Ag g n p) => {fin = copula CFuture n p g ; inf = part ++ hw p n } ; + VPStem => {fin = [] ; inf = "rh" }; + _ => {fin = part ; inf = [] } + }; + obj = {s = [] ; a = defaultAgr} ; + subj = VIntrans ; + inf = verb.inf; + ad = []; + embComp = []; + prog = False ; + comp = \\_ => [] + } ; + + Aux = { + inf,ppart,prpart : Str + } ; + + auxBe : Aux = { + inf = "" ; + ppart = "" ; + prpart = "" + } ; + + predProg : VPH -> VPH = \verb -> { + s = \\vh => + case vh of { + VPTense VPPres (Ag g n p) => {fin = copula CPresent n p g ; inf = (verb.s!VPStem).inf ++ raha g n} ; + VPTense VPPast (Ag g n p) => {fin = copula CPast n p g ; inf = (verb.s!VPStem).inf ++ raha g n} ; + VPTense VPFutr (Ag g n p) => {fin = copula CFuture n p g ; inf = (verb.s!VPStem).inf ++ raha g n } ; + VPTense VPPerf (Ag g n p) => {fin = copula CPast n p g ; inf = (verb.s!VPTense VPPres (Ag g n p)).inf ++ raha g n } ; + VPStem => {fin = [] ; inf = (verb.s!VPStem).inf }; + _ => {fin = [] ; inf = [] } + }; + obj = verb.obj ; + subj = VIntrans ; + inf = verb.inf; + ad = verb.ad; + embComp = verb.embComp; + prog = True ; + comp = verb.comp + } ; + +{- Clause : Type = {s : VPHTense => Polarity => Order => Str} ; + mkClause : NP -> VPH -> Clause = \np,vp -> { + s = \\vt,b,ord => + let + subjagr : NPCase * Agr = case vt of { + VPImpPast => case vp.subj of { + VTrans => ; + VTransPost => ; + _ => + } ; + _ => + } ; + subj = subjagr.p1 ; + agr = subjagr.p2 ; + n = (fromAgr agr).n; + p = (fromAgr agr).p; + g = (fromAgr agr).g; + vps = case vt of { + + VPGenPres => vp.s ! VPTense VPPres agr ; + VPImpPast => vp.s ! VPTense VPPast agr ; + VPFut => case vp.prog of { True => {fin = (vp.s ! VPTense VPFutr agr).fin ; inf = (vp.s ! VPTense VPFutr agr).inf ++ hw p n} ; + _ => vp.s ! VPTense VPFutr agr } ; + VPContPres => {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; + VPContPast => {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; + VPContFut => {fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ raha g n ++ hw p n} ; + VPPerfPres => {fin = copula CPresent n p g ; inf = (vp.s ! VPTense VPPerf agr).inf } ; + VPPerfPast => {fin = copula CPast n p g ; inf = (vp.s ! VPTense VPPerf agr).inf } ; + VPPerfFut => {fin = copula CFuture n p g ; inf = (vp.s ! VPTense VPPerf agr).inf ++ hw p n } ; + VPPerfPresCont => {fin = copula CPresent n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n } ; + VPPerfPastCont => {fin = copula CPast n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n } ; + VPPerfFutCont => {fin = copula CFuture n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n ++ hw p n } ; + VPSubj => case vp.prog of { True => {fin = (vp.s ! VPTense VPFutr agr).inf ++ hw p n ; inf = "Xayd" } ; + _ => {fin = (vp.s ! VPTense VPFutr agr).inf ; inf = "Xayd" } } + + }; + + + quest = + case ord of + { ODir => []; + OQuest => "kya" }; + na = + case b of + { Pos => []; + Neg => "na" }; + nahim = + case b of + { Pos => []; + Neg => "nhyN" }; + in + case vt of { + VPSubj => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ na ++ vps.inf ++ vps.fin ++ vp.embComp ; + _ => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp}; + + } ; + + mkSClause : Str -> Agr -> VPH -> Clause = + \subj,agr,vp -> { + s = \\t,b,ord => + let + n = (fromAgr agr).n; + p = (fromAgr agr).p; + g = (fromAgr agr).g; + vps = case t of { + VPGenPres => vp.s ! VPTense VPPres agr ; + VPImpPast => vp.s ! VPTense VPPast agr ; + VPFut => vp.s ! VPTense VPFutr agr ; + VPContPres => {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; + VPContPast => {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; + VPContFut => {fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ raha g n ++ hw p n } ; + VPPerfPres => {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ cka g n } ; + VPPerfPast => {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ cka g n } ; + VPPerfFut => {fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ cka g n ++ hw p n } ; + VPPerfPresCont => {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; + VPPerfPastCont => {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; + VPPerfFutCont => {fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ raha g n ++ hw p n } ; + VPSubj => {fin = insertSubj p (vp.s ! VPStem).inf ; inf = "xayd" } + + }; + + quest = + case ord of + { ODir => []; + OQuest => "kya" }; + na = + case b of + { Pos => []; + Neg => "na" }; + nahim = + case b of + { Pos => []; + Neg => "nhyN" }; + in + case t of { + VPSubj => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ na ++ vps.inf ++ vps.fin ++ vp.embComp; + _ => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp}; + } ; +-} +-- insertSubj : UPerson -> Str -> Str = \p,s -> +-- case p of { Pers1 => s ++ "wN" ; _ => s ++ "E"}; + + insertObj : (Agr => Str) -> VPH -> VPH = \obj1,vp -> { + s = vp.s ; + obj = vp.obj ; + subj = vp.subj ; + inf = vp.inf; + ad = vp.ad; + embComp = vp.embComp; + prog = vp.prog ; + comp = \\a => vp.comp ! a ++ obj1 ! a + } ; + insertVV : Str -> VPH -> Str -> VPH = \obj1,vp,emb -> { + s = vp.s ; + obj = vp.obj ; + subj = vp.subj ; + inf = vp.inf; + ad = vp.ad; + embComp = vp.embComp ++ emb ; + prog = vp.prog ; + comp = \\a => vp.comp ! a ++ obj1 + } ; + + insertObj2 : (Str) -> VPH -> VPH = \obj1,vp -> { + s = vp.s; + obj = vp.obj ; + subj = vp.subj ; + inf = vp.inf; + ad = vp.ad; + embComp = vp.embComp ++ obj1; + prog = vp.prog ; + comp = vp.comp + + } ; + + insertObjc : (Agr => Str) -> VPHSlash -> VPHSlash = \obj,vp -> + insertObj obj vp ** {c2 = vp.c2} ; + insertObjc2 : Str -> VPHSlash -> VPHSlash = \obj,vp -> + insertObj2 obj vp ** {c2 = vp.c2} ; + + infVP : Bool -> VPH -> Agr -> Str = \isAux,vp,a -> + vp.obj.s ++ vp.inf ++ vp.comp ! a ; +-- infVV : Bool -> VPH -> Str = \isAux,vp -> +-- case isAux of {False => vp.obj.s ++ vp.inf ; True => vp.obj.s ++ (vp.s ! VPImp).fin }; + infVV : Bool -> VPH -> Str = \isAux,vp -> + case isAux of {False => vp.obj.s ++ (vp.comp ! (toAgr Sg Pers1 Masc)) ++ vp.inf ; True => vp.obj.s ++ (vp.comp ! (toAgr Sg Pers1 Masc)) ++ (vp.s ! VPImp).fin } ; + infV2V : Bool -> VPH -> Str = \isAux,vp -> + case isAux of {False => vp.obj.s ++ (vp.comp ! (toAgr Sg Pers1 Masc)) ++ vp.inf ++ "ky" ; True => vp.obj.s ++ (vp.comp ! (toAgr Sg Pers1 Masc)) ++ (vp.s ! VPImp).fin ++ "ky"}; + + + insertObject : NP -> VPHSlash -> VPH = \np,vps -> { + s = vps.s ; + obj = {s = vps.obj.s ++ np.s ! objVType vps.c2.c ++ vps.c2.s ; a = np.a} ; + subj = vps.c2.c ; + inf = vps.inf; + ad = vps.ad; + embComp = vps.embComp; + prog = vps.prog ; + comp = vps.comp + } ; + + insertObjPre : (Agr => Str) -> VPHSlash -> VPH = \obj,vp -> { + s = vp.s ; + obj = vp.obj ; + inf = vp.inf ; + subj = vp.subj ; + ad = vp.ad ; + embComp = vp.embComp; + prog = vp.prog ; + comp = \\a => obj ! a ++ vp.c2.s ++ vp.comp ! a + } ; + + insertAdV : Str -> VPH -> VPH = \ad,vp -> { + s = vp.s ; + obj = vp.obj ; + inf = vp.inf ; + subj = vp.subj; + ad = vp.ad ++ ad ; + embComp = vp.embComp; + prog = vp.prog ; + comp = vp.comp + } ; + + conjThat : Str = "kh" ; + + insertEmbCompl : VPH -> Str -> VPH = \vp,emb -> { + s = vp.s ; + obj = vp.obj ; + inf = vp.inf ; + subj = vp.subj; + ad = vp.ad; + embComp = vp.embComp ++ emb; + prog = vp.prog ; + comp = vp.comp + } ; + insertTrans : VPH -> VType -> VPH = \vp,vtype -> { + s = vp.s ; + obj = vp.obj ; + inf = vp.inf ; + subj = vtype; + ad = vp.ad; + embComp = vp.embComp ; + prog = vp.prog ; + comp = vp.comp + } ; + +} + diff --git a/lib/src/hindustani/SentenceHindustani.gf b/lib/src/hindustani/SentenceHindustani.gf new file mode 100644 index 000000000..82a23e564 --- /dev/null +++ b/lib/src/hindustani/SentenceHindustani.gf @@ -0,0 +1,105 @@ +--concrete SentenceUrd of Sentence = CatUrd ** open Prelude, StringsHindustani, ResUrd in { +incomplete concrete SentenceHindustani of Sentence = + CatHindustani ** open CommonHindustani, ResHindustani, Prelude, StringsHindustani in { + + flags optimize=all_subs ; + coding = utf8; + + lin + + PredVP np vp = mkClause np vp ; + + PredSCVP sc vp = mkSClause sc.s (defaultAgr) vp ; + + ImpVP vp = { + s = \\pol,n => + let + agr = Ag Masc (numImp n) Pers2_Casual ; + verb = infVP True vp agr ; + dont = case pol of { + CNeg True => mt ; + CNeg False => nh ; + _ => [] + } + in + dont ++ verb + } ; + + SlashVP np vp = + mkClause np vp ** {c2 = vp.c2} ; + + AdvSlash slash adv = { + s = \\t,p,o => adv.s ! Masc ++ slash.s ! t ! p ! o ; + c2 = slash.c2 + } ; + + SlashPrep cl prep = cl ** {c2 = { s = prep.s ! Masc ; c = VIntrans}} ; + + SlashVS np vs slash = + mkClause np + (insertObj2 (conjThat ++ slash.s) (predV vs)) ** + {c2 = slash.c2} ; + + EmbedS s = {s = conjThat ++ s.s} ; + EmbedQS qs = {s = qs.s ! QIndir} ; + EmbedVP vp = {s = infVP False vp defaultAgr} ; --- agr + + UseCl temp p cl = + { s = case of { + => temp.s ++ p.s ++ cl.s ! VPGenPres ! p.p ! ODir; + => temp.s ++ p.s ++ cl.s ! VPPerfPres ! p.p ! ODir; + => temp.s ++ p.s ++ cl.s ! VPImpPast ! p.p ! ODir; + => temp.s ++ p.s ++ cl.s ! VPPerfPast ! p.p ! ODir; + => temp.s ++ p.s ++ cl.s ! VPFut ! p.p ! ODir; + => temp.s ++ p.s ++ cl.s ! VPPerfFut ! p.p ! ODir; + => temp.s ++ p.s ++ cl.s ! VPSubj ! p.p ! ODir; + => temp.s ++ p.s ++ cl.s ! VPSubj ! p.p ! ODir -- this needs to be fixed by making SubjPerf in ResUrd + + }; + } ; + UseQCl temp p cl = { + s = \\q => case of { + => temp.s ++ p.s ++ cl.s ! VPGenPres ! p.p ! q; + => temp.s ++ p.s ++ cl.s ! VPPerfPres ! p.p ! q; + => temp.s ++ p.s ++ cl.s ! VPImpPast ! p.p ! q; + => temp.s ++ p.s ++ cl.s ! VPPerfPast ! p.p ! q; + => temp.s ++ p.s ++ cl.s ! VPFut ! p.p ! q; + => temp.s ++ p.s ++ cl.s ! VPPerfFut ! p.p ! q; + => temp.s ++ p.s ++ cl.s ! VPSubj ! p.p ! q; + => temp.s ++ p.s ++ cl.s ! VPSubj ! p.p ! q + + }; + } ; + UseRCl temp p rcl = { + s = \\q => case of { + => temp.s ++ p.s ++ rcl.s ! VPGenPres ! p.p ! ODir ! q; + => temp.s ++ p.s ++ rcl.s ! VPPerfPres ! p.p ! ODir ! q; + => temp.s ++ p.s ++ rcl.s ! VPImpPast ! p.p ! ODir ! q; + => temp.s ++ p.s ++ rcl.s ! VPPerfPast ! p.p ! ODir ! q; + => temp.s ++ p.s ++ rcl.s ! VPFut ! p.p ! ODir ! q; + => temp.s ++ p.s ++ rcl.s ! VPPerfFut ! p.p ! ODir ! q; + => temp.s ++ p.s ++ rcl.s ! VPSubj ! p.p ! ODir ! q; + => temp.s ++ p.s ++ rcl.s ! VPSubj ! p.p ! ODir ! q + }; + c = rcl.c + } ; + UseSlash temp p clslash = { + s = case of { + => temp.s ++ p.s ++ clslash.s ! VPGenPres ! p.p ! ODir; + => temp.s ++ p.s ++ clslash.s ! VPPerfPres ! p.p ! ODir; + => temp.s ++ p.s ++ clslash.s ! VPImpPast ! p.p ! ODir ; + => temp.s ++ p.s ++ clslash.s ! VPPerfPast ! p.p ! ODir; + => temp.s ++ p.s ++ clslash.s ! VPFut ! p.p ! ODir; + => temp.s ++ p.s ++ clslash.s ! VPPerfFut ! p.p ! ODir; + => temp.s ++ p.s ++ clslash.s ! VPSubj ! p.p ! ODir; + => temp.s ++ p.s ++ clslash.s ! VPSubj ! p.p ! ODir + }; + c2 = clslash.c2 + } ; + + AdvS a s = {s = a.s ! Masc ++ s.s} ; + + RelS s r = {s = s.s ++ r.s ! agrP3 Masc Sg} ; + SSubjS s sj s = { s = s.s ++ sj.s ++ s.s}; + +} diff --git a/lib/src/hindustani/StringsHindustani.gf b/lib/src/hindustani/StringsHindustani.gf new file mode 100644 index 000000000..485d122d2 --- /dev/null +++ b/lib/src/hindustani/StringsHindustani.gf @@ -0,0 +1,20 @@ +resource StringsHindustani = { + +flags coding = utf8 ; + +oper + agr = "agr" ; + awr = "awr" ; + jn = "jn" ; + js = "js" ; + jw = "jw" ; + kw = "kw" ; + mt = "mt" ; + nE = "nE" ; + nh = "nh" ; + sE = "sE" ; + waN = "waN" ; + + comma = "," ; + +} diff --git a/lib/src/hindustani/SymbolHindustani.gf b/lib/src/hindustani/SymbolHindustani.gf new file mode 100644 index 000000000..95e80403b --- /dev/null +++ b/lib/src/hindustani/SymbolHindustani.gf @@ -0,0 +1,47 @@ +--# -path=.:../abstract:../common + +--concrete SymbolUrd of Symbol = CatUrd ** open Prelude, ResUrd, StringsHindustani in { +incomplete concrete SymbolHindustani of Symbol = + CatHindustani ** open Prelude, ResHindustani, CommonHindustani in { + + lin +-- SymbPN i = {s = \\_ => i.s ; g = Masc} ; + SymbPN i = {s = addGenitiveS i.s ; g = Masc} ; + IntPN i = {s = addGenitiveS i.s ; g = Masc} ; + FloatPN i = {s = addGenitiveS i.s ; g = Masc} ; + NumPN i = {s = \\_ =>i.s ; g = Masc} ; + CNIntNP cn i = { + s = \\c => cn.s ! Sg ! Dir ++ i.s ; + a = agrP3 cn.g Sg + } ; + CNSymbNP det cn xs = { + s = \\c => det.s!Sg!Masc ++ cn.s ! det.n ! Dir ++ xs.s ; + a = agrP3 cn.g det.n + } ; + CNNumNP cn i = { + s = \\c => cn.s ! Sg ! Dir ++ i.s ; + a = agrP3 cn.g Sg + } ; + + SymbS sy = sy ; + SymbNum sy = { s = sy.s ; n = Pl } ; + SymbOrd sy = { s = sy.s ++ waN ; n = Pl} ; + +lincat + + Symb, [Symb] = SS ; + +lin + MkSymb s = s ; + + BaseSymb = infixSS awr ; + 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 {_ => s ++ "ka" } ; + table {_ => s } ; -- testing for webalt but i think should bring back to its origional form as 'ka' is needed for making genitive, in webalt it gives unnecessary 'ka' + +} diff --git a/lib/src/hindustani/VerbHindustani.gf b/lib/src/hindustani/VerbHindustani.gf new file mode 100644 index 000000000..2d50a475e --- /dev/null +++ b/lib/src/hindustani/VerbHindustani.gf @@ -0,0 +1,41 @@ +--concrete VerbUrd of Verb = CatUrd ** open ResUrd in { +incomplete concrete VerbHindustani of Verb = CatHindustani ** open CommonHindustani, ResHindustani, StringsHindustani in { + + flags optimize=all_subs ; + + lin + UseV v = predV v ; + SlashV2a v = predV v ** {c2 = {s = v.c2.s ; c = VTrans}} ; + Slash2V3 v np = + insertObjc (\\_ => np.s ! NPObj ++ v.c3 ) (predV v ** {c2 = {s = v.c2 ; c = VTrans}}) ; + Slash3V3 v np = + insertObjc (\\_ => np.s ! NPC Obl ++ v.c2) (predV v ** {c2 = {s = v.c3 ; c = VTrans}}) ; + ComplVV v vp = insertTrans (insertVV (infVV v.isAux vp) (predV v) vp.embComp ) VTransPost; + ComplVS v s = insertTrans (insertObj2 (conjThat ++ s.s) (predV v)) VTransPost ; + ComplVQ v q = insertObj2 (conjThat ++ q.s ! QIndir) (predV v) ; + ComplVA v ap = insertObj (\\a => ap.s ! giveNumber a ! giveGender a ! Dir ! Posit) (predV v) ; + SlashV2V v vp = insertVV (infV2V v.isAux vp) (predV v) vp.embComp **{c2 = {s = sE ; c = VTransPost}} ; + SlashV2S v s = insertObjc2 (conjThat ++ s.s) (predV v ** {c2 = {s = kw ; c = VTransPost}}) ; + SlashV2Q v q = insertObjc2 (conjThat ++ q.s ! QIndir) (predV v ** {c2 = {s = sE ; c = VTransPost}}) ; + SlashV2A v ap = insertObjc (\\a => ap.s ! giveNumber a ! giveGender a ! Dir ! Posit) (predV v ** {c2 = {s = kw ; c = VTransPost}}) ; ---- + ComplSlash vp np = insertObject np vp ; + SlashVV vv vp = + insertEmbCompl (insertObj (\\a => infVP vv.isAux vp a) (predV vv)) vp.embComp ** + {c2 = vp.c2} ; + SlashV2VNP vv np vp = + insertObjPre (\\_ => np.s ! NPObj ) + (insertObjc (\\a => infVP vv.isAux vp a) (predVc vv)) ** + {c2 = vp.c2} ; + UseComp comp = insertObj comp.s (predAux auxBe) ; + + AdvVP vp adv = insertObj (\\a => adv.s ! giveGender a) vp ; + + AdVVP adv vp = insertAdV adv.s vp ; + ReflVP v = insertObjPre (\\_ => RefPron) v ; + PassV2 v = predV v ; -- need to be fixed + CompAP ap ={s = \\a => ap.s ! giveNumber a ! giveGender a ! Dir ! Posit } ; + CompNP np = {s = \\_ => np.s ! NPObj} ; + CompAdv adv = {s = \\a => adv.s ! giveGender a} ; + + +} diff --git a/lib/src/urdu/AdjectiveUrd.gf b/lib/src/urdu/AdjectiveUrd.gf index 66d1a70fa..d75199c28 100644 --- a/lib/src/urdu/AdjectiveUrd.gf +++ b/lib/src/urdu/AdjectiveUrd.gf @@ -1,38 +1,3 @@ -concrete AdjectiveUrd of Adjective = CatUrd ** open ResUrd, Prelude in { +concrete AdjectiveUrd of Adjective = CatUrd ** AdjectiveHindustani with + (ResHindustani = ResUrd) ; - lin - - PositA a = a ; - UseComparA a = a; - - ComparA a np = { - s = \\n,g,c,d => np.s ! NPC Obl ++ sE_Str ++ a.s ! n ! g ! c ! d ; - } ; - ----- $SuperlA$ belongs to determiner syntax in $Noun$. - - ComplA2 a np = { - s = \\n,g,c,d => np.s ! NPC Obl ++ a.c2 ++ a.s ! n ! g ! c ! d ; - } ; - - ReflA2 a = { - s = \\n,g,c,d => a.s ! n ! g ! c ! d ++ RefPron ++ sE_Str ; - } ; - - SentAP ap sc = { - s = \\n,g,c,d => ap.s ! n ! g ! c ! d ++ sc.s ; - } ; - - AdAP ada ap = { - s = \\n,g,c,d => ada.s ++ ap.s ! n ! g ! c ! d ; - } ; - - UseA2 a = a ; - - CAdvAP cadv ap np = { - s = \\n,g,c,d => cadv.s ++ ap.s ! n ! g ! c ! d ++ cadv.p ++ np.s ! NPC Dir ; - }; - - AdjOrd ord = { s = \\_,_,_,_ => ord.s ; }; - -} diff --git a/lib/src/urdu/AdverbUrd.gf b/lib/src/urdu/AdverbUrd.gf index ba891a6c8..c6a463132 100644 --- a/lib/src/urdu/AdverbUrd.gf +++ b/lib/src/urdu/AdverbUrd.gf @@ -1,20 +1,2 @@ -concrete AdverbUrd of Adverb = CatUrd ** open ResUrd, Prelude in { - - lin - PositAdvAdj a = {s = a.s ! Sg ! Masc ! Obl ! Posit} ; - ComparAdvAdj cadv a np = { - s = np.s ! NPObj ++ cadv.p ++ cadv.s ++ a.s ! Sg ! Masc ! Obl ! Posit; - } ; - ComparAdvAdjS cadv a s = { - s = cadv.p ++ cadv.s ++ a.s ! Sg ! Masc ! Obl ! Posit ++ s.s; - } ; - - PrepNP prep np = {s = np.s ! NPObj ++ prep.s } ; - - AdAdv ada adv = { s = ada.s ++ adv.s} ; - - SubjS = cc2 ; - - AdnCAdv cadv = {s = sE_Str ++ cadv.s} ; - -} +concrete AdverbUrd of Adverb = CatUrd ** AdverbHindustani with + (ResHindustani = ResUrd) ; diff --git a/lib/src/urdu/AllUrd.gf b/lib/src/urdu/AllUrd.gf index 5111e1a75..ce9dd0012 100644 --- a/lib/src/urdu/AllUrd.gf +++ b/lib/src/urdu/AllUrd.gf @@ -1,6 +1,6 @@ ---# -path=.:../abstract:../common:../prelude - -concrete AllUrd of AllUrdAbs = - LangUrd, - ExtraUrd - ** {} ; +--# -path=.:../abstract:../common:../prelude:../hindustani + +concrete AllUrd of AllUrdAbs = + LangUrd, + ExtraUrd + ** {} ; diff --git a/lib/src/urdu/AllUrdAbs.gf b/lib/src/urdu/AllUrdAbs.gf index d4060f792..d7d92fabd 100644 --- a/lib/src/urdu/AllUrdAbs.gf +++ b/lib/src/urdu/AllUrdAbs.gf @@ -1,4 +1,4 @@ -abstract AllUrdAbs = - Lang, - ExtraUrdAbs - ** {} ; +abstract AllUrdAbs = + Lang, + ExtraUrdAbs + ** {} ; diff --git a/lib/src/urdu/CatUrd.gf b/lib/src/urdu/CatUrd.gf index e4ba734e2..87c9ed9aa 100644 --- a/lib/src/urdu/CatUrd.gf +++ b/lib/src/urdu/CatUrd.gf @@ -1,85 +1,2 @@ -concrete CatUrd of Cat = CommonX ** open ResUrd, Prelude in { - - flags optimize=all_subs ; - - lincat ------- Tensed/Untensed - - S = {s : Str} ; - QS = {s : QForm => Str} ; - RS = {s : Agr => Str ; c : Case} ; -- c for it clefts - SSlash = {s : Str ; c2 : ResUrd.Compl} ; - ----- Sentence - - Cl = ResUrd.Clause ; - ClSlash = { - s : ResUrd.VPHTense => Polarity => Order => Str ; - c2 : ResUrd.Compl - } ; - Imp = {s : CPolarity => ImpForm => Str} ; - ----- Question - QCl = {s : ResUrd.VPHTense => Polarity => QForm => Str} ; - IP = {s: Case => Str ; g : Gender ; n : Number}; - IDet = {s :Gender => Str ; n : Number} ; - IQuant = {s : Number => Str} ; - IComp = {s : Str} ; - ----- Relative - - RCl = { - s : ResUrd.VPHTense => Polarity => Order => Agr => Str ; - c : Case - } ; - RP = {s: Number => Case => Str ; a:RAgr}; - ----- Verb - - VP = ResUrd.VPH ; - VPSlash = ResUrd.VPHSlash ; - Comp = {s : Agr => Str} ; - ----- Adjective - - AP = ResUrd.Adjective ; - ----- Noun - - CN = ResUrd.Noun ; - NP = ResUrd.NP ; - Pron = {s : Case => Str ; ps : Str ; a : Agr}; - Det = ResUrd.Determiner ; - Predet = {s : Str} ; - Num = {s : Str ; n : Number} ; - Card = {s : Str; n : Number} ; - Ord = {s : Str; n : Number} ; - Quant = {s:Number => Gender => Case => Str ; a:Agr}; - ----- Numeral - - Numeral = {s : CardOrd => Str ; n : Number} ; - Digits = {s : CardOrd => Str ; n : Number } ; - ----- Structural - - Conj = {s1,s2 : Str ; n : Number} ; ------b Conj = {s : Str ; n : Number} ; ------b DConj = {s1,s2 : Str ; n : Number} ; - Subj = {s : Str} ; - Prep = ResUrd.Preposition; ----- Open lexical classes, e.g. Lexicon - - V, VS, VQ, VA = ResUrd.Verb ; -- = {s : VForm => Str} ; - V2, V2A, V2Q, V2S = ResUrd.Verb ** {c2 : Compl} ; - V3 = ResUrd.Verb ** {c2, c3 : Str} ; - VV = ResUrd.Verb ** { isAux : Bool} ; - V2V = ResUrd.Verb ** {c1 : Str ; c2 : Str ; isAux : Bool} ; - A = ResUrd.Adjective ; --- {s : Gender => Number => Case => Str} ; - A2 = {s : Number => Gender => Case => Degree => Str ; c2 : Str} ; - N = {s : Number => Case => Str ; g : Gender} ; - N2 = {s : Number => Case => Str ; g : Gender} ** {c2 : Str ; c3 : Str } ; - N3 = {s : Number => Case => Str ; g : Gender} ** {c2 : Str ; c3 : Str ; c4 : Str} ; - PN = {s : Case => Str ; g : Gender} ; - -} +concrete CatUrd of Cat = CommonX - [Adv,AdN] ** CatHindustani with + (ResHindustani = ResUrd) ; diff --git a/lib/src/urdu/ConjunctionUrd.gf b/lib/src/urdu/ConjunctionUrd.gf index 22b13c9d9..822b78da2 100644 --- a/lib/src/urdu/ConjunctionUrd.gf +++ b/lib/src/urdu/ConjunctionUrd.gf @@ -1,43 +1,2 @@ ---concrete ConjunctionUrd of Conjunction = --- CatUrdu ** open ResUrdu, Coordination, Prelude in { - -concrete ConjunctionUrd of Conjunction = - CatUrd ** open ResUrd, Coordination, Prelude in { - - - flags optimize=all_subs ; - - lin - - ConjS = conjunctDistrSS ; - - ConjAdv = conjunctDistrSS ; - - ConjNP conj ss = conjunctDistrTable NPCase conj ss ** { - a = conjAgr (agrP3 Masc conj.n) ss.a - } ; - - ConjAP conj ss = conjunctDistrTable4 Number Gender Case Degree conj ss ; - ConjRS conj rs = conjunctDistrTable Agr conj rs ** { c = rs.c}; - ----- 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} ; - BaseRS x y = twoTable Agr x y ** {c = x.c}; - ConsNP xs x = consrTable NPCase comma xs x ** {a = conjAgr xs.a x.a} ; - ConsRS xs x = consrTable Agr comma xs x ** { c = xs.c}; - BaseAP x y = twoTable4 Number Gender Case Degree x y ; -- ** {isPre = andB x.isPre y.isPre} ; - ConsAP xs x = consrTable4 Number Gender Case Degree comma xs x ;-- ** {isPre = andB xs.isPre x.isPre} ; - - lincat - [S] = {s1,s2 : Str} ; - [Adv] = {s1,s2 : Str} ; - [NP] = {s1,s2 : NPCase => Str ; a : Agr} ; - [AP] = {s1,s2 : Number => Gender => Case => Degree => Str} ; - [RS] = {s1,s2 : Agr => Str ; c : Case}; - -} +concrete ConjunctionUrd of Conjunction = CatUrd ** ConjunctionHindustani with + (ResHindustani = ResUrd) ; diff --git a/lib/src/urdu/ExtraUrd.gf b/lib/src/urdu/ExtraUrd.gf index d7c7a8d89..8fa449524 100644 --- a/lib/src/urdu/ExtraUrd.gf +++ b/lib/src/urdu/ExtraUrd.gf @@ -1,11 +1,19 @@ concrete ExtraUrd of ExtraUrdAbs = CatUrd ** - open ResUrd, Coordination, Prelude, MorphoUrd, ParadigmsUrd in { + open ResUrd, Coordination, Prelude, MorphoUrd, ParadigmsUrd,CommonHindustani in { + +flags coding = utf8 ; lin - GenNP np = {s = \\_,_,_ => np.s ! NPC Obl ++ ka_Str ; a = np.a} ; + GenNP np = {s = \\_,_,_ => np.s ! NPC Obl ++ "كا" ; a = np.a} ; - each_Det = mkDet hr_kwy_Str hr_kwy_Str hr_kwy_Str hr_kwy_Str Sg ; - have_V = mkV rakh6na_Str ; + each_Det = mkDet "ہر كوی" "ہر كوی" "ہر كوی" "ہر كوی" Sg ; + have_V = mkV "راكh-نا"; + IAdvAdv adv = {s = "كتنی" ++ adv.s ! Masc} ; + ICompAP ap = {s = "كتنے" ++ ap.s ! Sg ! Masc ! Dir ! Posit} ; + cost_V = mkV "قیمت" ; + + -- added for causitives + make_CV = mkVerb "نoتہiنگ" ** {c2 = "" }; -- for VP conjunction } diff --git a/lib/src/urdu/ExtraUrdAbs.gf b/lib/src/urdu/ExtraUrdAbs.gf index 2b099a305..76bd73b5e 100644 --- a/lib/src/urdu/ExtraUrdAbs.gf +++ b/lib/src/urdu/ExtraUrdAbs.gf @@ -5,4 +5,5 @@ abstract ExtraUrdAbs = Extra ** { each_Det : Det ; have_V : V; + cost_V : V; } diff --git a/lib/src/urdu/GrammarUrd.gf b/lib/src/urdu/GrammarUrd.gf index 0debfa78f..efafb5d37 100644 --- a/lib/src/urdu/GrammarUrd.gf +++ b/lib/src/urdu/GrammarUrd.gf @@ -1,4 +1,4 @@ ---# -path=.:../abstract:../common:../prelude +--# -path=.:../abstract:../common:../prelude:c:/gf_unicoded/hindustani concrete GrammarUrd of Grammar = NounUrd, @@ -11,9 +11,9 @@ RelativeUrd, ConjunctionUrd, PhraseUrd, - TextX, + TextX - [Adv,AdN], StructuralUrd, - TenseX, + TenseX - [Adv,AdN], IdiomUrd ** { diff --git a/lib/src/urdu/IdiomUrd.gf b/lib/src/urdu/IdiomUrd.gf index 1edb02256..81718a447 100644 --- a/lib/src/urdu/IdiomUrd.gf +++ b/lib/src/urdu/IdiomUrd.gf @@ -1,10 +1,10 @@ -concrete IdiomUrd of Idiom = CatUrd ** open Prelude,Predef, ResUrd in { +concrete IdiomUrd of Idiom = CatUrd ** open Prelude,Predef, ResUrd,ParamX,CommonHindustani in { flags optimize=all_subs ; flags coding = utf8; lin - ImpersCl vp = mkSClause [] (agrP3 Masc Sg) vp ; + ImpersCl vp = mkSClause " " (agrP3 Masc Sg) vp ; GenericCl vp = mkSClause "كوی" (agrP3 Masc Sg) vp ; CleftNP np rs = @@ -12,7 +12,7 @@ concrete IdiomUrd of Idiom = CatUrd ** open Prelude,Predef, ResUrd in { in {s = \\t,p,o => cl.s ! t ! p ! o ++ rs.s ! np.a }; - CleftAdv ad ss = { s = \\t,b,o => ad.s ++ ss.s}; + CleftAdv ad ss = { s = \\t,b,o => ad.s ! Masc ++ ss.s}; ExistNP np = mkSClause "وہاں" (agrP3 (fromAgr np.a).g (fromAgr np.a).n) @@ -27,7 +27,8 @@ concrete IdiomUrd of Idiom = CatUrd ** open Prelude,Predef, ResUrd in { } }; - ProgrVP vp = insertObj (\\a => vp.obj.s ++ vp.ad ++ vp.comp ! a ++ (vp.s ! VPStem).inf ++ raha (fromAgr a).g (fromAgr a).n ) (predAux auxBe) ; +-- ProgrVP vp = insertObj (\\a => vp.obj.s ++ vp.ad ++ vp.comp ! a ++ (vp.s ! VPStem).inf ++ raha (fromAgr a).g (fromAgr a).n ) (predAux auxBe) ; + ProgrVP vp = (predProg vp) ; ImpPl1 vp = {s = "آو" ++ infVP True vp (agrP1 Masc Pl)} ; diff --git a/lib/src/urdu/LangUrd.gf b/lib/src/urdu/LangUrd.gf index 90443f017..12f198f16 100644 --- a/lib/src/urdu/LangUrd.gf +++ b/lib/src/urdu/LangUrd.gf @@ -1,4 +1,4 @@ ---# -path=.:../abstract:../common:../prelude +--# -path=.:../abstract:../common:../hindustani concrete LangUrd of Lang = GrammarUrd, diff --git a/lib/src/urdu/LexiconUrd.gf b/lib/src/urdu/LexiconUrd.gf index cd61d31d8..e092f01ed 100644 --- a/lib/src/urdu/LexiconUrd.gf +++ b/lib/src/urdu/LexiconUrd.gf @@ -35,7 +35,7 @@ concrete LexiconUrd of Lexicon = CatUrd ** bread_N = mkN "روتی" ; break_V2 = mkV2 (mkV "توڑنا") ; broad_A = mkA "كھلا" ; - brother_N2 = mkN2 (mkN "بھای") (mkPrep "كا") "كے" ; --not correct + brother_N2 = mkN2 (mkN "بھای") (mkPrep "كا" "كا") "كے" ; --not correct brown_A = mkA "نسواری" ; butter_N = mkN "مكھن" ; buy_V2 = mkV2 (mkV "خریدنا"); @@ -62,7 +62,7 @@ concrete LexiconUrd of Lexicon = CatUrd ** cow_N = mkN "گاے" feminine ; die_V = mkV "مرنا" ; dirty_A = mkA "گندا" ; - distance_N3 = mkN3 (mkN "فاصلہ") (mkPrep "كا") "كے" "سے" ; + distance_N3 = mkN3 (mkN "فاصلہ") (mkPrep "كا" "كا") "كے" "سے" ; doctor_N = mkN "معالج" ; dog_N = mkN "كتا" ; door_N = mkN "دروزہ" ; @@ -72,16 +72,16 @@ concrete LexiconUrd of Lexicon = CatUrd ** empty_A = mkA "خالی" ; enemy_N = mkN "دشمن" ; factory_N = mkN "كارخانہ" ; - father_N2 = mkN2 (mkN "ابا") (mkPrep "كا") "كے" ; + father_N2 = mkN2 (mkN "ابا") (mkPrep "كا" "كا") "كے" ; fear_VS = mkV "درنا"; find_V2 = mkV2 (mkV "پانا") ; fish_N = mkN "مچھلی" ; floor_N = mkN "فرش" ; forget_V2 = mkV2 (mkV "بھولنا") ; fridge_N = mkN "فریگ" ; - friend_N = mkN "دوست" masculine ; +-- friend_N = mkN "دوست" masculine ; fruit_N = mkN "پھل" ; --- fun_AV = mkAV (regA "فuن") ; +-- fun_AV = mkAV (regA "f?ن") ; garden_N = mkN "باغ" ; girl_N = mkN "لڑكی" ; glove_N = mkN "دستانہ" ; @@ -92,7 +92,7 @@ concrete LexiconUrd of Lexicon = CatUrd ** harbour_N = mkCmpdNoun "بندر" (mkN "گاہ") ; hate_V2 = mkV2 (compoundV "نفرت" do_V2) ; hat_N = mkN "توپی" ; --- have_V2 = dirV2 (mk5V "ہاvع" "ہاس" "ہاد" "ہاد" "ہاviنگ") ; +-- have_V2 = dirV2 (mk5V "ہa?ع" "ہاس" "ہاد" "ہاد" "ہa??نگ") ; hear_V2 = mkV2 (mkV "سننا") ; hill_N = mkN "پہاڑی" ; hope_VS = (compoundV "امید" do_V2); @@ -119,11 +119,11 @@ concrete LexiconUrd of Lexicon = CatUrd ** love_N = mkN "محبت" ; love_V2 = mkV2 (compoundV "پیار" do_V2) "كو"; man_N = mkN "آدمی" ; -- not correct according to rules should be discussed - married_A2 = mkA "شادی كرنا" "سے" ; + married_A2 = mkA "شادy?كرنا" "سے" ; meat_N = mkN "گوشت" ; milk_N = mkN "دودھ" ; moon_N = mkN "چاند" ; - mother_N2 = mkN2 (mkN "ماں") (mkPrep "كی") "كے"; -- not covered need to be discussed + mother_N2 = mkN2 (mkN "ماں") (mkPrep "كی" "كی") "كے"; -- not covered need to be discussed mountain_N = mkN "پہاڑی" ; music_N = mkN "موسیقی" ; narrow_A = mkA "باریك" ; @@ -142,7 +142,7 @@ concrete LexiconUrd of Lexicon = CatUrd ** play_V2 = mkV2 (mkV "كھیلنا") ; policeman_N = mkCmpdNoun "پولیس" (mkN "والا") ; priest_N = (mkN "پیغمبر") ; --- probable_AS = mkAS (regA "پرoبابلع") ; +-- probable_AS = mkAS (regA "پr?بابلع") ; queen_N = mkN "شہزادی" ; radio_N = mkN "ریڈیو" ; rain_V0 = compoundV "بارش" (mkV "ہونا" ) ; @@ -150,9 +150,9 @@ concrete LexiconUrd of Lexicon = CatUrd ** red_A = mkA "لال" ; religion_N = mkN "مزہب" ; restaurant_N = mkN "ہوٹل" ; - river_N = mkN "دریا" masculine ; +-- river_N = mkN "دریا" masculine ; rock_N = mkN "چٹان" ; - roof_N = mkN "چھت" masculine ; +-- roof_N = mkN "چھت" masculine ; rubber_N = mkN "ربڑ" ; run_V = mkV "دوڑنا" ; say_VS = mkV "كہنا" ; @@ -186,16 +186,16 @@ concrete LexiconUrd of Lexicon = CatUrd ** switch8off_V2 = mkV2 (mkV "چلانا") ; switch8on_V2 = mkV2 (compoundV "بند" do_V2) ; table_N = mkN "میز" feminine ; - talk_V3 = mkV3 (mkV "بولنا") "سے" "كے بارے معں"; - teacher_N = mkN "iستاد" ; + talk_V3 = mkV3 (mkV "بولنا") "سے" "كE?بارE?معں"; + teacher_N = mkN "?ستاد" ; teach_V2 = mkV2 (mkV "پڑھنا") ; television_N = mkN "تعلیویزن" ; thick_A = mkA "موٹا" ; thin_A = mkA "پتلا" ; train_N = mkN "گاڑی" ; travel_V = (compoundV "سفر" do_V2) ; - tree_N = mkN "درخت" masculine ; --- ---- trousers_N = mkN "ترouسعرس" ; +-- tree_N = mkN "درخت" masculine ; +-- ---- trousers_N = mkN "تr??سعرس" ; ugly_A = mkA "بدصورت" ; understand_V2 = mkV2 (mkV "سمجھنا") ; university_N = mkN "یونیورسٹی" ; @@ -218,7 +218,7 @@ concrete LexiconUrd of Lexicon = CatUrd ** young_A = mkA "جوان" ; do_V2 = mkV2 (mkV "كرنا") ; now_Adv = mkAdv "اب" ; - already_Adv = mkAdv "پہلے ہی" ; + already_Adv = mkAdv "پہلE?ہی" ; song_N = mkN "گانا" ; add_V3 = mkV3 (compoundV "اضافہ" do_V2) "" "" ; number_N = mkN "ہندسہ" ; @@ -231,7 +231,7 @@ concrete LexiconUrd of Lexicon = CatUrd ** far_Adv = mkAdv "دور" ; correct_A = mkA "صیہ" ; dry_A = mkA "خشك" ; - dull_A = mkA "نالiك" ; + dull_A = mkA "ناl?ك" ; full_A = mkA "مكمل" ; heavy_A = mkA "بھاری" ; near_A = mkA "قریب" ; @@ -266,7 +266,7 @@ concrete LexiconUrd of Lexicon = CatUrd ** foot_N = mkN "پاوں" ; -- not properly covered need to be discussed forest_N = mkN "نجگل" ; grass_N = mkN "گھس" feminine ; - guts_N = mkN "گuت" ; -- FIXME: no singular + guts_N = mkN "g?ت" ; -- FIXME: no singular hair_N = mkN "بال" ; hand_N = mkN "ہاتھ" ; head_N = mkN "سر" ; @@ -299,7 +299,7 @@ concrete LexiconUrd of Lexicon = CatUrd ** stick_N = mkN "چھڑی" ; tail_N = mkN "دم" ; tongue_N = mkN "زبان" feminine ; - tooth_N = mkN "دانت" masculine; +-- tooth_N = mkN "دانت" masculine; wife_N = mkN "بیوی" ; wind_N = mkN "آندھی" ; wing_N = mkN "پر" ; @@ -344,7 +344,7 @@ concrete LexiconUrd of Lexicon = CatUrd ** rub_V2 = mkV2 (mkV "رگڑنا") ; scratch_V2 = mkV2 (mkV "كھرچنا") "كو" ; split_V2 = mkV2 (mkV "بانتا") "كو" ; --- squeeze_V2 = dirV2 (regV "سقuععزع") ; +-- squeeze_V2 = dirV2 (regV "سq?ععزع") ; -- stab_V2 = dirV2 (regDuplV "ستاب") ; suck_V2 = mkV2 (mkV "چوسنا") ; throw_V2 = mkV2 (mkV "پھینكنا") ; @@ -352,19 +352,19 @@ concrete LexiconUrd of Lexicon = CatUrd ** wash_V2 = mkV2 (mkV "دھونا") ; wipe_V2 = mkV2 (compoundV "صاف" (mkV "كرنا" )); ----- other_A = regA "oتہعر" ; +---- other_A = regA "?تہعر" ; grammar_N = mkN "گردان" ; language_N = mkN "زبان" feminine ; rule_N = mkN "اصول" ; ---- added 4/6/2007 - john_PN = mkPN "جoن" ; + john_PN = mkPN "جان" ; question_N = mkN "سوال" ; -- ready_A = regA "رعادی" ; reason_N = mkN "وجہ" feminine ; today_Adv = mkAdv "آج" ; - uncertain_A = mkA ["غیر یقینی"] ; + uncertain_A = mkA ["غیریقینی"] ; } diff --git a/lib/src/urdu/Makefile b/lib/src/urdu/Makefile deleted file mode 100644 index b567981ee..000000000 --- a/lib/src/urdu/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -all: transliterate - -transliterate: - gf mkN03 (s); _ + ("اں"|"وں") => mkN04 (s); _ + "ؤ" => mkN12 (s); + _ + "ت" => mkN10 s ; _ => regNoun2 (s) }; regNoun2 : Str -> Noun; @@ -195,7 +196,11 @@ oper -- Proposition - makePrep : Str -> Preposition = \str -> {s = str}; + makePrep : Str -> Str -> Preposition = \s1,s2 -> {s = + table { + Masc => s1; + Fem => s2 + }; } ** { lock_Prep = <>}; ----2 Pronouns PronForm = {s:Pronoun => Str}; diff --git a/lib/src/urdu/NounUrd.gf b/lib/src/urdu/NounUrd.gf index c9fe05acc..a7e864da5 100644 --- a/lib/src/urdu/NounUrd.gf +++ b/lib/src/urdu/NounUrd.gf @@ -1,119 +1,2 @@ -concrete NounUrd of Noun = CatUrd ** open ResUrd, Prelude in { - - flags optimize=all_subs ; - - lin - DetCN det cn = { - s = \\c => detcn2NP det cn c det.n ; - a = agrP3 cn.g det.n - } ; - - UsePN pn = {s = \\c => toNP pn.s c ; a = agrP3 pn.g Sg} ; - UsePron p = {s = \\c => np2pronCase p.s c ; a = p.a} ; - - PredetNP pred np = { - s = \\c => pred.s ++ np.s ! c ; - a = np.a - } ; - - PPartNP np v2 = { - s = \\c => v2.s ! VF Imperf Pers1 Sg Fem ++ np.s ! c ; - a = np.a - } ; - - RelNP np rs = { - s = \\c => np.s ! c ++ comma_Str ++ rs.s ! np.a ; - a = np.a - } ; - - AdvNP np adv = { - s = \\c => np.s ! c ++ adv.s ; - a = np.a - } ; - - DetQuantOrd quant num ord = { --- s = \\ c => detquant2det quant.s num.s c ++ ord.s ; - s = \\n,g => quant.s!n!g!Dir ++ num.s ++ ord.s; - n = num.n - } ; - - DetQuant quant num = { --- s = \\c => detquant2det quant.s num.s c; - s = \\n,g => quant.s!n!g!Dir ++ num.s; - n = num.n - } ; - - DetNP det = { - s = \\c => det2NP det c ; ---- case - a = agrP3 Masc Sg - } ; - - PossPron p = {s = \\_,_,_ => p.ps ; a = p.a} ; - - NumSg = {s = []; n = Sg} ; - NumPl = {s = []; n = Pl} ; - - NumCard n = n ** {hasCard = True} ; - - NumDigits n = {s = n.s ! NCard ; n = n.n} ; - OrdDigits n = {s = n.s ! NOrd; n = n.n} ; - - NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n} ; - OrdNumeral numeral = {s = numeral.s ! NOrd ; n = numeral.n} ; - - AdNum adn num = {s = adn.s ++ num.s ; n = num.n} ; - - OrdSuperl a = {s = a.s ! Sg ! Masc ! Dir ! Superl ; n = Sg} ; - - DefArt = {s = \\_,_,_ => [] ; a = defaultAgr} ; - IndefArt = {s = \\_,_,_ => [] ; a =defaultAgr } ; - - MassNP cn = {s = \\c => toNP (cn.s ! Sg) c ; a = agrP3 cn.g Sg} ; - - UseN n = n ; - UseN2 n = { s = n.s ; g = n.g }; - - Use2N3 f = { - s = f.s; - g = f.g ; - c2 = f.c2; - c3 = f.c3 - } ; - - Use3N3 f = { - s = f.s ; - g = f.g ; - c2 = f.c2; - c3 = f.c3 - } ; - - ComplN2 f x = {s = \\n,c => case c of { - Dir => x.s ! NPC c ++ f.c2 ++ f.s ! n ! c ; - Obl => x.s ! NPC c ++ f.c3 ++ f.s ! n ! c ; - ResUrd.Voc => x.s ! NPC c ++ f.c3 ++ f.s ! n ! c - }; - g = f.g; - }; - ComplN3 f x = { - s = \\n,c => x.s ! NPObj ++ f.c4 ++ f.s ! n ! Dir ; - g = f.g ; - c2 = f.c2; - c3 = f.c3 - } ; - - AdjCN ap cn = { - s = \\n,c => ap.s ! n ! cn.g ! c ! Posit ++ cn.s ! n ! c ; - g = cn.g - } ; - - RelCN cn rs = { - s = \\n,c => cn.s ! n ! c ++ rs.s ! agrP3 cn.g n ; - 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 ! Dir ++ np.s ! NPC c ; g = cn.g} ; - -} +concrete NounUrd of Noun = CatUrd ** NounHindustani with + (ResHindustani = ResUrd) ; diff --git a/lib/src/urdu/NumeralUrd.gf b/lib/src/urdu/NumeralUrd.gf index 207ce90f5..b7f4ad3cb 100644 --- a/lib/src/urdu/NumeralUrd.gf +++ b/lib/src/urdu/NumeralUrd.gf @@ -1,127 +1,118 @@ -concrete NumeralUrd of Numeral = CatUrd ** open ResUrd in { --- By Harald Hammarström --- Modification for Urdu Shafqat Virk - flags coding=utf8 ; ---- still old Devanagari coding - - -param DForm = unit | ten ; -param DSize = sg | r2 | r3 | r4 | r5 | r6 | r7 | r8 | r9 ; -param Size = sing | less100 | more100 ; - -oper LinDigit = {s : DForm => Str ; size : DSize ; n : Number} ; - - -lincat Dig = { s:Str ; n : Number}; -lincat Digit = LinDigit ; -lincat Sub10 = {s : DForm => Str ; size : DSize ; n : Number} ; -lincat Sub100 = {s : Str ; size : Size ; n : Number} ; -lincat Sub1000 = {s : Str ; s2 : Str ; size : Size ; n : Number } ; -lincat Sub1000000 = { s : Str ; n : Number } ; - -lin num x0 = - {s = table { - NCard => x0.s ; - NOrd => x0.s ++ "واں" -- need to use mkOrd which will make irregular ordinals but it gives path error - }; - n = x0.n - } ; -oper mkOrd : Str -> Str = - \s -> case s of { - "عك" => "پہلا"; - "دo" => "دوسرا"; - "تi:ن" => "تعسرا"; - "چa:ر" => "چوتھا"; - ("چحاہ"|"چحا"|"چحاi") => "چھٹا"; - _ => s ++ "واں" - }; --- {s = \\_ => x0.s ; n = x0.n} ; - - -oper mkNum : Str -> Str -> DSize -> LinDigit = - \do -> \bis -> \sz -> - {s = table {unit => do ; ten => bis } ; - size = sz ; n = Pl} ; - -lin n2 = mkNum "دو" "بیس" r2 ; -lin n3 = mkNum "تین" "تیس" r3 ; -lin n4 = mkNum "چار" "چالیس" r4 ; -lin n5 = mkNum "پانچ" "پچاس" r5 ; -lin n6 = mkNum "چھ" "ساتھ" r6 ; -lin n7 = mkNum "سات" "ستر" r7; -lin n8 = mkNum "آتھ" "اسی" r8; -lin n9 = mkNum "نو" "نوے" r9 ; - -oper mkR : Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> DSize => Str = \a1 -> \a2 -> \a3 -> \a4 -> \a5 -> \a6 -> \a7 -> \a8 -> \a9 -> table { - sg => a1 + "اہ" ; - r2 => a2 + "i:س" ; - r3 => a3 + "تi:س" ; - r4 => a4 + "a:لi:س" ; - r5 => a5 + "ان" ; - r6 => a6 + "ساٹح" ; - r7 => a7 + "ہاتتار" ; - r8 => a8 + "a:سi:" ; - r9 => a9 + "a:ناvع" -} ; - -oper rows : DSize => DSize => Str = table { - sg => mkR "گیارہ" "iكك" "iكات" "عكت" "iكیاو" "iك" "iك" "iكی" "iكی" ; - r2 => mkR "بارہ" "بای" "بات" "بای" "باو" "با" "با" "بای" "ب" ; - r3 => mkR "تیر" "تی" "تین" "تنت" "ترپ" "تری" "ت" "تر" "تر" ; - r4 => mkR "چود" "چوب" "چون" "چوا" "چوو" "چون" "چوہ" "چور" "چور" ; - r5 => mkR "پند" "پچی" "پین" "پنتا" "پچپ" "پین" "پہ" "پچ" "پچ" ; - r6 => mkR "سول" "چھب" "چھت" "چھی" "چھپ" "چھیا" "چھ" "چھی" "چھی" ; - r7 => mkR "ستر" "ستا" "سین" "سنت" "ستاو" "ستا" "سر" "ست" "ستا" ; - r8 => mkR "اتھار" "اتھای" "اڑ" "اڑت" "اتھاو" "اڑ" "اتھ" "اتھ" "اتھ" ; - r9 => table {sg => "انیس" ; r2 => "انتیس" ; r3 => "انتالیس" ; - r4 => "انچاس" ; r5 => "انستھ" ; r6 => "انہتر" ; - r7 => "اناسی" ; - r8 => "انانوے" ; r9 => "ننانوے" } -} ; - -oper ss : Str -> {s : Str} = \s -> {s = s} ; - -lin pot01 = {s = table {unit => "ایك" ; _ => "دuممی" } ; size = sg ; n = Sg} ; -lin pot0 d = d ; -lin pot110 = {s = "داس" ; size = less100 ; n = Pl} ; -lin pot111 = {s = rows ! sg ! sg ; size = less100 ; n = Pl} ; -lin pot1to19 d = {s = rows ! d.size ! sg ; size = less100 ; n = d.n} ; -lin pot0as1 n = {s = n.s ! unit ; size = table {sg => sing ; _ => less100} ! n.size ; n = n.n } ; - -lin pot1 d = {s = d.s ! ten ; size = less100 ; n = d.n} ; -lin pot1plus d e = {s = rows ! e.size ! d.size ; size = less100 ; n = d.n} ; - -lin pot1as2 n = {s = n.s ; s2 = "دuممی" ; size = n.size ; n = n.n} ; -lin pot2 d = {s = (mksau (d.s ! unit) d.size) ; - s2 = d.s ! unit ++ "لاكھ" ; size = more100 ; n = d.n} ; -lin pot2plus d e = - {s = (mksau (d.s ! unit) d.size) ++ e.s ; - s2 = (d.s ! unit) ++ "لاكھ" ++ (mkhazar e.s e.size) ; - size = more100 ; n = d.n} ; - -lin pot2as3 n = {s = n.s ; n = n.n} ; -lin pot3 n = {s = table { sing => ekhazar ; - less100 => n.s ++ "ہزار" ; - more100 => n.s2 } ! n.size ; n = n.n} ; -lin pot3plus n m = - {s = table {sing => ekhazar ; - less100 => n.s ++ "ہزار" ; - more100 => n.s2 } ! n.size ++ m.s ; n = n.n} ; - -lin D_0 = { s = "0" ; n = Sg}; -lin D_1 = { s = "1" ; n = Sg}; -lin D_2 = { s = "2" ; n = Pl}; -lin D_3 = { s = "3" ; n = Pl}; -lin D_4 = { s = "4" ; n = Pl}; -lin D_5 = { s = "5" ; n = Pl}; -lin D_6 = { s = "6" ; n = Pl}; -lin D_7 = { s = "7" ; n = Pl}; -lin D_8 = { s = "8" ; n = Pl}; -lin D_9 = { s = "9" ; n = Pl}; -lin IDig d = { s = \\_ => d.s ; n = d.n} ; -lin IIDig d dg = { s = \\df => dg.s ! df ++ d.s ; n = Pl }; -- need to use + rather than ++, but gives error need to discuss - -oper ekhazar : Str = variants {"ہزار" ; "ایك" ++ "ہزار"} ; -oper mkhazar : Str -> Size -> Str = \s -> \sz -> table {sing => ekhazar ; _ => s ++ "ہزار"} ! sz ; -oper mksau : Str -> DSize -> Str = \s -> \sz -> table {sg => "سو" ; _ => s ++ "سو"} ! sz ; -} +concrete NumeralUrd of Numeral = CatUrd ** open ResUrd,CommonHindustani,ParamX, Prelude in { +-- By Harald Hammarström +-- Modification for Urdu Shafqat Virk + +-- still old Devanagari coding + +flags coding=utf8 ; + +param DForm = unit | ten ; +param DSize = sg | r2 | r3 | r4 | r5 | r6 | r7 | r8 | r9 ; +param Size = singl | less100 | more100 ; + +oper LinDigit = {s : DForm => Str ; size : DSize ; n : Number} ; + + +lincat Dig = { s:Str ; n : Number}; +lincat Digit = LinDigit ; +lincat Sub10 = {s : DForm => Str ; size : DSize ; n : Number} ; +lincat Sub100 = {s : Str ; size : Size ; n : Number} ; +lincat Sub1000 = {s : Str ; s2 : Str ; size : Size ; n : Number } ; +lincat Sub1000000 = { s : Str ; n : Number } ; + +lin num x0 = + {s = table { + NCard => x0.s ; + NOrd => x0.s ++ "واں" -- need to use mkOrd x0.s but it gives linking error + }; + n = x0.n + } ; + + +oper mkNum : Str -> Str -> DSize -> LinDigit = + \do -> \bis -> \sz -> + {s = table {unit => do ; ten => bis } ; + size = sz ; n = Pl} ; + +lin n2 = mkNum "دو" "بیس" r2 ; +lin n3 = mkNum "تین" "تیس" r3 ; +lin n4 = mkNum "چار" "چالیس" r4 ; +lin n5 = mkNum "پانچ" "پچاس" r5 ; +lin n6 = mkNum "چھ" "ساتھ" r6 ; +lin n7 = mkNum "سات" "ستر" r7; +lin n8 = mkNum "آتھ" "اسی" r8; +lin n9 = mkNum "نو" "نوے" r9 ; + +oper mkR : Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> DSize => Str = \a1 -> \a2 -> \a3 -> \a4 -> \a5 -> \a6 -> \a7 -> \a8 -> \a9 -> table { + sg => a1 + "اہ" ; + r2 => a2 + "یس" ; + r3 => a3 + "تیس" ; + r4 => a4 + "الیس" ; + r5 => a5 + "ن" ; + r6 => a6 + "ساٹھ" ; + r7 => a7 + "ہتر" ; + r8 => a8 + "اسی" ; + r9 => a9 + "انوے" +} ; + +oper rows : DSize => DSize => Str = table { + sg => mkR "گیارہ" "اك" "اكت" "اكت" "اكیاو" "اك" "اك" "اكی" "اكی" ; + r2 => mkR "بارہ" "بای" "بات" "بای" "باو" "با" "با" "بای" "ب" ; + r3 => mkR "تیر" "تی" "تین" "تنت" "ترپ" "تری" "ت" "تر" "تر" ; + r4 => mkR "چود" "چوب" "چون" "چوا" "چوو" "چون" "چوہ" "چور" "چور" ; + r5 => mkR "پند" "پچی" "پین" "پنتا" "پچپ" "پین" "پہ" "پچ" "پچ" ; + r6 => mkR "سول" "چھب" "چھت" "چھی" "چھپ" "چھیا" "چھ" "چھی" "چھی" ; + r7 => mkR "ستر" "ستا" "سین" "سنت" "ستاو" "ستا" "سر" "ست" "ستا" ; + r8 => mkR "اتھار" "اتھای" "اڑ" "اڑت" "اتھاو" "اڑ" "اتھ" "اتھ" "اتھ" ; + r9 => table {sg => "انیس" ; r2 => "انتیس" ; r3 => "انتالیس" ; + r4 => "انچاس" ; r5 => "انستھ" ; r6 => "انہتر" ; + r7 => "اناسی" ; + r8 => "انانوے" ; r9 => "ننانوے" } +} ; + +oper ss : Str -> {s : Str} = \s -> {s = s} ; + +lin pot01 = {s = table {unit => "ایك" ; _ => "دمی" } ; size = sg ; n = Sg} ; +lin pot0 d = d ; +lin pot110 = {s = "داس" ; size = less100 ; n = Pl} ; +lin pot111 = {s = rows ! sg ! sg ; size = less100 ; n = Pl} ; +lin pot1to19 d = {s = rows ! d.size ! sg ; size = less100 ; n = d.n} ; +lin pot0as1 n = {s = n.s ! unit ; size = table {sg => singl ; _ => less100} ! n.size ; n = n.n } ; + +lin pot1 d = {s = d.s ! ten ; size = less100 ; n = d.n} ; +lin pot1plus d e = {s = rows ! e.size ! d.size ; size = less100 ; n = d.n} ; + +lin pot1as2 n = {s = n.s ; s2 = "دمی" ; size = n.size ; n = n.n} ; +lin pot2 d = {s = (mksau (d.s ! unit) d.size) ; + s2 = d.s ! unit ++ "لاكھ" ; size = more100 ; n = d.n} ; +lin pot2plus d e = + {s = (mksau (d.s ! unit) d.size) ++ e.s ; + s2 = (d.s ! unit) ++ "لاكھ" ++ (mkhazar e.s e.size) ; + size = more100 ; n = d.n} ; + +lin pot2as3 n = {s = n.s ; n = n.n} ; +lin pot3 n = {s = table { singl => ekhazar ; + less100 => n.s ++ "ہزار" ; + more100 => n.s2 } ! n.size ; n = n.n} ; +lin pot3plus n m = + {s = table {singl => ekhazar ; + less100 => n.s ++ "ہزار" ; + more100 => n.s2 } ! n.size ++ m.s ; n = n.n} ; + +lin D_0 = { s = "۰" ; n = Sg}; +lin D_1 = { s = "۱" ; n = Sg}; +lin D_2 = { s = "۲" ; n = Pl}; +lin D_3 = { s = "۳" ; n = Pl}; +lin D_4 = { s = "۴" ; n = Pl}; +lin D_5 = { s = "۵" ; n = Pl}; +lin D_6 = { s = "۶" ; n = Pl}; +lin D_7 = { s = "۷" ; n = Pl}; +lin D_8 = { s = "۸" ; n = Pl}; +lin D_9 = { s = "۹" ; n = Pl}; +lin IDig d = { s = \\_ => d.s ; n = d.n} ; +lin IIDig d dg = { s = \\df => Prelude.glue (dg.s ! df) d.s ; n = Pl }; + +oper ekhazar : Str = variants {"ہزار" ; "ایك" ++ "ہزار"} ; +oper mkhazar : Str -> Size -> Str = \s -> \sz -> table {singl => ekhazar ; _ => s ++ "ہزار"} ! sz ; +oper mksau : Str -> DSize -> Str = \s -> \sz -> table {sg => "سو" ; _ => s ++ "سو"} ! sz ; +} diff --git a/lib/src/urdu/ParadigmsUrd.gf b/lib/src/urdu/ParadigmsUrd.gf index 8c08682cc..8a34fb844 100644 --- a/lib/src/urdu/ParadigmsUrd.gf +++ b/lib/src/urdu/ParadigmsUrd.gf @@ -6,7 +6,9 @@ resource ParadigmsUrd = open Predef, Prelude, MorphoUrd, - CatUrd + CatUrd, + CommonHindustani, + ParamX in { --2 Parameters @@ -33,10 +35,10 @@ oper = \sd,so,sv,pd,po,pv,g -> mkNoun sd so sv pd po pv g ** {lock_N = <>} ; } ; mkN2 : N -> Prep -> Str -> N2; - mkN2 = \n,p,c -> n ** {lock_N2 = <> ; c2 = p.s ; c3 = c } ; + mkN2 = \n,p,c -> n ** {lock_N2 = <> ; c2 = p.s ! n.g ; c3 = c } ; mkN3 : N -> Prep -> Str -> Str-> N3 ; - mkN3 = \n,p,q,r -> n ** {lock_N3 = <> ; c2 = p.s ; c3 = q ; c4 = r} ; + mkN3 = \n,p,q,r -> n ** {lock_N3 = <> ; c2 = p.s ! n.g ; c3 = q ; c4 = r} ; -- Compound Nouns @@ -51,6 +53,8 @@ oper mkDet : Str -> Str -> Str -> Str -> Number -> Det = \s1,s2,s3,s4,nb -> let dt = makeDet s1 s2 s3 s4 nb in {s = dt.s ; n = nb ; lock_Det = <>}; mkIP : (x1,x2,x3:Str) -> Number -> Gender -> IP = \s1,s2,s3,n,g -> let p = mkIntPronForm s1 s2 s3 in { s = p.s ; n = n ; g = g ; lock_IP = <>}; +-- AdN + mkAdN : Str -> AdN = \s -> {s = s ; p = False ; lock_AdN = <>} ; --2 Adjectives mkA = overload { @@ -59,6 +63,8 @@ oper mkA : Str -> Str -> A2 = \a,c -> let n = regAdjective a in {s = n.s; c2 = c} ** {lock_A2 = <>} ; } ; + mkA2 : A -> Str -> A2 ; + mkA2 a str = a ** {c2=str ; lock_A2 = <>} ; --2 Verbs @@ -73,11 +79,14 @@ oper mkV2 : V -> Str -> V2 = \v,p -> v ** {c2 = {s = p ; c = VTrans} ; lock_V2 = <>} ; } ; + dirV2 : V -> V2 = \v -> v ** {c2 = {s = [] ; c = VTrans} ; lock_V2 = <>} ; mkV3 : V -> Str -> Str -> V3; mkV3 v p q = v ** { c2 = p ; c3 = q ; lock_V3 = <>} ; mkV2V : V -> Str -> Str -> Bool -> V2V ; mkV2V v s1 s2 b = v ** {isAux = b ; c1 = s1 ; c2 = s2 ; lock_V2V = <>} ; + dirdirV3 : V -> V3 ; + dirdirV3 v = v ** { c2 = [] ; c3 = [] ; lock_V3 = <>} ; -- compund verbs compoundV = overload { @@ -87,12 +96,24 @@ oper ----2 Adverbs - mkAdv : Str -> Adv = \str -> {s = str ; lock_Adv = <>}; + mkAdv : Str -> Adv = \str -> {s = \\_ => str ; lock_Adv = <>}; ----2 Prepositions - mkPrep : Str -> Prep ; - mkPrep str = lin Prep (makePrep str) ; + mkPrep : Str -> Str -> Prep ; + mkPrep s1 s2 = makePrep s1 s2 ** {lock_Prep = <>}; + +--3 Determiners and quantifiers + +-- mkQuant : overload { +-- mkQuant : Pron -> Quant ; +-- mkQuant : (no_sg, no_pl, none_sg, non_pl : Str) -> Quant ; +-- } ; + +-- mkQuant = overload { +-- mkQuant : Pron -> Quant = \p -> {s = \\_,_,c => p.s!c ;a = p.a ; lock_Quant = <>}; +-- mkQuant : (no_sg, no_pl, none_sg, non_pl : Str) -> Quant = mkQuantifier; +-- } ; --2 Conjunctions mkConj : overload { @@ -112,15 +133,22 @@ oper lin Conj (sd2 x y ** {n = n}) ; -- mkV0 : V -> V0 ; --- mkVS : V -> VS ; + mkVS : V -> VS; + mkVS v = v ; -- mkV2S : V -> Prep -> V2S ; mkVV : V -> VV = \v -> lin VV (v ** {isAux = False}); + mkAdA : Str -> AdA ; +-- mkAdv x = lin Adv (ss x) ; +-- mkAdV x = lin AdV (ss x) ; + mkAdA x = lin AdA (ss x) ; +-- mkAdN x = lin AdN (ss x) ; -- mkV2V : V -> Prep -> Prep -> V2V ; -- mkVA : V -> VA ; -- mkV2A : V -> Prep -> V2A ; --- mkVQ : V -> VQ ; + mkVQ : V -> VQ ; + mkVQ v = v ; -- mkV2Q : V -> Prep -> V2Q ; -- -- mkAS : A -> AS ; diff --git a/lib/src/urdu/PhraseUrd.gf b/lib/src/urdu/PhraseUrd.gf index e398d3a31..5611516ad 100644 --- a/lib/src/urdu/PhraseUrd.gf +++ b/lib/src/urdu/PhraseUrd.gf @@ -1,27 +1,2 @@ -concrete PhraseUrd of Phrase = CatUrd ** open Prelude, ResUrd in { - - lin - PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; - - UttS s = s ; - UttQS qs = {s = qs.s ! QDir} ; - UttImpSg pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Sg False} ; - UttImpPl pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Pl False} ; - UttImpPol pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Sg True} ; - - UttIP ip = {s = ip.s ! Dir} ; --- Acc also - UttIAdv iadv = iadv ; - UttNP np = {s = np.s ! NPC Dir} ; - UttVP vp = {s = infVP False vp (agrP3 Masc Sg)} ; - UttAdv adv = adv ; - UttCN cn = {s = cn.s ! Sg ! Dir}; - UttCard n = n ; - UttAP ap = {s = ap.s ! Sg ! Masc ! Dir ! Posit} ; - - NoPConj = {s = []} ; - PConjConj conj = {s = conj.s2} ; --- - - NoVoc = {s = []} ; - VocNP np = {s = np.s ! NPC Dir} ; - -} +concrete PhraseUrd of Phrase = CatUrd ** PhraseHindustani with + (ResHindustani = ResUrd) ; diff --git a/lib/src/urdu/QuestionUrd.gf b/lib/src/urdu/QuestionUrd.gf index fcd33ec16..684974d6f 100644 --- a/lib/src/urdu/QuestionUrd.gf +++ b/lib/src/urdu/QuestionUrd.gf @@ -1,75 +1,2 @@ -concrete QuestionUrd of Question = CatUrd ** open ResUrd, Prelude in { - flags optimize=all_subs ; - - lin - - QuestCl cl = { - s = \\t,p,qf => case qf of { - QDir => cl.s ! t ! p ! OQuest; - QIndir => agr_Str ++ cl.s ! t! p ! ODir - } - }; - - QuestVP qp vp = - let cl = mkSClause [] (Ag qp.g qp.n Pers3_Near) vp; - qp1 = qp.s ! Dir; - qp2 = qp.s ! Obl ++ nE_Str - in { s = \\t,p,o => case t of { - VPImpPast => qp2 ++ cl.s ! t ! p ! ODir; - _ => qp1 ++ cl.s ! t ! p ! ODir - } - }; - QuestSlash ip slash = - let ip1 = ip.s ! Dir; - ip2 = ip.s ! Obl ++ nE_Str - in { - s = \\t,p,o => case t of { - VPImpPast => ip2 ++ slash.s ! t ! p ! ODir; - _ => ip1 ++ slash.s ! t ! p ! ODir - } - }; - - QuestIAdv iadv cl = { - s = \\t,p,_ => iadv.s ++ cl.s ! t ! p ! ODir; - }; - - QuestIComp icomp np = - let cl = mkSClause (np.s ! NPC Dir ++ icomp.s) np.a (predAux auxBe); - in { - s = \\t,p,qf => case qf of { - QDir => cl.s ! t ! p ! ODir; - QIndir => cl.s ! t! p ! ODir - } - }; - - PrepIP p ip = {s = ip.s ! ResUrd. Voc ++ p.s } ; - - AdvIP ip adv = { - s = \\c => adv.s ++ ip.s ! c ; - n = ip.n; - g = ip.g; - } ; - - IdetCN idet cn = { - s = \\c => idet.s ! cn.g ++ cn.s ! idet.n ! c ; - g = cn.g; - n = idet.n; - } ; - - IdetIP idet = { - s = \\_ => idet.s ! Masc ; - n = idet.n; - g = Masc; - } ; - - IdetQuant iqant num = { - s = \\g => iqant.s ! num.n ++ num.s ; - n = num.n - } ; - - AdvIAdv i a = {s = i.s ++ a.s} ; - - CompIAdv a = a ; - CompIP p = ss (p.s ! Dir) ; - -} +concrete QuestionUrd of Question = CatUrd ** QuestionHindustani with + (ResHindustani = ResUrd) ; diff --git a/lib/src/urdu/README b/lib/src/urdu/README index bb96f1af2..bd7d42006 100644 --- a/lib/src/urdu/README +++ b/lib/src/urdu/README @@ -1,17 +1,10 @@ -Urdu resource grammar in GF - -(c) Shafqat Virk 2010 under GNU LGPL - -Sources: files in ./transliterated/ convert to files with the same names in ./ -**Don't hand-edit** the generated files, but the ones in ./transliterated/ -To convert the edited files, do 'make' in this directory. - -Principles: all files containing string literals are in ./transliterated/ -**Don't put string literals** in other files. Add string opers to transliterated/ResUrd.gf -instead (to the end of the file). - -Purpose: the files without strings will work as such for Hindi as well. +Some of the sources are transliterated, in + ./src + ../hindustani +Before compilation, do + gf -s case of { - => js_Str ++ cl.s ! t ! p ! o ; - => jn_Str ++ cl.s ! t ! p ! o ; - <_,_> => jw_Str ++ cl.s ! t ! p ! o - }; - c = Dir - } ; - --- {- - RelVP rp vp = { - s = \\t,p,o,ag => - let - agr = case rp.a of { - RNoAg => ag ; - RAg a => a - } ; - cl = mkSClause (rp.s ! (giveNumber agr) ! Dir) agr vp; - --- cl = case t of { --- VPImpPast => mkSClause (rp.s ! (giveNumber agr) ! Obl) agr vp; --- _ => mkSClause (rp.s ! (giveNumber agr) ! Dir) agr vp --- }; - in - cl.s ! t ! p ! ODir ; - c = Dir - } ; - -- --- - RelSlash rp slash = { - s = \\t,p,o,agr => rp.s ! (giveNumber agr) ! Dir ++ slash.c2.s ++ slash.s ! t ! p ! o ;--case t of { --- VPImpPast => rp.s ! (giveNumber agr) Obl ++ slash.c2.s ++ slash.s ! t ! p ! o ; --- _ => rp.s ! (giveNumber agr) Dir ++ slash.c2.s ++ slash.s ! t ! p ! o --- }; - c = Dir - } ; --- -} - FunRP p np rp = { - s = \\n,c => rp.s ! n ! c ++ np.s ! NPC c ++ p.s ; - a = RAg np.a - } ; - - IdRP = { - s = table { - Sg => table { - - ResUrd.Dir => jw_Str ; - ResUrd.Obl => js_Str ; - ResUrd.Voc => js_Str - }; - Pl => table { - ResUrd.Dir => jw_Str ; - ResUrd.Obl => jn_Str ; - ResUrd.Voc => jn_Str - } - }; - a = RNoAg - } ; - -} +concrete RelativeUrd of Relative = CatUrd ** RelativeHindustani with + (ResHindustani = ResUrd) ; diff --git a/lib/src/urdu/ResUrd.gf b/lib/src/urdu/ResUrd.gf index 6612f764b..e3efd7ca7 100644 --- a/lib/src/urdu/ResUrd.gf +++ b/lib/src/urdu/ResUrd.gf @@ -1,641 +1,2 @@ ---# -path=.:../abstract:../common:../../prelude --- ---1 Urdu auxiliary operations. --- --- This module contains operations that are needed to make the --- resource syntax work. - -resource ResUrd = ParamX ** open Prelude,Predef in { - - flags optimize=all ; - coding = utf8; - - param - Case = Dir | Obl | Voc ; - Gender = Masc | Fem ; - VTense = Subj | Perf | Imperf; - UPerson = Pers1 - | Pers2_Casual - | Pers2_Familiar - | Pers2_Respect - | Pers3_Near - | Pers3_Distant; - - Order = ODir | OQuest ; - ---2 For $Relative$ - - RAgr = RNoAg | RAg Agr ; - RCase = RC Number Case ; - --- for Numerial - - CardOrd = NCard | NOrd ; - - ----------------------------------------- - -- Urd Pronouns - ----------------------------------------- - - Pronoun = P Number Gender Case UPerson; - PersPronForm = PPF Number UPerson Case; - -------------------------------------------- ---Verbs -------------------------------------------- - - VerbForm = VF VTense UPerson Number Gender - | Inf - | Root - | Inf_Obl - | Inf_Fem; - oper - Noun = {s : Number => Case => Str ; g : Gender} ; - Verb = {s : VerbForm => Str} ; - Preposition = {s : Str}; - DemPronForm = {s : Number => Gender => Case => Str}; - PossPronForm = {s : Number => Gender => Case => Str}; - Determiner = {s : Number => Gender => Str ; n : Number}; - --- a useful oper - eq : Str -> Str -> Bool = \s1,s2-> (pbool2bool (eqStr s1 s2)) ; - - ----------------------------------------------- - -- Urd Adjectives - ----------------------------------------------- - - Adjective = { s: Number => Gender => Case => Degree => Str }; - - - mkAdjective : (x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20,x21,x22,x23,x24,x25,x26,x27,x28,x29,x30,x31,x32,x33,x34,x35,x36:Str) -> Adjective = - \y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13,y14,y15,y16,y17,y18,y19,y20,y21,y22,y23,y24,y25,y26,y27,y28,y29,y30,y31,y32,y33,y34,y35,y36 -> { - s = table { - Sg => table { - Masc => table { - Dir => table { - Posit => y1 ; - Compar => y2 ; - Superl => y3 - }; - Obl => table { - Posit => y4 ; - Compar => y5 ; - Superl => y6 - }; - Voc => table { - Posit => y7 ; - Compar => y8 ; - Superl => y9 - } - }; - Fem => table { - Dir => table { - Posit => y10 ; - Compar => y11 ; - Superl => y12 - }; - Obl => table { - Posit => y13 ; - Compar => y14 ; - Superl => y15 - }; - Voc => table { - Posit => y16 ; - Compar => y17 ; - Superl => y18 - } - } - }; - Pl => table { - Masc => table { - Dir => table { - Posit => y19 ; - Compar => y20 ; - Superl => y21 - }; - Obl => table { - Posit => y22 ; - Compar => y23 ; - Superl => y24 - }; - Voc => table { - Posit => y25 ; - Compar => y26 ; - Superl => y27 - } - }; - Fem => table { - Dir => table { - Posit => y28 ; - Compar => y29 ; - Superl => y30 - }; - Obl => table { - Posit => y31 ; - Compar => y32 ; - Superl => y33 - }; - Voc => table { - Posit => y34 ; - Compar => y35 ; - Superl => y36 - } - } - } - } - }; - - - regAdjective : Str -> Adjective; - regAdjective x = case x of { - acch + ("ا"|"اں") => mkAdjective x ("بہت" ++ x) ("ساب سے" ++ x) (acch + "ے") ("بہت" ++ acch + "ے") ("ساب سے" ++ acch + "ے") (acch + "ے") ("بہت" ++ acch + "ے") ("ساب سے" ++ acch + "ے") - (acch + "ی") ("بہت" ++ acch + "ی") ("ساب سے" ++ acch + "ی") (acch + "ی") ("بہت" ++ acch + "ی") ("ساب سے" ++ acch + "ی") (acch + "ی") ("بہت" ++ acch + "ی") ("ساب سے" ++ acch + "ی") - (acch +"ے") ("بہت" ++ acch + "ے") ("ساب سے" ++ acch + "ے") (acch + "ے") ("بہت" ++ acch + "ے") ("ساب سے" ++ acch + "ے") (acch + "ے") ("بہت" ++ acch + "ے") ("ساب سے" ++ acch + "ے") - (acch + "ی") ("بہت" ++ acch + "ی") ("ساب سے" ++ acch + "ی") (acch + "ی") ("بہت" ++ acch + "ی") ("ساب سے" ++ acch + "ی") (acch + "ی") ("بہت" ++ acch + "ی") ("ساب سے" ++ acch + "ی"); - - _ => mkAdjective x x x x x x x x x - x x x x x x x x x - x x x x x x x x x - x x x x x x x x x - }; - - - - RefPron : Str; - RefPron = "خود"; - - ---------------------------------------------------------- - -- Grammar part - ---------------------------------------------------------- - - param - Agr = Ag Gender Number UPerson ; - NPCase = NPC Case | NPObj | NPErg ; - - oper - np2pronCase : (Case => Str) -> NPCase -> Str = \ppf,npc -> case npc of { - NPC c => ppf ! c; - NPObj => ppf ! Dir ; - NPErg => ppf ! Obl ++ "نع" - } ; - - toNP : ( Case => Str) -> NPCase -> Str = \pn, npc -> case npc of { - NPC c => pn ! c ; - NPObj => pn ! Dir ; - NPErg => pn ! Obl ++ "نع" - } ; - detcn2NP : (Determiner) -> Noun -> NPCase -> Number -> Str = \dt,cn,npc,nn -> case npc of { - NPC c => dt.s ! Sg ! Masc ++ cn.s ! nn ! Dir ; - NPObj => dt.s ! Sg ! Masc ++ cn.s ! nn ! Dir ; - NPErg => dt.s ! Sg ! Masc ++ cn.s ! nn ! Obl ++ "نع" - } ; - det2NP : (Determiner) -> NPCase -> Str = \dt,npc -> case npc of { - NPC c => dt.s ! Sg ! Masc ; - NPObj => dt.s ! Sg ! Masc ; - NPErg => dt.s ! Sg ! Masc ++ "نع" - } ; - ------------------------------------------- --- Agreement transformations ------------------------------------------ - toAgr : Number -> UPerson -> Gender -> Agr = \n,p,g -> - Ag g n p; - - - fromAgr : Agr -> {n : Number ; p : UPerson ; g : Gender} = \a -> case a of { - Ag g n p => {n = n ; p = p ; g = g} - } ; - - conjAgr : Agr -> Agr -> Agr = \a0,b0 -> - let a = fromAgr a0 ; b = fromAgr b0 - in - toAgr - (conjNumber a.n b.n) - b.p a.g; - - giveNumber : Agr -> Number =\a -> case a of { - Ag _ n _ => n - }; - giveGender : Agr -> Gender =\a -> case a of { - Ag g _ _ => g - }; - - defaultAgr : Agr = agrP3 Masc Sg ; - agrP3 : Gender -> Number -> Agr = \g,n -> Ag g n Pers3_Distant ; - personalAgr : Agr = agrP1 Masc Sg ; - agrP1 : Gender -> Number -> Agr = \g,n -> Ag g n Pers1 ; - - param - CPolarity = - CPos - | CNeg Bool ; -- contracted or not - - oper - contrNeg : Bool -> Polarity -> CPolarity = \b,p -> case p of { - Pos => CPos ; - Neg => CNeg b - } ; - - NP : Type = {s : NPCase => Str ; a : Agr} ; - - param - CTense = CPresent | CPast | CFuture ; - - oper - copula : CTense -> Number -> UPerson -> Gender -> Str = \t,n,p,g -> - case of { - => "ہوں" ; - => "ہے" ; - => "ہو" ; - => "ہیں" ; - => "ہے" ; - => "ہے" ; - => "ہیں" ; - => "ہو" ; - => "ہو" ; - => "ہیں" ; - => "ہیں" ; - => "ہیں" ; - => "تھا" ; - => "تھی" ; - => "تھا" ; - => "تھی" ; - => "تھا" ; - => "تھی" ; - => "تھے" ; - => "تھیں" ; - => "تھا" ; - => "تھی" ; - => "تھا" ; - => "تھی" ; - => "تھے" ; - => "تھیں" ; - => "تھے" ; - => "تھیں" ; - => "تھے" ; - => "تھیں" ; - => "تھے" ; - => "تھیں" ; - => "تھے" ; - => "تھیں" ; - => "تھے" ; - => "تھیں" ; - => "گا" ; - => "گی" ; - => "گا" ; - => "گi" ; - => "گے" ; - => "گی" ; - => "گے" ; - => "گی" ; - => "گا" ; - => "گی" ; - => "گا" ; - => "گی" ; - => "گے" ; - => "گی" ; - => "گے" ; - => "گی" ; - => "گے" ; - => "گی" ; - => "گے" ; - => "گی" ; - => "گے" ; - => "گے" ; - => "گے" ; - => "گی" - - - } ; - - param - VPPTense = - VPPres - |VPPast - |VPFutr; - - VPHTense = - VPGenPres -- impf hum nahim "I گo" - | VPImpPast -- impf Ta nahim "I وعنت" - | VPFut -- fut na/nahim "I سہالل گo" - | VPContPres -- stem raha hum nahim "I ام گoiنگ" - | VPContPast -- stem raha Ta nahim "I واس گoiنگ" - | VPContFut - | VPPerfPres -- perf hum na/nahim "I ہاvع گoنع" - | VPPerfPast -- perf Ta na/nahim "I ہاد گoنع" - | VPPerfFut - | VPPerfPresCont - | VPPerfPastCont - | VPPerfFutCont - | VPSubj -- subj na "I مای گo" - ; - - VPHForm = - VPTense VPPTense Agr -- 9 * 12 - | VPReq - | VPImp - | VPReqFut - | VPInf - | VPStem - ; - - VType = VIntrans | VTrans | VTransPost ; - - oper - - objVType : VType -> NPCase = \vt -> case vt of { - VTrans => NPObj ; - _ => NPC Obl - } ; - - VPH : Type = { - s : VPHForm => {fin, inf : Str} ; - obj : {s : Str ; a : Agr} ; - subj : VType ; - comp : Agr => Str; - inf : Str; - ad : Str; - embComp : Str ; - } ; - - VPHSlash = VPH ** {c2 : Compl} ; - - Compl : Type = {s : Str ; c : VType} ; - - predV : Verb -> VPH = \verb -> { - s = \\vh => - case vh of { - VPTense VPPres (Ag g n p) => {fin = copula CPresent n p g ; inf = verb.s ! VF Imperf p n g } ; - VPTense VPPast (Ag g n p) => {fin = [] ; inf =verb.s ! VF Perf p n g} ; - VPTense VPFutr (Ag g n p) => {fin = copula CFuture n p g ; inf = verb.s ! VF Subj p n g } ; - VPStem => {fin = [] ; inf = verb.s ! Root}; - _ => {fin = [] ; inf = verb.s ! Root} - }; - obj = {s = [] ; a = defaultAgr} ; - subj = VTrans ; - inf = verb.s ! Inf; - ad = []; - embComp = []; - comp = \\_ => [] - } ; - - predVc : (Verb ** {c2,c1 : Str}) -> VPHSlash = \verb -> - predV verb ** {c2 = {s = verb.c1 ; c = VTrans} } ; - - - raha : Gender -> Number -> Str = \g,n -> - (regAdjective "رہا").s ! n ! g ! Dir ! Posit ; - - cka : Gender -> Number -> Str = \g,n -> - (regAdjective "چكا").s ! n ! g ! Dir ! Posit ; - - hw : UPerson -> Number -> Str = \pp,n -> - case of { - => "ہوں"; - <_,Pl> => "ہوں"; - <_,_> => "ہو" - }; - - predAux : Aux -> VPH = \verb -> { - s = \\vh => - let - - inf = verb.inf ; - part = verb.ppart ; - - in - case vh of { - VPTense VPPres (Ag g n p) => {fin = copula CPresent n p g ; inf = part } ; - VPTense VPPast (Ag g n p) => {fin = copula CPast n p g ; inf = part } ; - VPTense VPFutr (Ag g n p) => {fin = copula CFuture n p g ; inf = part ++ hw p n } ; - VPStem => {fin = [] ; inf = "رہ" }; - _ => {fin = part ; inf = [] } - }; - obj = {s = [] ; a = defaultAgr} ; - subj = VIntrans ; - inf = verb.inf; - ad = []; - embComp = []; - comp = \\_ => [] - } ; - - Aux = { - inf,ppart,prpart : Str - } ; - - auxBe : Aux = { - inf = "" ; - ppart = "" ; - prpart = "" - } ; - - Clause : Type = {s : VPHTense => Polarity => Order => Str} ; - mkClause : NP -> VPH -> Clause = \np,vp -> { - s = \\vt,b,ord => - let - subjagr : NPCase * Agr = case vt of { - VPImpPast => case vp.subj of { - VTrans => ; - VTransPost => ; - _ => - } ; - _ => - } ; - subj = subjagr.p1 ; - agr = subjagr.p2 ; - n = (fromAgr agr).n; - p = (fromAgr agr).p; - g = (fromAgr agr).g; - vps = case vt of { - - VPGenPres => vp.s ! VPTense VPPres agr ; - VPImpPast => vp.s ! VPTense VPPast agr ; - VPFut => vp.s ! VPTense VPFutr agr ; - VPContPres => - {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; - VPContPast => - {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; - VPContFut => - {fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ raha g n ++ hw p n} ; - VPPerfPres => - {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ cka g n } ; - VPPerfPast => - {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ cka g n } ; - VPPerfFut => - {fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ cka g n ++ hw p n } ; - VPPerfPresCont => - {fin = copula CPresent n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n } ; - VPPerfPastCont => - {fin = copula CPast n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n } ; - VPPerfFutCont => - {fin = copula CFuture n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n ++ hw p n } ; - VPSubj => {fin = insertSubj p (vp.s ! VPStem).inf ; inf = "ژاید" } - - }; - - - quest = - case ord of - { ODir => []; - OQuest => "كیا" }; - na = - case b of - { Pos => []; - Neg => "نا" }; - nahim = - case b of - { Pos => []; - Neg => "نہیں" }; - in - case vt of { - VPSubj => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ na ++ vps.inf ++ vps.fin ++ vp.embComp ; - _ => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp}; - - } ; - - mkSClause : Str -> Agr -> VPH -> Clause = - \subj,agr,vp -> { - s = \\t,b,ord => - let - n = (fromAgr agr).n; - p = (fromAgr agr).p; - g = (fromAgr agr).g; - vps = case t of { - VPGenPres => vp.s ! VPTense VPPres agr ; - VPImpPast => vp.s ! VPTense VPPast agr ; - VPFut => vp.s ! VPTense VPFutr agr ; - VPContPres => - {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; - VPContPast => - {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; - VPContFut => - {fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ raha g n ++ hw p n } ; - VPPerfPres => - {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ cka g n } ; - VPPerfPast => - {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ cka g n } ; - VPPerfFut => - {fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ cka g n ++ hw p n } ; - VPPerfPresCont => - {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; - VPPerfPastCont => - {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; - VPPerfFutCont => - {fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ raha g n ++ hw p n } ; - VPSubj => {fin = insertSubj p (vp.s ! VPStem).inf ; inf = "ژاید" } - - }; - - quest = - case ord of - { ODir => []; - OQuest => "كیا" }; - na = - case b of - { Pos => []; - Neg => "نا" }; - nahim = - case b of - { Pos => []; - Neg => "نہیں" }; - in - case t of { - VPSubj => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ na ++ vps.inf ++ vps.fin ++ vp.embComp; - _ => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp}; - } ; - - insertSubj : UPerson -> Str -> Str = \p,s -> - case p of { Pers1 => s ++ "وں" ; _ => s ++ "ے"}; - - insertObj : (Agr => Str) -> VPH -> VPH = \obj1,vp -> { - s = vp.s ; - obj = vp.obj ; - subj = vp.subj ; - inf = vp.inf; - ad = vp.ad; - embComp = vp.embComp; - comp = \\a => vp.comp ! a ++ obj1 ! a - } ; - insertVV : Str -> VPH -> VPH = \obj1,vp -> { - s = vp.s ; - obj = vp.obj ; - subj = vp.subj ; - inf = vp.inf; - ad = vp.ad; - embComp = vp.embComp; - comp = \\a => vp.comp ! a ++ obj1 - } ; - - insertObj2 : (Str) -> VPH -> VPH = \obj1,vp -> { - s = vp.s; - obj = vp.obj ; - subj = vp.subj ; - inf = vp.inf; - ad = vp.ad; - embComp = vp.embComp ++ obj1; - comp = vp.comp - - } ; - - insertObjc : (Agr => Str) -> VPHSlash -> VPHSlash = \obj,vp -> - insertObj obj vp ** {c2 = vp.c2} ; - insertObjc2 : Str -> VPHSlash -> VPHSlash = \obj,vp -> - insertObj2 obj vp ** {c2 = vp.c2} ; - - infVP : Bool -> VPH -> Agr -> Str = \isAux,vp,a -> - vp.obj.s ++ vp.inf ++ vp.comp ! a ; - infVV : Bool -> VPH -> Str = \isAux,vp -> - case isAux of {False => vp.inf ; True => (vp.s ! VPImp).fin }; - - insertObject : NP -> VPHSlash -> VPH = \np,vps -> { - s = vps.s ; - obj = {s = vps.obj.s ++ np.s ! objVType vps.c2.c ++ vps.c2.s ; a = np.a} ; - subj = vps.c2.c ; - inf = vps.inf; - ad = vps.ad; - embComp = vps.embComp; - comp = vps.comp - } ; - - insertObjPre : (Agr => Str) -> VPHSlash -> VPH = \obj,vp -> { - s = vp.s ; - obj = vp.obj ; - inf = vp.inf ; - subj = vp.subj ; - ad = vp.ad ; - embComp = vp.embComp; - comp = \\a => obj ! a ++ vp.c2.s ++ vp.comp ! a - } ; - - insertAdV : Str -> VPH -> VPH = \ad,vp -> { - s = vp.s ; - obj = vp.obj ; - inf = vp.inf ; - subj = vp.subj; - ad = vp.ad ++ ad ; - embComp = vp.embComp; - comp = vp.comp - } ; - conjThat : Str = "كہ" ; - --- strings collected from syntax files, AR - -oper - sE_Str = "سے" ; - ka_Str = "كا" ; - hr_kwy_Str = "ہر كوی" ; - rakh6na_Str = "راكھنا" ; - comma_Str = "," ; - agr_Str = "اگر" ; - nE_Str = "نے" ; - jw_Str = "جو" ; - js_Str = "جس" ; - jn_Str = "جن" ; - mt_Str = "مت" ; - nh_Str = "نہ" ; - waN_Str = "واں" ; - awr_Str = "اور" ; - ky_Str = "كی" ; - kw_Str = "كو" ; - -} - +instance ResUrd of ResHindustani = DiffUrd ** open CommonHindustani, Prelude, Predef in { +} ; diff --git a/lib/src/urdu/SentenceUrd.gf b/lib/src/urdu/SentenceUrd.gf index c800e863d..7a7e5db0b 100644 --- a/lib/src/urdu/SentenceUrd.gf +++ b/lib/src/urdu/SentenceUrd.gf @@ -1,102 +1,2 @@ -concrete SentenceUrd of Sentence = CatUrd ** open Prelude, ResUrd in { - - flags optimize=all_subs ; - - lin - - PredVP np vp = mkClause np vp ; - - PredSCVP sc vp = mkSClause sc.s (defaultAgr) vp ; - - ImpVP vp = { - s = \\pol,n => - let - agr = Ag Masc (numImp n) Pers2_Casual ; - verb = infVP True vp agr ; - dont = case pol of { - CNeg True => mt_Str ; - CNeg False => nh_Str ; - _ => [] - } - in - dont ++ verb - } ; - - SlashVP np vp = - mkClause np vp ** {c2 = vp.c2} ; - - AdvSlash slash adv = { - s = \\t,p,o => adv.s ++ slash.s ! t ! p ! o ; - c2 = slash.c2 - } ; - - SlashPrep cl prep = cl ** {c2 = { s = prep.s ; c = VIntrans}} ; - - SlashVS np vs slash = - mkClause np - (insertObj2 (conjThat ++ slash.s) (predV vs)) ** - {c2 = slash.c2} ; - - EmbedS s = {s = conjThat ++ s.s} ; - EmbedQS qs = {s = qs.s ! QIndir} ; - EmbedVP vp = {s = infVP False vp defaultAgr} ; --- agr - - UseCl temp p cl = - { s = case of { - => temp.s ++ p.s ++ cl.s ! VPGenPres ! p.p ! ODir - ; => temp.s ++ p.s ++ cl.s ! VPPerfPres ! p.p ! ODir; --# notpresent - => temp.s ++ p.s ++ cl.s ! VPImpPast ! p.p ! ODir; --# notpresent - => temp.s ++ p.s ++ cl.s ! VPPerfPast ! p.p ! ODir; --# notpresent - => temp.s ++ p.s ++ cl.s ! VPFut ! p.p ! ODir; --# notpresent - => temp.s ++ p.s ++ cl.s ! VPPerfFut ! p.p ! ODir; --# notpresent - => temp.s ++ p.s ++ cl.s ! VPContPres ! p.p ! ODir; --# notpresent - => temp.s ++ p.s ++ cl.s ! VPContPast ! p.p ! ODir --# notpresent - - }; - } ; - UseQCl temp p cl = { - s = \\q => case of { - => temp.s ++ p.s ++ cl.s ! VPGenPres ! p.p ! q - ; => temp.s ++ p.s ++ cl.s ! VPPerfPres ! p.p ! q; --# notpresent - => temp.s ++ p.s ++ cl.s ! VPImpPast ! p.p ! q; --# notpresent - => temp.s ++ p.s ++ cl.s ! VPPerfPast ! p.p ! q; --# notpresent - => temp.s ++ p.s ++ cl.s ! VPFut ! p.p ! q; --# notpresent - => temp.s ++ p.s ++ cl.s ! VPPerfFut ! p.p ! q; --# notpresent - => temp.s ++ p.s ++ cl.s ! VPContPres ! p.p ! q; --# notpresent - => temp.s ++ p.s ++ cl.s ! VPContPast ! p.p ! q --# notpresent - - }; - } ; - UseRCl temp p rcl = { - s = \\q => case of { - => temp.s ++ p.s ++ rcl.s ! VPGenPres ! p.p ! ODir ! q - ; => temp.s ++ p.s ++ rcl.s ! VPPerfPres ! p.p ! ODir ! q; --# notpresent - => temp.s ++ p.s ++ rcl.s ! VPImpPast ! p.p ! ODir ! q; --# notpresent - => temp.s ++ p.s ++ rcl.s ! VPPerfPast ! p.p ! ODir ! q; --# notpresent - => temp.s ++ p.s ++ rcl.s ! VPFut ! p.p ! ODir ! q; --# notpresent - => temp.s ++ p.s ++ rcl.s ! VPPerfFut ! p.p ! ODir ! q; --# notpresent - => temp.s ++ p.s ++ rcl.s ! VPContPres ! p.p ! ODir ! q; --# notpresent - => temp.s ++ p.s ++ rcl.s ! VPContPast ! p.p ! ODir ! q --# notpresent - }; - c = rcl.c - } ; - UseSlash temp p clslash = { - s = case of { - => temp.s ++ p.s ++ clslash.s ! VPGenPres ! p.p ! ODir - ; => temp.s ++ p.s ++ clslash.s ! VPPerfPres ! p.p ! ODir; --# notpresent - => temp.s ++ p.s ++ clslash.s ! VPImpPast ! p.p ! ODir ; --# notpresent - => temp.s ++ p.s ++ clslash.s ! VPPerfPast ! p.p ! ODir; --# notpresent - => temp.s ++ p.s ++ clslash.s ! VPFut ! p.p ! ODir; --# notpresent - => temp.s ++ p.s ++ clslash.s ! VPPerfFut ! p.p ! ODir; --# notpresent - => temp.s ++ p.s ++ clslash.s ! VPContPres ! p.p ! ODir; --# notpresent - => temp.s ++ p.s ++ clslash.s ! VPContPast ! p.p ! ODir --# notpresent - }; - c2 = clslash.c2 - } ; - - AdvS a s = {s = a.s ++ s.s} ; - - RelS s r = {s = s.s ++ r.s ! agrP3 Masc Sg} ; - SSubjS s sj s = { s = s.s ++ sj.s ++ s.s}; - -} +concrete SentenceUrd of Sentence = CatUrd ** SentenceHindustani with + (ResHindustani = ResUrd) ; diff --git a/lib/src/urdu/StructuralUrd.gf b/lib/src/urdu/StructuralUrd.gf index 9ef15c3b9..a6c67fcf8 100644 --- a/lib/src/urdu/StructuralUrd.gf +++ b/lib/src/urdu/StructuralUrd.gf @@ -1,49 +1,51 @@ concrete StructuralUrd of Structural = CatUrd ** - open MorphoUrd, ParadigmsUrd, Prelude, NounUrd in { + open MorphoUrd, ParadigmsUrd, Prelude, NounUrd,ParamX,CommonHindustani in { flags optimize=all ; coding = utf8; lin - above_Prep = ss "اوپر" ; - after_Prep = ss "كے بعد" ; + above_Prep = mkPrep "اوپر" "اوپر" ; + after_Prep = mkPrep ["كے بعد"] ["كے بعد"] ; all_Predet = ss "تمام" ; - almost_AdA, almost_AdN = ss "تقریبا" ; - although_Subj = ss "اگرچھ" ; + almost_AdA, almost_AdN = mkAdN "تقریبا" ; + although_Subj = ss "اگرچh-" ; always_AdV = ss "ہمیشہ" ; and_Conj = sd2 [] "اور" ** {n = Pl} ; - because_Subj = ss "كیونكھ" ; - before_Prep = ss "پہلے" ; - behind_Prep = ss "پیچھے" ; - between_Prep = ss "درمیاں" ; + because_Subj = ss "كیونكh-" ; + before_Prep = mkPrep "پہلے" "پہلے" ; + behind_Prep = mkPrep "پیچh-ے" "پیچh-ے" ; + between_Prep = mkPrep "درمیاں" "درمیاں" ; both7and_DConj = sd2 "دونوں" "اور" ** {n = Pl} ; but_PConj = ss "لیكن" ; - by8agent_Prep = ss "" ; - by8means_Prep = ss "" ; + by8agent_Prep = mkPrep "" "" ; + by8means_Prep = mkPrep "" "" ; can8know_VV,can_VV = mkV "سكنا" ** { isAux = True} ; - during_Prep = ss ["كے درمیاں"] ; + during_Prep = mkPrep ["كے درمیاں"] ["كے درمیاں"] ; either7or_DConj = sd2 "كوی ایك" "یا" ** {n = Sg} ; everybody_NP = MassNP (UseN (ParadigmsUrd.mkN "ہر كوی" "ہر كوی" "ہر كوی" "ہر كوی" "ہر كوی" "ہر كوی" Masc )); -- not a good way coz need to include NounUrd every_Det = mkDet "ہر" "ہر" "ہر" "ہر" Sg; everything_NP = MassNP (UseN (ParadigmsUrd.mkN "ہر چیز" "ہر چیز" "ہر چیزو" "سب چیزیں" "سب چیزوں" "سب چیزو" Masc )); - everywhere_Adv = ss "ہر جگہ" ; + everywhere_Adv = mkAdv "ہر جگہ" ; few_Det = mkDet "چند" "چند" "چند" "چند" Pl ; - for_Prep = ss "كیلیے" ; - from_Prep = ss "سے" ; + first_Ord = {s = "پعہلا" ; n = Sg} ; --DEPRECATED + for_Prep = mkPrep "كیلیے" "كیلیے" ; + from_Prep = mkPrep "سے" "سے" ; he_Pron = personalPN "وہ" "اس" "" "اس كا" Sg Masc Pers3_Distant ; - here_Adv = ss "یہاں" ; - here7to_Adv = ss ["یہاں پر"] ; - here7from_Adv = ss ["یہاں سے"] ; - how_IAdv = ss "ہoو" ; + here_Adv = mkAdv "یہاں" ; + here7to_Adv = mkAdv ["یہاں پر"] ; + here7from_Adv = mkAdv ["یہاں سے"] ; + how_IAdv = ss "كیسے" ; how8many_IDet = makeIDet "كتنے" "كتنی" Pl ; + how8much_IAdv = ss "كتنا" ; if_Subj = ss "اگر" ; - in8front_Prep = ss ["كے سامنے"] ; - i_Pron = personalPN "میں" "مجھ" "" "میرا" Sg Masc Pers1; - in_Prep = ss "معں" ; + in8front_Prep = mkPrep ["كے سامنے"] ["كے سامنے"] ; + i_Pron = personalPN "میں" "مجh-" "" "میرا" Sg Masc Pers1; + in_Prep = mkPrep "معں" "معں" ; it_Pron = personalPN "یہ" "یہ" "یہ" "اس كا" Sg Masc Pers3_Near; less_CAdv = {s = "كم" ; p = ""} ; many_Det = mkDet "بہت زیادہ" "بہت زیادہ" "بہت زیادہ" "بہت زیادہ" Pl ; - more_CAdv = {s = "زیادھ" ; p = "" } ; + more_CAdv = {s = "زیادh-" ; p = "" } ; most_Predet = ss "زیادہ تر" ; much_Det = mkDet "بہت" "بہت" "بہت" "بہت" Sg ; -- must_VV = { @@ -60,34 +62,34 @@ concrete StructuralUrd of Structural = CatUrd ** -- } ; -----b no_Phr = ss "نo" ; no_Utt = ss "نہیں" ; - on_Prep = ss "پر" ; + on_Prep = mkPrep "پر" "پر" ; -- one_Quant = demoPN "ایك" "ایك" "ایك" ; -- DEPRECATED only_Predet = ss "سرف" ; or_Conj = sd2 [] "یا" ** {n = Sg} ; - otherwise_PConj = ss "یا پھر" ; - part_Prep = ss "" ; + otherwise_PConj = ss "یا پh-ر" ; + part_Prep = mkPrep "" "" ; please_Voc = ss "مہربانi" ; - possess_Prep = ss "كا" ; + possess_Prep = mkPrep "كا" "كی" ; quite_Adv = ss "كہامoسہ" ; she_Pron = personalPN "وہ" "اس" "وہ" "اس كی" Sg Fem Pers3_Distant ; so_AdA = ss "سo" ; somebody_NP = MassNP (UseN (ParadigmsUrd.mkN "كوی" "كوی" "كوی" "كوی" "كوی" "كوی" Masc )); - someSg_Det = mkDet "كچھ" "كچھ" "كچھ" "كچھ" Sg ; - somePl_Det = mkDet "كچھ" "كچھ" "كچھ" "كچھ" Pl ; - something_NP = MassNP (UseN (ParadigmsUrd.mkN "كوی چیز" "كوی چیز" "كوی چیز" "كھ چیزیں" "كھ چیزوں" "كھ چیزو" Masc )); - somewhere_Adv = ss "كہiن پر" ; + someSg_Det = mkDet "كچh-" "كچh-" "كچh-" "كچh-" Sg ; + somePl_Det = mkDet "كچh-" "كچh-" "كچh-" "كچh-" Pl ; + something_NP = MassNP (UseN (ParadigmsUrd.mkN "كوی چیز" "كوی چیز" "كوی چیز" "كh- چیزیں" "كh- چیزوں" "كh- چیزو" Masc )); + somewhere_Adv = mkAdv ["كہiن پر"] ; that_Quant = demoPN "وہ" "اس" "ان" ; that_Subj = ss "كہ"; - there_Adv = ss "وہاں" ; - there7to_Adv = ss "وہاں پر" ; - there7from_Adv = ss ["وہاں سے"] ; + there_Adv = mkAdv "وہاں" ; + there7to_Adv = mkAdv ["وہاں پر"] ; + there7from_Adv = mkAdv ["وہاں سے"] ; therefore_PConj = ss "اس لیے" ; they_Pron = personalPN "وہ" "وہ" "وہ" "ان كا" Pl Masc Pers3_Distant ; ---- this_Quant = demoPN "یہ" "اس" "ان"; - through_Prep = ss ["میں سے"] ; + through_Prep = mkPrep ["میں سے"] ["میں سے"] ; too_AdA = ss "بہت" ; - to_Prep = ss "كو" ; - under_Prep = ss "نیچے" ; + to_Prep = mkPrep "كو" "كو" ; -- ** {lock_Prep = <>}; + under_Prep = mkPrep "نیچے" "نیچے" ; -- ** {lock_Prep = <>}; very_AdA = ss "بہت" ; want_VV = mkV "چاہنا" ** { isAux = False} ; we_Pron = personalPN "ہم" "ہم" "ہم" "ہمارا" Pl Masc Pers1 ; @@ -102,25 +104,25 @@ concrete StructuralUrd of Structural = CatUrd ** whoSg_IP = mkIP "كون" "كiس" "كiس" Sg Masc ; whoPl_IP = mkIP "كون" "كن" "كنہوں" Pl Masc ; why_IAdv = ss "كیوں" ; - without_Prep = ss ["كے بغیر"] ; - with_Prep = ss ["كے ساتھ"] ; + without_Prep = mkPrep ["كے بغیر"] ["كے بغیر"] ; + with_Prep = mkPrep ["كے ساتh-"] ["كے ساتh-"] ; -- yes_Phr = ss "ہاں" ; yes_Utt = ss "ہاں" ; - youSg_Pron = personalPN "تم" "تم" "تم" "تمھارا" Sg Masc Pers2_Casual ; - youPl_Pron = personalPN "تم" "تم" "تم" "تمھارا" Pl Masc Pers2_Casual ; + youSg_Pron = personalPN "تم" "تم" "تم" "تمh-ارا" Sg Masc Pers2_Casual ; + youPl_Pron = personalPN "تم" "تم" "تم" "تمh-ارا" Pl Masc Pers2_Casual ; youPol_Pron = personalPN "آپ" "آP" "آP" "آپ كا" Sg Masc Pers2_Respect ; no_Quant = demoPN " كوی نہیں" "كوی نہیں" "كوی نہیں" ; not_Predet = {s="نہیں"} ; if_then_Conj = sd2 "اگر" "تو" ** {n = Sg} ; - at_least_AdN = ss ["كم از كم"] ; - at_most_AdN = ss ["زیادہ سے زیادہ"]; + at_least_AdN = mkAdN ["كم از كم"] ; + at_most_AdN = mkAdN ["زیادہ سے زیادہ"]; nothing_NP = MassNP (UseN (ParadigmsUrd.mkN "كوی چیز نہیں" "كوی چیز نہیں" "كوی چیز نہیں" "كوی چیز نہیں" "كوی چیز نہیں" "كوی چیز نہیں" Masc )); - except_Prep = ss "سواے" ; + except_Prep = mkPrep "سواے" "سواے" ; nobody_NP = MassNP (UseN (ParadigmsUrd.mkN "كوی نہیں" "كوی نہیں" "كوی نہیں" "كوی نہیں" "كوی نہیں" "كوی نہیں" Masc )); as_CAdv = {s = "عتنا" ; p = "جتنا"} ; - have_V2 = mkV2 (mkV "راكھنا") "" ; + have_V2 = mkV2 (mkV "راكh-نا") "" ; language_title_Utt = ss "اردو" ; diff --git a/lib/src/urdu/SymbolUrd.gf b/lib/src/urdu/SymbolUrd.gf index 2cfd7679e..a9fa1f3ea 100644 --- a/lib/src/urdu/SymbolUrd.gf +++ b/lib/src/urdu/SymbolUrd.gf @@ -1,46 +1,4 @@ ---# -path=.:../abstract:../common +--# -path=.:../hindustani:../abstract:../common -concrete SymbolUrd of Symbol = CatUrd ** open Prelude, ResUrd in { - - lin --- SymbPN i = {s = \\_ => i.s ; g = Masc} ; - SymbPN i = {s = addGenitiveS i.s ; g = Masc} ; - IntPN i = {s = addGenitiveS i.s ; g = Masc} ; - FloatPN i = {s = addGenitiveS i.s ; g = Masc} ; - NumPN i = {s = \\_ =>i.s ; g = Masc} ; - CNIntNP cn i = { - s = \\c => cn.s ! Sg ! Dir ++ i.s ; - a = agrP3 cn.g Sg - } ; - CNSymbNP det cn xs = { - s = \\c => det.s!Sg!Masc ++ cn.s ! det.n ! Dir ++ xs.s ; - a = agrP3 cn.g det.n - } ; - CNNumNP cn i = { - s = \\c => cn.s ! Sg ! Dir ++ i.s ; - a = agrP3 cn.g Sg - } ; - - SymbS sy = sy ; - SymbNum sy = { s = sy.s ; n = Pl } ; - SymbOrd sy = { s = sy.s ++ waN_Str ; n = Pl} ; - -lincat - - Symb, [Symb] = SS ; - -lin - MkSymb s = s ; - - BaseSymb = infixSS awr_Str - ; - 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 {_ => s ++ ka_Str} ; - - -} +concrete SymbolUrd of Symbol = CatUrd ** SymbolHindustani with + (ResHindustani = ResUrd) ; diff --git a/lib/src/urdu/VerbUrd.gf b/lib/src/urdu/VerbUrd.gf index 885fe81b2..3ae0ab75d 100644 --- a/lib/src/urdu/VerbUrd.gf +++ b/lib/src/urdu/VerbUrd.gf @@ -1,40 +1,2 @@ -concrete VerbUrd of Verb = CatUrd ** open ResUrd in { - - flags optimize=all_subs ; - - lin - UseV v = predV v ; - SlashV2a v = predV v ** {c2 = {s = v.c2.s ; c = VIntrans}} ; - Slash2V3 v np = - insertObjc (\\_ => np.s ! NPObj ++ v.c3 ) (predV v ** {c2 = {s = v.c2 ; c = VTrans}}) ; - Slash3V3 v np = - insertObjc (\\_ => np.s ! NPC Obl ++ v.c2) (predV v ** {c2 = {s = v.c3 ; c = VTrans}}) ; - ComplVV v vp = insertVV (infVV v.isAux vp) (predV v) ; - ComplVS v s = insertObj2 (conjThat ++ s.s) (predV v) ; - ComplVQ v q = insertObj2 (conjThat ++ q.s ! QIndir) (predV v) ; - ComplVA v ap = insertObj (\\a => ap.s ! giveNumber a ! giveGender a ! Dir ! Posit) (predV v) ; - SlashV2V v vp = insertVV ((vp.s!VPImp).inf++ky_Str) (predV v) **{c2 = {s = sE_Str ; c = VIntrans}} ; - SlashV2S v s = insertObjc2 (conjThat ++ s.s) (predV v ** {c2 = {s = kw_Str ; c = VIntrans}}) ; - SlashV2Q v q = insertObjc2 (conjThat ++ q.s ! QIndir) (predV v ** {c2 = {s = sE_Str ; c = VIntrans}}) ; - SlashV2A v ap = insertObjc (\\a => ap.s ! giveNumber a ! giveGender a ! Dir ! Posit) (predV v ** {c2 = {s = kw_Str ; c = VIntrans}}) ; ---- - ComplSlash vp np = insertObject np vp ; - SlashVV vv vp = - insertObj (\\a => infVP vv.isAux vp a) (predV vv) ** - {c2 = vp.c2} ; - SlashV2VNP vv np vp = - insertObjPre (\\_ => np.s ! NPObj ) - (insertObjc (\\a => infVP vv.isAux 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 ; - ReflVP v = insertObjPre (\\_ => RefPron) v ; - PassV2 v = predV v ; -- need to be fixed - CompAP ap ={s = \\a => ap.s ! giveNumber a ! giveGender a ! Dir ! Posit } ; - CompNP np = {s = \\_ => np.s ! NPObj} ; - CompAdv a = {s = \\_ => a.s} ; - - -} +concrete VerbUrd of Verb = CatUrd ** VerbHindustani with + (ResHindustani = ResUrd) ; diff --git a/lib/src/urdu/src/DiffUrd.gf b/lib/src/urdu/src/DiffUrd.gf new file mode 100644 index 000000000..eea9a25a9 --- /dev/null +++ b/lib/src/urdu/src/DiffUrd.gf @@ -0,0 +1,115 @@ +instance DiffUrd of DiffHindustani = open CommonHindustani, Prelude in { + +flags coding = utf8 ; + +oper + +Clause : Type = {s : VPHTense => Polarity => Order => Str} ; + mkClause : NP -> VPH -> Clause = \np,vp -> { + s = \\vt,b,ord => + let + subjagr : NPCase * Agr = case vt of { + VPImpPast => case vp.subj of { + VTrans => ; + VTransPost => ; + _ => + } ; + _ => + } ; + subj = subjagr.p1 ; + agr = subjagr.p2 ; + n = (fromAgr agr).n; + p = (fromAgr agr).p; + g = (fromAgr agr).g; + vps = case vt of { + + VPGenPres => vp.s ! VPTense VPPres agr ; + VPImpPast => vp.s ! VPTense VPPast agr ; + VPFut => case vp.prog of { True => {fin = (vp.s ! VPTense VPFutr agr).fin ; inf = (vp.s ! VPTense VPFutr agr).inf ++ hw p n} ; + _ => vp.s ! VPTense VPFutr agr } ; + VPContPres => {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; + VPContPast => {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; + VPContFut => {fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ raha g n ++ hw p n} ; + VPPerfPres => {fin = copula CPresent n p g ; inf = (vp.s ! VPTense VPPerf agr).inf } ; + VPPerfPast => {fin = copula CPast n p g ; inf = (vp.s ! VPTense VPPerf agr).inf } ; + VPPerfFut => {fin = copula CFuture n p g ; inf = (vp.s ! VPTense VPPerf agr).inf ++ hw p n } ; + VPPerfPresCont => {fin = copula CPresent n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n } ; + VPPerfPastCont => {fin = copula CPast n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n } ; + VPPerfFutCont => {fin = copula CFuture n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n ++ hw p n } ; + VPSubj => case vp.prog of { True => {fin = (vp.s ! VPTense VPFutr agr).inf ++ hw p n ; inf = "Xayd" } ; + _ => {fin = (vp.s ! VPTense VPFutr agr).inf ; inf = "Xayd" } } + + }; + + + quest = + case ord of + { ODir => []; + OQuest => "kya" }; + na = + case b of + { Pos => []; + Neg => "na" }; + nahim = + case b of + { Pos => []; + Neg => "nhyN" }; + in + case vt of { + VPSubj => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ na ++ vps.inf ++ vps.fin ++ vp.embComp ; + _ => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp}; + + } ; + + mkSClause : Str -> Agr -> VPH -> Clause = + \subj,agr,vp -> { + s = \\t,b,ord => + let + n = (fromAgr agr).n; + p = (fromAgr agr).p; + g = (fromAgr agr).g; + vps = case t of { + VPGenPres => vp.s ! VPTense VPPres agr ; + VPImpPast => vp.s ! VPTense VPPast agr ; + VPFut => vp.s ! VPTense VPFutr agr ; + VPContPres => {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; + VPContPast => {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; + VPContFut => {fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ raha g n ++ hw p n } ; + VPPerfPres => {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ cka g n } ; + VPPerfPast => {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ cka g n } ; + VPPerfFut => {fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ cka g n ++ hw p n } ; + VPPerfPresCont => {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; + VPPerfPastCont => {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; + VPPerfFutCont => {fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ raha g n ++ hw p n } ; + VPSubj => {fin = insertSubj p (vp.s ! VPStem).inf ; inf = "xayd" } + + }; + + quest = + case ord of + { ODir => []; + OQuest => "kya" }; + na = + case b of + { Pos => []; + Neg => "na" }; + nahim = + case b of + { Pos => []; + Neg => "nhyN" }; + in + case t of { + VPSubj => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ na ++ vps.inf ++ vps.fin ++ vp.embComp; + _ => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp}; + } ; + + + np2pronCase ppf npc a = case npc of { + NPC c => ppf ! c; + NPObj => ppf ! Obl ; + NPErg => case (fromAgr a).p of { + (Pers3_Near|Pers3_Distant) => ppf ! Obl ++ "nE" ; + _ => ppf ! Dir ++ "nE" + } + } ; +} diff --git a/lib/src/urdu/src/ExtraUrd.gf b/lib/src/urdu/src/ExtraUrd.gf new file mode 100644 index 000000000..b113a7c38 --- /dev/null +++ b/lib/src/urdu/src/ExtraUrd.gf @@ -0,0 +1,19 @@ +concrete ExtraUrd of ExtraUrdAbs = CatUrd ** + open ResUrd, Coordination, Prelude, MorphoUrd, ParadigmsUrd,CommonHindustani in { + +flags coding = utf8 ; + + lin + GenNP np = {s = \\_,_,_ => np.s ! NPC Obl ++ "ka" ; a = np.a} ; + + each_Det = mkDet "hr kwy" "hr kwy" "hr kwy" "hr kwy" Sg ; + have_V = mkV "rakh-na"; + IAdvAdv adv = {s = "ktny" ++ adv.s ! Masc} ; + ICompAP ap = {s = "ktnE" ++ ap.s ! Sg ! Masc ! Dir ! Posit} ; + cost_V = mkV "qymt" ; + + -- added for causitives + make_CV = mkVerb "nothing" ** {c2 = "" }; + +-- for VP conjunction +} diff --git a/lib/src/urdu/transliterated/IdiomUrd.gf b/lib/src/urdu/src/IdiomUrd.gf similarity index 70% rename from lib/src/urdu/transliterated/IdiomUrd.gf rename to lib/src/urdu/src/IdiomUrd.gf index c50fb81df..c71beea22 100644 --- a/lib/src/urdu/transliterated/IdiomUrd.gf +++ b/lib/src/urdu/src/IdiomUrd.gf @@ -1,10 +1,10 @@ -concrete IdiomUrd of Idiom = CatUrd ** open Prelude,Predef, ResUrd in { +concrete IdiomUrd of Idiom = CatUrd ** open Prelude,Predef, ResUrd,ParamX,CommonHindustani in { flags optimize=all_subs ; flags coding = utf8; lin - ImpersCl vp = mkSClause [] (agrP3 Masc Sg) vp ; + ImpersCl vp = mkSClause " " (agrP3 Masc Sg) vp ; GenericCl vp = mkSClause "kwy" (agrP3 Masc Sg) vp ; CleftNP np rs = @@ -12,7 +12,7 @@ concrete IdiomUrd of Idiom = CatUrd ** open Prelude,Predef, ResUrd in { in {s = \\t,p,o => cl.s ! t ! p ! o ++ rs.s ! np.a }; - CleftAdv ad ss = { s = \\t,b,o => ad.s ++ ss.s}; + CleftAdv ad ss = { s = \\t,b,o => ad.s ! Masc ++ ss.s}; ExistNP np = mkSClause "whaN" (agrP3 (fromAgr np.a).g (fromAgr np.a).n) @@ -27,7 +27,8 @@ concrete IdiomUrd of Idiom = CatUrd ** open Prelude,Predef, ResUrd in { } }; - ProgrVP vp = insertObj (\\a => vp.obj.s ++ vp.ad ++ vp.comp ! a ++ (vp.s ! VPStem).inf ++ raha (fromAgr a).g (fromAgr a).n ) (predAux auxBe) ; +-- ProgrVP vp = insertObj (\\a => vp.obj.s ++ vp.ad ++ vp.comp ! a ++ (vp.s ! VPStem).inf ++ raha (fromAgr a).g (fromAgr a).n ) (predAux auxBe) ; + ProgrVP vp = (predProg vp) ; ImpPl1 vp = {s = "Aw" ++ infVP True vp (agrP1 Masc Pl)} ; diff --git a/lib/src/urdu/transliterated/LexiconUrd.gf b/lib/src/urdu/src/LexiconUrd.gf similarity index 69% rename from lib/src/urdu/transliterated/LexiconUrd.gf rename to lib/src/urdu/src/LexiconUrd.gf index ea7847751..320b76864 100644 --- a/lib/src/urdu/transliterated/LexiconUrd.gf +++ b/lib/src/urdu/src/LexiconUrd.gf @@ -14,7 +14,7 @@ concrete LexiconUrd of Lexicon = CatUrd ** apartment_N = mkN "kmrh" ; apple_N = mkN "syb" ; art_N = mkN "fn" ; - ask_V2Q = mkV2 (mkV "pwch-na") ; + ask_V2Q = mkV2 (mkV "pwch'na") ; baby_N = mkN "bch" ; bad_A = mkA "bra" ; bank_N = mkN "bank" ; @@ -34,27 +34,27 @@ concrete LexiconUrd of Lexicon = CatUrd ** boy_N = mkN "lRka" ; bread_N = mkN "rwty" ; break_V2 = mkV2 (mkV "twRna") ; - broad_A = mkA "kh-la" ; - brother_N2 = mkN2 (mkN "bh-ay") (mkPrep "ka") "kE" ; --not correct + broad_A = mkA "kh'la" ; + brother_N2 = mkN2 (mkN "bh'ay") (mkPrep "ka" "ka") "kE" ; --not correct brown_A = mkA "nswary" ; - butter_N = mkN "mkh-n" ; + butter_N = mkN "mkh'n" ; buy_V2 = mkV2 (mkV "Krydna"); camera_N = mkN "kymrh" ; cap_N = mkN "twpy" ; car_N = mkN "gaRy" ; carpet_N = mkN "tpay^y" ; cat_N = mkN "bly" ; - ceiling_N = mkN "ch-t" feminine ; + ceiling_N = mkN "ch't" feminine ; chair_N = mkN "krsy" ; cheese_N = mkN "pnyr" feminine ; child_N = mkN "bch" ; - church_N = mkCmpdNoun "grja" (mkN "gh-r") ; + church_N = mkCmpdNoun "grja" (mkN "gh'r") ; city_N = mkN "Xhr" ; clean_A = mkA "Saf" ; clever_A = mkA "hwXyar" ; close_V2 = mkV2 (compoundV "bnd" do_V2); coat_N = mkN "kwT" ; - cold_A = mkA "Th-nDa" ; + cold_A = mkA "Th'nDa" ; come_V = mkV "Ana" ; computer_N = mkN "kmpywTr" ; country_N = mkN "mlk" ; @@ -62,75 +62,76 @@ concrete LexiconUrd of Lexicon = CatUrd ** cow_N = mkN "gaE" feminine ; die_V = mkV "mrna" ; dirty_A = mkA "gnda" ; - distance_N3 = mkN3 (mkN "faSlh") (mkPrep "ka") "kE" "sE" ; + distance_N3 = mkN3 (mkN "faSlh") (mkPrep "ka" "ka") "kE" "sE" ; doctor_N = mkN "mealj" ; dog_N = mkN "kta" ; door_N = mkN "drwzh" ; drink_V2 = mkV2 (mkV "pyna"); easy_A2V = mkA "Asan" "" ; - eat_V2 = mkV2 (mkV "kh-ana") "" ; + eat_V2 = mkV2 (mkV "kh'ana") "" ; empty_A = mkA "Kaly" ; enemy_N = mkN "dXmn" ; factory_N = mkN "karKanh" ; - father_N2 = mkN2 (mkN "aba") (mkPrep "ka") "kE" ; + father_N2 = mkN2 (mkN "aba") (mkPrep "ka" "ka") "kE" ; fear_VS = mkV "drna"; find_V2 = mkV2 (mkV "pana") ; - fish_N = mkN "mch-ly" ; + fish_N = mkN "mch'ly" ; floor_N = mkN "frX" ; - forget_V2 = mkV2 (mkV "bh-wlna") ; + forget_V2 = mkV2 (mkV "bh'wlna") ; fridge_N = mkN "fryg" ; - friend_N = mkN "dwst" masculine ; - fruit_N = mkN "ph-l" ; --- fun_AV = mkAV (regA "fun") ; +-- friend_N = mkN "dwst" masculine ; + fruit_N = mkN "ph'l" ; +-- fun_AV = mkAV (regA "f?n") ; garden_N = mkN "baG" ; girl_N = mkN "lRky" ; glove_N = mkN "dstanh" ; gold_N = mkN "swna" ; - good_A = mkA "ach-a" ; + good_A = mkA "ach'a" ; go_V = mkV "jana" ; green_A = mkA "sbz" ; harbour_N = mkCmpdNoun "bndr" (mkN "gah") ; hate_V2 = mkV2 (compoundV "nfrt" do_V2) ; hat_N = mkN "twpy" ; --- have_V2 = dirV2 (mk5V "have" "has" "had" "had" "having") ; +-- have_V2 = dirV2 (mk5V "ha?e" "has" "had" "had" "ha??ng") ; hear_V2 = mkV2 (mkV "snna") ; hill_N = mkN "phaRy" ; hope_VS = (compoundV "amyd" do_V2); - horse_N = mkN "gh-wRa" ; + horse_N = mkN "gh'wRa" ; hot_A = mkA "grm" ; - house_N = mkN "gh-r" ; + house_N = mkN "gh'r" ; important_A = mkA "ahm" ; industry_N = mkN "Snet" feminine ; iron_N = mkN "lwha" ; king_N = mkN "badXah" ; know_V2 = mkV2 (mkV "janna") ; - know_VS = mkV "janna"; - lake_N = mkN "jh-yl" feminine ; + know_VS = (mkV "janna") ; + know_VQ = (mkV "janna") ; + lake_N = mkN "jh'yl" feminine ; lamp_N = mkN "lymp" ; - learn_V2 = mkV2 (mkV "sykh-na") ; + learn_V2 = mkV2 (mkV "sykh'na") ; leather_N = mkN "cmRa" ; leave_V2 = mkV2 (mkV "jana") ; like_V2 = mkV2 (compoundV "psnd" do_V2); listen_V2 = mkV2 (mkV "snna") ; live_V = mkV "rhna" ; ---- touch long_A = mkA "lmba" ; - lose_V2 = mkV2 (compoundV "kh-w" do_V2) ; + lose_V2 = mkV2 (compoundV "kh'w" do_V2) ; love_N = mkN "mHbt" ; love_V2 = mkV2 (compoundV "pyar" do_V2) "kw"; man_N = mkN "Admy" ; -- not correct according to rules should be discussed - married_A2 = mkA "Xady krna" "sE" ; + married_A2 = mkA "Xady?krna" "sE" ; meat_N = mkN "gwXt" ; - milk_N = mkN "dwdh-" ; + milk_N = mkN "dwdh'" ; moon_N = mkN "cand" ; - mother_N2 = mkN2 (mkN "maN") (mkPrep "ky") "kE"; -- not covered need to be discussed + mother_N2 = mkN2 (mkN "maN") (mkPrep "ky" "ky") "kE"; -- not covered need to be discussed mountain_N = mkN "phaRy" ; music_N = mkN "mwsyqy" ; narrow_A = mkA "baryk" ; new_A = mkA "nya" ; newspaper_N = mkN "aKbar" ; oil_N = mkN "tyl" ; - old_A = mkA "bwRh-a" ; - open_V2 = mkV2 (mkV "kh-wlna") ; + old_A = mkA "bwRh'a" ; + open_V2 = mkV2 (mkV "kh'wlna") ; paint_V2A = mkV2 (compoundV "rng" do_V2) ; paper_N = mkN "kaGz" ; paris_PN = mkPN "pyrs" ; @@ -138,20 +139,20 @@ concrete LexiconUrd of Lexicon = CatUrd ** pen_N = mkN "pnsl" ; planet_N = mkN "syarh" ; plastic_N = mkN "plasTk" ; - play_V2 = mkV2 (mkV "kh-ylna") ; + play_V2 = mkV2 (mkV "kh'ylna") ; policeman_N = mkCmpdNoun "pwlys" (mkN "wala") ; priest_N = (mkN "pyGmbr") ; --- probable_AS = mkAS (regA "probable") ; +-- probable_AS = mkAS (regA "pr?bable") ; queen_N = mkN "Xhzady" ; radio_N = mkN "ryDyw" ; rain_V0 = compoundV "barX" (mkV "hwna" ) ; - read_V2 = mkV2 (mkV "pRh-na"); + read_V2 = mkV2 (mkV "pRh'na"); red_A = mkA "lal" ; religion_N = mkN "mzhb" ; restaurant_N = mkN "hwTl" ; - river_N = mkN "drya" masculine ; +-- river_N = mkN "drya" masculine ; rock_N = mkN "cTan" ; - roof_N = mkN "ch-t" masculine ; +-- roof_N = mkN "ch't" masculine ; rubber_N = mkN "rbR" ; run_V = mkV "dwRna" ; say_VS = mkV "khna" ; @@ -159,25 +160,25 @@ concrete LexiconUrd of Lexicon = CatUrd ** science_N = mkN "sans" ; sea_N = mkN "smndr" ; seek_V2 = mkV2 (compoundV "tlaX" do_V2) ; - see_V2 = mkV2 (mkV "dykh-na") ; + see_V2 = mkV2 (mkV "dykh'na") ; sell_V3 = mkV3 (mkV "bycna") "kw" ""; - send_V3 = mkV3 (mkV "bh-yjna") "kw" ""; - sheep_N = mkN "bh-yR" feminine ; + send_V3 = mkV3 (mkV "bh'yjna") "kw" ""; + sheep_N = mkN "bh'yR" feminine ; ship_N = mkN "jhaz" ; shirt_N = mkN "qmyZ-" feminine; shoe_N = mkN "jwta" ; shop_N = mkN "dwkan" feminine ; - short_A = mkA "ch-wTa" ; + short_A = mkA "ch'wTa" ; silver_N = mkN "candy" ; sister_N = mkN "bhn" feminine ; sleep_V = mkV "swna" ; - small_A = mkA "ch-wTa" ; + small_A = mkA "ch'wTa" ; snake_N = mkN "sanp" ; sock_N = mkN "jrab" feminine ; speak_V2 = mkV2 (mkV "bwlna") ; star_N = mkN "stara" ; steel_N = mkN "styl" ; - stone_N = mkN "pth-r" ; + stone_N = mkN "pth'r" ; stove_N = mkN "cwlha" ; student_N = mkCmpdNoun "t-alb" (mkN "elm") ; stupid_A = mkA "aHmq" ; @@ -185,99 +186,99 @@ concrete LexiconUrd of Lexicon = CatUrd ** switch8off_V2 = mkV2 (mkV "clana") ; switch8on_V2 = mkV2 (compoundV "bnd" do_V2) ; table_N = mkN "myz" feminine ; - talk_V3 = mkV3 (mkV "bwlna") "sE" "kE barE meN"; - teacher_N = mkN "istad" ; - teach_V2 = mkV2 (mkV "pRh-na") ; + talk_V3 = mkV3 (mkV "bwlna") "sE" "kE?barE?meN"; + teacher_N = mkN "?stad" ; + teach_V2 = mkV2 (mkV "pRh'na") ; television_N = mkN "telywyzn" ; thick_A = mkA "mwTa" ; thin_A = mkA "ptla" ; train_N = mkN "gaRy" ; travel_V = (compoundV "sfr" do_V2) ; - tree_N = mkN "drKt" masculine ; --- ---- trousers_N = mkN "trousers" ; +-- tree_N = mkN "drKt" masculine ; +-- ---- trousers_N = mkN "tr??sers" ; ugly_A = mkA "bdSwrt" ; - understand_V2 = mkV2 (mkV "smjh-na") ; + understand_V2 = mkV2 (mkV "smjh'na") ; university_N = mkN "ywnywrsTy" ; village_N = mkN "gawN" ; wait_V2 = mkV2 (compoundV "antz-ar" do_V2) ; walk_V = mkV "clna" ; warm_A = mkA "grm" ; war_N = mkN "jng" ; - watch_V2 = mkV2 (mkV "dykh-na") ; + watch_V2 = mkV2 (mkV "dykh'na") ; water_N = mkN "pany" ; -- not covered masculine ending with y white_A = mkA "sfyd" ; - window_N = mkN "kh-Rky" ; + window_N = mkN "kh'Rky" ; wine_N = mkN "Xrab" feminine ; win_V2 = mkV2 (mkV "jytna") ; woman_N = mkN "ewrt" feminine ; wonder_VQ = compoundV "Heran" (mkV "hwna") ; wood_N = mkN "lkRy" ; - write_V2 = mkV2 (mkV "lkh-na") ; + write_V2 = mkV2 (mkV "lkh'na") ; yellow_A = mkA "pyla" ; young_A = mkA "jwan" ; do_V2 = mkV2 (mkV "krna") ; now_Adv = mkAdv "ab" ; - already_Adv = mkAdv "phlE hy" ; + already_Adv = mkAdv "phlE?hy" ; song_N = mkN "gana" ; add_V3 = mkV3 (compoundV "aZ-afh" do_V2) "" "" ; number_N = mkN "hndsh" ; put_V2 = mkV2 (mkV "Dalna") ; stop_V = mkV "rkna" ; - jump_V = mkV "ch-langna" ; + jump_V = mkV "ch'langna" ; left_Ord = {s = "bayaN" ; n = singular}; right_Ord = {s= "dayaN" ; n = singular}; far_Adv = mkAdv "dwr" ; correct_A = mkA "Syh" ; dry_A = mkA "KXk" ; - dull_A = mkA "nalik" ; + dull_A = mkA "nal?k" ; full_A = mkA "mkml" ; - heavy_A = mkA "bh-ary" ; + heavy_A = mkA "bh'ary" ; near_A = mkA "qryb" ; rotten_A = mkA "Krab" ; round_A = mkA "gwl" ; sharp_A = mkA "tyz" ; smooth_A = mkA "hmwar" ; - straight_A = mkA "sydh-a" ; + straight_A = mkA "sydh'a" ; wet_A = mkA "gyla" ; ---- - wide_A = mkA "kh-la" ; + wide_A = mkA "kh'la" ; animal_N = mkN "janwr" ; - ashes_N = mkN "rakh-" feminine; -- FIXME: plural only? + ashes_N = mkN "rakh'" feminine; -- FIXME: plural only? back_N = mkN "qmr" feminine ; bark_N = mkN "bark" ; - belly_N = mkN "dh-ny" ; + belly_N = mkN "dh'ny" ; blood_N = mkN "Kwn" ; bone_N = mkN "hDy" ; - breast_N = mkN "ch-aty" ; + breast_N = mkN "ch'aty" ; cloud_N = mkN "badl" ; day_N = mkN "dn" ; - dust_N = mkN "dh-wl" ; + dust_N = mkN "dh'wl" ; ear_N = mkN "kan" ; earth_N = mkN "zmyn" feminine ; egg_N = mkN "anDh" ; - eye_N = mkN "Ankh-" feminine ; + eye_N = mkN "Ankh'" feminine ; fat_N = mkN "mwta" ; feather_N = mkN "pr" ; fingernail_N = mkN "naKn" ; fire_N = mkN "Ag" feminine ; - flower_N = mkN "ph-wl" ; - fog_N = mkN "dh-nd" feminine ; + flower_N = mkN "ph'wl" ; + fog_N = mkN "dh'nd" feminine ; foot_N = mkN "pawN" ; -- not properly covered need to be discussed forest_N = mkN "njgl" ; - grass_N = mkN "gh-s" feminine ; - guts_N = mkN "gut" ; -- FIXME: no singular + grass_N = mkN "gh's" feminine ; + guts_N = mkN "g?t" ; -- FIXME: no singular hair_N = mkN "bal" ; - hand_N = mkN "hath-" ; + hand_N = mkN "hath'" ; head_N = mkN "sr" ; heart_N = mkN "dl" ; - horn_N = mkN "gh-nty" ; + horn_N = mkN "gh'nty" ; husband_N = mkN "Xwhr" ; ice_N = mkN "brf" feminine ; knee_N = mkN "khny" ; leaf_N = mkN "pth" ; leg_N = mkN "tang" feminine ; liver_N = mkN "jgr" ; - louse_N = mkN "gh-r" ; + louse_N = mkN "gh'r" ; mouth_N = mkN "mnh" ; name_N = mkN "nam" ; neck_N = mkN "grdn" feminine ; @@ -293,21 +294,21 @@ concrete LexiconUrd of Lexicon = CatUrd ** seed_N = mkN "byj" ; skin_N = mkN "jld" feminine ; sky_N = mkN "Asman" ; - smoke_N = mkN "dh-waN"; -- singular masc nouns ending with aN,wN yet to be implemented + smoke_N = mkN "dh'waN"; -- singular masc nouns ending with aN,wN yet to be implemented snow_N = mkN "brf" feminine ; - stick_N = mkN "ch-Ry" ; + stick_N = mkN "ch'Ry" ; tail_N = mkN "dm" ; tongue_N = mkN "zban" feminine ; - tooth_N = mkN "dant" masculine; +-- tooth_N = mkN "dant" masculine; wife_N = mkN "bywy" ; - wind_N = mkN "Andh-y" ; + wind_N = mkN "Andh'y" ; wing_N = mkN "pr" ; worm_N = mkN "grm" ; year_N = mkN "sal" ; blow_V = mkV "clna" ; breathe_V = compoundV "sans" (mkV "lyna" ) ; burn_V = mkV "jlna" ; - dig_V = mkV "kh-wdna" ; + dig_V = mkV "kh'wdna" ; fall_V = mkV "grna" ; float_V = mkV "tyrna" ; flow_V = mkV "bhna" ; @@ -315,16 +316,16 @@ concrete LexiconUrd of Lexicon = CatUrd ** freeze_V = mkV "jmna"; give_V3 = mkV3 (mkV "dyna") "kw" ""; laugh_V = mkV "hnsna" ; --- lie_N = mkN "jh-wt" masculine ; - lie_V = compoundV "jh-wt" (mkV "bwlna" ); - play_V = mkV "kh-ylna" ; +-- lie_N = mkN "jh'wt" masculine ; + lie_V = compoundV "jh'wt" (mkV "bwlna" ); + play_V = mkV "kh'ylna" ; sew_V = mkV "syna" ; sing_V = mkV "gana" ; - sit_V = mkV "byTh-na" ; + sit_V = mkV "byTh'na" ; smell_V = mkV "swngna" ; - spit_V = mkV "th-wkna" ; - stand_V = compoundV "kh-RE" (mkV "hwna" ); - swell_V = mkV "swjh-na" ; + spit_V = mkV "th'wkna" ; + stand_V = compoundV "kh'RE" (mkV "hwna" ); + swell_V = mkV "swjh'na" ; swim_V = mkV "tyrna" ; think_V = mkV "swcna" ; turn_V = mkV "mRna"; @@ -334,36 +335,36 @@ concrete LexiconUrd of Lexicon = CatUrd ** cut_V2 = mkV2 (mkV "katna") ; fear_V2 = mkV2 (mkV "Drna") ; fight_V2 = mkV2 (mkV "lRna") ; - hit_V2 = mkV2 (compoundV "th-wkr" (mkV "marna" )); + hit_V2 = mkV2 (compoundV "th'wkr" (mkV "marna" )); hold_V2 = mkV2 (mkV "pkRna") ; hunt_V2 = mkV2 (compoundV "Xkar" do_V2); kill_V2 = mkV2 (compoundV "mar" (mkV "Dalna" )) ; - pull_V2 = mkV2 (mkV "kh-ncna"); - push_V2 = mkV2 (mkV "dh-kylna") "kw" ; + pull_V2 = mkV2 (mkV "kh'ncna"); + push_V2 = mkV2 (mkV "dh'kylna") "kw" ; rub_V2 = mkV2 (mkV "rgRna") ; - scratch_V2 = mkV2 (mkV "kh-rcna") "kw" ; + scratch_V2 = mkV2 (mkV "kh'rcna") "kw" ; split_V2 = mkV2 (mkV "banta") "kw" ; --- squeeze_V2 = dirV2 (regV "squeeze") ; +-- squeeze_V2 = dirV2 (regV "sq?eeze") ; -- stab_V2 = dirV2 (regDuplV "stab") ; suck_V2 = mkV2 (mkV "cwsna") ; - throw_V2 = mkV2 (mkV "ph-ynkna") ; - tie_V2 = mkV2 (mkV "bandh-na") ; - wash_V2 = mkV2 (mkV "dh-wna") ; + throw_V2 = mkV2 (mkV "ph'ynkna") ; + tie_V2 = mkV2 (mkV "bandh'na") ; + wash_V2 = mkV2 (mkV "dh'wna") ; wipe_V2 = mkV2 (compoundV "Saf" (mkV "krna" )); ----- other_A = regA "other" ; +---- other_A = regA "?ther" ; grammar_N = mkN "grdan" ; language_N = mkN "zban" feminine ; rule_N = mkN "aSwl" ; ---- added 4/6/2007 - john_PN = mkPN "jon" ; + john_PN = mkPN "jan" ; question_N = mkN "swal" ; -- ready_A = regA "ready" ; reason_N = mkN "wjh" feminine ; today_Adv = mkAdv "Aj" ; - uncertain_A = mkA ["Gyr yqyny"] ; + uncertain_A = mkA ["Gyryqyny"] ; } diff --git a/lib/src/urdu/transliterated/MorphoUrd.gf b/lib/src/urdu/src/MorphoUrd.gf similarity index 95% rename from lib/src/urdu/transliterated/MorphoUrd.gf rename to lib/src/urdu/src/MorphoUrd.gf index b1e75ad39..1b9636fab 100644 --- a/lib/src/urdu/transliterated/MorphoUrd.gf +++ b/lib/src/urdu/src/MorphoUrd.gf @@ -8,7 +8,7 @@ ---- syntax. To build a lexicon, it is better to use $ParadigmsUrd$, which ---- gives a higher-level access to this module. -- -resource MorphoUrd = ResUrd ** open Prelude,Predef in { +resource MorphoUrd = ResUrd ** open CommonHindustani,Prelude,Predef,ParamX in { flags optimize=all ; coding = utf8; @@ -42,6 +42,7 @@ oper _ + "y" => mkN03 (s); _ + ("aN"|"wN") => mkN04 (s); _ + "w^" => mkN12 (s); + _ + "t" => mkN10 s ; _ => regNoun2 (s) }; regNoun2 : Str -> Noun; @@ -195,7 +196,11 @@ oper -- Proposition - makePrep : Str -> Preposition = \str -> {s = str}; + makePrep : Str -> Str -> Preposition = \s1,s2 -> {s = + table { + Masc => s1; + Fem => s2 + }; } ** { lock_Prep = <>}; ----2 Pronouns PronForm = {s:Pronoun => Str}; diff --git a/lib/src/urdu/transliterated/StructuralUrd.gf b/lib/src/urdu/src/StructuralUrd.gf similarity index 71% rename from lib/src/urdu/transliterated/StructuralUrd.gf rename to lib/src/urdu/src/StructuralUrd.gf index 367ac420a..89e0debd8 100644 --- a/lib/src/urdu/transliterated/StructuralUrd.gf +++ b/lib/src/urdu/src/StructuralUrd.gf @@ -1,45 +1,47 @@ concrete StructuralUrd of Structural = CatUrd ** - open MorphoUrd, ParadigmsUrd, Prelude, NounUrd in { + open MorphoUrd, ParadigmsUrd, Prelude, NounUrd,ParamX,CommonHindustani in { flags optimize=all ; coding = utf8; lin - above_Prep = ss "awpr" ; - after_Prep = ss "kE bed" ; + above_Prep = mkPrep "awpr" "awpr" ; + after_Prep = mkPrep ["kE bed"] ["kE bed"] ; all_Predet = ss "tmam" ; - almost_AdA, almost_AdN = ss "tqryba" ; + almost_AdA, almost_AdN = mkAdN "tqryba" ; although_Subj = ss "agrch-" ; always_AdV = ss "hmyXh" ; and_Conj = sd2 [] "awr" ** {n = Pl} ; because_Subj = ss "kywnkh-" ; - before_Prep = ss "phlE" ; - behind_Prep = ss "pych-E" ; - between_Prep = ss "drmyaN" ; + before_Prep = mkPrep "phlE" "phlE" ; + behind_Prep = mkPrep "pych-E" "pych-E" ; + between_Prep = mkPrep "drmyaN" "drmyaN" ; both7and_DConj = sd2 "dwnwN" "awr" ** {n = Pl} ; but_PConj = ss "lykn" ; - by8agent_Prep = ss "" ; - by8means_Prep = ss "" ; + by8agent_Prep = mkPrep "" "" ; + by8means_Prep = mkPrep "" "" ; can8know_VV,can_VV = mkV "skna" ** { isAux = True} ; - during_Prep = ss ["kE drmyaN"] ; + during_Prep = mkPrep ["kE drmyaN"] ["kE drmyaN"] ; either7or_DConj = sd2 "kwy ayk" "ya" ** {n = Sg} ; everybody_NP = MassNP (UseN (ParadigmsUrd.mkN "hr kwy" "hr kwy" "hr kwy" "hr kwy" "hr kwy" "hr kwy" Masc )); -- not a good way coz need to include NounUrd every_Det = mkDet "hr" "hr" "hr" "hr" Sg; everything_NP = MassNP (UseN (ParadigmsUrd.mkN "hr cyz" "hr cyz" "hr cyzw" "sb cyzyN" "sb cyzwN" "sb cyzw" Masc )); - everywhere_Adv = ss "hr jgh" ; + everywhere_Adv = mkAdv "hr jgh" ; few_Det = mkDet "cnd" "cnd" "cnd" "cnd" Pl ; - for_Prep = ss "kylyE" ; - from_Prep = ss "sE" ; + first_Ord = {s = "pehla" ; n = Sg} ; --DEPRECATED + for_Prep = mkPrep "kylyE" "kylyE" ; + from_Prep = mkPrep "sE" "sE" ; he_Pron = personalPN "wh" "as" "" "as ka" Sg Masc Pers3_Distant ; - here_Adv = ss "yhaN" ; - here7to_Adv = ss ["yhaN pr"] ; - here7from_Adv = ss ["yhaN sE"] ; - how_IAdv = ss "how" ; + here_Adv = mkAdv "yhaN" ; + here7to_Adv = mkAdv ["yhaN pr"] ; + here7from_Adv = mkAdv ["yhaN sE"] ; + how_IAdv = ss "kysE" ; how8many_IDet = makeIDet "ktnE" "ktny" Pl ; + how8much_IAdv = ss "ktna" ; if_Subj = ss "agr" ; - in8front_Prep = ss ["kE samnE"] ; + in8front_Prep = mkPrep ["kE samnE"] ["kE samnE"] ; i_Pron = personalPN "myN" "mjh-" "" "myra" Sg Masc Pers1; - in_Prep = ss "meN" ; + in_Prep = mkPrep "meN" "meN" ; it_Pron = personalPN "yh" "yh" "yh" "as ka" Sg Masc Pers3_Near; less_CAdv = {s = "km" ; p = ""} ; many_Det = mkDet "bht zyadh" "bht zyadh" "bht zyadh" "bht zyadh" Pl ; @@ -60,14 +62,14 @@ concrete StructuralUrd of Structural = CatUrd ** -- } ; -----b no_Phr = ss "no" ; no_Utt = ss "nhyN" ; - on_Prep = ss "pr" ; + on_Prep = mkPrep "pr" "pr" ; -- one_Quant = demoPN "ayk" "ayk" "ayk" ; -- DEPRECATED only_Predet = ss "srf" ; or_Conj = sd2 [] "ya" ** {n = Sg} ; otherwise_PConj = ss "ya ph-r" ; - part_Prep = ss "" ; + part_Prep = mkPrep "" "" ; please_Voc = ss "mhrbani" ; - possess_Prep = ss "ka" ; + possess_Prep = mkPrep "ka" "ky" ; quite_Adv = ss "khamosh" ; she_Pron = personalPN "wh" "as" "wh" "as ky" Sg Fem Pers3_Distant ; so_AdA = ss "so" ; @@ -75,19 +77,19 @@ concrete StructuralUrd of Structural = CatUrd ** someSg_Det = mkDet "kch-" "kch-" "kch-" "kch-" Sg ; somePl_Det = mkDet "kch-" "kch-" "kch-" "kch-" Pl ; something_NP = MassNP (UseN (ParadigmsUrd.mkN "kwy cyz" "kwy cyz" "kwy cyz" "kh- cyzyN" "kh- cyzwN" "kh- cyzw" Masc )); - somewhere_Adv = ss "khin pr" ; + somewhere_Adv = mkAdv ["khin pr"] ; that_Quant = demoPN "wh" "as" "an" ; that_Subj = ss "kh"; - there_Adv = ss "whaN" ; - there7to_Adv = ss "whaN pr" ; - there7from_Adv = ss ["whaN sE"] ; + there_Adv = mkAdv "whaN" ; + there7to_Adv = mkAdv ["whaN pr"] ; + there7from_Adv = mkAdv ["whaN sE"] ; therefore_PConj = ss "as lyE" ; they_Pron = personalPN "wh" "wh" "wh" "an ka" Pl Masc Pers3_Distant ; ---- this_Quant = demoPN "yh" "as" "an"; - through_Prep = ss ["myN sE"] ; + through_Prep = mkPrep ["myN sE"] ["myN sE"] ; too_AdA = ss "bht" ; - to_Prep = ss "kw" ; - under_Prep = ss "nycE" ; + to_Prep = mkPrep "kw" "kw" ; -- ** {lock_Prep = <>}; + under_Prep = mkPrep "nycE" "nycE" ; -- ** {lock_Prep = <>}; very_AdA = ss "bht" ; want_VV = mkV "cahna" ** { isAux = False} ; we_Pron = personalPN "hm" "hm" "hm" "hmara" Pl Masc Pers1 ; @@ -102,8 +104,8 @@ concrete StructuralUrd of Structural = CatUrd ** whoSg_IP = mkIP "kwn" "kis" "kis" Sg Masc ; whoPl_IP = mkIP "kwn" "kn" "knhwN" Pl Masc ; why_IAdv = ss "kywN" ; - without_Prep = ss ["kE bGyr"] ; - with_Prep = ss ["kE sath-"] ; + without_Prep = mkPrep ["kE bGyr"] ["kE bGyr"] ; + with_Prep = mkPrep ["kE sath-"] ["kE sath-"] ; -- yes_Phr = ss "haN" ; yes_Utt = ss "haN" ; youSg_Pron = personalPN "tm" "tm" "tm" "tmh-ara" Sg Masc Pers2_Casual ; @@ -112,10 +114,10 @@ concrete StructuralUrd of Structural = CatUrd ** no_Quant = demoPN " kwy nhyN" "kwy nhyN" "kwy nhyN" ; not_Predet = {s="nhyN"} ; if_then_Conj = sd2 "agr" "tw" ** {n = Sg} ; - at_least_AdN = ss ["km az km"] ; - at_most_AdN = ss ["zyadh sE zyadh"]; + at_least_AdN = mkAdN ["km az km"] ; + at_most_AdN = mkAdN ["zyadh sE zyadh"]; nothing_NP = MassNP (UseN (ParadigmsUrd.mkN "kwy cyz nhyN" "kwy cyz nhyN" "kwy cyz nhyN" "kwy cyz nhyN" "kwy cyz nhyN" "kwy cyz nhyN" Masc )); - except_Prep = ss "swaE" ; + except_Prep = mkPrep "swaE" "swaE" ; nobody_NP = MassNP (UseN (ParadigmsUrd.mkN "kwy nhyN" "kwy nhyN" "kwy nhyN" "kwy nhyN" "kwy nhyN" "kwy nhyN" Masc )); as_CAdv = {s = "etna" ; p = "jtna"} ; diff --git a/lib/src/urdu/translit.gfs b/lib/src/urdu/translit.gfs new file mode 100644 index 000000000..b78d74eb6 --- /dev/null +++ b/lib/src/urdu/translit.gfs @@ -0,0 +1,11 @@ +rf -file=../hindustani/CommonHindustani.gf | ps -env=quotes -to_urdu | wf -file=CommonHindustani.gf +rf -file=../hindustani/ExtraHindustani.gf | ps -env=quotes -to_urdu | wf -file=ExtraHindustani.gf +rf -file=../hindustani/ResHindustani.gf | ps -env=quotes -to_urdu | wf -file=ResHindustani.gf +rf -file=../hindustani/StringsHindustani.gf | ps -env=quotes -to_urdu | wf -file=StringsHindustani.gf +rf -file=src/DiffUrd.gf | ps -env=quotes -to_urdu | wf -file=DiffUrd.gf +rf -file=src/ExtraUrd.gf | ps -env=quotes -to_urdu | wf -file=ExtraUrd.gf +rf -file=src/IdiomUrd.gf | ps -env=quotes -to_urdu | wf -file=IdiomUrd.gf +rf -file=src/LexiconUrd.gf | ps -env=quotes -to_urdu | wf -file=LexiconUrd.gf +rf -file=src/MorphoUrd.gf | ps -env=quotes -to_urdu | wf -file=MorphoUrd.gf +rf -file=src/StructuralUrd.gf | ps -env=quotes -to_urdu | wf -file=StructuralUrd.gf + diff --git a/lib/src/urdu/transliterateUrdu.gfs b/lib/src/urdu/transliterateUrdu.gfs deleted file mode 100644 index 9d6f1ed65..000000000 --- a/lib/src/urdu/transliterateUrdu.gfs +++ /dev/null @@ -1,6 +0,0 @@ -rf -file=transliterated/IdiomUrd.gf | ps -env=quotes -to_urdu | wf -file=IdiomUrd.gf -rf -file=transliterated/LexiconUrd.gf | ps -env=quotes -to_urdu | wf -file=LexiconUrd.gf -rf -file=transliterated/MorphoUrd.gf | ps -env=quotes -to_urdu | wf -file=MorphoUrd.gf -rf -file=transliterated/NumeralUrd.gf | ps -env=quotes -to_urdu | wf -file=NumeralUrd.gf -rf -file=transliterated/ResUrd.gf | ps -env=quotes -to_urdu | wf -file=ResUrd.gf -rf -file=transliterated/StructuralUrd.gf | ps -env=quotes -to_urdu | wf -file=StructuralUrd.gf diff --git a/lib/src/urdu/transliterated/NumeralUrd.gf b/lib/src/urdu/transliterated/NumeralUrd.gf deleted file mode 100644 index 70059c3e9..000000000 --- a/lib/src/urdu/transliterated/NumeralUrd.gf +++ /dev/null @@ -1,127 +0,0 @@ -concrete NumeralUrd of Numeral = CatUrd ** open ResUrd in { --- By Harald Hammarstrm --- Modification for Urdu Shafqat Virk - flags coding=utf8 ; ---- still old Devanagari coding - - -param DForm = unit | ten ; -param DSize = sg | r2 | r3 | r4 | r5 | r6 | r7 | r8 | r9 ; -param Size = sing | less100 | more100 ; - -oper LinDigit = {s : DForm => Str ; size : DSize ; n : Number} ; - - -lincat Dig = { s:Str ; n : Number}; -lincat Digit = LinDigit ; -lincat Sub10 = {s : DForm => Str ; size : DSize ; n : Number} ; -lincat Sub100 = {s : Str ; size : Size ; n : Number} ; -lincat Sub1000 = {s : Str ; s2 : Str ; size : Size ; n : Number } ; -lincat Sub1000000 = { s : Str ; n : Number } ; - -lin num x0 = - {s = table { - NCard => x0.s ; - NOrd => x0.s ++ "waN" -- need to use mkOrd which will make irregular ordinals but it gives path error - }; - n = x0.n - } ; -oper mkOrd : Str -> Str = - \s -> case s of { - "ek" => "phla"; - "do" => "dwsra"; - "ti:n" => "tesra"; - "ca:r" => "cwth-a"; - ("cHah"|"cHa"|"cHai") => "ch-Ta"; - _ => s ++ "waN" - }; --- {s = \\_ => x0.s ; n = x0.n} ; - - -oper mkNum : Str -> Str -> DSize -> LinDigit = - \do -> \bis -> \sz -> - {s = table {unit => do ; ten => bis } ; - size = sz ; n = Pl} ; - -lin n2 = mkNum "dw" "bys" r2 ; -lin n3 = mkNum "tyn" "tys" r3 ; -lin n4 = mkNum "car" "calys" r4 ; -lin n5 = mkNum "panc" "pcas" r5 ; -lin n6 = mkNum "ch-" "sath-" r6 ; -lin n7 = mkNum "sat" "str" r7; -lin n8 = mkNum "Ath-" "asy" r8; -lin n9 = mkNum "nw" "nwE" r9 ; - -oper mkR : Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> DSize => Str = \a1 -> \a2 -> \a3 -> \a4 -> \a5 -> \a6 -> \a7 -> \a8 -> \a9 -> table { - sg => a1 + "ah" ; - r2 => a2 + "i:s" ; - r3 => a3 + "ti:s" ; - r4 => a4 + "a:li:s" ; - r5 => a5 + "an" ; - r6 => a6 + "saTH" ; - r7 => a7 + "hattar" ; - r8 => a8 + "a:si:" ; - r9 => a9 + "a:nave" -} ; - -oper rows : DSize => DSize => Str = table { - sg => mkR "gyarh" "ikk" "ikat" "ekt" "ikyaw" "ik" "ik" "iky" "iky" ; - r2 => mkR "barh" "bay" "bat" "bay" "baw" "ba" "ba" "bay" "b" ; - r3 => mkR "tyr" "ty" "tyn" "tnt" "trp" "try" "t" "tr" "tr" ; - r4 => mkR "cwd" "cwb" "cwn" "cwa" "cww" "cwn" "cwh" "cwr" "cwr" ; - r5 => mkR "pnd" "pcy" "pyn" "pnta" "pcp" "pyn" "ph" "pc" "pc" ; - r6 => mkR "swl" "ch-b" "ch-t" "ch-y" "ch-p" "ch-ya" "ch-" "ch-y" "ch-y" ; - r7 => mkR "str" "sta" "syn" "snt" "staw" "sta" "sr" "st" "sta" ; - r8 => mkR "ath-ar" "ath-ay" "aR" "aRt" "ath-aw" "aR" "ath-" "ath-" "ath-" ; - r9 => table {sg => "anys" ; r2 => "antys" ; r3 => "antalys" ; - r4 => "ancas" ; r5 => "ansth-" ; r6 => "anhtr" ; - r7 => "anasy" ; - r8 => "ananwE" ; r9 => "nnanwE" } -} ; - -oper ss : Str -> {s : Str} = \s -> {s = s} ; - -lin pot01 = {s = table {unit => "ayk" ; _ => "dummy" } ; size = sg ; n = Sg} ; -lin pot0 d = d ; -lin pot110 = {s = "das" ; size = less100 ; n = Pl} ; -lin pot111 = {s = rows ! sg ! sg ; size = less100 ; n = Pl} ; -lin pot1to19 d = {s = rows ! d.size ! sg ; size = less100 ; n = d.n} ; -lin pot0as1 n = {s = n.s ! unit ; size = table {sg => sing ; _ => less100} ! n.size ; n = n.n } ; - -lin pot1 d = {s = d.s ! ten ; size = less100 ; n = d.n} ; -lin pot1plus d e = {s = rows ! e.size ! d.size ; size = less100 ; n = d.n} ; - -lin pot1as2 n = {s = n.s ; s2 = "dummy" ; size = n.size ; n = n.n} ; -lin pot2 d = {s = (mksau (d.s ! unit) d.size) ; - s2 = d.s ! unit ++ "lakh-" ; size = more100 ; n = d.n} ; -lin pot2plus d e = - {s = (mksau (d.s ! unit) d.size) ++ e.s ; - s2 = (d.s ! unit) ++ "lakh-" ++ (mkhazar e.s e.size) ; - size = more100 ; n = d.n} ; - -lin pot2as3 n = {s = n.s ; n = n.n} ; -lin pot3 n = {s = table { sing => ekhazar ; - less100 => n.s ++ "hzar" ; - more100 => n.s2 } ! n.size ; n = n.n} ; -lin pot3plus n m = - {s = table {sing => ekhazar ; - less100 => n.s ++ "hzar" ; - more100 => n.s2 } ! n.size ++ m.s ; n = n.n} ; - -lin D_0 = { s = "0" ; n = Sg}; -lin D_1 = { s = "1" ; n = Sg}; -lin D_2 = { s = "2" ; n = Pl}; -lin D_3 = { s = "3" ; n = Pl}; -lin D_4 = { s = "4" ; n = Pl}; -lin D_5 = { s = "5" ; n = Pl}; -lin D_6 = { s = "6" ; n = Pl}; -lin D_7 = { s = "7" ; n = Pl}; -lin D_8 = { s = "8" ; n = Pl}; -lin D_9 = { s = "9" ; n = Pl}; -lin IDig d = { s = \\_ => d.s ; n = d.n} ; -lin IIDig d dg = { s = \\df => dg.s ! df ++ d.s ; n = Pl }; -- need to use + rather than ++, but gives error need to discuss - -oper ekhazar : Str = variants {"hzar" ; "ayk" ++ "hzar"} ; -oper mkhazar : Str -> Size -> Str = \s -> \sz -> table {sing => ekhazar ; _ => s ++ "hzar"} ! sz ; -oper mksau : Str -> DSize -> Str = \s -> \sz -> table {sg => "sw" ; _ => s ++ "sw"} ! sz ; -} diff --git a/lib/src/urdu/transliterated/ResUrd.gf b/lib/src/urdu/transliterated/ResUrd.gf deleted file mode 100644 index 330cfc5d6..000000000 --- a/lib/src/urdu/transliterated/ResUrd.gf +++ /dev/null @@ -1,641 +0,0 @@ ---# -path=.:../abstract:../common:../../prelude --- ---1 Urdu auxiliary operations. --- --- This module contains operations that are needed to make the --- resource syntax work. - -resource ResUrd = ParamX ** open Prelude,Predef in { - - flags optimize=all ; - coding = utf8; - - param - Case = Dir | Obl | Voc ; - Gender = Masc | Fem ; - VTense = Subj | Perf | Imperf; - UPerson = Pers1 - | Pers2_Casual - | Pers2_Familiar - | Pers2_Respect - | Pers3_Near - | Pers3_Distant; - - Order = ODir | OQuest ; - ---2 For $Relative$ - - RAgr = RNoAg | RAg Agr ; - RCase = RC Number Case ; - --- for Numerial - - CardOrd = NCard | NOrd ; - - ----------------------------------------- - -- Urd Pronouns - ----------------------------------------- - - Pronoun = P Number Gender Case UPerson; - PersPronForm = PPF Number UPerson Case; - -------------------------------------------- ---Verbs -------------------------------------------- - - VerbForm = VF VTense UPerson Number Gender - | Inf - | Root - | Inf_Obl - | Inf_Fem; - oper - Noun = {s : Number => Case => Str ; g : Gender} ; - Verb = {s : VerbForm => Str} ; - Preposition = {s : Str}; - DemPronForm = {s : Number => Gender => Case => Str}; - PossPronForm = {s : Number => Gender => Case => Str}; - Determiner = {s : Number => Gender => Str ; n : Number}; - --- a useful oper - eq : Str -> Str -> Bool = \s1,s2-> (pbool2bool (eqStr s1 s2)) ; - - ----------------------------------------------- - -- Urd Adjectives - ----------------------------------------------- - - Adjective = { s: Number => Gender => Case => Degree => Str }; - - - mkAdjective : (x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20,x21,x22,x23,x24,x25,x26,x27,x28,x29,x30,x31,x32,x33,x34,x35,x36:Str) -> Adjective = - \y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13,y14,y15,y16,y17,y18,y19,y20,y21,y22,y23,y24,y25,y26,y27,y28,y29,y30,y31,y32,y33,y34,y35,y36 -> { - s = table { - Sg => table { - Masc => table { - Dir => table { - Posit => y1 ; - Compar => y2 ; - Superl => y3 - }; - Obl => table { - Posit => y4 ; - Compar => y5 ; - Superl => y6 - }; - Voc => table { - Posit => y7 ; - Compar => y8 ; - Superl => y9 - } - }; - Fem => table { - Dir => table { - Posit => y10 ; - Compar => y11 ; - Superl => y12 - }; - Obl => table { - Posit => y13 ; - Compar => y14 ; - Superl => y15 - }; - Voc => table { - Posit => y16 ; - Compar => y17 ; - Superl => y18 - } - } - }; - Pl => table { - Masc => table { - Dir => table { - Posit => y19 ; - Compar => y20 ; - Superl => y21 - }; - Obl => table { - Posit => y22 ; - Compar => y23 ; - Superl => y24 - }; - Voc => table { - Posit => y25 ; - Compar => y26 ; - Superl => y27 - } - }; - Fem => table { - Dir => table { - Posit => y28 ; - Compar => y29 ; - Superl => y30 - }; - Obl => table { - Posit => y31 ; - Compar => y32 ; - Superl => y33 - }; - Voc => table { - Posit => y34 ; - Compar => y35 ; - Superl => y36 - } - } - } - } - }; - - - regAdjective : Str -> Adjective; - regAdjective x = case x of { - acch + ("a"|"aN") => mkAdjective x ("bht" ++ x) ("sab sE" ++ x) (acch + "E") ("bht" ++ acch + "E") ("sab sE" ++ acch + "E") (acch + "E") ("bht" ++ acch + "E") ("sab sE" ++ acch + "E") - (acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y") (acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y") (acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y") - (acch +"E") ("bht" ++ acch + "E") ("sab sE" ++ acch + "E") (acch + "E") ("bht" ++ acch + "E") ("sab sE" ++ acch + "E") (acch + "E") ("bht" ++ acch + "E") ("sab sE" ++ acch + "E") - (acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y") (acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y") (acch + "y") ("bht" ++ acch + "y") ("sab sE" ++ acch + "y"); - - _ => mkAdjective x x x x x x x x x - x x x x x x x x x - x x x x x x x x x - x x x x x x x x x - }; - - - - RefPron : Str; - RefPron = "Kwd"; - - ---------------------------------------------------------- - -- Grammar part - ---------------------------------------------------------- - - param - Agr = Ag Gender Number UPerson ; - NPCase = NPC Case | NPObj | NPErg ; - - oper - np2pronCase : (Case => Str) -> NPCase -> Str = \ppf,npc -> case npc of { - NPC c => ppf ! c; - NPObj => ppf ! Dir ; - NPErg => ppf ! Obl ++ "ne" - } ; - - toNP : ( Case => Str) -> NPCase -> Str = \pn, npc -> case npc of { - NPC c => pn ! c ; - NPObj => pn ! Dir ; - NPErg => pn ! Obl ++ "ne" - } ; - detcn2NP : (Determiner) -> Noun -> NPCase -> Number -> Str = \dt,cn,npc,nn -> case npc of { - NPC c => dt.s ! Sg ! Masc ++ cn.s ! nn ! Dir ; - NPObj => dt.s ! Sg ! Masc ++ cn.s ! nn ! Dir ; - NPErg => dt.s ! Sg ! Masc ++ cn.s ! nn ! Obl ++ "ne" - } ; - det2NP : (Determiner) -> NPCase -> Str = \dt,npc -> case npc of { - NPC c => dt.s ! Sg ! Masc ; - NPObj => dt.s ! Sg ! Masc ; - NPErg => dt.s ! Sg ! Masc ++ "ne" - } ; - ------------------------------------------- --- Agreement transformations ------------------------------------------ - toAgr : Number -> UPerson -> Gender -> Agr = \n,p,g -> - Ag g n p; - - - fromAgr : Agr -> {n : Number ; p : UPerson ; g : Gender} = \a -> case a of { - Ag g n p => {n = n ; p = p ; g = g} - } ; - - conjAgr : Agr -> Agr -> Agr = \a0,b0 -> - let a = fromAgr a0 ; b = fromAgr b0 - in - toAgr - (conjNumber a.n b.n) - b.p a.g; - - giveNumber : Agr -> Number =\a -> case a of { - Ag _ n _ => n - }; - giveGender : Agr -> Gender =\a -> case a of { - Ag g _ _ => g - }; - - defaultAgr : Agr = agrP3 Masc Sg ; - agrP3 : Gender -> Number -> Agr = \g,n -> Ag g n Pers3_Distant ; - personalAgr : Agr = agrP1 Masc Sg ; - agrP1 : Gender -> Number -> Agr = \g,n -> Ag g n Pers1 ; - - param - CPolarity = - CPos - | CNeg Bool ; -- contracted or not - - oper - contrNeg : Bool -> Polarity -> CPolarity = \b,p -> case p of { - Pos => CPos ; - Neg => CNeg b - } ; - - NP : Type = {s : NPCase => Str ; a : Agr} ; - - param - CTense = CPresent | CPast | CFuture ; - - oper - copula : CTense -> Number -> UPerson -> Gender -> Str = \t,n,p,g -> - case of { - => "hwN" ; - => "hE" ; - => "hw" ; - => "hyN" ; - => "hE" ; - => "hE" ; - => "hyN" ; - => "hw" ; - => "hw" ; - => "hyN" ; - => "hyN" ; - => "hyN" ; - => "th-a" ; - => "th-y" ; - => "th-a" ; - => "th-y" ; - => "th-a" ; - => "th-y" ; - => "th-E" ; - => "th-yN" ; - => "th-a" ; - => "th-y" ; - => "th-a" ; - => "th-y" ; - => "th-E" ; - => "th-yN" ; - => "th-E" ; - => "th-yN" ; - => "th-E" ; - => "th-yN" ; - => "th-E" ; - => "th-yN" ; - => "th-E" ; - => "th-yN" ; - => "th-E" ; - => "th-yN" ; - => "ga" ; - => "gy" ; - => "ga" ; - => "gi" ; - => "gE" ; - => "gy" ; - => "gE" ; - => "gy" ; - => "ga" ; - => "gy" ; - => "ga" ; - => "gy" ; - => "gE" ; - => "gy" ; - => "gE" ; - => "gy" ; - => "gE" ; - => "gy" ; - => "gE" ; - => "gy" ; - => "gE" ; - => "gE" ; - => "gE" ; - => "gy" - - - } ; - - param - VPPTense = - VPPres - |VPPast - |VPFutr; - - VPHTense = - VPGenPres -- impf hum nahim "I go" - | VPImpPast -- impf Ta nahim "I went" - | VPFut -- fut na/nahim "I shall go" - | VPContPres -- stem raha hum nahim "I am going" - | VPContPast -- stem raha Ta nahim "I was going" - | VPContFut - | VPPerfPres -- perf hum na/nahim "I have gone" - | VPPerfPast -- perf Ta na/nahim "I had gone" - | VPPerfFut - | VPPerfPresCont - | VPPerfPastCont - | VPPerfFutCont - | VPSubj -- subj na "I may go" - ; - - VPHForm = - VPTense VPPTense Agr -- 9 * 12 - | VPReq - | VPImp - | VPReqFut - | VPInf - | VPStem - ; - - VType = VIntrans | VTrans | VTransPost ; - - oper - - objVType : VType -> NPCase = \vt -> case vt of { - VTrans => NPObj ; - _ => NPC Obl - } ; - - VPH : Type = { - s : VPHForm => {fin, inf : Str} ; - obj : {s : Str ; a : Agr} ; - subj : VType ; - comp : Agr => Str; - inf : Str; - ad : Str; - embComp : Str ; - } ; - - VPHSlash = VPH ** {c2 : Compl} ; - - Compl : Type = {s : Str ; c : VType} ; - - predV : Verb -> VPH = \verb -> { - s = \\vh => - case vh of { - VPTense VPPres (Ag g n p) => {fin = copula CPresent n p g ; inf = verb.s ! VF Imperf p n g } ; - VPTense VPPast (Ag g n p) => {fin = [] ; inf =verb.s ! VF Perf p n g} ; - VPTense VPFutr (Ag g n p) => {fin = copula CFuture n p g ; inf = verb.s ! VF Subj p n g } ; - VPStem => {fin = [] ; inf = verb.s ! Root}; - _ => {fin = [] ; inf = verb.s ! Root} - }; - obj = {s = [] ; a = defaultAgr} ; - subj = VTrans ; - inf = verb.s ! Inf; - ad = []; - embComp = []; - comp = \\_ => [] - } ; - - predVc : (Verb ** {c2,c1 : Str}) -> VPHSlash = \verb -> - predV verb ** {c2 = {s = verb.c1 ; c = VTrans} } ; - - - raha : Gender -> Number -> Str = \g,n -> - (regAdjective "rha").s ! n ! g ! Dir ! Posit ; - - cka : Gender -> Number -> Str = \g,n -> - (regAdjective "cka").s ! n ! g ! Dir ! Posit ; - - hw : UPerson -> Number -> Str = \pp,n -> - case of { - => "hwN"; - <_,Pl> => "hwN"; - <_,_> => "hw" - }; - - predAux : Aux -> VPH = \verb -> { - s = \\vh => - let - - inf = verb.inf ; - part = verb.ppart ; - - in - case vh of { - VPTense VPPres (Ag g n p) => {fin = copula CPresent n p g ; inf = part } ; - VPTense VPPast (Ag g n p) => {fin = copula CPast n p g ; inf = part } ; - VPTense VPFutr (Ag g n p) => {fin = copula CFuture n p g ; inf = part ++ hw p n } ; - VPStem => {fin = [] ; inf = "rh" }; - _ => {fin = part ; inf = [] } - }; - obj = {s = [] ; a = defaultAgr} ; - subj = VIntrans ; - inf = verb.inf; - ad = []; - embComp = []; - comp = \\_ => [] - } ; - - Aux = { - inf,ppart,prpart : Str - } ; - - auxBe : Aux = { - inf = "" ; - ppart = "" ; - prpart = "" - } ; - - Clause : Type = {s : VPHTense => Polarity => Order => Str} ; - mkClause : NP -> VPH -> Clause = \np,vp -> { - s = \\vt,b,ord => - let - subjagr : NPCase * Agr = case vt of { - VPImpPast => case vp.subj of { - VTrans => ; - VTransPost => ; - _ => - } ; - _ => - } ; - subj = subjagr.p1 ; - agr = subjagr.p2 ; - n = (fromAgr agr).n; - p = (fromAgr agr).p; - g = (fromAgr agr).g; - vps = case vt of { - - VPGenPres => vp.s ! VPTense VPPres agr ; - VPImpPast => vp.s ! VPTense VPPast agr ; - VPFut => vp.s ! VPTense VPFutr agr ; - VPContPres => - {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; - VPContPast => - {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; - VPContFut => - {fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ raha g n ++ hw p n} ; - VPPerfPres => - {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ cka g n } ; - VPPerfPast => - {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ cka g n } ; - VPPerfFut => - {fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ cka g n ++ hw p n } ; - VPPerfPresCont => - {fin = copula CPresent n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n } ; - VPPerfPastCont => - {fin = copula CPast n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n } ; - VPPerfFutCont => - {fin = copula CFuture n p g ; inf = (vp.s ! VPTense VPPres agr).inf ++ raha g n ++ hw p n } ; - VPSubj => {fin = insertSubj p (vp.s ! VPStem).inf ; inf = "xayd" } - - }; - - - quest = - case ord of - { ODir => []; - OQuest => "kya" }; - na = - case b of - { Pos => []; - Neg => "na" }; - nahim = - case b of - { Pos => []; - Neg => "nhyN" }; - in - case vt of { - VPSubj => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ na ++ vps.inf ++ vps.fin ++ vp.embComp ; - _ => quest ++ np.s ! subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! np.a ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp}; - - } ; - - mkSClause : Str -> Agr -> VPH -> Clause = - \subj,agr,vp -> { - s = \\t,b,ord => - let - n = (fromAgr agr).n; - p = (fromAgr agr).p; - g = (fromAgr agr).g; - vps = case t of { - VPGenPres => vp.s ! VPTense VPPres agr ; - VPImpPast => vp.s ! VPTense VPPast agr ; - VPFut => vp.s ! VPTense VPFutr agr ; - VPContPres => - {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; - VPContPast => - {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; - VPContFut => - {fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ raha g n ++ hw p n } ; - VPPerfPres => - {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ cka g n } ; - VPPerfPast => - {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ cka g n } ; - VPPerfFut => - {fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ cka g n ++ hw p n } ; - VPPerfPresCont => - {fin = copula CPresent n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; - VPPerfPastCont => - {fin = copula CPast n p g ; inf = (vp.s ! VPStem).inf ++ raha g n } ; - VPPerfFutCont => - {fin = copula CFuture n p g ; inf = (vp.s ! VPStem).inf ++ raha g n ++ hw p n } ; - VPSubj => {fin = insertSubj p (vp.s ! VPStem).inf ; inf = "xayd" } - - }; - - quest = - case ord of - { ODir => []; - OQuest => "kya" }; - na = - case b of - { Pos => []; - Neg => "na" }; - nahim = - case b of - { Pos => []; - Neg => "nhyN" }; - in - case t of { - VPSubj => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ na ++ vps.inf ++ vps.fin ++ vp.embComp; - _ => quest ++ subj ++ vp.obj.s ++ vp.ad ++ vp.comp ! agr ++ nahim ++ vps.inf ++ vps.fin ++ vp.embComp}; - } ; - - insertSubj : UPerson -> Str -> Str = \p,s -> - case p of { Pers1 => s ++ "wN" ; _ => s ++ "E"}; - - insertObj : (Agr => Str) -> VPH -> VPH = \obj1,vp -> { - s = vp.s ; - obj = vp.obj ; - subj = vp.subj ; - inf = vp.inf; - ad = vp.ad; - embComp = vp.embComp; - comp = \\a => vp.comp ! a ++ obj1 ! a - } ; - insertVV : Str -> VPH -> VPH = \obj1,vp -> { - s = vp.s ; - obj = vp.obj ; - subj = vp.subj ; - inf = vp.inf; - ad = vp.ad; - embComp = vp.embComp; - comp = \\a => vp.comp ! a ++ obj1 - } ; - - insertObj2 : (Str) -> VPH -> VPH = \obj1,vp -> { - s = vp.s; - obj = vp.obj ; - subj = vp.subj ; - inf = vp.inf; - ad = vp.ad; - embComp = vp.embComp ++ obj1; - comp = vp.comp - - } ; - - insertObjc : (Agr => Str) -> VPHSlash -> VPHSlash = \obj,vp -> - insertObj obj vp ** {c2 = vp.c2} ; - insertObjc2 : Str -> VPHSlash -> VPHSlash = \obj,vp -> - insertObj2 obj vp ** {c2 = vp.c2} ; - - infVP : Bool -> VPH -> Agr -> Str = \isAux,vp,a -> - vp.obj.s ++ vp.inf ++ vp.comp ! a ; - infVV : Bool -> VPH -> Str = \isAux,vp -> - case isAux of {False => vp.inf ; True => (vp.s ! VPImp).fin }; - - insertObject : NP -> VPHSlash -> VPH = \np,vps -> { - s = vps.s ; - obj = {s = vps.obj.s ++ np.s ! objVType vps.c2.c ++ vps.c2.s ; a = np.a} ; - subj = vps.c2.c ; - inf = vps.inf; - ad = vps.ad; - embComp = vps.embComp; - comp = vps.comp - } ; - - insertObjPre : (Agr => Str) -> VPHSlash -> VPH = \obj,vp -> { - s = vp.s ; - obj = vp.obj ; - inf = vp.inf ; - subj = vp.subj ; - ad = vp.ad ; - embComp = vp.embComp; - comp = \\a => obj ! a ++ vp.c2.s ++ vp.comp ! a - } ; - - insertAdV : Str -> VPH -> VPH = \ad,vp -> { - s = vp.s ; - obj = vp.obj ; - inf = vp.inf ; - subj = vp.subj; - ad = vp.ad ++ ad ; - embComp = vp.embComp; - comp = vp.comp - } ; - conjThat : Str = "kh" ; - --- strings collected from syntax files, AR - -oper - sE_Str = "sE" ; - ka_Str = "ka" ; - hr_kwy_Str = "hr kwy" ; - rakh6na_Str = "rakh-na" ; - comma_Str = "," ; - agr_Str = "agr" ; - nE_Str = "nE" ; - jw_Str = "jw" ; - js_Str = "js" ; - jn_Str = "jn" ; - mt_Str = "mt" ; - nh_Str = "nh" ; - waN_Str = "waN" ; - awr_Str = "awr" ; - ky_Str = "ky" ; - kw_Str = "kw" ; - -} -