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:
aarne
2013-12-15 20:11:19 +00:00
parent db278b0393
commit 85d4212a91
13 changed files with 78 additions and 40 deletions

View File

@@ -7,9 +7,9 @@
abstract Lang = abstract Lang =
Grammar, Grammar,
Lexicon, Lexicon
Construction, ,Construction --- can be compiled here, but not in concretes, as they call Syntax and Grammar
Documentation ,Documentation
** { ** {
flags startcat=Phr ; flags startcat=Phr ;
} ; } ;

View File

@@ -3,8 +3,8 @@
concrete LangChi of Lang = concrete LangChi of Lang =
GrammarChi, GrammarChi,
LexiconChi, LexiconChi
ConstructionChi -- ,ConstructionChi
** { ** {
flags startcat = Phr ; unlexer = concat ; lexer = text ; flags startcat = Phr ; unlexer = concat ; lexer = text ;

View File

@@ -305,7 +305,7 @@ oper
mkPrep p = {s = p ; lock_Prep = <>} ; mkPrep p = {s = p ; lock_Prep = <>} ;
noPrep = mkPrep [] ; 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 ; regN x = regGenN x Utr ;

View File

@@ -2,9 +2,9 @@
concrete LangEng of Lang = concrete LangEng of Lang =
GrammarEng, GrammarEng,
LexiconEng, LexiconEng
ConstructionEng, -- ,ConstructionEng,
DocumentationEng -- ,DocumentationEng
** { ** {
flags startcat = Phr ; unlexer = text ; lexer = text ; flags startcat = Phr ; unlexer = text ; lexer = text ;

View File

@@ -2,9 +2,9 @@
concrete LangFin of Lang = concrete LangFin of Lang =
GrammarFin, GrammarFin,
LexiconFin, LexiconFin
ConstructionFin, -- , ConstructionFin,
DocumentationFin -- , DocumentationFin
** { ** {
flags startcat = Phr ; unlexer = text ; lexer = finnish ; flags startcat = Phr ; unlexer = text ; lexer = finnish ;

View File

@@ -2,9 +2,9 @@
concrete LangFre of Lang = concrete LangFre of Lang =
GrammarFre, GrammarFre,
LexiconFre, LexiconFre
DocumentationFre, -- ,DocumentationFre
ConstructionFre -- ,ConstructionFre
** { ** {
flags startcat = Phr ; unlexer = text ; lexer = text ; flags startcat = Phr ; unlexer = text ; lexer = text ;

View File

@@ -2,9 +2,9 @@
concrete LangGer of Lang = concrete LangGer of Lang =
GrammarGer, GrammarGer,
LexiconGer, LexiconGer
ConstructionGer, -- ,ConstructionGer
DocumentationGer -- ,DocumentationGer
** { ** {
flags startcat = Phr ; unlexer = text ; lexer = text ; flags startcat = Phr ; unlexer = text ; lexer = text ;

View File

@@ -284,7 +284,7 @@ oper
nominative = Nom ; nominative = Nom ;
genitive = Gen ; 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 { regN x = regGenN x g where {
g = case <x : Str> of { g = case <x : Str> of {

View File

@@ -142,6 +142,7 @@ incomplete concrete NounScand of Noun =
s = f.s ; s = f.s ;
g = f.g ; g = f.g ;
c2 = f.c2 ; c2 = f.c2 ;
co = f.co ;
isMod = False isMod = False
} ; } ;
@@ -149,6 +150,7 @@ incomplete concrete NounScand of Noun =
s = f.s ; s = f.s ;
g = f.g ; g = f.g ;
c2 = f.c3 ; c2 = f.c3 ;
co = f.co ;
isMod = False 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 ; s = \\n,d,c => f.s ! n ! d ! Nom ++ f.c2.s ++ x.s ! accusative ;
g = f.g ; g = f.g ;
c2 = f.c3 ; c2 = f.c3 ;
co = f.co ;
isMod = False isMod = False
} ; } ;

View File

@@ -14,7 +14,7 @@ interface ResScand = DiffScand ** open CommonScand, Prelude in {
p = P3 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 -- needed for VP conjunction
param param

View File

@@ -125,17 +125,20 @@ lin
CompoundNomN a b = { CompoundNomN a b = {
s = \\n,d,c => a.s ! Sg ! Indef ! Nom ++ BIND ++ b.s ! n ! d ! c ; 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 = { CompoundGenN a b = {
s = \\n,d,c => a.s ! Sg ! Indef ! Gen ++ BIND ++ b.s ! n ! d ! c ; 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 = { CompoundAdjN a b = {
s = \\n,d,c => a.s ! AF (APosit (Strong (GSg Utr))) Nom ++ BIND ++ b.s ! n ! d ! c ; 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
} ; } ;

View File

@@ -2,9 +2,9 @@
concrete LangSwe of Lang = concrete LangSwe of Lang =
GrammarSwe, GrammarSwe,
LexiconSwe, LexiconSwe
ConstructionSwe, -- ,ConstructionSwe
DocumentationSwe -- ,DocumentationSwe
** { ** {
flags startcat = Phr ; unlexer = text ; lexer = text ; flags startcat = Phr ; unlexer = text ; lexer = text ;

View File

@@ -95,12 +95,17 @@ oper
-- and perhaps a gender. -- 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*, -- 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 --3 Relational nouns
@@ -350,21 +355,48 @@ oper
mkN : Str -> Gender -> N = regGenN ; mkN : Str -> Gender -> N = regGenN ;
mkN : (nyckel, nycklar : Str) -> N = mk2N ; mkN : (nyckel, nycklar : Str) -> N = mk2N ;
mkN : (museum,museet,museer,museerna : Str) -> N = mk4N ; 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 -> { -- The default compound form can be changed:
s = nounForms apa apan apor aporna ;
g = case last apan of { changeCompoundN : Str -> N -> N = \co,n -> lin N {
"n" => Utr ; s = n.s ;
_ => Neutr 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 ; s = nounForms apa apan apor aporna ;
g = g g = g ;
} ** {lock_N = <>} ; 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 { regN : Str -> N = \bil -> regGenN bil g where {
g = case <bil : Str> of { g = case <bil : Str> of {