forked from GitHub/gf-core
language specific extensions started
This commit is contained in:
14
lib/resource-1.0/abstract/Extra.gf
Normal file
14
lib/resource-1.0/abstract/Extra.gf
Normal file
@@ -0,0 +1,14 @@
|
||||
--1 More syntax rules
|
||||
|
||||
-- This module defines syntax rules that are not implemented in all
|
||||
-- languages, but in more than one, so that it makes sense to offer a
|
||||
-- common API.
|
||||
|
||||
abstract Extra = Cat ** {
|
||||
|
||||
fun
|
||||
GenNP : NP -> Quant ; -- this man's
|
||||
EmbedBareS : S -> SC ; -- (I know) you go
|
||||
ComplBareVS : VS -> S -> VP ; -- know you go
|
||||
|
||||
}
|
||||
@@ -3,5 +3,5 @@
|
||||
concrete English of EnglishAbs =
|
||||
LangEng,
|
||||
-- IrregEng,
|
||||
ExtEng
|
||||
ExtraEng
|
||||
** {} ;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
abstract EnglishAbs =
|
||||
Lang,
|
||||
--- IrregEngAbs,
|
||||
ExtEngAbs
|
||||
ExtraEngAbs
|
||||
** {} ;
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
concrete ExtEng of ExtEngAbs = CatEng ** open ResEng in {
|
||||
|
||||
lincat
|
||||
|
||||
Aux = {s : Polarity => Str} ;
|
||||
|
||||
lin
|
||||
|
||||
PredAux np aux vp = mkClause (np.s ! Nom) np.a {
|
||||
s = \\t,ant,b,ord,agr =>
|
||||
let
|
||||
fin = aux.s ! b ;
|
||||
vf : Str -> Str -> {fin, inf : Str} = \x,y ->
|
||||
{fin = x ; inf = y} ;
|
||||
in
|
||||
case ant of {
|
||||
Simul => vf fin [] ;
|
||||
Anter => vf fin "have"
|
||||
} ;
|
||||
s2 = \\agr => infVP vp agr
|
||||
} ;
|
||||
|
||||
can_Aux = {s = \\p => posneg p "can"} ; ---- cannt
|
||||
must_Aux = {s = \\p => posneg p "must"} ;
|
||||
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
abstract ExtEngAbs = Cat ** {
|
||||
|
||||
cat
|
||||
Aux ; -- auxiliary verbs: "can", "must", etc
|
||||
|
||||
-- Notice that $Aux$ cannot form $VP$ with infinitive, imperative, etc.
|
||||
|
||||
fun
|
||||
PredAux : NP -> Aux -> VP -> Cl ;
|
||||
QuestAux : IP -> Aux -> VP -> QCl ;
|
||||
|
||||
can_Aux : Aux ;
|
||||
must_Aux : Aux ;
|
||||
|
||||
}
|
||||
8
lib/resource-1.0/english/ExtraEng.gf
Normal file
8
lib/resource-1.0/english/ExtraEng.gf
Normal file
@@ -0,0 +1,8 @@
|
||||
concrete ExtraEng of ExtraEngAbs = CatEng ** open ResEng in {
|
||||
|
||||
lin
|
||||
GenNP np = {s = \\_ => np.s ! Gen} ;
|
||||
EmbedBareS s = s ;
|
||||
ComplBareVS v s = insertObj (\\_ => s.s) (predV v) ;
|
||||
|
||||
}
|
||||
3
lib/resource-1.0/english/ExtraEngAbs.gf
Normal file
3
lib/resource-1.0/english/ExtraEngAbs.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
abstract ExtraEngAbs = Extra ** {
|
||||
|
||||
}
|
||||
8
lib/resource-1.0/norwegian/ExtraNor.gf
Normal file
8
lib/resource-1.0/norwegian/ExtraNor.gf
Normal file
@@ -0,0 +1,8 @@
|
||||
concrete ExtraNor of ExtraNorAbs = ExtraScandNor ** open CommonScand, ResNor in {
|
||||
|
||||
lin
|
||||
PossNP np pro = {
|
||||
s = \\c => np.s ! NPNom ++ pro.s ! NPPoss np.a.gn ; ---- c
|
||||
a = np.a
|
||||
} ;
|
||||
}
|
||||
9
lib/resource-1.0/norwegian/ExtraNorAbs.gf
Normal file
9
lib/resource-1.0/norwegian/ExtraNorAbs.gf
Normal file
@@ -0,0 +1,9 @@
|
||||
-- Structures special for Norwegian. These are not implemented in other
|
||||
-- Scandinavian languages.
|
||||
|
||||
abstract ExtraNorAbs = ExtraScandAbs ** {
|
||||
|
||||
fun
|
||||
PossNP : NP -> Pron -> NP ; -- bilen min
|
||||
|
||||
}
|
||||
2
lib/resource-1.0/norwegian/ExtraScandNor.gf
Normal file
2
lib/resource-1.0/norwegian/ExtraScandNor.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete ExtraScandNor of ExtraScandAbs = CatNor ** ExtraScand with
|
||||
(ResScand = ResNor) ;
|
||||
7
lib/resource-1.0/norwegian/Norwegian.gf
Normal file
7
lib/resource-1.0/norwegian/Norwegian.gf
Normal file
@@ -0,0 +1,7 @@
|
||||
--# -path=.:../scandinavian:../abstract:../common:prelude
|
||||
|
||||
concrete Norwegian of NorwegianAbs =
|
||||
LangNor,
|
||||
-- IrregNor,
|
||||
ExtraNor
|
||||
** {} ;
|
||||
5
lib/resource-1.0/norwegian/NorwegianAbs.gf
Normal file
5
lib/resource-1.0/norwegian/NorwegianAbs.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
abstract NorwegianAbs =
|
||||
Lang,
|
||||
--- IrregNorAbs,
|
||||
ExtraNorAbs
|
||||
** {} ;
|
||||
@@ -1,14 +0,0 @@
|
||||
incomplete concrete ExtScand of ExtScandAbs =
|
||||
CatScand ** open CommonScand, ResScand in {
|
||||
|
||||
lin
|
||||
DefSgN predet noun = let g = noun.g in {
|
||||
s = \\c => predet.s ! gennum g Sg ++ noun.s ! Sg ! Def ! caseNP c ;
|
||||
a = agrP3 g Sg
|
||||
} ;
|
||||
DefPlN predet noun = let g = noun.g in {
|
||||
s = \\c => predet.s ! Plg ++ noun.s ! Pl ! Def ! caseNP c ;
|
||||
a = agrP3 g Sg
|
||||
} ;
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
abstract ExtScandAbs = Cat ** {
|
||||
|
||||
fun
|
||||
|
||||
-- Definite form of simple nouns without article; neither $Num$ nor $Ord$ allowed.
|
||||
|
||||
DefSgN, DefPlN : Predef -> N -> NP ;
|
||||
|
||||
}
|
||||
12
lib/resource-1.0/scandinavian/ExtraScand.gf
Normal file
12
lib/resource-1.0/scandinavian/ExtraScand.gf
Normal file
@@ -0,0 +1,12 @@
|
||||
incomplete concrete ExtraScand of ExtraScandAbs = CatScand ** open CommonScand,ResScand in {
|
||||
|
||||
lin
|
||||
GenNP np = {
|
||||
s = \\n,_,g => np.s ! NPPoss (gennum g n) ;
|
||||
det = DDef Indef
|
||||
} ;
|
||||
|
||||
EmbedBareS s = {s = s.s ! Sub} ;
|
||||
ComplBareVS v s = insertObj (\\_ => s.s ! Sub) (predV v) ;
|
||||
|
||||
}
|
||||
3
lib/resource-1.0/scandinavian/ExtraScandAbs.gf
Normal file
3
lib/resource-1.0/scandinavian/ExtraScandAbs.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
abstract ExtraScandAbs = Extra ** {
|
||||
|
||||
}
|
||||
2
lib/resource-1.0/swedish/ExtraScandSwe.gf
Normal file
2
lib/resource-1.0/swedish/ExtraScandSwe.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete ExtraScandSwe of ExtraScandAbs = CatSwe ** ExtraScand with
|
||||
(ResScand = ResSwe) ;
|
||||
3
lib/resource-1.0/swedish/ExtraSwe.gf
Normal file
3
lib/resource-1.0/swedish/ExtraSwe.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
concrete ExtraSwe of ExtraSweAbs = ExtraScandSwe ** {
|
||||
|
||||
}
|
||||
7
lib/resource-1.0/swedish/Swedish.gf
Normal file
7
lib/resource-1.0/swedish/Swedish.gf
Normal file
@@ -0,0 +1,7 @@
|
||||
--# -path=.:../scandinavian:../abstract:../common:prelude
|
||||
|
||||
concrete Swedish of SwedishAbs =
|
||||
LangSwe,
|
||||
-- IrregSwe,
|
||||
ExtraSwe
|
||||
** {} ;
|
||||
5
lib/resource-1.0/swedish/SwedishAbs.gf
Normal file
5
lib/resource-1.0/swedish/SwedishAbs.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
abstract SwedishAbs =
|
||||
Lang,
|
||||
--- IrregSweAbs,
|
||||
ExtraSweAbs
|
||||
** {} ;
|
||||
Reference in New Issue
Block a user