From b6957f4e414cd61b49b6fd78da59ddf462bc6d05 Mon Sep 17 00:00:00 2001 From: aarne Date: Mon, 20 Feb 2006 14:52:37 +0000 Subject: [PATCH] texts and idioms --- lib/resource-1.0/abstract/Cat.gf | 8 ++++++-- lib/resource-1.0/abstract/Idiom.gf | 13 +++++++++++++ lib/resource-1.0/abstract/Lang.gf | 2 ++ lib/resource-1.0/abstract/Text.gf | 11 +++++++++++ lib/resource-1.0/common/TextX.gf | 11 +++++++++++ lib/resource-1.0/english/IdiomEng.gf | 12 ++++++++++++ lib/resource-1.0/english/LangEng.gf | 2 ++ lib/resource-1.0/french/DiffFre.gf | 5 ++++- lib/resource-1.0/romance/ConjunctionRomance.gf | 4 ++-- lib/resource-1.0/romance/ResRomance.gf | 7 +++++++ lib/resource-1.0/romance/SentenceRomance.gf | 2 +- lib/resource-1.0/swedish/IdiomSwe.gf | 7 +++++++ lib/resource-1.0/swedish/LangSwe.gf | 2 ++ 13 files changed, 80 insertions(+), 6 deletions(-) create mode 100644 lib/resource-1.0/abstract/Idiom.gf create mode 100644 lib/resource-1.0/abstract/Text.gf create mode 100644 lib/resource-1.0/common/TextX.gf create mode 100644 lib/resource-1.0/english/IdiomEng.gf create mode 100644 lib/resource-1.0/swedish/IdiomSwe.gf diff --git a/lib/resource-1.0/abstract/Cat.gf b/lib/resource-1.0/abstract/Cat.gf index 752e0de00..954eeb697 100644 --- a/lib/resource-1.0/abstract/Cat.gf +++ b/lib/resource-1.0/abstract/Cat.gf @@ -6,16 +6,20 @@ abstract Cat = Tense ** { --2 Top-level units --- Constructed in [Phrase Phrase.html]. +-- Constructed in [Text Text.html]. Text ; -- text consisting of several phrases + +-- Constructed in [Phrase Phrase.html]. + Phr ; -- phrase in a text e.g. "But be quiet my darling." Utt ; -- sentence, question, word... e.g. "be quiet" Voc ; -- vocative or "please" e.g. "my darling" --2 Sentences and clauses --- Constructed in [Sentence Sentence.html]. +-- Constructed in [Sentence Sentence.html], and also in +-- [Idiom Idiom.html]. S ; -- declarative sentence e.g. "she lived here" QS ; -- question e.g. "where did she live" diff --git a/lib/resource-1.0/abstract/Idiom.gf b/lib/resource-1.0/abstract/Idiom.gf new file mode 100644 index 000000000..356b149e0 --- /dev/null +++ b/lib/resource-1.0/abstract/Idiom.gf @@ -0,0 +1,13 @@ +--1 Idiomatic expressions + +abstract Idiom = Cat ** { + +-- This module defines constructions that are formed in fixed ways, +-- often different even in closely related languages. + + fun + ExistNP : NP -> Cl ; -- there is a house + ImpersVP : VP -> Cl ; -- it rains + ProgrVP : VP -> VP ; -- sleeping + +} diff --git a/lib/resource-1.0/abstract/Lang.gf b/lib/resource-1.0/abstract/Lang.gf index 5663ac5cc..af95313dd 100644 --- a/lib/resource-1.0/abstract/Lang.gf +++ b/lib/resource-1.0/abstract/Lang.gf @@ -15,6 +15,8 @@ abstract Lang = Relative, Conjunction, Phrase, + Text, Structural, + Idiom, Lexicon ** {} ; diff --git a/lib/resource-1.0/abstract/Text.gf b/lib/resource-1.0/abstract/Text.gf new file mode 100644 index 000000000..7d4cca14a --- /dev/null +++ b/lib/resource-1.0/abstract/Text.gf @@ -0,0 +1,11 @@ +--1 Texts + +abstract Text = Cat ** { + + fun + TEmpty : Text ; + TFullStop : Phr -> Text -> Text ; + TQuestMark : Phr -> Text -> Text ; + TExclMark : Phr -> Text -> Text ; + +} diff --git a/lib/resource-1.0/common/TextX.gf b/lib/resource-1.0/common/TextX.gf new file mode 100644 index 000000000..38b15fddd --- /dev/null +++ b/lib/resource-1.0/common/TextX.gf @@ -0,0 +1,11 @@ +concrete TextX of Text = { + +-- This will work for almost all languages except Spanish. + + lin + TEmpty = {s = []} ; + TFullStop x xs = {s = x.s ++ "." ++ xs.s} ; + TQuestMark x xs = {s = x.s ++ "?" ++ xs.s} ; + TExclMark x xs = {s = x.s ++ "!" ++ xs.s} ; + +} diff --git a/lib/resource-1.0/english/IdiomEng.gf b/lib/resource-1.0/english/IdiomEng.gf new file mode 100644 index 000000000..82b61f123 --- /dev/null +++ b/lib/resource-1.0/english/IdiomEng.gf @@ -0,0 +1,12 @@ +concrete IdiomEng of Idiom = CatEng ** open Prelude, ResEng in { + + flags optimize=all_subs ; + + lin + ExistNP np = + mkClause "there" (agrP3 Sg) (insertObj (\\_ => np.s ! Acc) (predAux auxBe)) ; + ImpersVP vp = mkClause "it" (agrP3 Sg) vp ; +-- ProgrVP : VP -> VP ; -- sleeping + +} + diff --git a/lib/resource-1.0/english/LangEng.gf b/lib/resource-1.0/english/LangEng.gf index 944fcdb20..de5dd3853 100644 --- a/lib/resource-1.0/english/LangEng.gf +++ b/lib/resource-1.0/english/LangEng.gf @@ -11,7 +11,9 @@ concrete LangEng of Lang = RelativeEng, ConjunctionEng, PhraseEng, + TextX, StructuralEng, + IdiomEng, LexiconEng ** { diff --git a/lib/resource-1.0/french/DiffFre.gf b/lib/resource-1.0/french/DiffFre.gf index 3baed1f48..0fccab591 100644 --- a/lib/resource-1.0/french/DiffFre.gf +++ b/lib/resource-1.0/french/DiffFre.gf @@ -44,7 +44,10 @@ instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in { _ => prepCase c ++ artDef g Sg (CPrep P_de) } ; - conjunctCase : NPForm -> NPForm = \c -> c ; + conjunctCase : NPForm -> NPForm = \c -> case c of { + Aton k => Ton k ; + _ => c + } ; auxVerb : VType -> (VF => Str) = \vtyp -> case vtyp of { VHabere => avoir_V.s ; diff --git a/lib/resource-1.0/romance/ConjunctionRomance.gf b/lib/resource-1.0/romance/ConjunctionRomance.gf index 8b9494429..cdfbb97a2 100644 --- a/lib/resource-1.0/romance/ConjunctionRomance.gf +++ b/lib/resource-1.0/romance/ConjunctionRomance.gf @@ -34,12 +34,12 @@ incomplete concrete ConjunctionRomance of Conjunction = BaseAdv = twoSS ; ConsAdv = consrSS comma ; BaseNP x y = { - s1 = \\c => x.s ! c ; + s1 = \\c => x.s ! stressedCase c ; s2 = \\c => y.s ! (conjunctCase c) ; a = conjAgr x.a y.a } ; ConsNP x xs = { - s1 = \\c => x.s ! c ++ comma ++ xs.s1 ! (conjunctCase c) ; + s1 = \\c => x.s ! stressedCase c ++ comma ++ xs.s1 ! (conjunctCase c) ; s2 = \\c => xs.s2 ! (conjunctCase c) ; a = conjAgr x.a xs.a } ; diff --git a/lib/resource-1.0/romance/ResRomance.gf b/lib/resource-1.0/romance/ResRomance.gf index 4009ec22d..a5e724aad 100644 --- a/lib/resource-1.0/romance/ResRomance.gf +++ b/lib/resource-1.0/romance/ResRomance.gf @@ -39,6 +39,13 @@ oper _ => Ton c } ; +-- Pronouns in $NP$ lists are always in stressed forms. + + stressedCase : NPForm -> NPForm = \c -> case c of { + Aton k => Ton k ; + _ => c + } ; + appCompl : Compl -> (NPForm => Str) -> Str = \comp,np -> comp.s ++ np ! Ton comp.c ; diff --git a/lib/resource-1.0/romance/SentenceRomance.gf b/lib/resource-1.0/romance/SentenceRomance.gf index 332156e90..90b5acb56 100644 --- a/lib/resource-1.0/romance/SentenceRomance.gf +++ b/lib/resource-1.0/romance/SentenceRomance.gf @@ -26,7 +26,7 @@ incomplete concrete SentenceRomance of Sentence = SlashVVV2 np vv v2 = mkClause (np.s ! Aton Nom) np.a - (insertComplement (\\a => prepCase vv.c2.c ++ v2.s ! VInfin) (predV v2)) ** + (insertComplement (\\a => prepCase vv.c2.c ++ v2.s ! VInfin) (predV v2)) ** {c2 = v2.c2} ; AdvSlash slash adv = { diff --git a/lib/resource-1.0/swedish/IdiomSwe.gf b/lib/resource-1.0/swedish/IdiomSwe.gf new file mode 100644 index 000000000..03679a42f --- /dev/null +++ b/lib/resource-1.0/swedish/IdiomSwe.gf @@ -0,0 +1,7 @@ +concrete IdiomSwe of Idiom = CatSwe ** + open MorphoSwe, ParadigmsSwe, Prelude in { + + flags optimize=all_subs ; + +} + diff --git a/lib/resource-1.0/swedish/LangSwe.gf b/lib/resource-1.0/swedish/LangSwe.gf index e0d655ac0..42e1291e5 100644 --- a/lib/resource-1.0/swedish/LangSwe.gf +++ b/lib/resource-1.0/swedish/LangSwe.gf @@ -11,6 +11,8 @@ concrete LangSwe of Lang = RelativeSwe, ConjunctionSwe, PhraseSwe, + TextX, + IdiomSwe, StructuralSwe, LexiconSwe ** {