From Janna.

This commit is contained in:
aarne
2004-01-12 16:46:00 +00:00
parent 9c818d8924
commit c1cd85d397
13 changed files with 735 additions and 3 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

36
grammars/health/Health.gf Normal file
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,81 @@
--# -path=.:../abstract:../../prelude
abstract ResourceExamples = TestResource ** {
-- sentence examples to test resource grammar with
fun
ex1,ex2,ex3,ex4,ex5,ex6,ex7,ex8,ex9,ex10,ex11:Text;
ex12,ex13,ex14,ex15,ex16,ex17,ex18,ex19,ex20,ex21,ex22: Text;
def
ex1 = OnePhr (IndicPhrase (PredVP (ModGenNum NoNum (YeNumNP NoNum)
(AdvCN (UseFun
Mother) Always)) (PosVG (PredVS Prove (PredVP (YeNumNP NoNum) (PosVG
(PredAP (PositAdjP Small))))))));
ex2 = OnePhr (ImperMany (SubjImper WhenSubj (PredVP (YeNumNP
NoNum)(PosVG (PredAP
(PositAdjP Young)))) (ImperVP (PosVG (PredV Walk)))));
ex3 = OnePhr (QuestPhrase (QuestAdv WhyIAdv TheyNP (NegVG (PredTV Love
(UsePN Mary)))));
ex4 = OnePhr (QuestPhrase (QuestVP (WeNumNP NoNum) (PosVG (PredNP (IndefNumNP
NoNum (UseN Man))))));
ex5 = OnePhr (IndicPhrase (PredVP INP (PosVG (PredTV Love (ConjNP AndConj
(TwoNP (IndefNumNP NoNum (ModAdj (PositAdjP Old) (UseN House)))
(IndefNumNP NoNum (ModAdj (PositAdjP Young) (UseN Woman)))))))));
ex6 = OnePhr (ImperOne (ImperVP (PosVG (PredNP (IndefOneNP (UseN Man))))));
ex7 = ConsPhr PhrYes (ConsPhr (PhrOneCN (ModAdj (AdjP1 American) (ModRC
(UseN Wine) (RelSlash IdRP (PosSlashTV INP Wait)))))
(ConsPhr (PhrNP (DefNumNP (UseInt 2) (UseN Bottle)))
(ConsPhr (PhrIAdv WhereIAdv) (ConsPhr (PhrIAdv HowIAdv)
(OnePhr (PhrIP WhenIAdv))))));
ex8 = OnePhr (IndicPhrase (OneVP (PosVG (PredV3 Prefer (IndefOneNP (AppFun (AppFun2 Connection
(DefOneNP (UseN House))) (IndefOneNP (UseN Bar))))(ModGenNum
(UseInt 2) (MassNP (UseN Wine)) (UseN Bottle))))));
ex9 = OnePhr (QuestPhrase (IntVP WhoOne (AdvVP (SubjVP (PosVG (PredAP (AdvAP
VeryAdv (PositAdjP Happy)))) WhenSubj (ThereNP (DetNP
ManyDet (UseN Light)))) Always)));
ex10 = OnePhr (IndicPhrase (PredVP (ModGenOne INP (UseFun Mother)) (NegVG
(PredAP (ComplAdj Married (ModGenOne (UsePN John) (UseFun Uncle)))))));
ex11 = OnePhr (QuestPhrase (IsThereNP (SuperlNP Happy (UseN Man))));
ex12 = OnePhr (PhrOneCN (CNthatS (UseN Woman) (PredVP SheNP (PosVG (PredCN
(ModRC (UseN Woman) (RelVP IdRP (PosVG (PredVV WantVV
(PredAdV (AdjAdv (ComparAdjP Big EverythingNP))))))))))));
ex13 = OnePhr (IndicPhrase (SubjS IfSubj (PredVP SomebodyNP (PosVG
(PredTV Send (MassNP (UseN Wine))))) (PredVP
EverybodyNP (PosVG (PredV (VTrans Drink))))));
ex14 = OnePhr (IndicPhrase (SubjS IfSubj (PredVP SomebodyNP (PosVG
(PredTV Send (MassNP (UseN Wine))))) (PredVP
EverybodyNP (PosVG (PredV (VTrans Drink))))));
ex15 = OnePhr (AdvS ThereforeAdv (PredVP ThisNP (PosVG (PredNP (IndefOneNP (ModRC
(UseN House)(RelSuch (PredVP TheyNP (NegVG (PredVV CanKnowVV
(PredAdV (PrepNP WithPrep YouNP))))))))))));
ex16 = OnePhr (IndicPhrase (PredVP ThatNP (PosVG (PredCN (ModRC (UseN Woman)
(RelVP (FunRP Uncle IdRP) (PosVG (PredVS Say (PredVP (UsePN John)
(PosVG (PredTV Love (UsePN Mary))))))))))));
ex17 = OnePhr (QuestPhrase (IntVP (FunIP Mother (NounIPOne (UseN Woman)))
(PosVG (PredV Run))));
ex18 = OnePhr (IndicPhrase (ConjS AndConj (ConsS (TwoS (OneVP (PosVG
(PredV Run))) (OneVP (PosVG (PredV Walk)))) (OneVP (PosVG
(PredV (VTrans Wait)))))));
ex19 = OnePhr (IndicPhrase (ConjDS EitherOr (TwoS (PredVP (UsePN John) (PosVG (PredV Walk))) (PredVP
(UsePN Mary ) (PosVG (PredV Run))))));
ex20 = OnePhr (QuestPhrase (QuestVP SomebodyNP (PosVG (PredVV CanKnowVV (PredAP (ConjAP
OrConj (ConsAP (TwoAP (PositAdjP Young) (PositAdjP Big))
(PositAdjP Happy))))))));
ex21 = OnePhr (IndicPhrase (PredVP (IndefOneNP (UseN House))(PosVG (PredVV
CanVV (PredAP (ConjDAP BothAnd (TwoAP (PositAdjP Big) (PositAdjP
Small))))))));
ex22 = OnePhr (IndicPhrase ( PredVP HeNP (NegVG (PredV3 Give (ConjDNP NeitherNor (ConsNP (TwoNP (IndefNumNP
NoNum (UseN Woman)) (IndefOneNP (UseN Wine))) (IndefOneNP (UseN Car))))
NobodyNP))));
} ;