texts and idioms

This commit is contained in:
aarne
2006-02-20 14:52:37 +00:00
parent 4cd96c5d52
commit b6957f4e41
13 changed files with 80 additions and 6 deletions

View File

@@ -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"

View 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
}

View File

@@ -15,6 +15,8 @@ abstract Lang =
Relative,
Conjunction,
Phrase,
Text,
Structural,
Idiom,
Lexicon
** {} ;

View 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 ;
}

View 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} ;
}

View 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
}

View File

@@ -11,7 +11,9 @@ concrete LangEng of Lang =
RelativeEng,
ConjunctionEng,
PhraseEng,
TextX,
StructuralEng,
IdiomEng,
LexiconEng
** {

View File

@@ -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 ;

View File

@@ -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
} ;

View File

@@ -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 ;

View File

@@ -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 = {

View File

@@ -0,0 +1,7 @@
concrete IdiomSwe of Idiom = CatSwe **
open MorphoSwe, ParadigmsSwe, Prelude in {
flags optimize=all_subs ;
}

View File

@@ -11,6 +11,8 @@ concrete LangSwe of Lang =
RelativeSwe,
ConjunctionSwe,
PhraseSwe,
TextX,
IdiomSwe,
StructuralSwe,
LexiconSwe
** {