forked from GitHub/gf-core
added noun compound form to Swe; commented out Constructions and Documentation in Lang concretes, because their presence makes it impossible to bootstrap the compilation of the library, causing new makes of the library to fail (to be fixed)
This commit is contained in:
@@ -7,9 +7,9 @@
|
||||
|
||||
abstract Lang =
|
||||
Grammar,
|
||||
Lexicon,
|
||||
Construction,
|
||||
Documentation
|
||||
Lexicon
|
||||
,Construction --- can be compiled here, but not in concretes, as they call Syntax and Grammar
|
||||
,Documentation
|
||||
** {
|
||||
flags startcat=Phr ;
|
||||
} ;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
concrete LangChi of Lang =
|
||||
GrammarChi,
|
||||
LexiconChi,
|
||||
ConstructionChi
|
||||
LexiconChi
|
||||
-- ,ConstructionChi
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = concat ; lexer = text ;
|
||||
|
||||
@@ -305,7 +305,7 @@ oper
|
||||
mkPrep p = {s = p ; lock_Prep = <>} ;
|
||||
noPrep = mkPrep [] ;
|
||||
|
||||
mk4N x y z u = mkSubstantive x y z u ** {g = extNGen y ; lock_N = <>} ;
|
||||
mk4N x y z u = mkSubstantive x y z u ** {g = extNGen y ; lock_N = <> ; co = x} ; ---- TODO co
|
||||
|
||||
regN x = regGenN x Utr ;
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
concrete LangEng of Lang =
|
||||
GrammarEng,
|
||||
LexiconEng,
|
||||
ConstructionEng,
|
||||
DocumentationEng
|
||||
LexiconEng
|
||||
-- ,ConstructionEng,
|
||||
-- ,DocumentationEng
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
concrete LangFin of Lang =
|
||||
GrammarFin,
|
||||
LexiconFin,
|
||||
ConstructionFin,
|
||||
DocumentationFin
|
||||
LexiconFin
|
||||
-- , ConstructionFin,
|
||||
-- , DocumentationFin
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = finnish ;
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
concrete LangFre of Lang =
|
||||
GrammarFre,
|
||||
LexiconFre,
|
||||
DocumentationFre,
|
||||
ConstructionFre
|
||||
LexiconFre
|
||||
-- ,DocumentationFre
|
||||
-- ,ConstructionFre
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
concrete LangGer of Lang =
|
||||
GrammarGer,
|
||||
LexiconGer,
|
||||
ConstructionGer,
|
||||
DocumentationGer
|
||||
LexiconGer
|
||||
-- ,ConstructionGer
|
||||
-- ,DocumentationGer
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
|
||||
@@ -284,7 +284,7 @@ oper
|
||||
nominative = Nom ;
|
||||
genitive = Gen ;
|
||||
|
||||
mk4N x y z u = mkSubstantive x y z u ** {g = extNGen y ; lock_N = <>} ;
|
||||
mk4N x y z u = mkSubstantive x y z u ** {g = extNGen y ; lock_N = <> ; co = x} ; ---- TODO co
|
||||
|
||||
regN x = regGenN x g where {
|
||||
g = case <x : Str> of {
|
||||
|
||||
@@ -142,6 +142,7 @@ incomplete concrete NounScand of Noun =
|
||||
s = f.s ;
|
||||
g = f.g ;
|
||||
c2 = f.c2 ;
|
||||
co = f.co ;
|
||||
isMod = False
|
||||
} ;
|
||||
|
||||
@@ -149,6 +150,7 @@ incomplete concrete NounScand of Noun =
|
||||
s = f.s ;
|
||||
g = f.g ;
|
||||
c2 = f.c3 ;
|
||||
co = f.co ;
|
||||
isMod = False
|
||||
} ;
|
||||
|
||||
@@ -163,6 +165,7 @@ incomplete concrete NounScand of Noun =
|
||||
s = \\n,d,c => f.s ! n ! d ! Nom ++ f.c2.s ++ x.s ! accusative ;
|
||||
g = f.g ;
|
||||
c2 = f.c3 ;
|
||||
co = f.co ;
|
||||
isMod = False
|
||||
} ;
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ interface ResScand = DiffScand ** open CommonScand, Prelude in {
|
||||
p = P3
|
||||
} ;
|
||||
|
||||
Noun = {s : Number => Species => Case => Str ; g : NGender} ;
|
||||
Noun = {s : Number => Species => Case => Str ; g : NGender ; co : Str} ; -- co = compounding form
|
||||
|
||||
-- needed for VP conjunction
|
||||
param
|
||||
|
||||
@@ -125,17 +125,20 @@ lin
|
||||
|
||||
CompoundNomN a b = {
|
||||
s = \\n,d,c => a.s ! Sg ! Indef ! Nom ++ BIND ++ b.s ! n ! d ! c ;
|
||||
g = b.g
|
||||
g = b.g ;
|
||||
co = b.co
|
||||
} ;
|
||||
|
||||
CompoundGenN a b = {
|
||||
s = \\n,d,c => a.s ! Sg ! Indef ! Gen ++ BIND ++ b.s ! n ! d ! c ;
|
||||
g = b.g
|
||||
g = b.g ;
|
||||
co = b.co
|
||||
} ;
|
||||
|
||||
CompoundAdjN a b = {
|
||||
s = \\n,d,c => a.s ! AF (APosit (Strong (GSg Utr))) Nom ++ BIND ++ b.s ! n ! d ! c ;
|
||||
g = b.g
|
||||
g = b.g ;
|
||||
co = b.co
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
concrete LangSwe of Lang =
|
||||
GrammarSwe,
|
||||
LexiconSwe,
|
||||
ConstructionSwe,
|
||||
DocumentationSwe
|
||||
LexiconSwe
|
||||
-- ,ConstructionSwe
|
||||
-- ,DocumentationSwe
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
|
||||
@@ -95,12 +95,17 @@ oper
|
||||
|
||||
-- and perhaps a gender.
|
||||
|
||||
mkN : (museum,museet,museer,museerna : Str) -> Gender -> N -- even worse case for nouns
|
||||
} ;
|
||||
mkN : (museum,museet,museer,museerna : Str) -> Gender -> N ; -- even worse case for nouns
|
||||
|
||||
-- All the functions above work quite as well to form *compound nouns*,
|
||||
-- such as "fotboll".
|
||||
-- such as "fotboll", just given as one argument. But compound nouns can be formed from their parts as well,
|
||||
|
||||
mkN : (regering, makt : N) -> N ; -- regeringsmakt, using the co form of regering
|
||||
} ;
|
||||
|
||||
-- The default compound form can be changed:
|
||||
|
||||
changeCompoundN : Str -> N -> N ; -- kyrko + kyrka_N
|
||||
|
||||
|
||||
--3 Relational nouns
|
||||
@@ -350,21 +355,48 @@ oper
|
||||
mkN : Str -> Gender -> N = regGenN ;
|
||||
mkN : (nyckel, nycklar : Str) -> N = mk2N ;
|
||||
mkN : (museum,museet,museer,museerna : Str) -> N = mk4N ;
|
||||
mkN : (museum,museet,museer,museerna : Str) -> Gender -> N = mk5N
|
||||
} ;
|
||||
mkN : (museum,museet,museer,museerna : Str) -> Gender -> N = mk5N ;
|
||||
mkN : (regering, makt : N) -> N = \a,b -> lin N {
|
||||
s = \\n,d,c => a.co + b.s ! n ! d ! c ;
|
||||
g = b.g ;
|
||||
co = case b.co of {
|
||||
_ + "s" => a.co + b.co ;
|
||||
co => a.co + co + "s"
|
||||
}
|
||||
} ;
|
||||
} ;
|
||||
|
||||
mk4N : (museum,museet,museer,museerna : Str) -> N = \apa,apan,apor,aporna -> {
|
||||
s = nounForms apa apan apor aporna ;
|
||||
g = case last apan of {
|
||||
"n" => Utr ;
|
||||
_ => Neutr
|
||||
-- The default compound form can be changed:
|
||||
|
||||
changeCompoundN : Str -> N -> N = \co,n -> lin N {
|
||||
s = n.s ;
|
||||
g = n.g ;
|
||||
co = co
|
||||
} ;
|
||||
|
||||
|
||||
mk4N : (museum,museet,museer,museerna : Str) -> N = \apa,apan,apor,aporna ->
|
||||
mk5N apa apan apor aporna g
|
||||
where {
|
||||
g = case last apan of {
|
||||
"n" => Utr ;
|
||||
_ => Neutr
|
||||
}
|
||||
} ** {lock_N = <>} ;
|
||||
} ;
|
||||
|
||||
mk5N : (museum,museet,museer,museerna : Str) -> Gender -> N = \apa,apan,apor,aporna,g -> {
|
||||
mk5N : (museum,museet,museer,museerna : Str) -> Gender -> N = \apa,apan,apor,aporna,g -> lin N {
|
||||
s = nounForms apa apan apor aporna ;
|
||||
g = g
|
||||
} ** {lock_N = <>} ;
|
||||
g = g ;
|
||||
co = case apa of {
|
||||
ap + "e" => case g of {
|
||||
Neutr => apa + "s" ; -- rikes
|
||||
_ => ap -- pojk
|
||||
} ;
|
||||
ap + "a" => ap ; -- flick
|
||||
? + ? + ? + _ + ("ing" | "ion" | "het") => apa + "s" ; -- regerings, stations, frihets
|
||||
_ => apa
|
||||
}
|
||||
} ;
|
||||
|
||||
regN : Str -> N = \bil -> regGenN bil g where {
|
||||
g = case <bil : Str> of {
|
||||
|
||||
Reference in New Issue
Block a user