mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-16 14:42:50 -06:00
scandinavian topological sentence model
This commit is contained in:
@@ -30,7 +30,7 @@ fun
|
||||
SPredSuperl : NP -> ADeg -> Cl ; -- "John is the oldest"
|
||||
SPredCN : NP -> CN -> Cl ; -- "John is a man"
|
||||
SPredNP : NP -> NP -> Cl ; -- "John is Bill"
|
||||
SPredPP : NP -> PP -> Cl ; -- "John is in France"
|
||||
SPredAdv : NP -> Adv -> Cl ; -- "John is in France"
|
||||
SPredAV : NP -> AV ->VPI ->Cl ; -- "John is eager to leave"
|
||||
SPredObjA2V : NP -> A2V -> NP ->VPI ->Cl ; -- "John is easy for us to convince"
|
||||
|
||||
@@ -55,7 +55,7 @@ fun
|
||||
QPredSuperl : IP -> ADeg -> QCl ; -- "who is the oldest"
|
||||
QPredCN : IP -> CN -> QCl ; -- "who is a man"
|
||||
QPredNP : IP -> NP -> QCl ; -- "who is Bill"
|
||||
QPredPP : IP -> PP -> QCl ; -- "who is in France"
|
||||
QPredAdv : IP -> Adv -> QCl ; -- "who is in France"
|
||||
QPredAV : IP -> AV ->VPI ->QCl ; -- "who is eager to leave"
|
||||
QPredObjA2V : IP -> A2V -> NP ->VPI ->QCl ; -- "who is easy for us to convince"
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ incomplete concrete ClauseI of Clause = open Rules, Verbphrase in {
|
||||
SPredSuperl np a = PredVP np (PredSuperl a) ;
|
||||
SPredCN np v = PredVP np (PredCN v) ;
|
||||
SPredNP np v = PredVP np (PredNP v) ;
|
||||
SPredPP np v = PredVP np (PredPP v) ;
|
||||
SPredAdv np v = PredVP np (PredAdv v) ;
|
||||
SPredAV np v x = PredVP np (PredAV v x) ;
|
||||
SPredObjA2V np v x y = PredVP np (PredObjA2V v x y) ;
|
||||
|
||||
@@ -49,7 +49,7 @@ incomplete concrete ClauseI of Clause = open Rules, Verbphrase in {
|
||||
QPredSuperl np a = IntVP np (PredSuperl a) ;
|
||||
QPredCN np v = IntVP np (PredCN v) ;
|
||||
QPredNP np v = IntVP np (PredNP v) ;
|
||||
QPredPP np v = IntVP np (PredPP v) ;
|
||||
QPredAdv np v = IntVP np (PredAdv v) ;
|
||||
QPredAV np v x = IntVP np (PredAV v x) ;
|
||||
QPredObjA2V np v x y = IntVP np (PredObjA2V v x y) ;
|
||||
|
||||
|
||||
41
lib/resource/abstract/Simple.gf
Normal file
41
lib/resource/abstract/Simple.gf
Normal file
@@ -0,0 +1,41 @@
|
||||
abstract Simple = Categories ** {
|
||||
|
||||
cat
|
||||
|
||||
Sentence ;
|
||||
|
||||
fun
|
||||
|
||||
PAffirm : Sentence -> Phr ;
|
||||
PNegate : Sentence -> Phr ;
|
||||
PQuestion : Sentence -> Phr ;
|
||||
PCommand : Imp -> Phr ;
|
||||
|
||||
SVerb : NP -> V -> Sentence ;
|
||||
STransVerb : NP -> V2 -> NP -> Sentence ;
|
||||
SAdjective : NP -> AP -> Sentence ;
|
||||
SAdverb : NP -> Adv -> Sentence ;
|
||||
|
||||
SModified : Sentence -> Adv -> Sentence ;
|
||||
|
||||
PIntV : IP -> V -> Phr ;
|
||||
PIntSubjV2 : IP -> V2 -> NP -> Phr ;
|
||||
PIntObjV2 : IP -> NP -> V2 -> Phr ;
|
||||
PIntAP : IP -> AP -> Phr ;
|
||||
PIntAdv : IP -> Adv -> Phr ;
|
||||
|
||||
NPDef : CN -> NP ;
|
||||
NPIndef : CN -> NP ;
|
||||
NPGroup : CN -> NP ;
|
||||
NPMass : CN -> NP ;
|
||||
NPName : PN -> NP ;
|
||||
|
||||
NSimple : N -> CN ;
|
||||
NModified : AP -> CN -> CN ;
|
||||
|
||||
ASimple : ADeg -> AP ;
|
||||
AVery : ADeg -> AP ;
|
||||
|
||||
AdvPrep : Prep -> NP -> Adv ;
|
||||
|
||||
}
|
||||
6
lib/resource/abstract/SimpleAux.gf
Normal file
6
lib/resource/abstract/SimpleAux.gf
Normal file
@@ -0,0 +1,6 @@
|
||||
resource SimpleAux = {
|
||||
|
||||
param
|
||||
SentenceForm = SAffirm | SNegate | SQuestion ;
|
||||
|
||||
}
|
||||
73
lib/resource/abstract/SimpleI.gf
Normal file
73
lib/resource/abstract/SimpleI.gf
Normal file
@@ -0,0 +1,73 @@
|
||||
incomplete concrete SimpleI of Simple =
|
||||
open Predef, Prelude, SimpleAux, Categories, Rules, Structural, Verbphrase in {
|
||||
|
||||
lincat
|
||||
|
||||
Sentence = {s : SentenceForm => Str} ;
|
||||
|
||||
lin
|
||||
PAffirm sent = ss (sent.s ! SAffirm) ** {lock_Phr = <>} ;
|
||||
PNegate sent = ss (sent.s ! SNegate) ** {lock_Phr = <>} ;
|
||||
PQuestion sent = ss (sent.s ! SQuestion) ** {lock_Phr = <>} ;
|
||||
PCommand = ImperOne ;
|
||||
|
||||
SVerb np v = {s = table {
|
||||
SAffirm => toStr S (UseCl (PosTP TPresent ASimul) (PredVP np (UseV v))) ;
|
||||
SNegate => toStr S (UseCl (NegTP TPresent ASimul) (PredVP np (UseV v))) ;
|
||||
SQuestion => toStr QS (UseQCl (PosTP TPresent ASimul) (QuestCl (PredVP np
|
||||
(UseV v))))
|
||||
}
|
||||
} ;
|
||||
|
||||
STransVerb np tv obj = {s = table {
|
||||
SAffirm => toStr S (UseCl (PosTP TPresent ASimul) (PredVP np (ComplV2 tv obj))) ;
|
||||
SNegate => toStr S (UseCl (PosTP TPresent ASimul) (PredVP np (ComplV2 tv obj))) ;
|
||||
SQuestion =>
|
||||
toStr QS (UseQCl (PosTP TPresent ASimul) (QuestCl (PredVP np (ComplV2 tv obj))))
|
||||
}
|
||||
} ;
|
||||
|
||||
SAdjective np ap = {s = table {
|
||||
SAffirm => toStr S (UseCl (PosTP TPresent ASimul) (PredVP np (PredAP ap))) ;
|
||||
SNegate => toStr S (UseCl (NegTP TPresent ASimul) (PredVP np (PredAP ap))) ;
|
||||
SQuestion => toStr QS (UseQCl (PosTP TPresent ASimul) (QuestCl (PredVP np
|
||||
(PredAP ap))))
|
||||
}
|
||||
} ;
|
||||
|
||||
SAdverb np ap = {s = table {
|
||||
SAffirm => toStr S (UseCl (PosTP TPresent ASimul) (PredVP np (PredAdv ap))) ;
|
||||
SNegate => toStr S (UseCl (NegTP TPresent ASimul) (PredVP np (PredAdv ap))) ;
|
||||
SQuestion => toStr QS (UseQCl (PosTP TPresent ASimul) (QuestCl (PredVP np
|
||||
(PredAdv ap))))
|
||||
}
|
||||
} ;
|
||||
|
||||
SModified s a = {s = \\f => s.s ! f ++ a.s ; lock_S = <>} ; ---
|
||||
|
||||
PIntV ip v =
|
||||
QuestPhrase (UseQCl (PosTP TPresent ASimul) (IntVP ip (UseV v))) ;
|
||||
PIntSubjV2 ip v np =
|
||||
QuestPhrase (UseQCl (PosTP TPresent ASimul) (IntVP ip (ComplV2 v np))) ;
|
||||
PIntObjV2 ip np v =
|
||||
QuestPhrase (UseQCl (PosTP TPresent ASimul) (IntSlash ip (SlashV2 np v))) ;
|
||||
PIntAP ip v =
|
||||
QuestPhrase (UseQCl (PosTP TPresent ASimul) (IntVP ip (PredAP v))) ;
|
||||
PIntAdv ip v =
|
||||
QuestPhrase (UseQCl (PosTP TPresent ASimul) (IntVP ip (PredAdv v))) ;
|
||||
|
||||
NPDef = DefOneNP ;
|
||||
NPIndef = IndefOneNP ;
|
||||
NPGroup = IndefNumNP NoNum ;
|
||||
NPMass = MassNP ;
|
||||
NPName = UsePN ;
|
||||
|
||||
NSimple = UseN ;
|
||||
NModified = ModAP ;
|
||||
|
||||
ASimple = PositADeg ;
|
||||
AVery a = AdvAP very_Adv (PositADeg a) ;
|
||||
|
||||
AdvPrep p np = AdvPP (PrepNP p np) ;
|
||||
|
||||
}
|
||||
26
lib/resource/abstract/SimpleLang.gf
Normal file
26
lib/resource/abstract/SimpleLang.gf
Normal file
@@ -0,0 +1,26 @@
|
||||
--# -path=.:../../prelude
|
||||
|
||||
abstract SimpleLang =
|
||||
Simple,
|
||||
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 ;
|
||||
|
||||
}
|
||||
@@ -37,7 +37,7 @@ abstract Verbphrase = Categories ** {
|
||||
PredSuperl : ADeg -> VP ; -- "is the oldest"
|
||||
PredCN : CN -> VP ; -- "is a man"
|
||||
PredNP : NP -> VP ; -- "is Bill"
|
||||
PredPP : PP -> VP ; -- "is in France"
|
||||
PredAdv : Adv -> VP ; -- "is in France", "is here"
|
||||
PredAV : AV -> VPI -> VP ; -- "is eager to leave"
|
||||
PredObjA2V : A2V -> NP -> VPI -> VP ; -- "is easy for us to convince"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user