peace grammars patched to work with the new API

This commit is contained in:
aarne
2008-08-20 07:14:20 +00:00
parent 74373394a6
commit 02a80d68aa
14 changed files with 87 additions and 77 deletions

View File

@@ -3,7 +3,8 @@ abstract PeaceCat = {
cat
N; A; V; V2; V3; Pron;
IP; IAdv;
Adv; NP; CN; Imp; Det; Num;
Adv; NP; CN; Imp; Det; Num ;
Card ; Art ; --a
MassN ;
Phrase ;
PhraseWritten ;
@@ -16,4 +17,4 @@ abstract PeaceCat = {
Written : Phrase -> PhraseWritten ;
Spoken : Phrase -> PhraseSpoken ;
}
}

View File

@@ -3,6 +3,7 @@ incomplete concrete PeaceCatI of PeaceCat =
lincat
N = N; A = A; V = V; V2 = V2; V3 = V3; Pron = Pron;
Card = Card ; Art = Art ; --a
IP = IP; IAdv = IAdv;
Adv = Adv; NP = NP; CN = CN; Imp = Imp; Det = Det; Num = Num;
@@ -27,4 +28,4 @@ incomplete concrete PeaceCatI of PeaceCat =
ExclMark => { s = x ++ "!" } --TExclMark (ss s) TEmpty
} ;
}
}

View File

@@ -20,10 +20,13 @@ abstract PeaceLexCommon = PeaceCat ** {
-- Determiners
aSg_Det : Det ;
aPl_Det : Det ;
theSg_Det : Det ;
thePl_Det : Det ;
the_Art : Art ; --a
a_Art : Art ; --a
-- aSg_Det : Det ;
-- aPl_Det : Det ;
-- theSg_Det : Det ;
-- thePl_Det : Det ; --a
that_Det : Det ;
those_Det : Det ;
this_Det : Det ;
@@ -40,10 +43,10 @@ abstract PeaceLexCommon = PeaceCat ** {
-- Causes too much ambiguity
-- one_Det : Det ;
two_Num : Num ;
three_Num : Num ;
four_Num : Num ;
five_Num : Num ;
two_Num : Card ; --a
three_Num : Card ;
four_Num : Card ;
five_Num : Card ;
-- Adjectives
@@ -87,4 +90,4 @@ abstract PeaceLexCommon = PeaceCat ** {
sleep_V : V ;
walk_V : V ;
}
}

View File

@@ -1,4 +1,5 @@
incomplete concrete PeaceLexCommonI of PeaceLexCommon = PeaceCatI ** open Lang in {
incomplete concrete PeaceLexCommonI of PeaceLexCommon = PeaceCatI **
open Lang, Constructors in {
lin
@@ -15,20 +16,17 @@ incomplete concrete PeaceLexCommonI of PeaceLexCommon = PeaceCatI ** open Lang i
whatPl_IP = whatPl_IP ;
whatSg_IP = whatSg_IP ;
this_NP = this_NP ;
that_NP = that_NP ;
this_NP = mkNP this_Quant ;
that_NP = mkNP that_Quant ;
-- Determiners
aSg_Det = DetSg (SgQuant IndefArt) NoOrd;
aPl_Det = DetPl (PlQuant IndefArt) NoNum NoOrd;
theSg_Det = DetSg (SgQuant DefArt) NoOrd ;
thePl_Det = DetPl (PlQuant DefArt) NoNum NoOrd ;
that_Det = DetSg (SgQuant that_Quant) NoOrd ;
those_Det = DetPl (PlQuant that_Quant) NoNum NoOrd ;
this_Det = DetSg (SgQuant this_Quant) NoOrd ;
these_Det = DetPl (PlQuant this_Quant) NoNum NoOrd ;
a_Art = IndefArt ;
the_Art = DefArt ;
that_Det = mkDet that_Quant ;
those_Det = mkDet that_Quant plNum ;
this_Det = mkDet this_Quant ;
these_Det = mkDet this_Quant plNum ;
-- Adverbs
here_Adv = here_Adv;

View File

@@ -42,8 +42,10 @@ abstract PeaceSyntax = PeaceCat ** {
UsePron : Pron -> NP ;
PossPronCNSg : Pron -> CN -> NP ;
PossPronCNPl : Pron -> CN -> NP ;
ArtCNSg : Art -> CN -> NP ; --a
ArtCNPl : Art -> CN -> NP ; --a
DetCN : Det -> CN -> NP ;
NumCN : Num -> CN -> NP ;
NumCN : Card -> CN -> NP ; --a
UseN : N -> CN ;
ModCN : A -> CN -> CN ;
@@ -51,4 +53,4 @@ abstract PeaceSyntax = PeaceCat ** {
UseMassN : MassN -> MassCN ;
ModMass : A -> MassCN -> MassCN ;
}
}

View File

@@ -14,7 +14,7 @@ incomplete concrete PeaceSyntaxI of PeaceSyntax =
PhrYes = stop yes_Utt.s ;
PhrNo = stop no_Utt.s ;
{-
QuestSent sent = { s = sent.s!SQuest } ;
QuestIP_V v ip = mkQuest (QuestVP ip (UseV v)) ;
QuestIP_V2 v2 ip x = mkQuest (QuestVP ip (mkVP v2 x)) ;
@@ -26,9 +26,9 @@ incomplete concrete PeaceSyntaxI of PeaceSyntax =
QuestIAdv_V v x ia = mkQuest (QuestIAdv ia (PredVP x (UseV v)));
QuestIAdv_V2 v x y ia = mkQuest (QuestIAdv ia (PredVP x (ComplV2 v y)));
-}
SentV v np = mkSent (mkS np v) ;
SentV v np = mkSent (mkCl np v) ;
SentV2 v2 x y = mkSent (mkCl x v2 y) ;
SentV2Mass v2 x y = mkSent (mkCl x v2 (MassNP y)) ;
@@ -47,10 +47,12 @@ incomplete concrete PeaceSyntaxI of PeaceSyntax =
ImpV3Mass v3 x y = mkImp (mkVP v3 (MassNP x) y) ;
UsePron p = mkNP p ;
-- PossPronCNSg p n = DetCN (DetSg (SgQuant (PossPron p)) NoOrd) n;
-- PossPronCNPl p n = mkNP (DetPl (PlQuant (PossPron p)) NoNum NoOrd) n;
PossPronCNSg p n = mkNP (mkDet p) n ;
PossPronCNPl p n = mkNP (mkDet p plNum) n ;
DetCN d n = mkNP d n ;
NumCN k cn = mkNP a_Art k cn ;
ArtCNSg = DetArtSg ;
ArtCNPl = DetArtPl ;
UseN n = mkCN n ;
ModCN a cn = mkCN a cn ;
@@ -59,19 +61,19 @@ incomplete concrete PeaceSyntaxI of PeaceSyntax =
ModMass a cn = mkCN a cn ;
oper
mkSent : Cl -> Sent ;
mkSent : Lang.Cl -> Sent ;
mkSent cl =
{
s = table {
SPos => Predef.toStr S (mkS cl) ;
SNeg => Predef.toStr S (mkS negativePol cl) ;
SQuest => Predef.toStr QS (mkQS cl)
SPos => Predef.toStr Lang.S (mkS cl) ;
SNeg => Predef.toStr Lang.S (mkS negativePol cl) ;
SQuest => Predef.toStr Lang.QS (mkQS cl)
} ;
lock_Sent = <>
} ;
mkQuest : QCl -> Quest ;
mkQuest q = { s = Predef.toStr QS (mkQS q);
mkQuest : Lang.QCl -> Quest ;
mkQuest q = { s = Predef.toStr Lang.QS (mkQS q);
lock_Quest = <> } ;
}

View File

@@ -1,5 +1,6 @@
--# -path=.:present:prelude
concrete PeaceLexCommon_Eng of PeaceLexCommon =
PeaceCat_Eng ** PeaceLexCommonI with (Lang = LangEng) ;
PeaceCat_Eng ** PeaceLexCommonI with (Lang = LangEng),
(Constructors = ConstructorsEng) ;

View File

@@ -1,5 +1,6 @@
--# -path=.:present:prelude
concrete PeaceSyntax_Eng of PeaceSyntax = PeaceCat_Eng ** PeaceSyntaxI with
(Constructors = ConstructorsEng),
(Lang = LangEng) ;

View File

@@ -1,5 +1,6 @@
--# -path=.:present:prelude
concrete PeaceLexCommon_Fin of PeaceLexCommon =
PeaceCat_Fin ** PeaceLexCommonI with (Lang = LangFin) ;
PeaceCat_Fin ** PeaceLexCommonI with
(Lang = LangFin), (Constructors = ConstructorsFin) ;

View File

@@ -6,39 +6,39 @@ concrete PeaceLexExt_Fin of PeaceLexExt =
lin
-- Adjectives
dangerous_A = regA "vaarallinen" ;
dead_A = mkA (nRae "kuollut" "kuolleena") ;
hungry_A = regA "nälkäinen" ;
large_A = regA "iso" ;
sick_A = regA "sairas" ;
dangerous_A = mkA "vaarallinen" ;
dead_A = mkA (mkN "kuollut" "kuolleita") ;
hungry_A = mkA "nälkäinen" ;
large_A = mkA "iso" ;
sick_A = mkA "sairas" ;
-- Nouns
air_N = regN "ilma" ;
arm_N = reg3N "käsi" "käden" "käsiä" ;
building_N = regN "rakennus" ;
car_N = regN "auto" ;
corpse_N = regN "ruumis" ;
doctor_N = regN "lääkäri";
enemy_N = regN "vihollinen";
face_N = regN "naama" ; ---- kasvot
food_N = regN "ruoka";
friend_N = regN "ystävä";
ground_N = regN "maa" ;
knife_N = reg2N "veitsi" "veitsiä" ; ---- veistä
landmine_N = regN "maamiina" ;
map_N = regN "kartta" ;
medicine_N = regN "lääke" ;
police8officer_N = regN "poliisi" ;
skin_N = regN "iho" ;
soldier_N = regN "sotilas" ;
weapon_N = regN "ase";
air_N = mkN "ilma" ;
arm_N = mk3N "käsi" "käden" "käsiä" ;
building_N = mkN "rakennus" ;
car_N = mkN "auto" ;
corpse_N = mkN "ruumis" ;
doctor_N = mkN "lääkäri";
enemy_N = mkN "vihollinen";
face_N = mkN "naama" ; ---- kasvot
food_N = mkN "ruoka";
friend_N = mkN "ystävä";
ground_N = mkN "maa" ;
knife_N = mk2N "veitsi" "veitsiä" ; ---- veistä
landmine_N = mkN "maamiina" ;
map_N = mkN "kartta" ;
medicine_N = mkN "lääke" ;
police8officer_N = mkN "poliisi" ;
skin_N = mkN "iho" ;
soldier_N = mkN "sotilas" ;
weapon_N = mkN "ase";
-- Verbs
cough_V = regV "yskiä" ;
drop_V2 = dirV2 (regV "pudottaa") ;
hurt_V = regV "sattua" ;
need_V2 = dirV2 (regV "tarvita");
own_V2 = dirV2 (regV "omistaa") ;
show_V3 = dirdirV3 (regV "näyttää") ;
cough_V = mkV "yskiä" ;
drop_V2 = dirV2 (mkV "pudottaa") ;
hurt_V = mkV "sattua" ;
need_V2 = dirV2 (mkV "tarvita");
own_V2 = dirV2 (mkV "omistaa") ;
show_V3 = dirdirV3 (mkV "näyttää") ;
}

View File

@@ -1,14 +1,13 @@
--# -path=.:..:present:prelude
concrete PeacePhrases_Fin of PeacePhrases =
PeaceCat_Fin ** open LangFin, ParadigmsFin, PeaceRes in {
PeaceCat_Fin ** open LangFin, ParadigmsFin, ConstructorsFin, PeaceRes in {
lin
Hello = stop "terve" ;
GoodMorning = stop ["hyvää huomenta"] ;
GoodEvening = stop ["hyvää iltaa"] ;
WhatIsNamePron p = quest (PhrUtt NoPConj (UttQS (UseQCl TPres ASimul PPos
(QuestVP whatSg_IP (UseComp (CompNP (DetCN (DetSg (SgQuant (PossPron p)) NoOrd)
(UseN (reg2N "nimi" "nimiä")))))))) NoVoc).s ;
WhatIsNamePron p = quest (
mkPhr (mkUtt (mkQS (mkQCl whatSg_IP (mkVP (mkNP (mkDet p) name_N)))))).s ;
}
}

View File

@@ -1,5 +1,5 @@
--# -path=.:present:prelude
concrete PeaceSyntax_Fin of PeaceSyntax = PeaceCat_Fin ** PeaceSyntaxI with
(Lang = LangFin) ;
(Lang = LangFin), (Constructors = ConstructorsFin) ;

View File

@@ -1,5 +1,6 @@
--# -path=.:present:prelude
concrete PeaceLexCommon_Swe of PeaceLexCommon =
PeaceCat_Swe ** PeaceLexCommonI with (Lang = LangSwe) ;
PeaceCat_Swe ** PeaceLexCommonI with
(Lang = LangSwe), (Constructors = ConstructorsSwe) ; ;

View File

@@ -1,5 +1,5 @@
--# -path=.:present:prelude
concrete PeaceSyntax_Swe of PeaceSyntax = PeaceCat_Swe ** PeaceSyntaxI with
(Lang = LangSwe) ;
(Lang = LangSwe), (Constructors = ConstructorsSwe) ;