diff --git a/examples/peacekeeping/PeaceCat.gf b/examples/peacekeeping/PeaceCat.gf index ac75334ad..103295396 100644 --- a/examples/peacekeeping/PeaceCat.gf +++ b/examples/peacekeeping/PeaceCat.gf @@ -2,5 +2,12 @@ abstract PeaceCat = Cat ** { cat MassN ; + Phrase ; + PhraseWritten ; + PhraseSpoken ; + + fun + Written : Phrase -> PhraseWritten ; + Spoken : Phrase -> PhraseSpoken ; } \ No newline at end of file diff --git a/examples/peacekeeping/PeaceCatI.gf b/examples/peacekeeping/PeaceCatI.gf index 9b19b319b..312bc1b1e 100644 --- a/examples/peacekeeping/PeaceCatI.gf +++ b/examples/peacekeeping/PeaceCatI.gf @@ -1,6 +1,22 @@ -incomplete concrete PeaceCatI of PeaceCat = Cat ** open Cat in { +incomplete concrete PeaceCatI of PeaceCat = + Cat ** open Lang, PeaceRes, Prelude in { lincat MassN = N ; + Phrase = { s : Str; p : Punct } ; + PhraseWritten = { s : Str } ; + PhraseSpoken = { s : Str } ; + + lin + Written x = mkWritten x.s x.p ; + Spoken x = { s = x.s } ; + + oper + mkWritten : Str -> Punct -> { s : Str } ; + mkWritten x p = case p of { + FullStop => { s = x ++ "." } ; --TFullStop (ss s) TEmpty ; + QuestMark => { s = x ++ "?" } ; --TQuestMark (ss s) TEmpty ; + ExclMark => { s = x ++ "!" } --TExclMark (ss s) TEmpty + } ; } \ No newline at end of file diff --git a/examples/peacekeeping/PeacePhrases.gf b/examples/peacekeeping/PeacePhrases.gf index b44ddd2da..e883e9e19 100644 --- a/examples/peacekeeping/PeacePhrases.gf +++ b/examples/peacekeeping/PeacePhrases.gf @@ -1,9 +1,9 @@ -abstract PeacePhrases = Cat ** { +abstract PeacePhrases = PeaceCat ** { fun - Hello : Phr ; - GoodMorning : Phr ; - GoodEvening : Phr ; - WhatIsNamePron : Pron -> Phr ; + Hello : Phrase ; + GoodMorning : Phrase ; + GoodEvening : Phrase ; + WhatIsNamePron : Pron -> Phrase ; } \ No newline at end of file diff --git a/examples/peacekeeping/PeaceRes.gf b/examples/peacekeeping/PeaceRes.gf new file mode 100644 index 000000000..52d77ce3b --- /dev/null +++ b/examples/peacekeeping/PeaceRes.gf @@ -0,0 +1,11 @@ +resource PeaceRes = { + + param Punct = FullStop | QuestMark | ExclMark ; + + oper + stop, quest, excl : Str -> { s : Str; p : Punct } ; + stop x = { s = x; p = FullStop } ; + quest x = { s = x; p = QuestMark } ; + excl x = { s = x; p = ExclMark } ; + +} \ No newline at end of file diff --git a/examples/peacekeeping/PeaceSpoken.gf b/examples/peacekeeping/PeaceSpoken.gf new file mode 100644 index 000000000..59d7210f3 --- /dev/null +++ b/examples/peacekeeping/PeaceSpoken.gf @@ -0,0 +1 @@ +abstract PeaceSpoken = Peace ** {} \ No newline at end of file diff --git a/examples/peacekeeping/PeaceSyntax.gf b/examples/peacekeeping/PeaceSyntax.gf index 00da55ad2..21b852d63 100644 --- a/examples/peacekeeping/PeaceSyntax.gf +++ b/examples/peacekeeping/PeaceSyntax.gf @@ -6,14 +6,14 @@ abstract PeaceSyntax = PeaceCat ** { MassCN ; fun - PhrPos : Sent -> Phr ; - PhrNeg : Sent -> Phr ; - PhrQuest : Quest -> Phr ; - PhrImp : Imp -> Phr ; - PhrImpNeg : Imp -> Phr ; + PhrPos : Sent -> Phrase ; + PhrNeg : Sent -> Phrase ; + PhrQuest : Quest -> Phrase ; + PhrImp : Imp -> Phrase ; + PhrImpNeg : Imp -> Phrase ; - PhrYes : Phr ; - PhrNo : Phr ; + PhrYes : Phrase ; + PhrNo : Phrase ; QuestSent : Sent -> Quest ; diff --git a/examples/peacekeeping/PeaceSyntaxI.gf b/examples/peacekeeping/PeaceSyntaxI.gf index 4864682d6..89517d735 100644 --- a/examples/peacekeeping/PeaceSyntaxI.gf +++ b/examples/peacekeeping/PeaceSyntaxI.gf @@ -1,4 +1,5 @@ -incomplete concrete PeaceSyntaxI of PeaceSyntax = PeaceCatI ** open Lang in { +incomplete concrete PeaceSyntaxI of PeaceSyntax = + PeaceCatI ** open Lang,PeaceRes in { flags -- optimize = all_subs ; @@ -11,22 +12,21 @@ incomplete concrete PeaceSyntaxI of PeaceSyntax = PeaceCatI ** open Lang in { MassCN = CN ; lin - PhrPos sent = {s = sent.s ! SPos ++ "."} ; - PhrNeg sent = {s = sent.s ! SNeg ++ "."} ; - PhrQuest q = {s = q.s ++ "?" } ; - PhrImp imp = {s = (PhrUtt NoPConj (UttImpSg PPos imp) NoVoc).s ++ "!"} ; - PhrImpNeg imp = {s = (PhrUtt NoPConj (UttImpSg PNeg imp) NoVoc).s ++ "!"} ; + PhrPos sent = stop (sent.s!SPos) ; + PhrNeg sent = stop (sent.s!SNeg) ; + PhrQuest q = quest q.s ; + PhrImp imp = excl (PhrUtt NoPConj (UttImpSg PPos imp) NoVoc).s; + PhrImpNeg imp = excl (PhrUtt NoPConj (UttImpSg PNeg imp) NoVoc).s; - PhrYes = { s = yes_Phr.s ++ "." } ; - PhrNo = { s = no_Phr.s ++ "." } ; + PhrYes = stop yes_Phr.s ; + PhrNo = stop no_Phr.s ; - QuestSent sent = {s = sent.s ! SQuest } ; + QuestSent sent = { s = sent.s!SQuest } ; QuestIP_V v ip = mkQuest (QuestVP ip (UseV v)) ; QuestIP_V2 v ip x = mkQuest (QuestVP ip (ComplV2 v x)) ; QuestIP_V2Mass v ip x = mkQuest (QuestVP ip (ComplV2 v (massNP x))) ; QuestIP_V3 v ip x y = mkQuest (QuestVP ip (ComplV3 v x y)) ; QuestIP_V3Mass v ip x y = mkQuest (QuestVP ip (ComplV3 v (massNP x) y)) ; - QuestIP_A : A -> IP -> Phr ; QuestIP_A a ip = mkQuest (QuestVP ip (UseComp (CompAP (PositA a)))); QuestIAdv_NP x ia = mkQuest (QuestIComp (CompIAdv ia) x); diff --git a/examples/peacekeeping/english/PeaceCat_Eng.gf b/examples/peacekeeping/english/PeaceCat_Eng.gf index ac1d9a7dd..d73e1d581 100644 --- a/examples/peacekeeping/english/PeaceCat_Eng.gf +++ b/examples/peacekeeping/english/PeaceCat_Eng.gf @@ -1,3 +1,3 @@ --# -path=.:present:prelude -concrete PeaceCat_Eng of PeaceCat = CatEng ** PeaceCatI with (Cat = CatEng); \ No newline at end of file +concrete PeaceCat_Eng of PeaceCat = CatEng ** PeaceCatI with (Lang = LangEng); \ No newline at end of file diff --git a/examples/peacekeeping/english/PeacePhrases_Eng.gf b/examples/peacekeeping/english/PeacePhrases_Eng.gf index 73297d111..8bcf41ce0 100644 --- a/examples/peacekeeping/english/PeacePhrases_Eng.gf +++ b/examples/peacekeeping/english/PeacePhrases_Eng.gf @@ -1,12 +1,12 @@ --# -path=.:..:present:prelude concrete PeacePhrases_Eng of PeacePhrases = - PeaceCat_Eng ** open ResEng in { + PeaceCat_Eng ** open ResEng, PeaceRes in { lin - Hello = { s = "hello" ++ "." } ; - GoodMorning = { s = ["good morning"] ++ "." } ; - GoodEvening = { s = ["good evening"] ++ "." } ; - WhatIsNamePron p = { s = ["what is"] ++ p.s!Gen ++ "name" ++ "?"; }; + Hello = stop "hello" ; + GoodMorning = stop ["good morning"]; + GoodEvening = stop ["good evening"] ; + WhatIsNamePron p = quest (["what is"] ++ p.s!Gen ++ "name") ; } \ No newline at end of file diff --git a/examples/peacekeeping/english/PeaceSpoken_Eng.gf b/examples/peacekeeping/english/PeaceSpoken_Eng.gf new file mode 100644 index 000000000..bdd81bd9f --- /dev/null +++ b/examples/peacekeeping/english/PeaceSpoken_Eng.gf @@ -0,0 +1,8 @@ +--# -path=.:..:present:prelude + +concrete PeaceSpoken_Eng of PeaceSpoken = + Peace_Eng ** { + + flags startcat = PhraseSpoken ; + +} diff --git a/examples/peacekeeping/english/Peace_Eng.gf b/examples/peacekeeping/english/Peace_Eng.gf index bb3c726ed..dff33298b 100644 --- a/examples/peacekeeping/english/Peace_Eng.gf +++ b/examples/peacekeeping/english/Peace_Eng.gf @@ -5,6 +5,6 @@ concrete Peace_Eng of Peace = PeaceLexExt_Eng, PeacePhrases_Eng ** { - flags startcat = Phr ; + flags startcat = PhraseWritten ; } diff --git a/examples/peacekeeping/finnish/PeaceCat_Fin.gf b/examples/peacekeeping/finnish/PeaceCat_Fin.gf index 78da43ba7..b5e73aaf1 100644 --- a/examples/peacekeeping/finnish/PeaceCat_Fin.gf +++ b/examples/peacekeeping/finnish/PeaceCat_Fin.gf @@ -1,3 +1,3 @@ --# -path=.:present:prelude -concrete PeaceCat_Fin of PeaceCat = CatFin ** PeaceCatI with (Cat = CatFin); +concrete PeaceCat_Fin of PeaceCat = CatFin ** PeaceCatI with (Lang = LangFin); diff --git a/examples/peacekeeping/finnish/PeacePhrases_Fin.gf b/examples/peacekeeping/finnish/PeacePhrases_Fin.gf index ee8f5ea61..bd528c36b 100644 --- a/examples/peacekeeping/finnish/PeacePhrases_Fin.gf +++ b/examples/peacekeeping/finnish/PeacePhrases_Fin.gf @@ -1,14 +1,14 @@ --# -path=.:..:present:prelude concrete PeacePhrases_Fin of PeacePhrases = - PeaceCat_Fin ** open LangFin, ParadigmsFin in { + PeaceCat_Fin ** open LangFin, ParadigmsFin, PeaceRes in { lin - Hello = { s = "terve" ++ "." } ; - GoodMorning = { s = ["hyvää huomenta"] ++ "." } ; - GoodEvening = { s = ["hyvää iltaa"] ++ "." } ; - WhatIsNamePron p = PhrUtt NoPConj (UttQS (UseQCl TPres ASimul PPos + 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 ; + (UseN (reg2N "nimi" "nimiä")))))))) NoVoc).s ; } \ No newline at end of file diff --git a/examples/peacekeeping/finnish/PeaceSpoken_Fin.gf b/examples/peacekeeping/finnish/PeaceSpoken_Fin.gf new file mode 100644 index 000000000..98a23732b --- /dev/null +++ b/examples/peacekeeping/finnish/PeaceSpoken_Fin.gf @@ -0,0 +1,8 @@ +--# -path=.:..:present:prelude + +concrete PeaceSpoken_Fin of PeaceSpoken = + Peace_Fin ** { + + flags startcat = PhraseSpoken ; + +} diff --git a/examples/peacekeeping/finnish/Peace_Fin.gf b/examples/peacekeeping/finnish/Peace_Fin.gf index 0be7f4e96..f8e19d2b6 100644 --- a/examples/peacekeeping/finnish/Peace_Fin.gf +++ b/examples/peacekeeping/finnish/Peace_Fin.gf @@ -5,6 +5,6 @@ concrete Peace_Fin of Peace = PeaceLexExt_Fin, PeacePhrases_Fin ** { - flags startcat = Phr ; - + flags startcat = PhraseWritten ; + optimize = all_subs ; } diff --git a/examples/peacekeeping/swedish/PeaceCat_Swe.gf b/examples/peacekeeping/swedish/PeaceCat_Swe.gf index 8b0ce1346..5ccfb2ed5 100644 --- a/examples/peacekeeping/swedish/PeaceCat_Swe.gf +++ b/examples/peacekeeping/swedish/PeaceCat_Swe.gf @@ -1,3 +1,3 @@ --# -path=.:present:prelude -concrete PeaceCat_Swe of PeaceCat = CatSwe ** PeaceCatI with (Cat = CatSwe); \ No newline at end of file +concrete PeaceCat_Swe of PeaceCat = CatSwe ** PeaceCatI with (Lang = LangSwe); \ No newline at end of file diff --git a/examples/peacekeeping/swedish/PeacePhrases_Swe.gf b/examples/peacekeeping/swedish/PeacePhrases_Swe.gf index e04f58d61..7f9d88014 100644 --- a/examples/peacekeeping/swedish/PeacePhrases_Swe.gf +++ b/examples/peacekeeping/swedish/PeacePhrases_Swe.gf @@ -1,12 +1,12 @@ --# -path=.:..:present:prelude concrete PeacePhrases_Swe of PeacePhrases = - PeaceCat_Swe ** open CommonScand in { + PeaceCat_Swe ** open CommonScand, PeaceRes in { lin - Hello = { s = "hej" ++ "." } ; - GoodMorning = { s = ["god morgon"] ++ "." } ; - GoodEvening = { s = ["god kväll"] ++ "." } ; - WhatIsNamePron p = { s = ["vad heter"] ++ p.s!NPNom ++ "?"; }; + Hello = stop "hej" ; + GoodMorning = stop ["god morgon"] ; + GoodEvening = stop ["god kväll"] ; + WhatIsNamePron p = stop (["vad heter"] ++ p.s!NPNom) ; } \ No newline at end of file diff --git a/examples/peacekeeping/swedish/PeaceSpoken_Swe.gf b/examples/peacekeeping/swedish/PeaceSpoken_Swe.gf new file mode 100644 index 000000000..d622a1c07 --- /dev/null +++ b/examples/peacekeeping/swedish/PeaceSpoken_Swe.gf @@ -0,0 +1,8 @@ +--# -path=.:..:present:prelude + +concrete PeaceSpoken_Swe of PeaceSpoken = + Peace_Swe ** { + + flags startcat = PhraseSpoken ; + +} diff --git a/examples/peacekeeping/swedish/Peace_Swe.gf b/examples/peacekeeping/swedish/Peace_Swe.gf index 77090ceb2..c08e227d3 100644 --- a/examples/peacekeeping/swedish/Peace_Swe.gf +++ b/examples/peacekeeping/swedish/Peace_Swe.gf @@ -5,6 +5,6 @@ concrete Peace_Swe of Peace = PeaceLexExt_Swe, PeacePhrases_Swe ** { - flags startcat = Phr ; + flags startcat = PhraseWritten ; }