1
0
forked from GitHub/gf-core

some fixes in Hindi and Finnish

This commit is contained in:
aarne
2008-06-24 20:40:21 +00:00
parent a0953a6c94
commit 06eb01ac7e
11 changed files with 111 additions and 79 deletions

View File

@@ -206,8 +206,8 @@ PhrUtt NoPConj (UttS (UseCl TPres ASimul PPos (PredVP (DetCN every_Det (UseN bab
PhrUtt NoPConj (UttAdv (ConjAdv either7or_DConj (ConsAdv here7from_Adv (BaseAdv there_Adv everywhere_Adv)))) NoVoc
PhrUtt NoPConj (UttVP (PassV2 know_V2)) NoVoc
RelCN (UseN bird_N) (UseRCl TPres ASimul PPos (RelSlash IdRP (SlashVP (UsePron i_Pron) (SlashVV want_VV (SlashV2A paint_V2A (PositA red_A))))))
UttImpSg PPos (ImpVP (ComplSlash (SlashVV want_VV (SlashV2a buy_V2)) (UsePron it_Pron)))
UttImpSg PPos (ImpVP (ComplSlash (SlashVV want_VV (SlashV2A paint_V2A (PositA red_A))) (UsePron it_Pron)))
UttImpSg PPos (ImpVP (ComplVV want_VV (ComplSlash (SlashV2a buy_V2) (UsePron it_Pron))))
UttImpSg PPos (ImpVP (ComplVV want_VV (ComplSlash (SlashV2A paint_V2A (PositA red_A)) (UsePron it_Pron))))
UttImpSg PPos (ImpVP (ComplSlash (SlashVV want_VV (SlashV2VNP beg_V2V (UsePron i_Pron) (SlashV2a buy_V2))) (UsePron it_Pron)))
PhrUtt NoPConj (UttS (UseCl TPres ASimul PPos (PredVP (DetArtPl DefArt (UseN fruit_N)) (ReflVP (Slash3V3 sell_V3 (DetArtSg DefArt (UseN road_N))))))) NoVoc
PhrUtt NoPConj (UttS (UseCl TPres ASimul PPos (PredVP (UsePron i_Pron) (ReflVP (SlashV2V beg_V2V (UseV live_V)))))) NoVoc
@@ -215,3 +215,6 @@ PhrUtt NoPConj (UttS (UseCl TPres ASimul PPos (PredVP (UsePron i_Pron) (ReflVP (
PhrUtt NoPConj (UttImpSg PPos (ImpVP (ReflVP (SlashV2Q ask_V2Q (UseQCl TPast ASimul PPos (QuestVP whoSg_IP (UseV come_V))))))) NoVoc
PhrUtt NoPConj (UttS (UseCl TPast ASimul PPos (PredVP (UsePron i_Pron) (ReflVP (SlashV2A paint_V2A (ComparA beautiful_A (UsePN john_PN))))))) NoVoc
-- more long examples
UttS (UseCl TPres ASimul PPos (PredVP (DetCN (DetQuant this_Quant NumSg) (UseN grammar_N)) (ComplSlash (SlashV2a speak_V2) (DetCN (DetArtCard IndefArt (NumNumeral (num (pot2as3 (pot1as2 (pot1to19 n2)))))) (UseN language_N)))))

View File

@@ -91,8 +91,8 @@ concrete CatFin of Cat = CommonX ** open ResFin, Prelude in {
A2 = {s : Degree => AForm => Str ; c2 : Compl} ;
N = {s : NForm => Str} ;
N2 = {s : NForm => Str} ** {c2 : Compl} ;
N3 = {s : NForm => Str} ** {c2,c3 : Compl} ;
N2 = {s : NForm => Str} ** {c2 : Compl ; isPre : Bool} ;
N3 = {s : NForm => Str} ** {c2,c3 : Compl ; isPre,isPre2 : Bool} ;
PN = {s : Case => Str} ;
oper Verb1 = {s : VForm => Str ; sc : NPForm ; qp : Str} ;

View File

@@ -203,22 +203,25 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
Use2N3 f = {
s = f.s ;
c2 = f.c2
c2 = f.c2 ;
isPre = f.isPre
} ;
Use3N3 f = {
s = f.s ;
c2 = f.c3
c2 = f.c3 ;
isPre = f.isPre2
} ;
--- If a possessive suffix is added here it goes after the complements...
ComplN2 f x = {
s = \\nf => f.s ! nf ++ appCompl True Pos f.c2 x
s = \\nf => preOrPost f.isPre (f.s ! nf) (appCompl True Pos f.c2 x)
} ;
ComplN3 f x = {
s = \\nf => f.s ! nf ++ appCompl True Pos f.c2 x ;
c2 = f.c3
s = \\nf => preOrPost f.isPre (f.s ! nf) (appCompl True Pos f.c2 x) ;
c2 = f.c3 ;
isPre = f.isPre2
} ;
AdjCN ap cn = {

View File

@@ -418,9 +418,18 @@ oper
mkN2 : N -> Prep -> N2 = mmkN2
} ;
mmkN2 : N -> Prep -> N2 = \n,c -> n ** {c2 = c ; lock_N2 = <>} ;
mkN3 = \n,c,e -> n ** {c2 = c ; c3 = e ; lock_N3 = <>} ;
mmkN2 : N -> Prep -> N2 = \n,c -> n ** {c2 = c ; isPre = mkIsPre c ; lock_N2 = <>} ;
mkN3 = \n,c,e -> n ** {c2 = c ; c3 = e ;
isPre = mkIsPre c ; -- matka Lontoosta Pariisiin
isPre2 = mkIsPre e ; -- Suomen voitto Ruotsista
lock_N3 = <>
} ;
mkIsPre : Prep -> Bool = \p -> case p.c of {
NPCase Gen => notB p.isPre ; -- Jussin veli (prep is <Gen,"",True>, isPre becomes False)
_ => True -- syyte Jussia vastaan, puhe Jussin puolesta
} ;
mkPN = overload {
mkPN : Str -> PN = mkPN_1 ;
mkPN : N -> PN = \s -> {s = \\c => s.s ! NCase Sg c ; lock_PN = <>} ;

View File

@@ -1618,36 +1618,36 @@ LangIna: ave que io wan pinger in rubie
LangIta: uccello che voglio pingere in rosso
LangNor: fugl som jeg vil male rød
LangSwe: fågel som jag vill måla röd
Lang: UttImpSg PPos (ImpVP (ComplSlash (SlashVV want_VV (SlashV2a buy_V2)) (UsePron it_Pron)))
LangDan: villed det købe
LangEng: want it to buy
LangFin: tahdo sen ostaa
LangFre: veux - l' acheter
Lang: UttImpSg PPos (ImpVP (ComplVV want_VV (ComplSlash (SlashV2a buy_V2) (UsePron it_Pron))))
LangDan: villed købe det
LangEng: want to buy it
LangFin: tahdo ostaa se
LangFre: veux l' acheter
LangGer: woll es kaufen
LangIna: wan lo compra
LangIta: vuoi &+ lo comprare
LangNor: villed det kjøpe
LangSwe: vilj det köpa
Lang: UttImpSg PPos (ImpVP (ComplSlash (SlashVV want_VV (SlashV2A paint_V2A (PositA red_A))) (UsePron it_Pron)))
LangDan: villed det male rød
LangEng: want it to paint red
LangFin: tahdo sen maalata punaiseksi
LangFre: veux - le peindre en rouge
LangIta: vuoi comprar &+ lo
LangNor: villed kjøpe det
LangSwe: vilj köpa det
Lang: UttImpSg PPos (ImpVP (ComplVV want_VV (ComplSlash (SlashV2A paint_V2A (PositA red_A)) (UsePron it_Pron))))
LangDan: villed male det rødt
LangEng: want to paint it red
LangFin: tahdo maalata se punaiseksi
LangFre: veux le peindre en rouge
LangGer: woll es rot malen
LangIna: wan lo pinger in rubie
LangIta: vuoi &+ lo pingere in rosso
LangNor: villed det male rød
LangSwe: vilj det måla röd
LangIta: vuoi pinger &+ lo in rosso
LangNor: villed male det rødt
LangSwe: vilj måla det rött
Lang: UttImpSg PPos (ImpVP (ComplSlash (SlashVV want_VV (SlashV2VNP beg_V2V (UsePron i_Pron) (SlashV2a buy_V2))) (UsePron it_Pron)))
LangDan: villed det bede mig at købe
LangEng: want it to beg me to buy
LangFin: tahdo sen pyytää minua ostamaan
LangFre: veux - le me demander acheter
LangGer: woll es mich bitten zu kaufen
LangIna: wan lo me rogar compra
LangIta: vuoi &+ lo pregar &+ mi comprare
LangNor: villed det be meg att kjøpe
LangSwe: vilj det be mig att köpa
LangDan: villed bede mig at købe det
LangEng: want to beg me to buy it
LangFin: tahdo pyytää minua ostamaan se
LangFre: veux me demander l' acheter
LangGer: woll mich bitten es zu kaufen
LangIna: wan me rogar lo compra
LangIta: vuoi pregar &+ mi comprar &+ lo
LangNor: villed be meg att kjøpe det
LangSwe: vilj be mig att köpa det
Lang: PhrUtt NoPConj (UttS (UseCl TPres ASimul PPos (PredVP (DetArtPl DefArt (UseN fruit_N)) (ReflVP (Slash3V3 sell_V3 (DetArtSg DefArt (UseN road_N))))))) NoVoc
LangDan: frugterne sælger sig til vejen
LangEng: the fruits sell themselves to the road
@@ -1698,3 +1698,6 @@ LangIna: io pingeva me in plus belle que John
LangIta: mi pingevo in più bello che Giovanni
LangNor: jeg mala meg vakkerere enn John
LangSwe: jag målade mig vackrare än Johan
Lang: UttImpSg PPos (ImpVP (ComplVV (ComplVV want_VV (ComplSlash (SlashV2a buy_V2) (UsePron it_Pron)))))

View File

@@ -49,13 +49,14 @@ concrete CatHin of Cat = CommonX ** open ResHin, Prelude in {
---- Noun
--
CN = ResHin.Noun ;
NP, Pron = ResHin.NP ;
-- Det = {s : Str ; n : Number} ;
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 ; hasCard : Bool} ;
Num = {s : Str ; n : Number} ;
-- Card = {s : Str; n : Number} ;
-- Quant = {s : Number => Str} ;
-- Art = {s : Bool => Number => Str} ;
Quant = {s : Number => Gender => Case => Str} ;
Art = {s : Str} ;
--
---- Numeral
--

View File

@@ -356,7 +356,7 @@ concrete LexiconHin of Lexicon = CatHin **
-- rule_N = regN "rule" ;
--
---- added 4/6/2007
-- john_PN = mkPN (mkN masculine (mkN "John")) ;
john_PN = mkPN "jon" ;
-- question_N = regN "question" ;
-- ready_A = regA "ready" ;
-- reason_N = regN "reason" ;

View File

@@ -3,13 +3,13 @@ concrete NounHin of Noun = CatHin ** open ResHin, Prelude in {
flags optimize=all_subs ;
lin
-- DetCN det cn = {
-- s = \\c => det.s ++ cn.s ! det.n ! c ;
-- a = agrgP3 det.n cn.g
-- } ;
--
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 = p ;
UsePron p = {s = \\c => p.s ! np2pronCase c ; a = p.a} ;
--
-- PredetNP pred np = {
-- s = \\c => pred.s ++ np.s ! c ;
@@ -35,22 +35,22 @@ concrete NounHin of Noun = CatHin ** open ResHin, Prelude in {
-- s = quant.s ! num.n ++ num.s ++ ord.s ;
-- n = num.n
-- } ;
--
-- DetQuant quant num = {
-- s = quant.s ! num.n ++ num.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 ! Gen} ;
--
-- NumSg = {s = []; n = Sg ; hasCard = False} ;
-- NumPl = {s = []; n = Pl ; hasCard = False} ;
--
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} ;

View File

@@ -29,6 +29,11 @@ oper
= \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 {

View File

@@ -144,17 +144,18 @@ resource ResHin = ParamX ** open Prelude in {
} ;
param
PronCase = PCase Case | PObj | PPoss ;
PronCase = PC Case | PObj | PPoss ;
oper
personalPronoun : Person -> Number -> {s : PronCase => Str} = \p,n ->
case <p,n> of {
<P1,Sg> => {s = table PronCase ["mEN" ; "muJ" ; "muJe" ; "merA"]} ;
<P1,Pl> => {s = table PronCase ["ham" ; "ham" ; "hameN" ; "hamArA"]} ;
<P2,Sg> => {s = table PronCase ["tU" ; "tuJ" ; "tuJe" ; "terA"]} ;
<P2,Pl> => {s = table PronCase ["tum" ; "tum" ; "tumheN" ; "tumhArA"]} ;
<P3,Sg> => {s = table PronCase ["vah" ; "u-s" ; "u-se" ; "u-skA"]} ;
<P3,Pl> => {s = table PronCase ["ve" ; "u-n" ; "u-nheN" ; "u-nkA"]}
} ;
<P1,Sg> => {s = table PronCase ["mEN" ; "muJ" ; "muJ" ; "muJe" ; "merA"]} ;
<P1,Pl> => {s = table PronCase ["ham" ; "ham" ; "ham" ; "hameN" ; "hamArA"]} ;
<P2,Sg> => {s = table PronCase ["tU" ; "tuJ" ; "tuJ" ; "tuJe" ; "terA"]} ;
<P2,Pl> => {s = table PronCase ["tum" ; "tum" ; "tum" ; "tum" ; "tumhArA"]} ;
<P3,Sg> => {s = table PronCase ["vah" ; "u-s" ; "u-s" ; "u-se" ; "u-skA"]} ;
<P3,Pl> => {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
@@ -187,6 +188,11 @@ resource ResHin = ParamX ** open Prelude in {
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} ;
@@ -238,14 +244,14 @@ resource ResHin = ParamX ** open Prelude in {
insertObject : NP -> VPHSlash -> VPH = \np,vps -> {
s = vps.s ;
obj = {s = vps.obj.s ++ np.s ! NPC Obl ++ vps.c2.s ; a = np.a} ;
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 | NPErg ;
NPCase = NPC Case | NPObj | NPErg ;
oper
agrP3 : Gender -> Number -> Agr = \g,n -> Ag g n P3 ;
@@ -254,23 +260,24 @@ resource ResHin = ParamX ** open Prelude in {
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} ;
--- param
--- PronCase = PCase Case | PObj | PPoss ;
--- oper
--- personalPronoun : Person -> Number -> {s : PronCase => Str} = \p,n ->
mkClause : NP -> VPH -> Clause = \np,vp -> {
s = \\vt,b =>
let

View File

@@ -42,7 +42,7 @@ concrete StructuralHin of Structural = CatHin **
----- first_Ord = ss "first" ; DEPRECATED
-- for_Prep = ss "for" ;
-- from_Prep = ss "from" ;
-- he_Pron = mkNP "he" "him" "his" Sg P3 Masc ;
he_Pron = personalPronoun P3 Sg ** {a = Ag Masc Sg P3} ;
-- here_Adv = ss "here" ;
-- here7to_Adv = ss ["to here"] ;
-- here7from_Adv = ss ["from here"] ;
@@ -50,7 +50,7 @@ concrete StructuralHin of Structural = CatHin **
-- how8many_IDet = mkDeterminer Pl ["how many"] ;
-- if_Subj = ss "if" ;
-- in8front_Prep = ss ["in front of"] ;
-- i_Pron = mkNP "I" "me" "my" Sg P1 Masc ;
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" ;
@@ -101,7 +101,8 @@ concrete StructuralHin of Structural = CatHin **
-- under_Prep = ss "under" ;
-- very_AdA = ss "very" ;
-- want_VV = P.mkVV (P.regV "want") ;
-- we_Pron = mkNP "we" "us" "our" Pl P1 Masc ;
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" ;