mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
texts and idioms
This commit is contained in:
@@ -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"
|
||||
|
||||
13
lib/resource-1.0/abstract/Idiom.gf
Normal file
13
lib/resource-1.0/abstract/Idiom.gf
Normal file
@@ -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
|
||||
|
||||
}
|
||||
@@ -15,6 +15,8 @@ abstract Lang =
|
||||
Relative,
|
||||
Conjunction,
|
||||
Phrase,
|
||||
Text,
|
||||
Structural,
|
||||
Idiom,
|
||||
Lexicon
|
||||
** {} ;
|
||||
|
||||
11
lib/resource-1.0/abstract/Text.gf
Normal file
11
lib/resource-1.0/abstract/Text.gf
Normal file
@@ -0,0 +1,11 @@
|
||||
--1 Texts
|
||||
|
||||
abstract Text = Cat ** {
|
||||
|
||||
fun
|
||||
TEmpty : Text ;
|
||||
TFullStop : Phr -> Text -> Text ;
|
||||
TQuestMark : Phr -> Text -> Text ;
|
||||
TExclMark : Phr -> Text -> Text ;
|
||||
|
||||
}
|
||||
11
lib/resource-1.0/common/TextX.gf
Normal file
11
lib/resource-1.0/common/TextX.gf
Normal file
@@ -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} ;
|
||||
|
||||
}
|
||||
12
lib/resource-1.0/english/IdiomEng.gf
Normal file
12
lib/resource-1.0/english/IdiomEng.gf
Normal file
@@ -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
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,9 @@ concrete LangEng of Lang =
|
||||
RelativeEng,
|
||||
ConjunctionEng,
|
||||
PhraseEng,
|
||||
TextX,
|
||||
StructuralEng,
|
||||
IdiomEng,
|
||||
LexiconEng
|
||||
** {
|
||||
|
||||
|
||||
@@ -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 ;
|
||||
|
||||
@@ -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
|
||||
} ;
|
||||
|
||||
@@ -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 ;
|
||||
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
7
lib/resource-1.0/swedish/IdiomSwe.gf
Normal file
7
lib/resource-1.0/swedish/IdiomSwe.gf
Normal file
@@ -0,0 +1,7 @@
|
||||
concrete IdiomSwe of Idiom = CatSwe **
|
||||
open MorphoSwe, ParadigmsSwe, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ concrete LangSwe of Lang =
|
||||
RelativeSwe,
|
||||
ConjunctionSwe,
|
||||
PhraseSwe,
|
||||
TextX,
|
||||
IdiomSwe,
|
||||
StructuralSwe,
|
||||
LexiconSwe
|
||||
** {
|
||||
|
||||
Reference in New Issue
Block a user