mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-06-02 22:58:54 -06:00
resource = resource-1.0
This commit is contained in:
91
lib/resource-0.9/scandinavian/CategoriesScand.gf
Normal file
91
lib/resource-0.9/scandinavian/CategoriesScand.gf
Normal file
@@ -0,0 +1,91 @@
|
||||
incomplete concrete CategoriesScand of Categories =
|
||||
PredefCnc ** open Prelude, SyntaxScand in {
|
||||
|
||||
lincat
|
||||
CN = {s : Number => SpeciesP => Case => Str ; g : NounGender ;
|
||||
p : IsComplexCN} ;
|
||||
N = CommNoun ;
|
||||
-- = {s : Number => Species => Case => Str ; g : NounGender} ;
|
||||
NP = NounPhrase ;
|
||||
-- = {s : NPForm => Str ; g : Gender ; n : Number ; p : Person} ;
|
||||
PN = {s : Case => Str ; g : NounGender} ;
|
||||
Det = {s : NounGender => Str ; n : Number ; b : SpeciesP} ;
|
||||
NDet = {s : NounGender => Str ; b : SpeciesP} ;
|
||||
N2 = Function ;
|
||||
-- = CommNoun ** {s2 : Preposition} ;
|
||||
N3 = Function ** {s3 : Preposition} ;
|
||||
Num = {s : Gender => Case => Str ; n : Number} ;
|
||||
Prep = {s : Str} ;
|
||||
|
||||
A = Adjective ;
|
||||
-- = {s : AdjFormPos => Case => Str} ;
|
||||
A2 = Adjective ** {s2 : Preposition} ;
|
||||
ADeg = {s : AdjForm => Str} ;
|
||||
AP = Adjective ** {p : IsPostfixAdj} ;
|
||||
AS = Adjective ; --- "more difficult for him to come than..."
|
||||
A2S = Adjective ** {s2 : Preposition} ;
|
||||
AV = Adjective ;
|
||||
A2V = Adjective ** {s2 : Preposition} ;
|
||||
|
||||
V = Verb ;
|
||||
-- = {s : VerbForm => Str ; s1 : Str} ;
|
||||
VP = VerbGroup ;
|
||||
VCl = {s : Bool => Anteriority => VIForm => Gender => Number => Person => Str} ;
|
||||
VPI = {s : VIForm => Gender => Number => Person => Str} ;
|
||||
V2 = TransVerb ;
|
||||
-- = Verb ** {s2 : Preposition} ;
|
||||
V3 = TransVerb ** {s3 : Preposition} ;
|
||||
|
||||
VS = Verb ;
|
||||
VQ = Verb ;
|
||||
VV = Verb ** {isAux : Bool} ;
|
||||
VA = Verb ;
|
||||
|
||||
V2S = TransVerb ;
|
||||
V2Q = TransVerb ;
|
||||
V2V = DitransVerbVerb ;
|
||||
V2A = DitransAdjVerb ;
|
||||
V0 = Verb ;
|
||||
|
||||
TP = {s : Str ; b : Bool ; t : Tense ; a : Anteriority} ; --- the Str field is dummy
|
||||
Tense = {s : Str ; t : Tense} ;
|
||||
Pol = {s : Str ; p : Bool} ;
|
||||
Ant = {s : Str ; a : Anteriority} ;
|
||||
|
||||
|
||||
Adv = Adverb ;
|
||||
-- = {s : Str} ;
|
||||
AdV = Adverb ;
|
||||
AdA = Adverb ;
|
||||
AdC = Adverb ;
|
||||
PP = Adverb ;
|
||||
|
||||
S = Sentence ;
|
||||
-- = {s : Order => Str} ;
|
||||
Cl = Clause ;
|
||||
-- = {s : Bool => ClForm => Str} ;
|
||||
Slash = Clause ** {s2 : Preposition} ;
|
||||
|
||||
RP = {s : RelCase => GenNum => Str ; g : RelGender} ;
|
||||
RS = {s : GenNum => Person => Str} ;
|
||||
RCl = {s : Bool => SForm => GenNum => Person => Str} ;
|
||||
|
||||
IP = IntPron ; -- = NounPhrase ;
|
||||
IDet = {s : NounGender => Str ; n : Number ; b : SpeciesP} ;
|
||||
QS = {s : QuestForm => Str} ;
|
||||
QCl = {s : Bool => SForm => QuestForm => Str} ;
|
||||
Imp = {s : Number => Str} ;
|
||||
|
||||
Phr = {s : Str} ;
|
||||
|
||||
Conj = {s : Str ; n : Number} ;
|
||||
ConjD = {s1 : Str ; s2 : Str ; n : Number} ;
|
||||
|
||||
ListS = {s1,s2 : Order => Str} ;
|
||||
ListAP = {s1,s2 : AdjFormPos => Case => Str ; p : Bool} ;
|
||||
ListNP = {s1,s2 : NPForm => Str ; g : Gender ; n : Number ; p : Person} ;
|
||||
ListAdv = {s1,s2 : Str} ;
|
||||
|
||||
Subj = {s : Str} ;
|
||||
|
||||
}
|
||||
27
lib/resource-0.9/scandinavian/LangSats.gf
Normal file
27
lib/resource-0.9/scandinavian/LangSats.gf
Normal file
@@ -0,0 +1,27 @@
|
||||
--# -path=.:../../prelude
|
||||
|
||||
abstract LangSats =
|
||||
Rules,
|
||||
Sats,
|
||||
Structural,
|
||||
Basic,
|
||||
Time,
|
||||
Country
|
||||
|
||||
** {
|
||||
fun
|
||||
|
||||
-- Mount $Time$.
|
||||
|
||||
AdvDate : Date -> Adv ;
|
||||
AdvTime : Time -> Adv ;
|
||||
NWeekday : Weekday -> N ;
|
||||
PNWeekday : Weekday -> PN ;
|
||||
|
||||
-- Mount $Country$.
|
||||
|
||||
PNCountry : Country -> PN ;
|
||||
ANationality : Nationality -> A ;
|
||||
NLanguage : Language -> N ;
|
||||
|
||||
}
|
||||
52
lib/resource-0.9/scandinavian/MathScand.gf
Normal file
52
lib/resource-0.9/scandinavian/MathScand.gf
Normal file
@@ -0,0 +1,52 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
incomplete concrete MathScand of Math = CategoriesScand **
|
||||
open Prelude, SyntaxScand in {
|
||||
|
||||
lin
|
||||
SymbPN i = {s = \\_ => i.s ; g = NNeutr} ; --- cannot know gender
|
||||
IntPN i = {s = \\_ => i.s ; g = NNeutr} ;
|
||||
IntNP cn i = nameNounPhrase {
|
||||
s = \\c => cn.s ! Sg ! DefP Def ! Nom ++ i.s ;
|
||||
g = cn.g
|
||||
} ;
|
||||
|
||||
IndefSymbNumNP nu cn xs =
|
||||
addSymbNounPhrase (indefNounPhraseNum plural nu cn) xs.s ;
|
||||
DefSymbNumNP nu cn xs =
|
||||
addSymbNounPhrase (defNounPhraseNum plural nu cn) xs.s ;
|
||||
NDetSymbNP det nu cn xs =
|
||||
addSymbNounPhrase (numDetNounPhrase det nu cn) xs.s ;
|
||||
|
||||
lincat
|
||||
SymbList = SS ;
|
||||
|
||||
lin
|
||||
SymbTwo = infixSS conjEt ;
|
||||
SymbMore = infixSS "," ;
|
||||
|
||||
|
||||
LetImp x np = {
|
||||
s = \\_ => letImp ++ x.s ! PNom ++ verbVara.s ! VI (Inf Act) ++ np.s ! PNom
|
||||
} ;
|
||||
|
||||
--- to be replaced by "det existerar", etc.
|
||||
|
||||
ExistNP np = predVerbGroupClause npDet
|
||||
(complTransVerb (mkDirectVerb (deponentVerb verbFinnas))
|
||||
np) ;
|
||||
|
||||
-- Moved from $RulesScand$.
|
||||
|
||||
SymbCN cn s =
|
||||
{s = \\a,n,c => cn.s ! a ! n ! c ++ s.s ;
|
||||
g = cn.g ;
|
||||
p = cn.p
|
||||
} ;
|
||||
IntCN cn s =
|
||||
{s = \\a,n,c => cn.s ! a ! n ! c ++ s.s ;
|
||||
g = cn.g ;
|
||||
p = cn.p
|
||||
} ;
|
||||
|
||||
}
|
||||
192
lib/resource-0.9/scandinavian/RulesScand.gf
Normal file
192
lib/resource-0.9/scandinavian/RulesScand.gf
Normal file
@@ -0,0 +1,192 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
incomplete concrete RulesScand of Rules = CategoriesScand **
|
||||
open Prelude, SyntaxScand in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
UseN = noun2CommNounPhrase ;
|
||||
UsePN = nameNounPhrase ;
|
||||
|
||||
|
||||
IndefOneNP = indefNounPhrase singular ;
|
||||
IndefNumNP = indefNounPhraseNum plural ;
|
||||
DefOneNP = defNounPhrase singular ;
|
||||
DefNumNP = defNounPhraseNum plural ;
|
||||
|
||||
DetNP = detNounPhrase ;
|
||||
NDetNP = numDetNounPhrase ;
|
||||
NDetNum = justNumDetNounPhrase ;
|
||||
MassNP = detNounPhrase (mkDeterminerSg (detSgInvar []) IndefP) ;
|
||||
|
||||
AppN2 = appFunComm ;
|
||||
AppN3 = appFun2 ;
|
||||
UseN2 = funAsCommNounPhrase ;
|
||||
|
||||
ModAP = modCommNounPhrase ;
|
||||
CNthatS = nounThatSentence ;
|
||||
|
||||
ModGenOne = npGenDet singular noNum ;
|
||||
ModGenNum = npGenDet plural ;
|
||||
|
||||
UseInt i = {s = \\_ => table {Nom => i.s ; Gen => i.s ++ "s"} ; n = Pl} ; ---
|
||||
NoNum = noNum ;
|
||||
|
||||
UseA = adj2adjPhrase ;
|
||||
ComplA2 = complAdj ;
|
||||
ComplAV = complVerbAdj ;
|
||||
ComplObjA2V = complVerbAdj2 True ;
|
||||
|
||||
PositADeg = positAdjPhrase ;
|
||||
ComparADeg = comparAdjPhrase ;
|
||||
SuperlADeg = superlAdjPhrase ;
|
||||
|
||||
-- verbs and verb phrases mostly in $Clause$
|
||||
|
||||
PredAS = predAdjSent ;
|
||||
PredV0 = predVerb0 ;
|
||||
|
||||
-- Partial saturation.
|
||||
|
||||
UseV2 = transAsVerb ;
|
||||
---- ComplV3 = complDitransVerb ;
|
||||
|
||||
ComplA2S = predAdjSent2 ;
|
||||
|
||||
AdjPart = adjPastPart ;
|
||||
|
||||
UseV2V x = x ** {isAux = False} ;
|
||||
UseV2S x = x ;
|
||||
UseV2Q x = x ;
|
||||
UseA2S x = x ;
|
||||
UseA2V x = x ;
|
||||
|
||||
-- Formation of infinitival phrases.
|
||||
|
||||
UseCl tp cl = {s = \\o => tp.s ++ cl.s ! tp.b ! ClFinite tp.t tp.a o} ;
|
||||
UseRCl tp cl =
|
||||
{s = \\gn,p => tp.s ++ cl.s ! tp.b ! VFinite tp.t tp.a ! gn ! p} ;
|
||||
UseQCl tp cl = {s = \\q => tp.s ++ cl.s ! tp.b ! VFinite tp.t tp.a ! q} ;
|
||||
UseVCl po a cl = {
|
||||
s = \\v,g,n,p => po.s ++ a.s ++ cl.s ! po.p ! a.a ! v ! g ! n ! p ;
|
||||
} ;
|
||||
|
||||
PosTP t a = {s = t.s ++ a.s ; b = True ; t = t.t ; a = a.a} ;
|
||||
NegTP t a = {s = t.s ++ a.s ; b = False ; t = t.t ; a = a.a} ;
|
||||
|
||||
TPresent = {s = [] ; t = Present} ;
|
||||
TPast = {s = [] ; t = Past} ;
|
||||
TFuture = {s = [] ; t = Future} ;
|
||||
TConditional = {s = [] ; t = Condit} ;
|
||||
|
||||
ASimul = {s = [] ; a = Simul} ;
|
||||
AAnter = {s = [] ; a = Anter} ;
|
||||
|
||||
PPos = {s = [] ; p = True} ;
|
||||
PNeg = {s = [] ; p = False} ;
|
||||
|
||||
-- Adverbs.
|
||||
|
||||
AdjAdv a = advPost (a.s ! adverbForm ! Nom) ;
|
||||
AdvPP p = p ;
|
||||
PrepNP p = prepPhrase p.s ; ---
|
||||
|
||||
AdvCN = advCommNounPhrase ;
|
||||
AdvAP = advAdjPhrase ;
|
||||
AdvAdv = cc2 ;
|
||||
AdvNP np adv = <np : {g : Gender ; n : Number ; p : Person}> **
|
||||
{s = \\f => np.s ! f ++ adv.s} ;
|
||||
|
||||
--3 Sentences and relative clauses
|
||||
--
|
||||
|
||||
SlashV2 = slashTransVerb ;
|
||||
SlashVV2 = slashVerbVerb ;
|
||||
SlashAdv cl p = slashAdverb cl p.s ;
|
||||
|
||||
IdRP = identRelPron ;
|
||||
FunRP = funRelPron ;
|
||||
RelSlash = relSlash ;
|
||||
ModRS = modRelClause ;
|
||||
RelCl = relSuch ;
|
||||
|
||||
|
||||
--!
|
||||
--3 Questions and imperatives
|
||||
--
|
||||
|
||||
IDetCN d n = detNounPhrase d n ;
|
||||
FunIP = funIntPron ;
|
||||
|
||||
QuestCl = questClause ;
|
||||
IntSlash = intSlash ;
|
||||
QuestAdv = questAdverbial ;
|
||||
|
||||
PosImpVP = imperVerbPhrase True ;
|
||||
NegImpVP = imperVerbPhrase False ;
|
||||
|
||||
IndicPhrase = indicUtt ;
|
||||
QuestPhrase = interrogUtt ;
|
||||
ImperOne = imperUtterance singular ;
|
||||
ImperMany = imperUtterance plural ;
|
||||
|
||||
AdvCl = advClause ;
|
||||
AdvVPI = advVerbPhrase ;
|
||||
AdvPhr = advSentence ;
|
||||
AdCPhr = advSentence ;
|
||||
|
||||
|
||||
--!
|
||||
--3 Coordination
|
||||
--
|
||||
|
||||
TwoS = twoSentence ;
|
||||
ConsS = consSentence ;
|
||||
ConjS = conjunctSentence ;
|
||||
ConjDS = conjunctDistrSentence ;
|
||||
|
||||
TwoAP = twoAdjPhrase ;
|
||||
ConsAP = consAdjPhrase ;
|
||||
ConjAP = conjunctAdjPhrase ;
|
||||
ConjDAP = conjunctDistrAdjPhrase ;
|
||||
|
||||
TwoNP = twoNounPhrase ;
|
||||
ConsNP = consNounPhrase ;
|
||||
ConjNP = conjunctNounPhrase ;
|
||||
ConjDNP = conjunctDistrNounPhrase ;
|
||||
|
||||
TwoAdv = twoAdverb ;
|
||||
ConsAdv = consAdverb ;
|
||||
ConjAdv = conjunctAdverb ;
|
||||
ConjDAdv = conjunctDistrAdverb ;
|
||||
|
||||
SubjS = subjunctSentence ;
|
||||
SubjImper = subjunctImperative ;
|
||||
SubjQS = subjunctQuestion ;
|
||||
AdvSubj if A = {s = if.s ++ A.s ! Sub} ;
|
||||
|
||||
PhrNP = useNounPhrase ;
|
||||
PhrOneCN = useCommonNounPhrase singular ;
|
||||
PhrManyCN = useCommonNounPhrase plural ;
|
||||
PhrIP ip = ip ;
|
||||
PhrIAdv ia = ia ;
|
||||
PhrVPI = verbUtterance ;
|
||||
|
||||
OnePhr p = p ;
|
||||
ConsPhr = cc2 ;
|
||||
|
||||
-----------------------
|
||||
-- special constructions
|
||||
|
||||
OneNP = npMan ;
|
||||
|
||||
ExistCN A = predVerbGroupClause npDet
|
||||
(complTransVerb (mkDirectVerb (deponentVerb verbFinnas))
|
||||
(indefNounPhrase singular A)) ;
|
||||
ExistNumCN nu A = predVerbGroupClause npDet
|
||||
(complTransVerb (mkDirectVerb (deponentVerb verbFinnas))
|
||||
(indefNounPhraseNum plural nu A)) ;
|
||||
|
||||
|
||||
} ;
|
||||
162
lib/resource-0.9/scandinavian/SatsScand.gf
Normal file
162
lib/resource-0.9/scandinavian/SatsScand.gf
Normal file
@@ -0,0 +1,162 @@
|
||||
--1 Topological structure of Scandinavian sentences.
|
||||
--
|
||||
-- This is an alternative, more 'native' analysis than $Clause$ and
|
||||
-- $Verbphrase$, due to Diderichsen.
|
||||
--
|
||||
-- Sources:
|
||||
-- N. Jörgensen & J. Svensson, "Nusvensk grammatik" (Gleerups, 2001);
|
||||
-- R. Zola Christensen, "Dansk grammatik for svenskere"
|
||||
-- (Studentlitteratur 1999).
|
||||
|
||||
incomplete concrete SatsScand of Sats = CategoriesScand **
|
||||
open Prelude, SyntaxScand in {
|
||||
|
||||
flags optimize=parametrize ;
|
||||
|
||||
-- The analysis is based on the notions of fundament, nexus, and
|
||||
-- content ("innehåll") fields. Nexus and content are both divided into
|
||||
-- two subfields - a verb, a noun phrase, and an adverbial.
|
||||
-- In addition, there is a field for an extraposed sentence.
|
||||
-- Each of these subfields can in a main clause be 'moved' to the
|
||||
-- sentence-initial fundament position.
|
||||
|
||||
lincat
|
||||
Sats = {
|
||||
s1 : SForm => Str ; -- V1 har
|
||||
s2 : Str ; -- N1 jag
|
||||
s3 : Bool => Str ; -- A1 inte
|
||||
s4 : SForm => Str ; -- V2 sett
|
||||
s5 : Str ; -- N2 dig
|
||||
s6 : Str ; -- A2 idag
|
||||
s7 : Str ; -- S att... (extraposed sentence)
|
||||
e3,e4,e5,e6,e7 : Bool -- indicate if the field exists
|
||||
} ;
|
||||
|
||||
-- Thus the fundament is not a part of the $Sats$, but it is only
|
||||
-- created when the $Sats$ is used as a $Main$ clause.
|
||||
-- In an $Inv$erted clause, no fundament is created.
|
||||
-- In a $Sub$ordinate clause, the order is rigid as well.
|
||||
|
||||
lin
|
||||
ClSats sats = {s = \\b,cf =>
|
||||
let
|
||||
osf = cl2s cf ;
|
||||
har = sats.s1 ! osf.sf ;
|
||||
jag = sats.s2 ;
|
||||
inte = sats.s3 ! b ;
|
||||
sagt = sats.s4 ! osf.sf ;
|
||||
dig = sats.s5 ;
|
||||
idag = sats.s6 ;
|
||||
exts = sats.s7
|
||||
in case osf.o of {
|
||||
Main => variants {
|
||||
jag ++ har ++ inte ++ sagt ++ dig ++ idag ++ exts ;
|
||||
onlyIf (orB sats.e3 (notB b))
|
||||
(inte ++ har ++ jag ++ sagt ++ dig ++ idag ++ exts) ;
|
||||
onlyIf (orB sats.e4 (isCompoundClForm cf))
|
||||
(sagt ++ har ++ jag ++ inte ++ dig ++ idag ++ exts) ;
|
||||
onlyIf sats.e5
|
||||
(dig ++ har ++ jag ++ inte ++ sagt ++ idag ++ exts) ;
|
||||
onlyIf sats.e6
|
||||
(idag ++ har ++ jag ++ inte ++ sagt ++ dig ++ exts) ;
|
||||
onlyIf sats.e7
|
||||
(exts ++ har ++ jag ++ inte ++ sagt ++ dig ++ idag)
|
||||
} ;
|
||||
Inv =>
|
||||
har ++ jag ++ inte ++ sagt ++ dig ++ idag ++ exts ;
|
||||
Sub =>
|
||||
jag ++ inte ++ har ++ sagt ++ dig ++ idag ++ exts
|
||||
}
|
||||
} ;
|
||||
|
||||
-- The following rules show how the fields are filled in a
|
||||
-- predication, with different subcategorization patterns.
|
||||
|
||||
SatsV = mkSats ;
|
||||
|
||||
SatsV2 subj verb obj =
|
||||
mkSatsObject subj verb (verb.s2 ++ obj.s ! PAcc) ;
|
||||
|
||||
SatsV3 subj verb obj1 obj2 =
|
||||
mkSatsObject subj verb (verb.s2 ++ obj1.s ! PAcc ++ verb.s3 ++ obj2.s ! PAcc) ;
|
||||
|
||||
SatsReflV2 subj verb =
|
||||
mkSatsObject subj verb (verb.s2 ++ reflPron subj.n subj.p) ;
|
||||
|
||||
SatsVS subj verb sent =
|
||||
insertExtrapos (mkSats subj verb) (optStr infinAtt ++ sent.s ! Sub) ;
|
||||
|
||||
SatsVQ subj verb quest =
|
||||
insertExtrapos (mkSats subj verb) (quest.s ! IndirQ) ;
|
||||
|
||||
SatsV2S subj verb obj sent =
|
||||
insertExtrapos
|
||||
(mkSatsObject subj verb (verb.s2 ++ obj.s ! PAcc))
|
||||
(optStr infinAtt ++ sent.s ! Sub) ;
|
||||
|
||||
SatsV2Q subj verb obj quest =
|
||||
insertExtrapos
|
||||
(mkSatsObject subj verb (verb.s2 ++ obj.s ! PAcc))
|
||||
(quest.s ! IndirQ) ;
|
||||
|
||||
SatsAP subj adj =
|
||||
mkSatsCopula subj (adj.s ! predFormAdj subj.g subj.n ! Nom) ;
|
||||
|
||||
SatsCN subj cn =
|
||||
mkSatsCopula subj (indefNoun subj.n cn) ;
|
||||
|
||||
SatsNP subj np =
|
||||
mkSatsCopula subj (np.s ! PNom) ;
|
||||
|
||||
SatsAdv subj adv =
|
||||
mkSatsCopula subj adv.s ;
|
||||
|
||||
-- No problem to insert a verb-complement verb:
|
||||
---- (another rule needed for complement in perfect: "jag vill ha gått")
|
||||
|
||||
VVSats sats vv =
|
||||
let
|
||||
harvelat = verbSForm vv Act
|
||||
in
|
||||
{s1 = \\sf => (harvelat sf).fin ;
|
||||
s2 = sats.s2 ;
|
||||
s3 = sats.s3 ;
|
||||
s4 = \\sf => (harvelat sf).inf ++ sats.s4 ! VInfinit Simul ;
|
||||
s5 = sats.s5 ;
|
||||
s6 = sats.s6 ;
|
||||
s7 = sats.s7 ;
|
||||
e3 = sats.e3 ;
|
||||
e4 = True ;
|
||||
e5 = sats.e5 ;
|
||||
e6 = sats.e6 ;
|
||||
e7 = sats.e7
|
||||
} ;
|
||||
|
||||
-- This is where sentence adverbials are inserted.
|
||||
|
||||
AdVSats sats adv = {
|
||||
s1 = sats.s1 ;
|
||||
s2 = sats.s2 ;
|
||||
s3 = \\b => sats.s3 ! b ++ adv.s ;
|
||||
s4 = sats.s4 ;
|
||||
s5 = sats.s5 ;
|
||||
s6 = sats.s6 ;
|
||||
s7 = sats.s7 ;
|
||||
e3 = True ;
|
||||
e4 = sats.e4 ;
|
||||
e5 = sats.e5 ;
|
||||
e6 = sats.e6 ;
|
||||
e7 = sats.e7
|
||||
} ;
|
||||
|
||||
-- This is where other adverbials ('TSR') are inserted. There is an
|
||||
-- operation for this, since this place is used for many more things
|
||||
-- than the sentence adverbial place
|
||||
|
||||
AdvSats sats adv = insertAdverb sats adv.s ;
|
||||
|
||||
-- with proper means in GF, this would become even nicer:
|
||||
|
||||
--- AdVSats sats adv = sats ** {s3 = sats.s3 ++ adv.s ; e3 = True} ;
|
||||
|
||||
}
|
||||
1721
lib/resource-0.9/scandinavian/SyntaxScand.gf
Normal file
1721
lib/resource-0.9/scandinavian/SyntaxScand.gf
Normal file
File diff suppressed because it is too large
Load Diff
160
lib/resource-0.9/scandinavian/TypesScand.gf
Normal file
160
lib/resource-0.9/scandinavian/TypesScand.gf
Normal file
@@ -0,0 +1,160 @@
|
||||
--1 Scandinavian Word Classes and Morphological Parameters
|
||||
--
|
||||
-- This is a resource module for Swedish morphology, defining the
|
||||
-- morphological parameters and word classes of Swedish. It is aimed
|
||||
-- to be complete w.r.t. the description of word forms.
|
||||
-- However, it does not include those parameters that are not needed for
|
||||
-- analysing individual words: such parameters are defined in syntax modules.
|
||||
--
|
||||
-- This GF grammar was obtained from the functional morphology file TypesSw.hs
|
||||
-- semi-automatically. The GF inflection engine obtained was obtained automatically.
|
||||
|
||||
interface TypesScand = {
|
||||
|
||||
--
|
||||
|
||||
--2 Enumerated parameter types
|
||||
--
|
||||
-- These types are the ones found in school grammars.
|
||||
-- Their parameter values are atomic.
|
||||
|
||||
param
|
||||
Gender ;
|
||||
Number = Sg | Pl ;
|
||||
Species = Indef | Def ;
|
||||
Case = Nom | Gen ;
|
||||
Sex = NoMasc | Masc ;
|
||||
Mode = Ind | Cnj ;
|
||||
Voice = Act | Pass ;
|
||||
Degree = Pos | Comp | Sup ;
|
||||
Person = P1 | P2 | P3 ;
|
||||
|
||||
--2 Word classes and hierarchical parameter types
|
||||
--
|
||||
-- Real parameter types (i.e. ones on which words and phrases depend)
|
||||
-- are mostly hierarchical. The alternative would be cross-products of
|
||||
-- simple parameters, but this would usually overgenerate.
|
||||
--
|
||||
|
||||
--3 Substantives
|
||||
--
|
||||
-- Substantives (= common nouns) have a parameter of type SubstForm.
|
||||
|
||||
param SubstForm = SF Number Species Case ;
|
||||
|
||||
-- Substantives moreover have an inherent gender.
|
||||
|
||||
oper Subst : Type = {s : SubstForm => Str ; h1 : Gender} ;
|
||||
|
||||
neutrum, utrum : Gender ;
|
||||
|
||||
--3 Adjectives
|
||||
--
|
||||
-- Adjectives are a very complex class, and the full table has as many as
|
||||
-- 18 different forms. The major division is between the comparison degrees;
|
||||
-- the comparative has only the 2 case forms, whereas the positive has 12 forms.
|
||||
|
||||
param
|
||||
AdjForm = AF AdjFormGrad Case ;
|
||||
|
||||
-- The positive strong forms depend on gender: "en stor bil" - "ett stort hus".
|
||||
-- But the weak forms depend on sex: "den stora bilen" - "den store mannen".
|
||||
-- The plural never makes a gender-sex distinction.
|
||||
|
||||
GenNum = ASg Gender | APl ;
|
||||
SexNum = AxSg Sex | AxPl ;
|
||||
|
||||
-- This parameter is different from $Gender$ only for Swedish.
|
||||
|
||||
param
|
||||
NounGender ;
|
||||
|
||||
oper
|
||||
genNoun : NounGender -> Gender ;
|
||||
sexNoun : NounGender -> Sex ;
|
||||
gen2nounGen : Gender -> NounGender ;
|
||||
|
||||
param
|
||||
AdjFormPos ;
|
||||
AdjFormSup = SupStrong | SupWeak ;
|
||||
|
||||
AdjFormGrad =
|
||||
Posit AdjFormPos
|
||||
| Compar
|
||||
| Super AdjFormSup ;
|
||||
|
||||
oper
|
||||
Adj : Type = {s : AdjForm => Str} ;
|
||||
|
||||
adverbForm : AdjFormPos = Strong (ASg neutrum) ;
|
||||
|
||||
--3 Verbs
|
||||
--
|
||||
-- Verbs have 9 finite forms and as many as 18 infinite forms; the large number
|
||||
-- of the latter comes from adjectives.
|
||||
|
||||
oper Verbum : Type = {s : VerbForm => Str} ;
|
||||
|
||||
param
|
||||
VFin =
|
||||
Pres Voice
|
||||
| Pret Voice
|
||||
| Imper Voice ;
|
||||
|
||||
VInf =
|
||||
Inf Voice
|
||||
| Supin Voice
|
||||
| PtPret AdjFormPos Case
|
||||
;
|
||||
|
||||
VerbForm =
|
||||
VF VFin
|
||||
| VI VInf ;
|
||||
|
||||
-- However, the syntax only needs a simplified verb category, with
|
||||
-- present tense only. Such a verb can be extracted from the full verb,
|
||||
-- and a choice can be made between an active and a passive (deponent) verb.
|
||||
-- Active verbs continue to have passive forms. But we add an extra field $s1$
|
||||
-- for a verb particle, as e.g. in "se upp".
|
||||
|
||||
oper
|
||||
Verb : Type = {s : VerbForm => Str ; s1 : Str} ;
|
||||
|
||||
vNopart : Verbum -> Verb = \v -> v ** {s1 = []} ;
|
||||
|
||||
--3 Other open classes
|
||||
--
|
||||
-- Proper names, adverbs (Adv having comparison forms and AdvIn not having them),
|
||||
-- and interjections are the remaining open classes.
|
||||
|
||||
oper
|
||||
PNm : Type = {s : Case => Str ; h1 : Gender} ;
|
||||
--- Adv : Type = {s : Degree => Str} ;
|
||||
AdvInv : Type = {s : Str} ;
|
||||
Interj : Type = {s : Str} ;
|
||||
|
||||
--3 Closed classes
|
||||
--
|
||||
-- The rest of the Swedish word classes are closed, i.e. not extensible by new
|
||||
-- lexical entries. Thus we don't have to know how to build them, but only
|
||||
-- how to use them, i.e. which parameters they have.
|
||||
--
|
||||
-- The most important distinction is between proper-name-like pronouns and
|
||||
-- adjective-like pronouns, which are inflected in completely different parameters.
|
||||
|
||||
param
|
||||
NPForm = PNom | PAcc | PGen GenNum ;
|
||||
AdjPronForm = APron GenNum Case ;
|
||||
AuxVerbForm = AuxInf | AuxPres | AuxPret | AuxSup ;
|
||||
|
||||
oper
|
||||
ProPN : Type = {s : NPForm => Str ; h1 : Gender ; h2 : Number ; h3 : Person} ;
|
||||
ProAdj : Type = {s : AdjPronForm => Str} ;
|
||||
Prep : Type = {s : Str} ;
|
||||
Conjunct : Type = {s : Str} ;
|
||||
Subjunct : Type = {s : Str} ;
|
||||
Art : Type = {s : GenNum => Str} ;
|
||||
Part : Type = {s : Str} ;
|
||||
Infin : Type = {s : Str} ;
|
||||
VAux : Type = {s : AuxVerbForm => Str} ;
|
||||
}
|
||||
63
lib/resource-0.9/scandinavian/VerbphraseScand.gf
Normal file
63
lib/resource-0.9/scandinavian/VerbphraseScand.gf
Normal file
@@ -0,0 +1,63 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
--1 The Top-Level English Resource Grammar: Combination Rules
|
||||
--
|
||||
-- Aarne Ranta 2002 -- 2003
|
||||
--
|
||||
-- This is the English concrete syntax of the multilingual resource
|
||||
-- grammar. Most of the work is done in the file $syntax.Eng.gf$.
|
||||
-- However, for the purpose of documentation, we make here explicit the
|
||||
-- linearization types of each category, so that their structures and
|
||||
-- dependencies can be seen.
|
||||
-- Another substantial part are the linearization rules of some
|
||||
-- structural words.
|
||||
--
|
||||
-- The users of the resource grammar should not look at this file for the
|
||||
-- linearization rules, which are in fact hidden in the document version.
|
||||
-- They should use $resource.Abs.gf$ to access the syntactic rules.
|
||||
-- This file can be consulted in those, hopefully rare, occasions in which
|
||||
-- one has to know how the syntactic categories are
|
||||
-- implemented. The parameter types are defined in $TypesEng.gf$.
|
||||
|
||||
incomplete concrete VerbphraseScand of Verbphrase = CategoriesScand **
|
||||
open Prelude, SyntaxScand in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
UseV = predVerb ;
|
||||
UsePassV = passVerb ;
|
||||
ComplV2 = complTransVerb ;
|
||||
ComplV3 = complDitransVerb ;
|
||||
ComplReflV2 = reflTransVerb ;
|
||||
ComplVS = complSentVerb ;
|
||||
ComplVV = complVerbVerb ;
|
||||
ComplVQ = complQuestVerb ;
|
||||
ComplVA = complAdjVerb ;
|
||||
ComplV2A = complDitransAdjVerb ;
|
||||
ComplSubjV2V = complDitransVerbVerb False ;
|
||||
ComplObjV2V = complDitransVerbVerb True ;
|
||||
ComplV2S = complDitransSentVerb ;
|
||||
ComplV2Q = complDitransQuestVerb ;
|
||||
|
||||
PredAP = predAdjective ;
|
||||
PredCN = predCommNoun ;
|
||||
PredNP = predNounPhrase ;
|
||||
PredAdv = predAdverb ;
|
||||
|
||||
PredProgVP = progressiveVerbPhrase ;
|
||||
|
||||
-- Use VPs
|
||||
|
||||
PredVP = predVerbGroupClause ;
|
||||
RelVP = relVerbPhrase ;
|
||||
IntVP = intVerbPhrase ;
|
||||
|
||||
-- PosVP tp = predVerbGroup True tp ;
|
||||
-- NegVP tp = predVerbGroup False tp ;
|
||||
UseVP = predVerbGroupI ;
|
||||
|
||||
AdvVP = adVerbPhrase ;
|
||||
SubjVP = subjunctVerbPhrase ;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user