forked from GitHub/comp-syntax-gu-mlt
first version of the lab material in place
This commit is contained in:
92
lab2/grammar/application/Doctor.gf
Normal file
92
lab2/grammar/application/Doctor.gf
Normal file
@@ -0,0 +1,92 @@
|
||||
abstract Doctor = {
|
||||
|
||||
flags startcat = Phrase ;
|
||||
|
||||
cat
|
||||
Phrase ;
|
||||
Fact ;
|
||||
Action ;
|
||||
Property ;
|
||||
Profession ;
|
||||
Person ;
|
||||
Place ;
|
||||
Substance ;
|
||||
Illness ;
|
||||
|
||||
fun
|
||||
presPosPhrase : Fact -> Phrase ;
|
||||
presNegPhrase : Fact -> Phrase ;
|
||||
pastPosPhrase : Fact -> Phrase ;
|
||||
pastNegPhrase : Fact -> Phrase ;
|
||||
presQuestionPhrase : Fact -> Phrase ;
|
||||
pastQuestionPhrase : Fact -> Phrase ;
|
||||
|
||||
impPosPhrase : Action -> Phrase ;
|
||||
impNegPhrase : Action -> Phrase ;
|
||||
|
||||
actionFact : Person -> Action -> Fact ;
|
||||
propertyFact : Person -> Property -> Fact ;
|
||||
|
||||
isProfessionProperty : Profession -> Property ;
|
||||
isAtPlaceProperty : Place -> Property ;
|
||||
haveIllnessProperty : Illness -> Property ;
|
||||
needProfessionProperty : Profession -> Property ;
|
||||
|
||||
theProfessionPerson : Profession -> Person ;
|
||||
|
||||
iMascPerson : Person ;
|
||||
iFemPerson : Person ;
|
||||
youMascPerson : Person ;
|
||||
youFemPerson : Person ;
|
||||
hePerson : Person ;
|
||||
shePerson : Person ;
|
||||
|
||||
goToAction : Place -> Action ;
|
||||
stayAtAction : Place -> Action ;
|
||||
vaccinateAction : Person -> Action ;
|
||||
examineAction : Person -> Action ;
|
||||
takeSubstanceAction : Substance -> Action ;
|
||||
|
||||
coughAction : Action ;
|
||||
breatheAction : Action ;
|
||||
vomitAction : Action ;
|
||||
sleepAction : Action ;
|
||||
undressAction : Action ;
|
||||
dressAction : Action ;
|
||||
eatAction : Action ;
|
||||
drinkAction : Action ;
|
||||
smokeAction : Action ;
|
||||
measureTemperatureAction : Action ;
|
||||
measureBloodPressureAction : Action ;
|
||||
|
||||
hospitalPlace : Place ;
|
||||
homePlace : Place ;
|
||||
schoolPlace : Place ;
|
||||
workPlace : Place ;
|
||||
|
||||
doctorProfession : Profession ;
|
||||
nurseProfession : Profession ;
|
||||
interpreterProfession : Profession ;
|
||||
|
||||
bePregnantProperty : Property ;
|
||||
beIllProperty : Property ;
|
||||
beWellProperty : Property ;
|
||||
beDeadProperty : Property ;
|
||||
haveAllergiesProperty : Property ;
|
||||
havePainsProperty : Property ;
|
||||
haveChildrenProperty : Property ;
|
||||
|
||||
feverIllness : Illness ;
|
||||
fluIllness : Illness ;
|
||||
headacheIllness : Illness ;
|
||||
diarrheaIllness : Illness ;
|
||||
heartDiseaseIllness : Illness ;
|
||||
lungDiseaseIllness : Illness ;
|
||||
hypertensionIllness : Illness ;
|
||||
|
||||
alcoholSubstance : Substance ;
|
||||
medicineSubstance : Substance ;
|
||||
drugsSubstance : Substance ;
|
||||
|
||||
|
||||
}
|
||||
117
lab2/grammar/application/DoctorEng.gf
Normal file
117
lab2/grammar/application/DoctorEng.gf
Normal file
@@ -0,0 +1,117 @@
|
||||
--# -path=.:../abstract:../english:../api
|
||||
|
||||
-- model implementation using Mini RGL
|
||||
|
||||
concrete DoctorEng of Doctor =
|
||||
open
|
||||
MiniSyntaxEng,
|
||||
MiniParadigmsEng,
|
||||
Prelude
|
||||
in {
|
||||
|
||||
-- application using your own Mini* modules
|
||||
|
||||
lincat
|
||||
Phrase = Utt ;
|
||||
Fact = Cl ;
|
||||
Action = VP ;
|
||||
Property = VP ;
|
||||
Profession = CN ;
|
||||
Person = NP ;
|
||||
Place = {at,to : Adv} ;
|
||||
Substance = NP ;
|
||||
Illness = NP ;
|
||||
|
||||
lin
|
||||
presPosPhrase fact = mkUtt (mkS fact) ;
|
||||
presNegPhrase fact = mkUtt (mkS negativePol fact) ;
|
||||
pastPosPhrase fact = mkUtt (mkS anteriorAnt fact) ;
|
||||
pastNegPhrase fact = mkUtt (mkS anteriorAnt negativePol fact) ;
|
||||
-- presQuestionPhrase fact = mkUtt (mkQS (mkQCl fact)) ;
|
||||
-- pastQuestionPhrase fact = mkUtt (mkQS anteriorAnt (mkQCl fact)) ;
|
||||
presQuestionPhrase fact = let p : Utt = mkUtt (mkQS (mkQCl fact)) in p ** {s = p.s ++ SOFT_BIND ++ "?"} ;
|
||||
pastQuestionPhrase fact = let p : Utt = mkUtt (mkQS anteriorAnt (mkQCl fact)) in p ** {s = p.s ++ SOFT_BIND ++ "?"} ;
|
||||
|
||||
|
||||
impPosPhrase action = mkUtt (mkImp action) ;
|
||||
impNegPhrase action = mkUtt negativePol (mkImp action) ;
|
||||
|
||||
actionFact person action = mkCl person action ;
|
||||
propertyFact person property = mkCl person property ;
|
||||
|
||||
isProfessionProperty profession = mkVP (mkNP a_Det profession) ;
|
||||
needProfessionProperty profession = mkVP need_V2 (mkNP a_Det profession) ;
|
||||
isAtPlaceProperty place = mkVP place.at ;
|
||||
haveIllnessProperty illness = mkVP have_V2 illness ;
|
||||
|
||||
theProfessionPerson profession = mkNP the_Det profession ;
|
||||
|
||||
iMascPerson = i_NP ;
|
||||
iFemPerson = i_NP ;
|
||||
youMascPerson = you_NP ;
|
||||
youFemPerson = you_NP ;
|
||||
hePerson = he_NP ;
|
||||
shePerson = she_NP ;
|
||||
|
||||
goToAction place = mkVP (mkVP go_V) place.to ;
|
||||
stayAtAction place = mkVP (mkVP stay_V) place.at ;
|
||||
vaccinateAction person = mkVP vaccinate_V2 person ;
|
||||
examineAction person = mkVP examine_V2 person ;
|
||||
takeSubstanceAction substance = mkVP take_V2 substance ;
|
||||
|
||||
-- end of what could be a functor
|
||||
--------------------------------
|
||||
|
||||
coughAction = mkVP (mkV "cough") ;
|
||||
breatheAction = mkVP (mkV "breathe") ;
|
||||
vomitAction = mkVP (mkV "vomit") ;
|
||||
sleepAction = mkVP (mkV "sleep" "slept" "slept") ;
|
||||
undressAction = mkVP (mkVP take_V2 (mkNP thePl_Det (mkN "clothe"))) (pAdv "off") ;
|
||||
dressAction = mkVP (mkVP put_V2 (mkNP thePl_Det (mkN "clothe"))) (pAdv "on") ;
|
||||
eatAction = mkVP (mkV "eat" "ate" "eaten") ;
|
||||
drinkAction = mkVP (mkV "drink" "drank" "drunk") ;
|
||||
smokeAction = mkVP (mkV "smoke") ;
|
||||
measureTemperatureAction = mkVP (mkV2 (mkV "measure")) (mkNP the_Det (mkN "body temperature")) ;
|
||||
measureBloodPressureAction = mkVP (mkV2 (mkV "measure")) (mkNP the_Det (mkN "blood pressure")) ;
|
||||
|
||||
hospitalPlace = {at = pAdv "at the hospital" ; to = pAdv "to the hospital"} ;
|
||||
homePlace = {at = pAdv "at home" ; to = pAdv "home"} ;
|
||||
schoolPlace = {at = pAdv "at school" ; to = pAdv "to school"} ;
|
||||
workPlace = {at = pAdv "at work" ; to = pAdv "to work"} ;
|
||||
|
||||
doctorProfession = mkCN (mkN "doctor") ;
|
||||
nurseProfession = mkCN (mkN "nurse") ;
|
||||
interpreterProfession = mkCN (mkN "interpreter") ;
|
||||
|
||||
bePregnantProperty = mkVP (mkA "pregnant") ;
|
||||
beIllProperty = mkVP (mkA "ill") ;
|
||||
beWellProperty = mkVP (mkA "well") ;
|
||||
beDeadProperty = mkVP (mkA "dead") ;
|
||||
haveAllergiesProperty = mkVP have_V2 (mkNP aPl_Det (mkN "allergy")) ;
|
||||
havePainsProperty = mkVP have_V2 (mkNP aPl_Det (mkN "pain")) ;
|
||||
haveChildrenProperty = mkVP have_V2 (mkNP aPl_Det (mkN "child" "children")) ;
|
||||
|
||||
feverIllness = mkNP a_Det (mkN "fever") ;
|
||||
fluIllness = mkNP a_Det (mkN "flu") ;
|
||||
headacheIllness = mkNP a_Det (mkN "headache") ;
|
||||
diarrheaIllness = mkNP a_Det (mkN "diarrhea") ;
|
||||
heartDiseaseIllness = mkNP a_Det (mkN "heart disease") ;
|
||||
lungDiseaseIllness = mkNP a_Det (mkN "lung disease") ;
|
||||
hypertensionIllness = mkNP (mkN "hypertension") ;
|
||||
|
||||
alcoholSubstance = mkNP (mkN "alcohol") ;
|
||||
medicineSubstance = mkNP a_Det (mkN "drug") ;
|
||||
drugsSubstance = mkNP aPl_Det (mkN "drug") ;
|
||||
|
||||
oper
|
||||
pAdv : Str -> Adv = MiniParadigmsEng.mkAdv ;
|
||||
|
||||
go_V = mkV "go" "went" "gone" ;
|
||||
stay_V = mkV "stay" ;
|
||||
need_V2 = mkV2 (mkV "need") ;
|
||||
take_V2 = mkV2 (mkV "take" "took" "taken") ;
|
||||
put_V2 = mkV2 (mkV "put" "put" "put") ;
|
||||
vaccinate_V2 = mkV2 (mkV "vaccinate") ;
|
||||
examine_V2 = mkV2 (mkV "examine") ;
|
||||
|
||||
}
|
||||
118
lab2/grammar/application/DoctorFraMerle.gf
Normal file
118
lab2/grammar/application/DoctorFraMerle.gf
Normal file
@@ -0,0 +1,118 @@
|
||||
--# -path=.:../abstract:../english:../api
|
||||
|
||||
-- model implementation using Mini RGL
|
||||
|
||||
concrete DoctorFraMerle of Doctor =
|
||||
open
|
||||
SyntaxFre,
|
||||
ParadigmsFre,
|
||||
Prelude,
|
||||
StructuralFre
|
||||
in {
|
||||
|
||||
-- application using your own Mini* modules
|
||||
|
||||
lincat
|
||||
Phrase = Utt ;
|
||||
Fact = Cl ;
|
||||
Action = VP ;
|
||||
Property = VP ;
|
||||
Profession = CN ;
|
||||
Person = NP ;
|
||||
Place = {at,to : Adv} ;
|
||||
Substance = NP ;
|
||||
Illness = NP ;
|
||||
|
||||
lin
|
||||
presPosPhrase fact = mkUtt (mkS fact) ;
|
||||
presNegPhrase fact = mkUtt (mkS negativePol fact) ;
|
||||
pastPosPhrase fact = mkUtt (mkS anteriorAnt fact) ;
|
||||
pastNegPhrase fact = mkUtt (mkS anteriorAnt negativePol fact) ;
|
||||
presQuestionPhrase fact = let p : Utt = mkUtt (mkQS (mkQCl fact)) in p ** {s = p.s ++ SOFT_BIND ++ "?"} ;
|
||||
pastQuestionPhrase fact = let p : Utt = mkUtt (mkQS anteriorAnt (mkQCl fact)) in p ** {s = p.s ++ SOFT_BIND ++ "?"} ;
|
||||
|
||||
|
||||
impPosPhrase action = mkUtt (mkImp action) ;
|
||||
impNegPhrase action = mkUtt negativePol (mkImp action) ;
|
||||
|
||||
actionFact person action = mkCl person action ;
|
||||
propertyFact person property = mkCl person property ;
|
||||
|
||||
isProfessionProperty profession = mkVP (mkNP a_Det profession) ;
|
||||
needProfessionProperty profession = mkVP need_V2 (mkNP a_Det profession) ;
|
||||
isAtPlaceProperty place = mkVP place.at ;
|
||||
haveIllnessProperty illness = mkVP have_V2 illness ;
|
||||
|
||||
theProfessionPerson profession = mkNP the_Det profession ;
|
||||
|
||||
iMascPerson = i_NP ;
|
||||
iFemPerson = i_NP ;
|
||||
youMascPerson = youPol_NP ;
|
||||
youFemPerson = youPol_NP ;
|
||||
hePerson = he_NP ;
|
||||
shePerson = she_NP ;
|
||||
|
||||
goToAction place = mkVP (mkVP go_V) place.to ;
|
||||
stayAtAction place = mkVP (mkVP stay_V) place.at ;
|
||||
vaccinateAction person = mkVP vaccinate_V2 person ;
|
||||
examineAction person = mkVP examine_V2 person ;
|
||||
takeSubstanceAction substance = mkVP take_V2 substance ;
|
||||
|
||||
-- end of what could be a functor
|
||||
--------------------------------
|
||||
|
||||
coughAction = mkVP (mkV "tousser") ;
|
||||
breatheAction = mkVP (mkV "respirer") ;
|
||||
vomitAction = mkVP (mkV "vomir") ;
|
||||
sleepAction = mkVP (mkV "dormir" "dors" "dormons" "dorment" "dormit" "dormira" "dormi") ;
|
||||
undressAction = mkVP (reflV (mkV "déshabiller")) ;
|
||||
dressAction = mkVP (reflV (mkV "habiller")) ;
|
||||
eatAction = mkVP (mkV "manger") ;
|
||||
drinkAction = mkVP (mkV "boire" "bois" "buvons" "boivent" "but" "boira" "bu") ;
|
||||
smokeAction = mkVP (mkV "fumer") ;
|
||||
measureTemperatureAction = mkVP (mkV2 (mkV "mesurer")) (mkNP the_Det (mkN "temperatur du corps" feminine)) ;
|
||||
measureBloodPressureAction = mkVP (mkV2 (mkV "mesurer")) (mkNP the_Det (mkN "tension artérielle")) ;
|
||||
|
||||
--these are identical for 'at' and 'to' in French
|
||||
hospitalPlace = {at = pAdv "à l'hôpital" ; to = pAdv "à l'hôpital"} ;
|
||||
homePlace = {at = pAdv "à la maison" ; to = pAdv "à la maison"} ;
|
||||
schoolPlace = {at = pAdv "à l'école" ; to = pAdv "à l'école"} ;
|
||||
workPlace = {at = pAdv "au travail" ; to = pAdv "au travail"} ;
|
||||
|
||||
doctorProfession = mkCN (mkN "médecin") ;
|
||||
nurseProfession = mkCN ((mkN "infirmière") | (mkN "infermier")) ;
|
||||
interpreterProfession = mkCN (mkN "interprète") ;
|
||||
|
||||
bePregnantProperty = mkVP (mkA "enceinte") ;
|
||||
beIllProperty = mkVP (mkA "malade") ;
|
||||
beWellProperty = mkVP (mkA "bien" "bien" "bien" "bien") ;
|
||||
beDeadProperty = mkVP (mkA "mort") ;
|
||||
haveAllergiesProperty = mkVP have_V2 (mkNP aPl_Det (mkN "allergie")) ;
|
||||
havePainsProperty = mkVP have_V2 (mkNP aPl_Det (mkN "douleur")) ;
|
||||
haveChildrenProperty = mkVP have_V2 (mkNP aPl_Det (mkN "enfant")) ;
|
||||
|
||||
feverIllness = mkNP (mkN "fièvre") ;
|
||||
fluIllness = mkNP a_Det (mkN "grippe") ;
|
||||
headacheIllness = mkNP a_Det (mkN "mal de crâne") ;
|
||||
diarrheaIllness = mkNP (mkN "diarrhée") ;
|
||||
heartDiseaseIllness = mkNP a_Det (mkN "cardiopathie") ;
|
||||
lungDiseaseIllness = mkNP a_Det (mkN "maladie pulmonaire") ;
|
||||
hypertensionIllness = mkNP (mkN "hypertension") ;
|
||||
|
||||
alcoholSubstance = mkNP (mkN "alcool") ;
|
||||
medicineSubstance = mkNP a_Det (mkN "médicament") ;
|
||||
drugsSubstance = mkNP aPl_Det (mkN "drogue") ;
|
||||
|
||||
oper
|
||||
pAdv : Str -> Adv = ParadigmsFre.mkAdv ;
|
||||
|
||||
go_V = etreV (mkV "aller" "vais" "allons" "vont" "alla" "ira" "allé") ;
|
||||
stay_V = etreV (mkV "rester") ;
|
||||
need_V2 = mkV2 (mkV (mkV have_V2) "besoin d'") ;
|
||||
--need_V2 = mkV2 (mkV "nécessiter") ;
|
||||
take_V2 = mkV2 (mkV "prendre" "prends" "prenons" "prennent" "prit" "prendra" "pris") ;
|
||||
put_V2 = mkV2 (mkV "mettre" "mets" "mettons" "mettent" "mit" "mettra" "mis") ;
|
||||
vaccinate_V2 = mkV2 (mkV "vacciner") ;
|
||||
examine_V2 = mkV2 (mkV "examiner") ;
|
||||
|
||||
}
|
||||
113
lab2/grammar/application/DoctorRGLEng.gf
Normal file
113
lab2/grammar/application/DoctorRGLEng.gf
Normal file
@@ -0,0 +1,113 @@
|
||||
concrete DoctorRGLEng of Doctor =
|
||||
open
|
||||
SyntaxEng,
|
||||
ParadigmsEng,
|
||||
Prelude
|
||||
in {
|
||||
|
||||
-- application using standard RGL
|
||||
|
||||
lincat
|
||||
Phrase = Utt ;
|
||||
Fact = Cl ;
|
||||
Action = VP ;
|
||||
Property = VP ;
|
||||
Profession = CN ;
|
||||
Person = NP ;
|
||||
Place = {at,to : Adv} ;
|
||||
Substance = NP ;
|
||||
Illness = NP ;
|
||||
|
||||
lin
|
||||
presPosPhrase fact = mkUtt (mkS fact) ;
|
||||
presNegPhrase fact = mkUtt (mkS negativePol fact) ;
|
||||
pastPosPhrase fact = mkUtt (mkS anteriorAnt fact) ;
|
||||
pastNegPhrase fact = mkUtt (mkS anteriorAnt negativePol fact) ;
|
||||
-- presQuestionPhrase fact = mkUtt (mkQS (mkQCl fact)) ;
|
||||
-- pastQuestionPhrase fact = mkUtt (mkQS anteriorAnt (mkQCl fact)) ;
|
||||
presQuestionPhrase fact = let p : Utt = mkUtt (mkQS (mkQCl fact)) in p ** {s = p.s ++ SOFT_BIND ++ "?"} ;
|
||||
pastQuestionPhrase fact = let p : Utt = mkUtt (mkQS anteriorAnt (mkQCl fact)) in p ** {s = p.s ++ SOFT_BIND ++ "?"} ;
|
||||
|
||||
|
||||
impPosPhrase action = mkUtt (mkImp action) ;
|
||||
impNegPhrase action = mkUtt negativePol (mkImp action) ;
|
||||
|
||||
actionFact person action = mkCl person action ;
|
||||
propertyFact person property = mkCl person property ;
|
||||
|
||||
isProfessionProperty profession = mkVP (mkNP a_Det profession) ;
|
||||
needProfessionProperty profession = mkVP need_V2 (mkNP a_Det profession) ;
|
||||
isAtPlaceProperty place = mkVP place.at ;
|
||||
haveIllnessProperty illness = mkVP have_V2 illness ;
|
||||
|
||||
theProfessionPerson profession = mkNP the_Det profession ;
|
||||
|
||||
iMascPerson = i_NP ;
|
||||
iFemPerson = i_NP ;
|
||||
youMascPerson = you_NP ;
|
||||
youFemPerson = you_NP ;
|
||||
hePerson = he_NP ;
|
||||
shePerson = she_NP ;
|
||||
|
||||
goToAction place = mkVP (mkVP go_V) place.to ;
|
||||
stayAtAction place = mkVP (mkVP stay_V) place.at ;
|
||||
vaccinateAction person = mkVP vaccinate_V2 person ;
|
||||
examineAction person = mkVP examine_V2 person ;
|
||||
takeSubstanceAction substance = mkVP take_V2 substance ;
|
||||
|
||||
-- end of what could be a functor
|
||||
--------------------------------
|
||||
|
||||
coughAction = mkVP (mkV "cough") ;
|
||||
breatheAction = mkVP (mkV "breathe") ;
|
||||
vomitAction = mkVP (mkV "vomit") ;
|
||||
sleepAction = mkVP (mkV "sleep" "slept" "slept") ;
|
||||
undressAction = mkVP (mkVP take_V2 (mkNP thePl_Det (mkN "clothe"))) (pAdv "off") ;
|
||||
dressAction = mkVP (mkVP put_V2 (mkNP thePl_Det (mkN "clothe"))) (pAdv "on") ;
|
||||
eatAction = mkVP (mkV "eat" "ate" "eaten") ;
|
||||
drinkAction = mkVP (mkV "drink" "drank" "drunk") ;
|
||||
smokeAction = mkVP (mkV "smoke") ;
|
||||
measureTemperatureAction = mkVP (mkV2 (mkV "measure")) (mkNP the_Det (mkN "body temperature")) ;
|
||||
measureBloodPressureAction = mkVP (mkV2 (mkV "measure")) (mkNP the_Det (mkN "blood pressure")) ;
|
||||
|
||||
hospitalPlace = {at = pAdv "at the hospital" ; to = pAdv "to the hospital"} ;
|
||||
homePlace = {at = pAdv "at home" ; to = pAdv "home"} ;
|
||||
schoolPlace = {at = pAdv "at school" ; to = pAdv "to school"} ;
|
||||
workPlace = {at = pAdv "at work" ; to = pAdv "to work"} ;
|
||||
|
||||
doctorProfession = mkCN (mkN "doctor") ;
|
||||
nurseProfession = mkCN (mkN "nurse") ;
|
||||
interpreterProfession = mkCN (mkN "interpreter") ;
|
||||
|
||||
bePregnantProperty = mkVP (mkA "pregnant") ;
|
||||
beIllProperty = mkVP (mkA "ill") ;
|
||||
beWellProperty = mkVP (mkA "well") ;
|
||||
beDeadProperty = mkVP (mkA "dead") ;
|
||||
haveAllergiesProperty = mkVP have_V2 (mkNP aPl_Det (mkN "allergy")) ;
|
||||
havePainsProperty = mkVP have_V2 (mkNP aPl_Det (mkN "pain")) ;
|
||||
haveChildrenProperty = mkVP have_V2 (mkNP aPl_Det (mkN "child" "children")) ;
|
||||
|
||||
feverIllness = mkNP a_Det (mkN "fever") ;
|
||||
fluIllness = mkNP a_Det (mkN "flu") ;
|
||||
headacheIllness = mkNP a_Det (mkN "headache") ;
|
||||
diarrheaIllness = mkNP a_Det (mkN "diarrhea") ;
|
||||
heartDiseaseIllness = mkNP a_Det (mkN "heart disease") ;
|
||||
lungDiseaseIllness = mkNP a_Det (mkN "lung disease") ;
|
||||
hypertensionIllness = mkNP (mkN "hypertension") ;
|
||||
|
||||
alcoholSubstance = mkNP (mkN "alcohol") ;
|
||||
medicineSubstance = mkNP a_Det (mkN "drug") ;
|
||||
drugsSubstance = mkNP aPl_Det (mkN "drug") ;
|
||||
|
||||
oper
|
||||
pAdv : Str -> Adv = ParadigmsEng.mkAdv ;
|
||||
|
||||
go_V = mkV "go" "went" "gone" ;
|
||||
stay_V = mkV "stay" ;
|
||||
need_V2 = mkV2 (mkV "need") ;
|
||||
take_V2 = mkV2 (mkV "take" "took" "taken") ;
|
||||
put_V2 = mkV2 (mkV "put" "put" "put") ;
|
||||
vaccinate_V2 = mkV2 (mkV "vaccinate") ;
|
||||
examine_V2 = mkV2 (mkV "examine") ;
|
||||
|
||||
}
|
||||
112
lab2/grammar/application/DoctorSweBritta.gf
Normal file
112
lab2/grammar/application/DoctorSweBritta.gf
Normal file
@@ -0,0 +1,112 @@
|
||||
concrete DoctorSweBritta of Doctor =
|
||||
open
|
||||
SyntaxSwe,
|
||||
ParadigmsSwe,
|
||||
Prelude
|
||||
in {
|
||||
|
||||
-- application using standard RGL
|
||||
|
||||
lincat
|
||||
Phrase = Utt ;
|
||||
Fact = Cl ;
|
||||
Action = VP ;
|
||||
Property = VP ;
|
||||
Profession = CN ;
|
||||
Person = NP ;
|
||||
Place = {at,to : Adv} ;
|
||||
Substance = NP ;
|
||||
Illness = NP ;
|
||||
|
||||
lin
|
||||
presPosPhrase fact = mkUtt (mkS fact) ;
|
||||
presNegPhrase fact = mkUtt (mkS negativePol fact) ;
|
||||
pastPosPhrase fact = mkUtt (mkS anteriorAnt fact) ;
|
||||
pastNegPhrase fact = mkUtt (mkS anteriorAnt negativePol fact) ;
|
||||
-- presQuestionPhrase fact = mkUtt (mkQS (mkQCl fact)) ;
|
||||
-- pastQuestionPhrase fact = mkUtt (mkQS anteriorAnt (mkQCl fact)) ;
|
||||
presQuestionPhrase fact = let p : Utt = mkUtt (mkQS (mkQCl fact)) in p ** {s = p.s ++ SOFT_BIND ++ "?"} ;
|
||||
pastQuestionPhrase fact = let p : Utt = mkUtt (mkQS anteriorAnt (mkQCl fact)) in p ** {s = p.s ++ SOFT_BIND ++ "?"} ;
|
||||
|
||||
|
||||
impPosPhrase action = mkUtt (mkImp action) ;
|
||||
impNegPhrase action = mkUtt negativePol (mkImp action) ;
|
||||
|
||||
actionFact person action = mkCl person action ;
|
||||
propertyFact person property = mkCl person property ;
|
||||
|
||||
isProfessionProperty profession = mkVP (mkNP profession) ;
|
||||
needProfessionProperty profession = mkVP need_V2 (mkNP a_Det profession) ;
|
||||
isAtPlaceProperty place = mkVP place.at ;
|
||||
haveIllnessProperty illness = mkVP have_V2 illness ;
|
||||
|
||||
theProfessionPerson profession = mkNP the_Det profession ;
|
||||
|
||||
iMascPerson = i_NP ;
|
||||
iFemPerson = i_NP ;
|
||||
youMascPerson = you_NP ;
|
||||
youFemPerson = you_NP ;
|
||||
hePerson = he_NP ;
|
||||
shePerson = she_NP ;
|
||||
|
||||
goToAction place = mkVP (mkVP go_V) place.to ;
|
||||
stayAtAction place = mkVP (mkVP stay_V) place.at ;
|
||||
vaccinateAction person = mkVP vaccinate_V2 person ;
|
||||
examineAction person = mkVP examine_V2 person ;
|
||||
takeSubstanceAction substance = mkVP use_V2 substance ;
|
||||
|
||||
-- end of what could be a functor
|
||||
--------------------------------
|
||||
|
||||
coughAction = mkVP (mkV "hostar") ;
|
||||
breatheAction = mkVP (mkV "andas" "andas" "andas" "andades" "andats" "andad") ;
|
||||
vomitAction = mkVP (mkV "kräkas" "kräks" "kräks" "kräktes" "kräkts" "kräkt") ;
|
||||
sleepAction = mkVP (mkV "sova" "sov" "sovit") ;
|
||||
undressAction = mkVP (mkV2 (take_V "av" )) (mkNP thePl_Det (mkN "kläd" "kläder")) ;
|
||||
dressAction = mkVP (mkV2 (take_V "på")) (mkNP thePl_Det (mkN "kläd" "kläder")) ;
|
||||
eatAction = mkVP (mkV "äta" "åt" "ätit") ;
|
||||
drinkAction = mkVP (mkV "dricka" "drack" "druckit") ;
|
||||
smokeAction = mkVP (mkV "röker") ;
|
||||
measureTemperatureAction = mkVP (mkV2 (mkV "mäter")) (mkNP the_Det (mkN "kroppstemperatur")) ;
|
||||
measureBloodPressureAction = mkVP (mkV2 (mkV "mäter")) (mkNP the_Det (mkN "blodtryck" "blodtrycket" "blodtryck" "blodtrycken")) ;
|
||||
|
||||
hospitalPlace = {at = pAdv "på sjukhuset" ; to = pAdv "till sjukhuset"} ;
|
||||
homePlace = {at = pAdv "hemma" ; to = pAdv "hem"} ;
|
||||
schoolPlace = {at = pAdv "i skolan" ; to = pAdv "till skolan"} ;
|
||||
workPlace = {at = pAdv "på jobbet" ; to = pAdv "till jobbet"} ;
|
||||
|
||||
doctorProfession = mkCN (mkN "läkare" "läkare") ;
|
||||
nurseProfession = mkCN (mkN "sköterska") ;
|
||||
interpreterProfession = mkCN (mkN "tolk") ;
|
||||
|
||||
bePregnantProperty = mkVP (mkA "gravid") ;
|
||||
beIllProperty = mkVP (mkA "sjuk") ;
|
||||
beWellProperty = mkVP (mkA "frisk") ;
|
||||
beDeadProperty = mkVP (mkA "död") ;
|
||||
haveAllergiesProperty = mkVP have_V2 (mkNP aPl_Det (mkN "allergi" "allergier")) ;
|
||||
havePainsProperty = mkVP have_V2 (mkNP aPl_Det (mkN "smärta")) ;
|
||||
haveChildrenProperty = mkVP have_V2 (mkNP aPl_Det (mkN "barn" "barn")) ;
|
||||
|
||||
feverIllness = mkNP (mkN "feber") ;
|
||||
fluIllness = mkNP (mkN "influensa") ;
|
||||
headacheIllness = mkNP (mkN "huvudvärk") ;
|
||||
diarrheaIllness = mkNP (mkN "diarré") ;
|
||||
heartDiseaseIllness = mkNP a_Det (mkN "hjärtsjukdom") ;
|
||||
lungDiseaseIllness = mkNP a_Det (mkN "lungsjukdom") ;
|
||||
hypertensionIllness = mkNP (mkN "hypertoni") ;
|
||||
|
||||
alcoholSubstance = mkNP (mkN "alkohol") ;
|
||||
medicineSubstance = mkNP a_Det (mkN "medicin") ;
|
||||
drugsSubstance = mkNP aPl_Det (mkN "drog" "droger") ;
|
||||
|
||||
oper
|
||||
pAdv : Str -> Adv = ParadigmsSwe.mkAdv ;
|
||||
|
||||
go_V = mkV "gå" "gick" "gått" ;
|
||||
stay_V = mkV "stannar" ;
|
||||
take_V = mkV (mkV "ta" "tar" "ta" "tog" "tagit" "tagen") ;
|
||||
need_V2 = mkV2 (mkV "behöver") ;
|
||||
use_V2 = mkV2 (mkV "använda" "använde" "använt") ;
|
||||
vaccinate_V2 = mkV2 (mkV "vaccinerar") ;
|
||||
examine_V2 = mkV2 (mkV "undersöker") ;
|
||||
}
|
||||
Reference in New Issue
Block a user