1
0
forked from GitHub/gf-core

language specific extensions started

This commit is contained in:
aarne
2006-06-03 21:23:22 +00:00
parent 477feb0af1
commit 2bfe0731c7
20 changed files with 90 additions and 66 deletions

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

View File

@@ -3,5 +3,5 @@
concrete English of EnglishAbs =
LangEng,
-- IrregEng,
ExtEng
ExtraEng
** {} ;

View File

@@ -1,5 +1,5 @@
abstract EnglishAbs =
Lang,
--- IrregEngAbs,
ExtEngAbs
ExtraEngAbs
** {} ;

View File

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

View File

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

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

View File

@@ -0,0 +1,3 @@
abstract ExtraEngAbs = Extra ** {
}

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

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

View File

@@ -0,0 +1,2 @@
concrete ExtraScandNor of ExtraScandAbs = CatNor ** ExtraScand with
(ResScand = ResNor) ;

View File

@@ -0,0 +1,7 @@
--# -path=.:../scandinavian:../abstract:../common:prelude
concrete Norwegian of NorwegianAbs =
LangNor,
-- IrregNor,
ExtraNor
** {} ;

View File

@@ -0,0 +1,5 @@
abstract NorwegianAbs =
Lang,
--- IrregNorAbs,
ExtraNorAbs
** {} ;

View File

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

View File

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

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

View File

@@ -0,0 +1,3 @@
abstract ExtraScandAbs = Extra ** {
}

View File

@@ -0,0 +1,2 @@
concrete ExtraScandSwe of ExtraScandAbs = CatSwe ** ExtraScand with
(ResScand = ResSwe) ;

View File

@@ -0,0 +1,3 @@
concrete ExtraSwe of ExtraSweAbs = ExtraScandSwe ** {
}

View File

@@ -0,0 +1,7 @@
--# -path=.:../scandinavian:../abstract:../common:prelude
concrete Swedish of SwedishAbs =
LangSwe,
-- IrregSwe,
ExtraSwe
** {} ;

View File

@@ -0,0 +1,5 @@
abstract SwedishAbs =
Lang,
--- IrregSweAbs,
ExtraSweAbs
** {} ;