From ae9fe52eaace159d650aa32b19fbfa957c1df8c8 Mon Sep 17 00:00:00 2001 From: aarne Date: Mon, 12 Jan 2004 16:46:00 +0000 Subject: [PATCH] From Janna. --- grammars/database/DatabaseI.gf | 6 +- grammars/health/ExtraEng.gf | 65 +++++++++++++++++++++ grammars/health/ExtraFre.gf | 39 +++++++++++++ grammars/health/ExtraIta.gf | 39 +++++++++++++ grammars/health/ExtraRus.gf | 36 ++++++++++++ grammars/health/ExtraSwe.gf | 72 +++++++++++++++++++++++ grammars/health/Health.gf | 36 ++++++++++++ grammars/health/HealthEng.gf | 69 ++++++++++++++++++++++ grammars/health/HealthFre.gf | 81 ++++++++++++++++++++++++++ grammars/health/HealthResourceIta.gf | 63 +++++++++++++++++++++ grammars/health/HealthRus.gf | 66 +++++++++++++++++++++ grammars/health/HealthSwe.gf | 85 ++++++++++++++++++++++++++++ 12 files changed, 654 insertions(+), 3 deletions(-) create mode 100644 grammars/health/ExtraEng.gf create mode 100644 grammars/health/ExtraFre.gf create mode 100644 grammars/health/ExtraIta.gf create mode 100644 grammars/health/ExtraRus.gf create mode 100644 grammars/health/ExtraSwe.gf create mode 100644 grammars/health/Health.gf create mode 100644 grammars/health/HealthEng.gf create mode 100644 grammars/health/HealthFre.gf create mode 100644 grammars/health/HealthResourceIta.gf create mode 100644 grammars/health/HealthRus.gf create mode 100644 grammars/health/HealthSwe.gf diff --git a/grammars/database/DatabaseI.gf b/grammars/database/DatabaseI.gf index 5afeda711..204e43c81 100644 --- a/grammars/database/DatabaseI.gf +++ b/grammars/database/DatabaseI.gf @@ -18,7 +18,7 @@ lincat lin WhichAre A B = QuestPhrase (IntVP (NounIPMany A) (PosVG (PredAP B))) ; IsThere A = QuestPhrase (IsThereNP (IndefOneNP A)) ; - AreThere A = QuestPhrase (IsThereNP (IndefManyNP NoNum A)) ; + AreThere A = QuestPhrase (IsThereNP (IndefNumNP NoNum A)) ; WhatIs val = QuestPhrase (IntVP WhatOne (PosVG (PredNP val))) ; IsIt Q A = QuestPhrase (QuestVP Q (PosVG (PredAP A))) ; @@ -35,9 +35,9 @@ lin Individual = UsePN ; - AllN = DetNP (AllsDet NoNum) ; + AllN = DetNP (AllNumDet NoNum) ; MostN = DetNP MostsDet ; EveryN = DetNP EveryDet ; - Any = DetNP (AnysDet NoNum) ; + Any = DetNP (AnyNumDet NoNum) ; } ; diff --git a/grammars/health/ExtraEng.gf b/grammars/health/ExtraEng.gf new file mode 100644 index 000000000..b0057c7c1 --- /dev/null +++ b/grammars/health/ExtraEng.gf @@ -0,0 +1,65 @@ +-- use this path to read the grammar from the same directory +--# -path=.:../abstract:../../prelude:../english + +--1 Functions that are not in the API, but common in Russian +-- +-- Aarne Ranta, Janna Khegai 2003 + +resource ExtraEng = open PredicationEng, ResourceEng, Prelude, SyntaxEng in { + +oper + BodyCNCategory : Type = + { s : Bool => Number => Case => Str ; painInType : Bool} ; + + mkPain: BodyCNCategory -> CN = \body -> + cnNoHum({ s = \\_,_ => body.s ! body.painInType ! Sg ! Nom })** {lock_CN = <>} ; + + mkBody: BodyCNCategory -> CN = \body -> + cnNoHum({ s = \\n,_ => body.s ! True ! n ! Nom })** {lock_CN = <>} ; + + injuredBody: TV -> NP -> BodyCNCategory -> S = + \haveInjured, patient, head -> + predV2 haveInjured patient (hisHead patient (mkBody head) **{lock_NP = <>}) ; + + nullDet : Det = mkDeterminer Sg [] ** {lock_Det = <>}; + + hisHead: NP -> CN -> NP =\patient, head -> + { s =\\c => patient.s ! GenP ++ head.s ! patient.n ! Nom ; + n = patient.n ; p = P3 ; lock_NP = <>} ; + + tvHave: TV = mkTransVerbDir verbP3Have ** {lock_TV = <>}; + + + painInPatientsBody: CN -> NP -> BodyCNCategory -> S = + \pain, patient, head -> case head.painInType of { + False => predV2 tvHave patient (DetNP (aDet** {lock_Det = <>}) ( mkPain head)); + True => predV2 tvHave patient (DetNP nullDet + ( + cnNoHum(appFunComm (pain ** {s2 = "in"}) + (hisHead patient (mkBody head)))** {lock_CN = <>} + ) + ) + } ; + + painInPatientsBodyMode: CN -> NP -> BodyCNCategory -> AP -> S = + \pain, patient, head, degree -> case head.painInType of { + False => predV2 tvHave patient (DetNP (aDet** {lock_Det = <>}) + ( + modCommNounPhrase degree (mkPain head) ** {lock_CN = <>} + )); + True => predV2 tvHave patient (DetNP nullDet + ( + modCommNounPhrase degree + ( + cnNoHum + ( + appFunComm (pain ** {s2 = "in"}) + (hisHead patient (mkBody head)) + ) + ) ** {lock_CN = <>} + )) + } ; + +}; + + diff --git a/grammars/health/ExtraFre.gf b/grammars/health/ExtraFre.gf new file mode 100644 index 000000000..5f1f995e4 --- /dev/null +++ b/grammars/health/ExtraFre.gf @@ -0,0 +1,39 @@ +-- use this path to read the grammar from the same directory +--# -path=.:../abstract:../../prelude:../french:../romance + +--1 Functions that are not in the API, but common in Russian +-- +-- Aarne Ranta, Janna Khegai 2003 + +resource ExtraFre = open PredicationFre, ResourceFre, Prelude, SyntaxFre, MorphoFre in { + +oper + avoirBesoin: CN -> VP = \medicine -> + PosVG ( PredTV tvAvoir (DetNP nullDet ( + AppFun (funDe (mkCNomReg "besoin" Masc) ** {lock_Fun =<>} ) + (IndefOneNP medicine) + ) + ) + ) **{lock_VP =<>} ; + + injuredBody: (Gender => Number => Str) -> NP -> CN -> S = + \injured, patient, head -> + PredVP patient + {s = \\g,v => pronRefl patient.n patient.p ++ + verbEtre.s ! v ++ + injured ! g ! patient.n ++ + (DefOneNP head).s ! case2pform Acc; + lock_VP = <> + } ; + + + delDet : Det = mkDeterminer Sg (artDef Masc Sg genitive) + (artDef Fem Sg genitive) ** {lock_Det = <>} ; + + nullDet : Det = mkDeterminer1 Sg "" ** {lock_Det =<>} ; + + tvAvoir = mkTransVerbDir (verbPres (conj3savoir ""))** {lock_TV = <> }; + +}; + + diff --git a/grammars/health/ExtraIta.gf b/grammars/health/ExtraIta.gf new file mode 100644 index 000000000..68b5d40c2 --- /dev/null +++ b/grammars/health/ExtraIta.gf @@ -0,0 +1,39 @@ +--1 Functions that are not in the API, but common in Russian +-- +-- Aarne Ranta, Janna Khegai 2003 + +resource ExtraIta = open ResourceIta, Prelude, SyntaxIta, MorphoIta in { + +oper + NPLock = NounPhrase ** {lock_NP : {}} ; + CNLock = CommNounPhrase ** {lock_CN : {}} ; + SLock = Sentence ** {lock_S : {}} ; +oper + + averBisogno : CN -> VP = \cn -> + PosVG (PredTV (mkTransVerbPrep (verbPres avere) "bisogno"** {lock_TV = <>}) (IndefOneNP cn)) ; + +-- the following are too low-level and should be provided by the resources + + injuredBody: AP -> NPLock -> CNLock -> SLock = \injured, patient, head -> + (PredVP patient + {s = \\g,v => pronRefl patient.n patient.p ++ + verbEssere.s ! v ++ + injured.s ! (AF g patient.n) ++ + (DefOneNP head).s ! case2pform accusative ; + lock_VP = <> + } ) ** {lock_S = <> }; + + partitNP : CN -> NP = \cn -> + let {np = DefOneNP cn} in {s = \\_ => np.s ! Aton genitive} ** np ; + + datAdv : NP -> AdV = \np -> + {s = np.s ! Aton dative; lock_AdV = <> } ; + +-- from Predication: + predV2: TransVerb -> NPLock -> NounPhrase -> SLock = \F, x, y -> + predVerbPhrase x ((predVerbGroup True) (complTransVerb F y)) ** { lock_S = <>} ; + +}; + + diff --git a/grammars/health/ExtraRus.gf b/grammars/health/ExtraRus.gf new file mode 100644 index 000000000..6adc0d40d --- /dev/null +++ b/grammars/health/ExtraRus.gf @@ -0,0 +1,36 @@ +-- use this path to read the grammar from the same directory +--# -path=.:../abstract:../../prelude:../russian + +--1 Functions that are not in the API, but common in Russian +-- +-- Aarne Ranta, Janna Khegai 2003 +resource ExtraRus = open ResourceRus, Prelude, SyntaxRus in { + +flags coding=utf8 ; + +oper + predNeedShortAdjective: Bool -> NP -> CN -> S = \b, Jag, Dig -> { s = + let { + mne = Jag.s ! (mkPronForm Dat No NonPoss) ; + nuzhen = need.s ! AF Nom Inanimate (gNum Dig.g Sg) ; + doctor = Dig.s ! Sg ! Nom ; + ne = negation b + } in + mne ++ ne ++ nuzhen ++ doctor ; + lock_S = <> + } ; + + U_predTransVerb : Bool -> TV -> NP -> NP -> S = + \b,Ser,Jag,Dig -> { s = + let { + menya = Jag.s ! (mkPronForm Gen Yes NonPoss) ; + bolit = Ser.s ! VFin (gNum (pgen2gen Dig.g) Dig.n) Dig.p ; + golova = Dig.s ! (mkPronForm Nom No NonPoss) ; + ne = negation b + } in + "҃" ++ menya ++ ne ++ bolit ++ golova ; + lock_S = <> + } ; + + tvHave : TV = mkDirectVerb (extVerb have Act Present) ** { lock_TV = <>}; +}; diff --git a/grammars/health/ExtraSwe.gf b/grammars/health/ExtraSwe.gf new file mode 100644 index 000000000..af1a829ba --- /dev/null +++ b/grammars/health/ExtraSwe.gf @@ -0,0 +1,72 @@ +-- use this path to read the grammar from the same directory +--# -path=.:../abstract:../../prelude:../swedish + +--1 Functions that are not in the API, but common in Russian +-- +-- Aarne Ranta, Janna Khegai 2003 + +resource ExtraSwe = open PredicationSwe, ResourceSwe, Prelude, SyntaxSwe in { + +oper + patientNPCategory : Type = {s : NPForm => Str ; + g : Gender ; n : Number; p : Person }** {lock_NP : {}} ; + + mkPronPatient : ProPN -> patientNPCategory = \jag -> + {s = jag.s ; g = jag.h1 ; n = jag.h2 ; p = jag.h3; + lock_NP = <> + } ; + + nullDet : Det = { s = table {_ => table {_ => ""}} ; + n = Sg ; b = IndefP; lock_Det =<> } ; + + injuredBody: patientNPCategory -> CN -> S = + \Jag, head -> + let { + jag = Jag.s ! PNom ; + harSkadat = ["har skadat"] ; + mig = case Jag.p of + { + P1 => case Jag.n of + { Sg => "mig" ; + Pl => "oss" + } ; + P2 => case Jag.n of + { Sg => "dig" ; + Pl => "er" + } ; + P3 => "sig" + } ; + iBenet = "i" ++ (defNounPhrase Jag.n head).s ! PNom + } in + {s = table { + _ => jag ++ harSkadat ++ mig++ iBenet + }; + lock_S = <> + + } ; + + sFeber : Str -> Subst = \feb -> + {s = table { + SF Sg Indef Nom => feb + "er" ; + SF Sg Indef Gen => feb + "ers" ; + SF Sg Def Nom => feb + "ern" ; + SF Sg Def Gen => feb + "erns" ; + SF Pl Indef Nom => feb + "rar" ; + SF Pl Indef Gen => feb + "rars" ; + SF Pl Def Nom => feb + "rar" ; + SF Pl Def Gen => feb + "rars" + } ; + h1 = Utr + } ; + + verbTa = {s = table {VPres Infinit _ => "ta" ; VPres Indicat _ => "tar" ; VPres Imperat _ => "ta"}; s1 =""} ; + verbBehova = {s = table {VPres Infinit _ => "behöva" ; VPres Indicat _ => "behöver" ; VPres Imperat _ => + "behöv"}; s1 =""} ; + +-- almost from Predication: +-- predV2: TV -> patientNPCategory -> NP -> S = \F, x, y -> +-- predVerbPhrase x ((predVerbGroup True) (complTransVerb F y)) ** { lock_S = <>} ; + +}; + + diff --git a/grammars/health/Health.gf b/grammars/health/Health.gf new file mode 100644 index 000000000..db901d29f --- /dev/null +++ b/grammars/health/Health.gf @@ -0,0 +1,36 @@ +abstract Health = { + +cat + Specialization ; Patient ; Body ; Symptom ; SymptomDegree ; Illness ; + Prop ; Condition ; Medicine ; + +fun + And : Prop -> Prop -> Prop ; + Complain : Patient -> Symptom -> Prop ; + FeverMod : SymptomDegree -> Symptom ; + PainIn : Patient -> Body -> Prop ; + PainInMod : Patient -> Body -> SymptomDegree -> Prop ; + Injured : Patient -> Body -> Prop ; + Broken : Patient -> Body -> Prop ; + HaveIllness : Patient -> Illness -> Prop ; + BeInCondition : Patient -> Condition -> Prop ; + NeedDoctor : Patient -> Specialization -> Prop ; + NeedMedicine : Patient -> Medicine -> Prop ; + TakeMedicine : Patient -> Medicine -> Prop ; + CatchCold : Condition ; + Pregnant : Condition ; + Fever : Symptom ; + High : SymptomDegree ; + Terrible : SymptomDegree ; + Head : Body ; + Leg : Body ; + ShePatient : Patient ; + TheyPatient : Patient ; + IPatientHe : Patient ; + Influenza : Illness ; + Malaria : Illness ; + + Dentist : Specialization ; + PainKiller : Medicine ; + +} ; diff --git a/grammars/health/HealthEng.gf b/grammars/health/HealthEng.gf new file mode 100644 index 000000000..5663f38cd --- /dev/null +++ b/grammars/health/HealthEng.gf @@ -0,0 +1,69 @@ +-- use this path to read the grammar from the same directory +--# -path=.:../newresource/abstract:../prelude:../newresource/english +concrete HealthEng of Health = open PredicationEng, ResourceEng, Prelude, SyntaxEng, ExtraEng in { + +flags + startcat=Phr ; lexer=text ; parser=chart ; unlexer=text ; + +lincat + Patient = NP ; + -- CN is not enough, because of the different form of the "head" body part + -- expression in "I have a headache" and "I have injured my head": + Body = BodyCNCategory ; + Symptom = NP ; + SymptomDegree = AP ; + Prop = S ; + Illness = CN ; + Condition = VP ; + Specialization = CN ; + Medicine = CN ; + +lin + ShePatient = SheNP ; + TheyPatient = TheyNP ; + IPatientHe = INP ; + + And x y = ConjS AndConj (TwoS x y) ; + + Influenza = cnNoHum (nounReg "influenza")** {lock_CN = <>} ; + Malaria = cnNoHum (nounReg "malaria") ** {lock_CN = <>}; + Dentist = cnHum (nounReg "dentist")** {lock_CN = <>} ; + PainKiller = cnNoHum (nounReg "painkiller")** {lock_CN = <>} ; + + High = AdjP1 ((regAdjective "high") ** {lock_Adj1 = <>}); + Terrible = AdjP1 ((regAdjective "terrible")** {lock_Adj1 = <>}); + + Leg = { s = \\_,n,_ => case n of {Sg =>"leg" ; Pl=> "legs" }; + painInType = True } ; + Head = { s = table{ True => table {Sg => table {_ => "head" }; + Pl => table {_ => "heads" }}; + False => table { _ => table {_=> "headache"}}} ; + painInType = False } ; + + BeInCondition = PredVP ; + Pregnant = PosVG ( PredAP( AdjP1 (regAdjective ["pregnant"] ** {lock_Adj1 = <>}))) ; + CatchCold = PosVG (PredTV (tvHave** {lock_TV = <>}) (DetNP (aDet** {lock_Det = <>}) (cnNoHum (nounReg "cold")** {lock_CN = <>}))); + + Fever = DetNP (aDet** {lock_Det = <>}) (cnNoHum (nounReg "fever")** {lock_CN = <>}) ; + FeverMod degree = DetNP (aDet** {lock_Det = <>}) (ModAdj degree (cnNoHum (nounReg "fever")** {lock_CN = <>})) ; + + HaveIllness patient illness = predV2 tvHave patient (DetNP (nullDet** {lock_Det = <>}) illness) ; + Complain = predV2 tvHave ; + + NeedDoctor patient doctor = predV2 (mkTransVerbDir (regVerbP3 "need")**{lock_TV = <>}) + patient (DetNP (aDet ** {lock_Det = <>}) doctor); + NeedMedicine patient medicine = predV2 (mkTransVerbDir (regVerbP3 "need")**{lock_TV = <>}) + patient (DetNP (aDet ** {lock_Det = <>}) medicine); + TakeMedicine patient medicine = predV2 (mkTransVerbDir (regVerbP3 "take")**{lock_TV = <>}) + patient (DetNP (aDet ** {lock_Det = <>}) medicine) ; + + Injured = injuredBody (mkTransVerb verbP3Have "injured"**{lock_TV = <>}) ; + Broken = injuredBody (mkTransVerb verbP3Have "broken"**{lock_TV = <>}) ; + + PainIn = painInPatientsBody (cnNoHum (nounReg "pain")**{lock_CN = <>}) ; + PainInMod = painInPatientsBodyMode (cnNoHum (nounReg "pain")**{lock_CN = <>}); +}; + + + + diff --git a/grammars/health/HealthFre.gf b/grammars/health/HealthFre.gf new file mode 100644 index 000000000..cc5bfaa33 --- /dev/null +++ b/grammars/health/HealthFre.gf @@ -0,0 +1,81 @@ +-- UTF8 version currently differs from non-UTF8 !!! + +-- use this path to read the grammar from the same directory +--# -path=.:../newresource/abstract:../prelude:../newresource/french:../newresource/romance + +concrete HealthFre of Health = open PredicationFre, ResourceFre, Prelude, SyntaxFre, MorphoFre, ExtraFre in { + +-- 1. still using "ā" instead of "aux" in PainIn operations +-- because of the UTF8 problem with non-utf8 resource grammars! + +flags + coding=utf8 ; + startcat=Phr ; lexer=text ; parser=chart ; unlexer=text ; + +lincat + Patient = NP ; + Body = CN ; + Symptom = NP ; + SymptomDegree = AP ; + Prop = S ; + Illness = CN ; + Condition = VP ; + Specialization = CN ; + Medicine = CN ; + +lin + And x y = ConjS AndConj (TwoS x y) ; + + ShePatient = SheNP ; + TheyPatient = TheyNP ; + IPatientHe = INP ; + + Influenza = mkCNomReg "grippe" Fem ** {lock_CN = <> }; + Malaria = mkCNomReg "malaria" Fem ** {lock_CN = <> }; + HaveIllness patient illness = predV2 tvAvoir patient (DefOneNP illness) ; + Complain = predV2 tvAvoir ; + + BeInCondition = PredVP ; + CatchCold = PosVG (PredTV tvAvoir (IndefOneNP (mkCNomReg "rhume" Masc ** {lock_CN = <> }))); + Pregnant = PosVG (PredAP (mkAdjective (adjJeune "enceinte") adjPost** {lock_AP = <> })) ; + + High = AdjP1 (mkAdjReg "élevé" adjPost ** {lock_Adj1 = <> }) ; + Terrible = AdjP1 ((mkAdjective (mkAdj "terrible" "terrible" "terrible" "terrible") adjPre ** {lock_Adj1 = <> })** {lock_AP = <> }); + + Head = mkCNomReg "tęte" Fem ** {lock_CN = <> }; + Leg = mkCNomReg "jambe" Fem ** {lock_CN = <> }; + Dentist = mkCNomReg "dentiste" Masc ** {lock_CN = <> } ; + PainKiller = mkCNomReg "calmant" Masc ** {lock_CN = <> }; + + NeedDoctor patient doctor = PredVP patient (avoirBesoin doctor ** {lock_VP = <> }) ; + NeedMedicine patient medicine = PredVP patient (avoirBesoin medicine** {lock_VP = <> }) ; + TakeMedicine patient medicine = predV2 (mkTransVerbDir (verbPres + (conj3prendre "prendre")) ** {lock_TV = <> } ) patient (IndefOneNP medicine) ; + + FeverMod degree = DetNP (delDet ** {lock_Det = <> }) (ModAdj degree (mkCNomReg "fičvre" Fem** {lock_CN = <> })) ; + Fever = DetNP (delDet ** {lock_Det = <> }) (mkCNomReg "fičvre" Fem ** {lock_CN = <> }) ; + + PainInMod patient head degree = predV2 tvAvoir patient + (DetNP (nullDet ** {lock_Det = <> }) + ( ModAdj degree + ( + AppFun ((mkCNomReg "mal" Masc ** {lock_CN = <> })** complementCas Dat** {lock_Fun = <> }) + (defNounPhrase patient.n head ** {lock_NP = <> }) + ) + ) + ) ; + + PainIn patient head = predV2 tvAvoir patient + (DetNP (nullDet ** {lock_Det = <> }) + ( + AppFun + ((mkCNomReg "mal" Masc ** {lock_CN = <> })** complementCas Dat ** {lock_Fun = <> }) + (defNounPhrase patient.n head ** {lock_NP = <> }) + ) + ) ; + + Injured = injuredBody (adjReg "blessé") ; + Broken = injuredBody (adjReg "cassé") ; + +}; + diff --git a/grammars/health/HealthResourceIta.gf b/grammars/health/HealthResourceIta.gf new file mode 100644 index 000000000..208af4a20 --- /dev/null +++ b/grammars/health/HealthResourceIta.gf @@ -0,0 +1,63 @@ +-- use this path to read the grammar from the same directory +--# -path=.:../abstract:../../prelude:../italian:../romance +concrete HealthResourceIta of HealthResource = open ResourceIta, Prelude, SyntaxIta, ExtraIta, MorphoIta in { + +flags + startcat=Phr ; lexer=text ; parser=chart ; unlexer=text ; + +lin + ShePatient = SheNP ; + TheyPatient = TheyNP ; + IPatientHe = INP ; + + Influenza = mkCN (nRana "influenza") ; + Malaria = mkCN (nRana "malaria") ; + HaveIllness patient illness = predV2 (tvDir vAvere) patient (DefOneNP +illness) ; + + BeInCondition = PredVP ; + + CatchCold = + PosTV (tvDir vAvere) (IndefOneNP (mkCN (nSale "raffreddore" +masculine))) ; + + Pregnant = PosA (apSolo "gravido" postpos) ; + + Complain = predV2 (tvDir vAvere) ; + + PainInMod pat loc deg = + PredVP pat + (AdvVP (PosTV (tvDir vAvere) + (IndefOneNP (ModAdj deg (mkCN (nSale "dolore" +masculine))))) + (datAdv (DefOneNP loc))) ; + + FeverMod deg = partitNP (ModAdj deg (mkCN (nSale "febbre" feminine))); + + PainIn pat loc = + PredVP pat (AdvVP (PosV (averCosa "male")) (datAdv (DefOneNP loc))) ; + + Fever = partitNP (mkCNomReg (nSale "febbre" feminine)) ; + + High = apSolo "alto" postpos ; + Terrible = apTale "terribile" postpos ; + Head = mkCN (nRana "testa") ; + Leg = mkCN (nRana "gamba") ; + + Dentist = mkCN (mkN "dentista" "dentisti" masculine) ; + PainKiller = mkCN (nSale "calmante" masculine) ; + NeedDoctor pat doc = PredVP pat (averBisogno doc) ; + NeedMedicine pat med = PredVP pat (averBisogno med) ; + TakeMedicine pat med = predV2 (tvDir (vCorrere "prendere")) pat +(IndefOneNP med) ; + + Injured = injuredBody (mkAdjective (adjSolo "ferito") True) ; + Broken = injuredBody (mkAdjective (adjSolo "rotto") True) ; + + And = conjS ; + + +}; + + + diff --git a/grammars/health/HealthRus.gf b/grammars/health/HealthRus.gf new file mode 100644 index 000000000..749cbcc90 --- /dev/null +++ b/grammars/health/HealthRus.gf @@ -0,0 +1,66 @@ +-- use this path to read the grammar from the same directory + +concrete HealthRus of Health = open PredicationRus, ResourceRus, Prelude, SyntaxRus, ExtraRus in { +--# -path=.:../newresource/abstract:../prelude:../newresource/russian + +flags + coding=utf8 ; + startcat=Phr ; lexer=text ; parser=chart ; unlexer=text ; + +lincat + Patient = NP ; + Body = CN ; + Symptom = NP ; + SymptomDegree = AP ; + Prop = S ; + Illness = CN ; + Condition = VP ; + Specialization = CN ; + Medicine = CN ; +lin + And x y = ConjS AndConj (TwoS x y) ; + + ShePatient = SheNP ; + TheyPatient = TheyNP ; + IPatientHe = { s = INP.s ; g = PGen Masc; anim = INP.anim ; + n = INP.n ; nComp = INP.nComp ; p = INP.p ; pron = INP.pron; lock_NP = <>} ; + + Influenza = n2n gripp ** {lock_CN = <>}; + Malaria = n2n malaria ** {lock_CN = <>} ; + + Dentist = n2n stomatolog ** {lock_CN = <>}; + PainKiller = n2n obezbolivauchee ** {lock_CN = <>}; + High = AdjP1 (extAdjective vusokij ** {lock_Adj1 = <>}); + Terrible = AdjP1 (extAdjective uzhasnuj ** {lock_Adj1 = <>}); + + Head = n2n golova ** {lock_CN = <>}; + Leg = n2n noga ** {lock_CN = <>}; + Fever = mkNounPhrase Sg (n2n temperatura)** {lock_NP = <>}; + FeverMod degree = mkNounPhrase Sg (ModAdj degree (n2n temperatura** {lock_CN = <>})) ** {lock_NP = <>}; + BeInCondition = PredVP ; + CatchCold = PosVG (PredAP (AdjP1 (prostuzhen ** {lock_Adj1 = <>}))) ; + Pregnant = PosVG (PredAP (AdjP1 (beremenen ** {lock_Adj1 = <>}))) ; + + + TakeMedicine patient painkiller = predV2 (mkDirectVerb + (extVerb verbPrinimat Act Present)**{lock_TV = <>}) patient (mkNounPhrase Sg painkiller ** {lock_NP = <>}) ; + Injured patient painkiller = predV2 (mkDirectVerb + (extVerb verbPoranit Act Past)**{lock_TV = <>}) patient (mkNounPhrase patient.n painkiller ** {lock_NP = <>}) ; + Broken patient painkiller = predV2 (mkDirectVerb + (extVerb verbSlomat Act Past)**{lock_TV = <>}) patient (mkNounPhrase patient.n painkiller ** {lock_NP = <>}) ; + + HaveIllness patient symptom = U_predTransVerb True tvHave + patient (mkNounPhrase Sg symptom) ; + Complain = U_predTransVerb True tvHave ; + + NeedDoctor = predNeedShortAdjective True ; + NeedMedicine = predNeedShortAdjective True ; + + PainIn patient head = U_predTransVerb True (mkDirectVerb + (extVerb verbBolet_2 Act Present )) patient (mkNounPhrase patient.n head) ; + + PainInMod patient head degree = U_predTransVerb True (mkDirectVerb + (extVerb have Act Present)) patient (mkNounPhrase Sg (ModAdj degree + (AppFun (mkFun bol "в" Prepos ** {lock_Fun = <>}) (mkNounPhrase patient.n head** {lock_NP = <>})))); + +}; diff --git a/grammars/health/HealthSwe.gf b/grammars/health/HealthSwe.gf new file mode 100644 index 000000000..406d8d975 --- /dev/null +++ b/grammars/health/HealthSwe.gf @@ -0,0 +1,85 @@ +-- The UTF8 version currently differs from the non-UTF8 !!! + +-- The difference with the UTF8 version is that +-- operation "verbVara" doesn't need to be replaced +-- using the UTF8 encoding (because of the UTF8 problem +-- with UTF8 resource grammars) + +-- use this path to read the grammar from the same directory + +--# -path=.:../newresource/abstract:../prelude:../newresource/swedish +concrete HealthSwe of Health = open PredicationSwe, ResourceSwe, Prelude, SyntaxSwe, ExtraSwe in { + +flags + startcat=Phr ; lexer=text ; parser=chart ; unlexer=text ; + +lincat + Patient = patientNPCategory ; + Body = CN ; + Symptom = NP ; + SymptomDegree = AP ; + Prop = S ; + Illness = CN ; + Condition = VP ; + Specialization = CN ; + Medicine = CN ; + +lin + And x y = ConjS AndConj (TwoS x y) ; + + ShePatient = mkPronPatient hon_35 ; + TheyPatient = mkPronPatient de_38 ; + IPatientHe = mkPronPatient jag_32 ; + + Influenza = n2n (extCommNoun NoMasc (sApa "influens")) ** {lock_CN = <>} ; + Malaria = n2n (extCommNoun NoMasc (sApa "malari")) ** {lock_CN = <>} ; + Head = n2n (extCommNoun NoMasc (sHus "huvud")) ** {lock_CN = <>} ; + Leg = n2n (extCommNoun NoMasc (sHus "ben")) ** {lock_CN = <>} ; + Dentist = n2n (extCommNoun Masc (sKikare "tandläkar")) ** {lock_CN = <>} ; + PainKiller = n2n (extCommNoun NoMasc (sBil "smärtstillande")) ** {lock_CN = <>} ; + + CatchCold = PosVG ( PredAP( AdjP1 (extAdjective (aGrund("förkyl")) ** {lock_Adj1 = <>}) )); + Pregnant = PosVG ( PredAP( AdjP1 (extAdjective (aGrund("gravi") )** {lock_Adj1 = <>}) )); + High = AdjP1 (extAdjective (aFin "hög")** {lock_Adj1 = <>}) ; + Terrible = AdjP1 (extAdjective (aFin "hemsk")** {lock_Adj1 = <>}) ; + + BeInCondition = PredVP ; + HaveIllness patient illness = predV2 (mkDirectVerb verbHava** {lock_TV =<>}) patient + (DetNP (nullDet ** {lock_Det = <>}) illness) ; + NeedMedicine patient illness = predV2 (mkDirectVerb verbBehova** {lock_TV =<>}) patient + (DetNP (nullDet ** {lock_Det = <>}) illness) ; + TakeMedicine patient illness = predV2 (mkDirectVerb verbTa** {lock_TV =<>}) patient + (DetNP (nullDet ** {lock_Det = <>}) illness) ; + NeedDoctor patient illness = predV2 (mkDirectVerb verbBehova** {lock_TV =<>}) patient + (DetNP (enDet ** {lock_Det = <>}) illness) ; + Fever = DetNP (nullDet ** {lock_Det = <>}) (n2n (extCommNoun NoMasc (sFeber "feb")) ** {lock_CN = <>}) ; + FeverMod degree = DetNP (nullDet ** {lock_Det = <>}) (ModAdj degree (n2n (extCommNoun NoMasc (sFeber "feb")) ** {lock_CN = <>})) ; + + Complain = predV2 (mkDirectVerb verbHava ** {lock_TV =<>}) ; + Broken patient head = predV2 (mkTransVerb verbHava "brutit" ** {lock_TV =<>} ) patient + (defNounPhrase patient.n head ** {lock_NP =<>}) ; + + PainIn patient head = predV2 (mkDirectVerb verbHava** {lock_TV =<>}) patient + ( + DetNP (nullDet ** {lock_Det = <>}) + ( AppFun + ((mkFun (extCommNoun NoMasc (sBil "ont")) "i") ** {lock_Fun = <>}) + ((defNounPhrase patient.n head)** {lock_NP = <>}) + ) + ) ; + PainInMod patient head degree = predV2 (mkDirectVerb verbHava** {lock_TV =<>}) patient + ( + DetNP (nullDet ** {lock_Det = <>}) + ( modCommNounPhrase degree + ( AppFun + ((mkFun (extCommNoun NoMasc (sBil "ont")) "i") ** {lock_Fun = <>}) + ((defNounPhrase patient.n head)** {lock_NP = <>}) + ) ** {lock_CN = <>} + ) + ) ; + + Injured = injuredBody ; + +}; + +