mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
rules for constructing structural words (separate from Paradigms - is this desirable?)
This commit is contained in:
@@ -32,6 +32,11 @@ constructX:
|
||||
gfc common/ConstructX.gf
|
||||
cp -p common/ConstructX.gfo ../prelude
|
||||
|
||||
MakeStructural:
|
||||
gfc */MakeStructural*.gf
|
||||
cp -p */MakeStructural*.gfo ../present
|
||||
cp -p */MakeStructural*.gfo ../alltenses
|
||||
|
||||
test:
|
||||
$(RUNMAKE) test
|
||||
|
||||
|
||||
@@ -132,4 +132,5 @@ abstract Noun = Cat ** {
|
||||
|
||||
ApposCN : CN -> NP -> CN ; -- city Paris (, numbers x and y)
|
||||
|
||||
|
||||
} ;
|
||||
|
||||
@@ -17,7 +17,7 @@ abstract Relative = Cat ** {
|
||||
RelSlash : RP -> ClSlash -> RCl ; -- whom John loves
|
||||
|
||||
-- Relative pronouns are formed from an 'identity element' by prefixing
|
||||
-- or suffixing (depending on language) prepositional phrases.
|
||||
-- or suffixing (depending on language) prepositional phrases or genitives.
|
||||
|
||||
IdRP : RP ; -- which
|
||||
FunRP : Prep -> NP -> RP -> RP ; -- the mother of whom
|
||||
|
||||
@@ -109,13 +109,12 @@ abstract Structural = Cat ** {
|
||||
youPol_Pron : Pron ; -- you (polite)
|
||||
|
||||
no_Quant : Quant ;
|
||||
nobody_but_Predet : Predet ;
|
||||
nothing_but_Predet : Predet ;
|
||||
not_Predet : Predet ;
|
||||
if_then_Conj : Conj ;
|
||||
at_least_AdN : AdN ;
|
||||
at_most_AdN : AdN ;
|
||||
nobody_NP : NP ;
|
||||
nothing_NP : NP ;
|
||||
except_Prep : Prep ;
|
||||
|
||||
}
|
||||
|
||||
@@ -749,7 +749,9 @@ incomplete resource Constructors = open Grammar in {
|
||||
|
||||
mkRS : overload {
|
||||
mkRS : RCl -> RS ; -- 1. that walk
|
||||
mkRS : (Tense) -> (Ant) -> (Pol) -> RCl -> RS -- 2. that wouldn't have walked
|
||||
mkRS : (Tense) -> (Ant) -> (Pol) -> RCl -> RS ; -- 2. that wouldn't have walked
|
||||
mkRS : Conj -> RS -> RS -> RS ; -- 3. who walks and whom I know
|
||||
mkRS : Conj -> ListRS -> RS ; -- 4. who walks, whose son runs, and whom I know
|
||||
} ;
|
||||
|
||||
--3 RCl, relative clauses
|
||||
@@ -857,6 +859,12 @@ incomplete resource Constructors = open Grammar in {
|
||||
mkListNP : NP -> ListNP -> ListNP -- 2. John, I, that
|
||||
} ;
|
||||
|
||||
--3 ListRS, relative clause lists
|
||||
|
||||
mkListRS : overload {
|
||||
mkListRS : RS -> RS -> ListRS ; -- 1. who walks, who runs
|
||||
mkListRS : RS -> ListRS -> ListRS -- 2. who walks, who runs, who sleeps
|
||||
} ;
|
||||
|
||||
--.
|
||||
-- Definitions
|
||||
@@ -1473,7 +1481,12 @@ incomplete resource Constructors = open Grammar in {
|
||||
mkRS : Ant -> Pol -> RCl -> RS
|
||||
= \a,p -> TUseRCl TPres a p ;
|
||||
mkRS : Tense -> Ant -> Pol -> RCl -> RS
|
||||
= TUseRCl
|
||||
= TUseRCl ;
|
||||
mkRS : Conj -> RS -> RS -> RS
|
||||
= \c,x,y -> ConjRS c (BaseRS x y) ;
|
||||
mkRS : Conj -> ListRS -> RS
|
||||
= \c,xy -> ConjRS c xy ;
|
||||
|
||||
} ;
|
||||
|
||||
param Punct = PFullStop | PExclMark | PQuestMark ;
|
||||
@@ -1618,6 +1631,11 @@ incomplete resource Constructors = open Grammar in {
|
||||
mkListNP : NP -> ListNP -> ListNP = ConsNP
|
||||
} ;
|
||||
|
||||
mkListRS = overload {
|
||||
mkListRS : RS -> RS -> ListRS = BaseRS ;
|
||||
mkListRS : RS -> ListRS -> ListRS = ConsRS
|
||||
} ;
|
||||
|
||||
|
||||
------------ for backward compatibility
|
||||
|
||||
|
||||
11
next-lib/src/english/MakeStructuralEng.gf
Normal file
11
next-lib/src/english/MakeStructuralEng.gf
Normal file
@@ -0,0 +1,11 @@
|
||||
--# -path=.:../common:../abstract
|
||||
|
||||
resource MakeStructuralEng = open CatEng, ParadigmsEng, MorphoEng, Prelude in {
|
||||
|
||||
oper
|
||||
mkConj : Str -> Str -> Number -> Conj = \x,y,n ->
|
||||
{s1 = x ; s2 = y ; n = n ; lock_Conj = <>} ;
|
||||
mkSubj : Str -> Subj = \x ->
|
||||
{s = x ; lock_Subj = <>} ;
|
||||
|
||||
}
|
||||
@@ -123,8 +123,6 @@ concrete StructuralEng of Structural = CatEng **
|
||||
youPol_Pron = mkPron "you" "you" "your" "yours" singular P2 human ;
|
||||
|
||||
not_Predet = {s = "not" ; lock_Predet = <>} ;
|
||||
nothing_but_Predet = {s = "nothing but" ; lock_Predet = <>} ;
|
||||
nobody_but_Predet = {s = "nobody but" ; lock_Predet = <>} ;
|
||||
no_Quant = mkQuant "no" "no" ;
|
||||
if_then_Conj = {s1 = "if" ; s2 = "then" ; n = singular ; lock_Conj = <>} ;
|
||||
nobody_NP = regNP "nobody" singular ;
|
||||
@@ -132,5 +130,7 @@ concrete StructuralEng of Structural = CatEng **
|
||||
|
||||
at_least_AdN = mkAdN "at least" ;
|
||||
at_most_AdN = mkAdN "at most" ;
|
||||
|
||||
except_Prep = mkPrep "except" ;
|
||||
}
|
||||
|
||||
|
||||
13
next-lib/src/french/MakeStructuralFre.gf
Normal file
13
next-lib/src/french/MakeStructuralFre.gf
Normal file
@@ -0,0 +1,13 @@
|
||||
--# -path=.:../romance:../common:../abstract
|
||||
|
||||
resource MakeStructuralFre = open CatFre, ParadigmsFre, MorphoFre, Prelude in {
|
||||
|
||||
oper
|
||||
mkConj : Str -> Str -> Number -> Conj = \x,y,n ->
|
||||
{s1 = x ; s2 = y ; n = n ; lock_Conj = <>} ;
|
||||
mkSubj : Str -> Subj = \x ->
|
||||
{s = x ; m = Indic ; lock_Subj = <>} ;
|
||||
mkSubjSubj : Str -> Subj = \x ->
|
||||
{s = x ; m = Conjunct ; lock_Subj = <>} ;
|
||||
|
||||
}
|
||||
@@ -163,9 +163,6 @@ lin
|
||||
Masc Pl P2 ;
|
||||
|
||||
not_Predet = {s = \\a,c => prepCase c ++ "pas" ; c = Nom} ;
|
||||
nothing_but_Predet = {s = \\a,c => prepCase c ++ "rien excepté" ; c = Nom} ;
|
||||
nobody_but_Predet = {s = \\a,c => prepCase c ++ "personne excepté" ; c = Nom} ;
|
||||
|
||||
|
||||
no_Quant =
|
||||
let aucun : ParadigmsFre.Number => ParadigmsFre.Gender => Case => Str = table {
|
||||
@@ -184,5 +181,7 @@ lin
|
||||
at_least_AdN = ss "au moins" ;
|
||||
at_most_AdN = ss "au plus" ;
|
||||
|
||||
except_Prep = mkPreposition "excepté" ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
11
next-lib/src/german/MakeStructuralGer.gf
Normal file
11
next-lib/src/german/MakeStructuralGer.gf
Normal file
@@ -0,0 +1,11 @@
|
||||
--# -path=.:../common:../abstract
|
||||
|
||||
resource MakeStructuralGer = open CatGer, ParadigmsGer, MorphoGer, Prelude in {
|
||||
|
||||
oper
|
||||
mkConj : Str -> Str -> Number -> Conj = \x,y,n ->
|
||||
{s1 = x ; s2 = y ; n = n ; lock_Conj = <>} ;
|
||||
mkSubj : Str -> Subj = \x ->
|
||||
{s = x ; lock_Subj = <>} ;
|
||||
|
||||
}
|
||||
@@ -128,12 +128,6 @@ concrete StructuralGer of Structural = CatGer **
|
||||
yes_Utt = ss "ja" ;
|
||||
|
||||
not_Predet = {s = \\_,_,_ => "nicht" ; c = NoCase} ;
|
||||
nothing_but_Predet = {s = \\_,_,_ => "nichts ausser" ; c = PredCase Dat} ;
|
||||
nobody_but_Predet = {
|
||||
s = \\_,_,c =>
|
||||
caselist "niemand" "niemanden" "niemandem" "niemands" ! c ++ "ausser" ;
|
||||
c = PredCase Dat
|
||||
} ;
|
||||
no_Quant = let
|
||||
keiner : Number => Gender => Case => Str = table {
|
||||
Sg => \\g,c => "kein" + pronEnding ! GSg g ! c ;
|
||||
@@ -148,5 +142,5 @@ concrete StructuralGer of Structural = CatGer **
|
||||
nameNounPhrase {s = \\_ => "nichts"} ;
|
||||
at_least_AdN = ss "wenigstens" ;
|
||||
at_most_AdN = ss "höchstens" ;
|
||||
|
||||
except_Prep = mkPrep "außer" Dat ;
|
||||
}
|
||||
|
||||
@@ -189,5 +189,4 @@ incomplete concrete NounScand of Noun =
|
||||
g = g ;
|
||||
isMod = cn.isMod
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
11
next-lib/src/swedish/MakeStructuralSwe.gf
Normal file
11
next-lib/src/swedish/MakeStructuralSwe.gf
Normal file
@@ -0,0 +1,11 @@
|
||||
--# -path=.:../scandinavian:../common:../abstract
|
||||
|
||||
resource MakeStructuralSwe = open CatSwe, ParadigmsSwe, MorphoSwe, Prelude in {
|
||||
|
||||
oper
|
||||
mkConj : Str -> Str -> Number -> Conj = \x,y,n ->
|
||||
{s1 = x ; s2 = y ; n = n ; lock_Conj = <>} ;
|
||||
mkSubj : Str -> Subj = \x ->
|
||||
{s = x ; lock_Subj = <>} ;
|
||||
|
||||
}
|
||||
@@ -125,8 +125,6 @@ concrete StructuralSwe of Structural = CatSwe **
|
||||
|
||||
lin
|
||||
not_Predet = {s = \\_ => "inte"} ;
|
||||
nothing_but_Predet = {s = \\_ => "inget förutom"} ;
|
||||
nobody_but_Predet = {s = \\_ => "ingen förutom"} ;
|
||||
no_Quant =
|
||||
{s = table {
|
||||
Sg => \\_,_ => genderForms "ingen" "inget" ;
|
||||
@@ -141,5 +139,7 @@ lin
|
||||
|
||||
at_least_AdN = ss "minst" ;
|
||||
at_most_AdN = ss "högst" ;
|
||||
|
||||
except_Prep = ss "utom" ;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user