mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
Icelandic added to RGL by Bjarki Traustason
This commit is contained in:
8
lib/src/api/CombinatorsIce.gf
Normal file
8
lib/src/api/CombinatorsIce.gf
Normal file
@@ -0,0 +1,8 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource CombinatorsIce = Combinators - [ appCN, appCNc ] with
|
||||
(Cat = CatIce),
|
||||
(Structural = StructuralIce),
|
||||
(Noun = NounIce),
|
||||
(Constructors = ConstructorsIce) **
|
||||
{}
|
||||
3
lib/src/api/ConstructorsIce.gf
Normal file
3
lib/src/api/ConstructorsIce.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource ConstructorsIce = Constructors with (Grammar = GrammarIce) ;
|
||||
5
lib/src/api/SymbolicIce.gf
Normal file
5
lib/src/api/SymbolicIce.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:../english:../common:../abstract:../prelude
|
||||
|
||||
resource SymbolicIce = Symbolic with
|
||||
(Symbol = SymbolIce),
|
||||
(Grammar = GrammarIce) ;
|
||||
5
lib/src/api/SyntaxIce.gf
Normal file
5
lib/src/api/SyntaxIce.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
instance SyntaxIce of Syntax =
|
||||
ConstructorsIce, CatIce, StructuralIce, CombinatorsIce ;
|
||||
|
||||
3
lib/src/api/TryIce.gf
Normal file
3
lib/src/api/TryIce.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
resource TryIce = SyntaxIce, LexiconIce, ParadigmsIce - [mkAdv,mkAdN,mkOrd] ;
|
||||
47
lib/src/icelandic/AdjectiveIce.gf
Normal file
47
lib/src/icelandic/AdjectiveIce.gf
Normal file
@@ -0,0 +1,47 @@
|
||||
concrete AdjectiveIce of Adjective = CatIce ** open ResIce, Prelude in {
|
||||
|
||||
lin
|
||||
PositA a = {
|
||||
s = \\n,g,d,c => a.s ! APosit d n g c
|
||||
} ;
|
||||
|
||||
ComparA a np = {
|
||||
s = \\n,g,d,c => a.s ! ACompar n g c ++ "heldur en" ++ np.s ! NCase Nom
|
||||
} ;
|
||||
|
||||
ComplA2 a2 np = {
|
||||
s = \\n,g,d,c => a2.s ! APosit d n g c ++ a2.c2.s ++ np.s ! NCase a2.c2.c
|
||||
} ;
|
||||
|
||||
ReflA2 a2 = {
|
||||
s = \\n,g,d,c => a2.s ! APosit d n g c ++ a2.c2.s ++ reflPron P3 n g a2.c2.c
|
||||
} ;
|
||||
|
||||
UseA2 a2 = {
|
||||
s = \\n,g,d,c => a2.s ! APosit d n g c
|
||||
} ;
|
||||
|
||||
UseComparA a = {
|
||||
s = \\n,g,d,c => a.s ! ACompar n g c
|
||||
} ;
|
||||
|
||||
CAdvAP cadv ap np = {
|
||||
s = \\n,g,d,c => cadv.s ++ ap.s ! n ! g ! d ! c ++ cadv.p ++ np.s ! NCase Nom
|
||||
} ;
|
||||
|
||||
AdjOrd ord = {
|
||||
s = \\n,g,d,c => ord.s ! d ! n ! g ! c
|
||||
} ;
|
||||
|
||||
SentAP ap sc = {
|
||||
s = \\n,g,d,c => ap.s ! n ! g ! d ! c ++ sc.s
|
||||
} ;
|
||||
|
||||
AdAP ad ap = {
|
||||
s = \\n,g,d,c => ad.s ++ ap.s ! n ! g ! d ! c
|
||||
} ;
|
||||
|
||||
AdvAP ap adv = {
|
||||
s = \\n,g,d,c => ap.s ! n ! g ! d ! c ++ adv.s
|
||||
} ;
|
||||
}
|
||||
22
lib/src/icelandic/AdverbIce.gf
Normal file
22
lib/src/icelandic/AdverbIce.gf
Normal file
@@ -0,0 +1,22 @@
|
||||
concrete AdverbIce of Adverb = CatIce ** open ResIce, Prelude in {
|
||||
lin
|
||||
PositAdvAdj a = { s = a.adv } ;
|
||||
|
||||
PrepNP p np = { s = p.s ++ np.s ! NCase p.c} ;
|
||||
|
||||
ComparAdvAdjS cadv a s = {
|
||||
s = cadv.s ++ a.adv ++ cadv.p ++ s.s
|
||||
} ;
|
||||
|
||||
ComparAdvAdj cadv a np = {
|
||||
s = cadv.s ++ a.adv ++ cadv.p ++ np.s ! NCase Nom
|
||||
} ;
|
||||
|
||||
AdAdv ad adv = { s = ad.s ++ adv.s} ;
|
||||
|
||||
PositAdAAdj a = { s = a.adv } ;
|
||||
|
||||
SubjS sub s = { s = sub.s ++ s.s } ;
|
||||
|
||||
AdnCAdv cadv = { s = cadv.s ++ cadv.p} ;
|
||||
}
|
||||
11
lib/src/icelandic/AllIce.gf
Normal file
11
lib/src/icelandic/AllIce.gf
Normal file
@@ -0,0 +1,11 @@
|
||||
--# -path=.:../abstract:../common:../api:../prelude
|
||||
|
||||
concrete AllIce of AllIceAbs =
|
||||
LangIce,
|
||||
IrregIce
|
||||
-- ExtraIce
|
||||
**
|
||||
{
|
||||
--{} ;
|
||||
|
||||
}
|
||||
9
lib/src/icelandic/AllIceAbs.gf
Normal file
9
lib/src/icelandic/AllIceAbs.gf
Normal file
@@ -0,0 +1,9 @@
|
||||
abstract AllIceAbs =
|
||||
Lang,
|
||||
IrregIceAbs,
|
||||
ExtraIceAbs
|
||||
**
|
||||
{
|
||||
--{} ;
|
||||
|
||||
}
|
||||
150
lib/src/icelandic/CatIce.gf
Normal file
150
lib/src/icelandic/CatIce.gf
Normal file
@@ -0,0 +1,150 @@
|
||||
concrete CatIce of Cat = CommonX ** open ResIce, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lincat
|
||||
|
||||
--2 Sentences and clauses
|
||||
|
||||
S = {s : Str} ;
|
||||
|
||||
QS = {s : QForm => Str} ;
|
||||
|
||||
RS = {
|
||||
s : Agr => Str ;
|
||||
c : NPCase
|
||||
} ;
|
||||
|
||||
Cl = ResIce.Cl ;
|
||||
|
||||
ClSlash = {
|
||||
s : Tense => Anteriority => Polarity => Order => Str ;
|
||||
c2 : Preposition
|
||||
} ;
|
||||
|
||||
SSlash = {
|
||||
s : Order => Str ;
|
||||
c2 : Preposition
|
||||
} ;
|
||||
|
||||
Imp = {s : Polarity => Number => Str} ;
|
||||
|
||||
|
||||
--2 Questions and interrogatives
|
||||
|
||||
QCl = {s : Tense => Anteriority => Polarity => QForm => Str} ;
|
||||
|
||||
IP = {
|
||||
s : Gender => Case => Str ;
|
||||
n : Number
|
||||
} ;
|
||||
|
||||
IComp = {s : Number => Gender => Case => Str} ;
|
||||
|
||||
IDet = {s : Gender => Case => Str ; n : Number} ;
|
||||
|
||||
IQuant = {s : Number => Gender => Case => Str} ;
|
||||
|
||||
|
||||
--2 Relative clauses and pronouns
|
||||
|
||||
RCl = {s : Tense => Anteriority => Polarity => Agr => Str} ;
|
||||
|
||||
RP = {s : Str} ;
|
||||
|
||||
|
||||
--2 Verb phrases
|
||||
|
||||
VP = ResIce.VP ;
|
||||
|
||||
Comp = {s : Agr => Str} ;
|
||||
|
||||
VPSlash = ResIce.VP ** {
|
||||
c2 : Preposition
|
||||
} ;
|
||||
|
||||
--2 Adjectival phrases
|
||||
|
||||
AP = {s : Number => Gender => Declension => Case => Str} ;
|
||||
|
||||
|
||||
--2 Nouns and noun phrases
|
||||
|
||||
CN = {
|
||||
s : Number => Species => Declension => Case => Str ;
|
||||
comp : Number => Case => Str ; -- used to separate the head from its tail components in cases of possessive constructions.
|
||||
g : Gender
|
||||
} ;
|
||||
|
||||
NP = ResIce.NP ;
|
||||
|
||||
Pron = ResIce.Pron ;
|
||||
|
||||
Det = {
|
||||
s : Gender => Case => Str ;
|
||||
pron : Gender => Case => Str ; -- pronouns generally follow the noun that they describe, but numbers and ordinals/adjectivs preced it
|
||||
n : Number ;
|
||||
b : ResIce.Species ;
|
||||
d : ResIce.Declension
|
||||
} ;
|
||||
|
||||
Predet = {
|
||||
s : Number => Gender => Case => Str
|
||||
} ;
|
||||
|
||||
Quant = {
|
||||
s : Number => Gender => Case => Str ;
|
||||
b : ResIce.Species ; -- for nouns, indication if the suffixed article is used or not.
|
||||
d : ResIce.Declension ; -- for adjectives, indication if the weak or strong form of the adjective is used.
|
||||
isPron : Bool -- pronouns generally follow the noun that they describe
|
||||
} ;
|
||||
|
||||
Num = {
|
||||
s : Gender => Case => Str ;
|
||||
n : Number ;
|
||||
hasCard : Bool
|
||||
} ;
|
||||
|
||||
Card = {
|
||||
s : Gender => Case => Str ;
|
||||
n : Number
|
||||
} ;
|
||||
|
||||
Ord = {
|
||||
s : ResIce.Declension => Number => Gender => Case => Str
|
||||
} ;
|
||||
|
||||
DAP = {
|
||||
s : Gender => Case => Str ;
|
||||
n : Number ;
|
||||
b : ResIce.Species ;
|
||||
d : ResIce.Declension
|
||||
} ;
|
||||
|
||||
|
||||
--2 Numerals
|
||||
|
||||
Numeral = {s : CardOrd => Str ; n : Number} ;
|
||||
Digits = {s : CardOrd => Str ; n : Number} ;
|
||||
|
||||
|
||||
--2 Structural words
|
||||
|
||||
Conj = {s1,s2 : Str ; n : Number} ;
|
||||
Prep = ResIce.Preposition ;
|
||||
|
||||
|
||||
--2 Words of open classes
|
||||
|
||||
V, VS, VQ, VA = ResIce.V;
|
||||
VV, V2, V2A, V2S, V2Q = ResIce.V ** {c2 : Preposition} ;
|
||||
V3, V2V = ResIce.V ** {c2,c3 : Preposition} ;
|
||||
|
||||
A = ResIce.A ;
|
||||
A2 = ResIce.A ** {c2 : Preposition} ;
|
||||
|
||||
N = ResIce.N ;
|
||||
N2 = ResIce.N ** {c2 : Preposition} ;
|
||||
N3 = ResIce.N ** {c2,c3 : Preposition} ;
|
||||
PN = {s : Case => Str ; g : Gender} ;
|
||||
}
|
||||
93
lib/src/icelandic/ConjunctionIce.gf
Normal file
93
lib/src/icelandic/ConjunctionIce.gf
Normal file
@@ -0,0 +1,93 @@
|
||||
concrete ConjunctionIce of Conjunction =
|
||||
CatIce ** open ResIce, Coordination, Prelude in {
|
||||
|
||||
lin
|
||||
ConjS = conjunctDistrSS ;
|
||||
|
||||
ConjRS conj ss = conjunctDistrTable Agr conj ss ** {c = ss.c} ;
|
||||
|
||||
ConjCN co ns = conjunctDistrTable4 Number Species Declension Case co ns ** {comp = \\_,_ => [] ; g = Neutr} ;
|
||||
|
||||
ConjAP co as = conjunctDistrTable4 Number Gender Declension Case co as ;
|
||||
|
||||
ConjNP co ns = conjunctDistrTable NPCase co ns ** {
|
||||
a = {g = ns.a.g ; n = conjNumber co.n ns.a.n ; p = ns.a.p} ;
|
||||
isPron = ns.isPron
|
||||
} ;
|
||||
|
||||
ConjDet co ds = let cds = (conjunctDistrTable2 Gender Case co ds).s in {
|
||||
s = cds ;
|
||||
pron = \\_,_ => [] ;
|
||||
n = ds.n ;
|
||||
b = ds.b ;
|
||||
d = ds.d ;
|
||||
} ;
|
||||
|
||||
ConjAdv = conjunctDistrSS ;
|
||||
|
||||
ConjAdV = conjunctDistrSS ;
|
||||
|
||||
ConjIAdv = conjunctDistrSS ;
|
||||
|
||||
-- These are fun's generated from the list cat's.
|
||||
|
||||
BaseS = twoSS ;
|
||||
|
||||
ConsS = consrSS comma ;
|
||||
|
||||
BaseAdV = twoSS ;
|
||||
|
||||
ConsAdV = consrSS comma ;
|
||||
|
||||
BaseAdv = twoSS ;
|
||||
|
||||
ConsAdv = consrSS comma ;
|
||||
|
||||
BaseIAdv = twoSS ;
|
||||
|
||||
ConsIAdv = consrSS comma ;
|
||||
|
||||
BaseRS x y = twoTable Agr x y ** {c = y.c} ;
|
||||
|
||||
ConsRS xs x = consrTable Agr comma xs x ** {c = xs.c} ;
|
||||
|
||||
BaseCN = twoTable4 Number Species Declension Case ;
|
||||
|
||||
ConsCN = consrTable4 Number Species Declension Case comma ;
|
||||
|
||||
BaseAP x y = twoTable4 Number Gender Declension Case x y ;
|
||||
|
||||
ConsAP xs x = consrTable4 Number Gender Declension Case comma xs x ;
|
||||
|
||||
BaseNP x y = twoTable NPCase x y ** {
|
||||
a = conjAgr x.a y.a ;
|
||||
isPron = isBothPron x.isPron y.isPron
|
||||
} ;
|
||||
|
||||
ConsNP xs x = consrTable NPCase comma xs x ** {
|
||||
a = conjAgr xs.a x.a ;
|
||||
isPron = isBothPron xs.isPron x.isPron
|
||||
} ;
|
||||
|
||||
BaseDAP x y = twoTable2 Gender Case x y ** {n = y.n ; b = y.b ; d = y.d} ;
|
||||
|
||||
ConsDAP x xs = consrTable2 Gender Case comma x xs ** {n = xs.n ; b = xs.b ; d = xs.d} ;
|
||||
|
||||
lincat
|
||||
[S] = {s1,s2 : Str} ;
|
||||
[Adv] = {s1,s2 : Str} ;
|
||||
[AdV] = {s1,s2 : Str} ;
|
||||
[IAdv] = {s1,s2 : Str} ;
|
||||
[NP] = {s1,s2 : NPCase => Str ; a : Agr ; isPron : Bool} ;
|
||||
[CN] = {s1,s2 : Number => Species => Declension => Case => Str} ;
|
||||
[AP] = {s1,s2 : Number => Gender => Declension => Case => Str} ;
|
||||
[RS] = {s1,s2 : Agr => Str ; c : NPCase} ;
|
||||
[DAP] = {s1,s2 : Gender => Case => Str ; n : Number ; b : Species ; d : Declension} ;
|
||||
|
||||
oper
|
||||
|
||||
isBothPron : Bool -> Bool -> Bool = \x,y -> case <x,y> of {
|
||||
<True,True> => True ;
|
||||
_ => False
|
||||
} ;
|
||||
}
|
||||
6
lib/src/icelandic/ConstructionIce.gf
Normal file
6
lib/src/icelandic/ConstructionIce.gf
Normal file
@@ -0,0 +1,6 @@
|
||||
--# -path=.:../abstract
|
||||
|
||||
concrete ConstructionIce of Construction = CatIce **
|
||||
open SyntaxIce, SymbolicIce, ParadigmsIce, (L = LexiconIce), (E = ExtraIce), (G = GrammarIce), (R = ResIce), (S = StructuralIce), Prelude in {
|
||||
|
||||
}
|
||||
48
lib/src/icelandic/ExtraIce.gf
Normal file
48
lib/src/icelandic/ExtraIce.gf
Normal file
@@ -0,0 +1,48 @@
|
||||
concrete ExtraIce of ExtraIceAbs = CatIce **
|
||||
open ResIce, Coordination, Prelude, MorphoIce, ParadigmsIce in {
|
||||
|
||||
lin
|
||||
-- Det -> NP
|
||||
DetNPMasc det = {
|
||||
s = \\c => det.s ! Masc ! c ;
|
||||
a = Ag Masc det.n P3
|
||||
} ;
|
||||
|
||||
-- Det -> NP
|
||||
DetNPFem det = {
|
||||
s = \\c => det.s ! Fem ! c ;
|
||||
a = Ag Fem det.n P3
|
||||
} ;
|
||||
|
||||
QuestVPNeutr ip vp =
|
||||
let
|
||||
cl = mkClause (ip.s ! Neutr ! Nom) vp {g = Neutr; n = ip.n; p = P3}
|
||||
|
||||
in {
|
||||
s = \\ten,ant,pol => table {
|
||||
_ => cl.s ! ten ! ant ! pol ! OQuestion
|
||||
}
|
||||
} ;
|
||||
|
||||
QuestVPFem ip vp =
|
||||
let
|
||||
cl = mkClause (ip.s ! Fem ! Nom) vp {g = Fem; n = ip.n; p = P3}
|
||||
|
||||
in {
|
||||
s = \\ten,ant,pol => table {
|
||||
_ => cl.s ! ten ! ant ! pol ! OQuestion
|
||||
}
|
||||
} ;
|
||||
|
||||
PrepIPFem prep ip = {
|
||||
s = prep.s ++ ip.s ! Fem ! prep.c
|
||||
} ;
|
||||
|
||||
PrepIPNeutr prep ip = {
|
||||
s = prep.s ++ ip.s ! Neutr ! prep.c
|
||||
} ;
|
||||
|
||||
CompIPFem ip = {s = \\_,_,_ => ip.s ! Neutr ! Nom} ;
|
||||
|
||||
CompIPNeutr ip = {s = \\_,_,_ => ip.s ! Neutr ! Nom} ;
|
||||
}
|
||||
1
lib/src/icelandic/ExtraIceAbs.gf
Normal file
1
lib/src/icelandic/ExtraIceAbs.gf
Normal file
@@ -0,0 +1 @@
|
||||
abstract ExtraIceAbs = Extra - [ProDrop] ** {}
|
||||
22
lib/src/icelandic/GrammarIce.gf
Normal file
22
lib/src/icelandic/GrammarIce.gf
Normal file
@@ -0,0 +1,22 @@
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
|
||||
concrete GrammarIce of Grammar =
|
||||
NounIce,
|
||||
VerbIce,
|
||||
AdjectiveIce,
|
||||
AdverbIce,
|
||||
NumeralIce,
|
||||
SentenceIce,
|
||||
QuestionIce,
|
||||
RelativeIce,
|
||||
ConjunctionIce,
|
||||
PhraseIce,
|
||||
TextX,
|
||||
StructuralIce,
|
||||
IdiomIce,
|
||||
TenseX
|
||||
** open ResIce, Prelude in {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
|
||||
} ;
|
||||
52
lib/src/icelandic/IdiomIce.gf
Normal file
52
lib/src/icelandic/IdiomIce.gf
Normal file
@@ -0,0 +1,52 @@
|
||||
concrete IdiomIce of Idiom = CatIce ** open Prelude, ResIce in {
|
||||
|
||||
lin
|
||||
ImpersCl vp = mkClause "það" vp {g = Neutr ; n = Sg ; p = P3} ;
|
||||
|
||||
GenericCl vp = mkClause "maður" vp {g = Masc ; n = Sg ; p = P3} ;
|
||||
|
||||
CleftNP np rs = let vp = (predV verbBe) in
|
||||
mkClause "það" (vp ** {dirObj = \\_ => np.s ! rs.c ++ rs.s ! np.a}) np.a ;
|
||||
|
||||
CleftAdv ad s = let vp = (predV verbBe) in
|
||||
mkClause "það" (vp ** {dirObj = \\_ => ad.s ++ "sem" ++ s.s}) {g = Neutr ; n = Sg ; p = P3} ;
|
||||
|
||||
ExistNP np = let vp = (predV verbBe) in
|
||||
mkClause "til" (vp ** {dirObj = \\_ => np.s ! NCase Nom}) np.a ;
|
||||
|
||||
ExistIP ip = let
|
||||
vp = (predV verbBe) ;
|
||||
cl = mkClause (ip.s ! Masc ! Nom) vp {g = Masc ; n = ip.n ; p = P3}
|
||||
in {s = \\ten,ant,pol,_ => cl.s ! ten ! ant ! pol ! ODir ++ "þarna"} ;
|
||||
|
||||
ExistNPAdv np adv = let vp = (predV verbBe) in
|
||||
mkClause "til" (vp ** {dirObj = \\_ => np.s ! NCase Nom ++ adv.s}) np.a ;
|
||||
|
||||
ExistIPAdv ip adv = let
|
||||
vp = (predV verbBe) ;
|
||||
cl = mkClause (ip.s ! Masc ! Nom) vp {g = Masc ; n = ip.n ; p = P3}
|
||||
in {s = \\ten,ant,pol,_ => cl.s ! ten ! ant ! pol ! ODir ++ adv.s} ;
|
||||
|
||||
ProgrVP vp = let vvp = predV verbBe in
|
||||
vvp ** {dirObj = \\a => vp.p ! PPres ++ vp.dirObj ! a} ;
|
||||
|
||||
ImpPl1 vp = { s = let
|
||||
agr = gennumperToAgr Masc Pl P1 ;
|
||||
verb = vp.s ! VPMood Pres Simul ! Pos ! agr
|
||||
in verb.fin ++ verb.inf ++ vp.dirObj ! agr } ;
|
||||
|
||||
ImpP3 np vp = {s = let
|
||||
verb = vp.s ! VPMood Pres Simul ! Pos ! np.a
|
||||
in verbLet.s ! VPres Active Indicative np.a.n np.a.p ++ np.s ! NCase Acc ++ verb.inf} ;
|
||||
|
||||
SelfAdvVP vp = vp ** {dirObj = \\a => vp.dirObj ! a ++ reflPron a.p a.n a.g Nom} ;
|
||||
|
||||
SelfAdVVP vp = vp ** {dirObj = \\a => reflPron a.p a.n a.g Nom ++ vp.dirObj ! a} ;
|
||||
|
||||
SelfNP np = {
|
||||
s = \\c => reflPron np.a.p np.a.n np.a.g Nom ++ np.s ! c ;
|
||||
a = np.a ;
|
||||
isPron = False
|
||||
} ;
|
||||
}
|
||||
|
||||
186
lib/src/icelandic/IrregIce.gf
Normal file
186
lib/src/icelandic/IrregIce.gf
Normal file
@@ -0,0 +1,186 @@
|
||||
--# -path=.:prelude:../abstract:../common
|
||||
|
||||
concrete IrregIce of IrregIceAbs = CatIce ** open ParadigmsIce,MorphoIce in {
|
||||
|
||||
flags optimize=values ;
|
||||
|
||||
lin
|
||||
|
||||
|
||||
-- present preterite verbs
|
||||
-- technically they have no past participle..
|
||||
|
||||
eiga_V = irregV "eiga" "á" "átti" "eigi" "ætti" "áttinn" ;
|
||||
mega_V = irregV "mega" "má" "mátti" "megi" "mætti" "máttinn" ;
|
||||
unna_V = irregV "unna" "ann" "unni" "unni" "ynni" "unnaður" ;
|
||||
kunna_V = irregV "kunna" "kann" "kunni" "kunni" "kynni" "kunnaður" ;
|
||||
þurfa_V = irregV "þurfa" "þarf" "þurfti" "þurfi" "þyrfti" "þurfinn" ;
|
||||
vita_V = irregV "vita" "veit" "vissi" "viti" "vissi" "vitaður";
|
||||
vilja_V = irregV "vilja" "vil" "vildi" "vilji" "vildi" "viljaður" ;
|
||||
muna_V = irregV "muna" "man" "mundi" "muni" "myndi" "muninn" ;
|
||||
munu_V = irregV "munu" "mun" "mundi" "muni" "myndi" "muninn" ;
|
||||
skulu_V = irregV "skulu" "skal" "skyldi" "skuli" "skyldi" "skulinn" ;
|
||||
vera_V = irregV "vera" "er" "var" "sé" "væri" "verinn" ;
|
||||
|
||||
-- -ri verbs
|
||||
róa_V = irregV "róa" "ræ" "reri" "rói" "reri" "róinn" ;
|
||||
gróa_V = irregV "gróa" "græ" "greri" "grói" "greri" "gróinn" ;
|
||||
núa_V = irregV "núa" "ný" "neri" "núi" "neri" "núinn" ;
|
||||
snúa_V = irregV "snúa" "sný" "sneri" "snúi" "sneri" "snúinn" ;
|
||||
|
||||
-- Strong verbs
|
||||
|
||||
bíða_V = irregV "bíða" "beðinn" ;
|
||||
bíta_V = irregV "bíta" "bitinn" ;
|
||||
bresta_V = irregV "bresta" "brostinn" ;
|
||||
brjóta_V = irregV "brjóta" "brotinn" ;
|
||||
drífa_V = irregV "drífa" "drifinn" ;
|
||||
fara_V = irregV "fara" "farinn" ;
|
||||
fljúga_V = irregV "fljúga" "floginn" ;
|
||||
fljóta_V = irregV "fljóta" "flotinn" ;
|
||||
frjósa_V = irregV "frjósa" "frosinn" ;
|
||||
gjósa_V = irregV "gjósa" "gosinn" ;
|
||||
grípa_V = irregV "grípa" "gripinn" ;
|
||||
hljóta_V = irregV "hljóta" "hlotinn" ;
|
||||
hvína_V = irregV "hvína" "hvininn" ;
|
||||
hrína_V = irregV "hrína" "hrininn" ;
|
||||
hrífa_V = irregV "hrífa" "hrifinn" ;
|
||||
hníga_V = irregV "hníga" "hniginn" ;
|
||||
kvíða_V = irregV "kvíða" "kviðinn" ;
|
||||
ljúga_V = irregV "ljúga" "loginn" ;
|
||||
líða_V = irregV "líða" "liðinn" ;
|
||||
líta_V = irregV "líta" "litinn" ;
|
||||
míga_V = irregV "míga" "miginn" ;
|
||||
ríða_V = irregV "ríða" "riðinn" ;
|
||||
rísa_V = irregV "rísa" "risinn" ;
|
||||
síga_V = irregV "síga" "siginn" ;
|
||||
sjúga_V = irregV "sjúga" "soginn" ;
|
||||
strjúka_V = irregV "strjúka" "strokinn" ;
|
||||
svífa_V = irregV "svífa" "svifinn" ;
|
||||
svíkja_V = irregV "svíkja" "svikinn" ;
|
||||
stíga_V = irregV "stíga" "stiginn" ;
|
||||
sníða_V = irregV "sníða" "sniðinn" ;
|
||||
slíta_V = irregV "slíta" "slitinn" ;
|
||||
skína_V = irregV "skína" "skininn" ;
|
||||
skríða_V = irregV "skríða" "skriðinn" ;
|
||||
víkja_V = irregV "víkja" "vikinn" ;
|
||||
þrífa_V = irregV "þrífa" "þrifinn" ;
|
||||
hnjóta_V = irregV "hnjóta" "hnotinn" ;
|
||||
kjósa_V = irregV "kjósa" "kosinn" ;
|
||||
njóta_V = irregV "njóta" "notinn" ;
|
||||
sjóða_V = irregV "sjóða" "soðinn" ;
|
||||
þjóta_V = irregV "þjóta" "þotinn" ;
|
||||
þrjóta_V = irregV "þrjóta" "þrotinn" ;
|
||||
drjúpa_V = irregV "drjúpa" "dropinn" ;
|
||||
fjúka_V = irregV "fjúka" "fokinn" ;
|
||||
kljúfa_V = irregV "kljúfa" "klofinn" ;
|
||||
ljúka_V = irregV "ljúka" "lokinn" ;
|
||||
rjúfa_V = irregV "rjúfa" "rofinn" ;
|
||||
sjúga_V = irregV "sjúga" "soginn" ;
|
||||
súpa_V = irregV "súpa" "sopinn" ;
|
||||
lúka_V = irregV "lúka" "lokinn" ;
|
||||
lúta_V = irregV "lúta" "lotinn" ;
|
||||
smjúga_V = irregV "smjúga" "smoginn" ;
|
||||
detta_V = irregV "detta" "dottinn" ;
|
||||
skella_V = irregV "skella" "skollinn" ;
|
||||
skreppa_V = irregV "skreppa" "skroppinn" ;
|
||||
sleppa_V = irregV "sleppa" "sloppinn" ;
|
||||
smella_V = irregV "smella" "smollinn" ;
|
||||
snerta_V = irregV "snerta" "snortinn" ;
|
||||
spretta_V = irregV "spretta" "sprotinn" ;
|
||||
verða_V = irregV "verða" "orðinn" ;
|
||||
svelta_V = irregV "svelta" "soltinn" ;
|
||||
hverfa_V = irregV "hverfa" "horfinn" ;
|
||||
sverfa_V = irregV "sverfa" "sorfinn" ;
|
||||
vella_V = irregV "vella" "ollinn" ;
|
||||
velta_V = irregV "velta" "oltinn" ;
|
||||
verpa_V = irregV "verpa" "orpinn" ;
|
||||
þverra_V = irregV "þverra" "þorrinn" ;
|
||||
spinna_V = irregV "spinna" "spunninn" ;
|
||||
finna_V = irregV "finna" "fundinn" ;
|
||||
vinna_V = irregV "vinna" "unninn" ;
|
||||
drekka_V = irregV "drekka" "drukkinn" ;
|
||||
brenna_V = irregV "brenna" "brunninn" ;
|
||||
renna_V = irregV "renna" "runninn" ;
|
||||
gjalda_V = irregV "gjalda" "goldinn" ;
|
||||
skjálfa_V = irregV "skjálfa" "skolfinn" ;
|
||||
gjalla_V = irregV "gjalla" "gollinn" ;
|
||||
bjarga_V = irregV "bjarga" "borginn" ; -- has usuall a weak declension in modern speach
|
||||
hrökkva_V = irregV "hrökkva" "hrokkinn" ;
|
||||
slökkva_V = irregV "slökkva" "slokkinn" ;
|
||||
stökkva_V = irregV "stökkva" "stokkinn" ;
|
||||
sökkva_V = irregV "sökkva" "sokkinn" ;
|
||||
bera_V = irregV "bera" "borinn" ;
|
||||
skera_V = irregV "skera" "skorinn" ;
|
||||
stela_V = irregV "stela" "stolinn" ;
|
||||
fela_V = irregV "fela" "fólginn" ;
|
||||
nema_V = irregV "nema" "numinn" ;
|
||||
gefa_V = irregV "gefa" "gefinn" ;
|
||||
drepa_V = irregV "drepa" "drepinn" ;
|
||||
geta_V = irregV "geta" "getinn" ;
|
||||
kveða_V = irregV "kveða" "kveðinn" ;
|
||||
leka_V = irregV "leka" "lekinn" ;
|
||||
lesa_V = irregV "lesa" "lesinn" ;
|
||||
meta_V = irregV "meta" "metinn" ;
|
||||
reka_V = irregV "reka" "rekinn" ;
|
||||
biðja_V = irregV "biðja" "beðinn" ;
|
||||
sitja_V = irregV "sitja" "setinn" ;
|
||||
liggja_V = irregV "liggja" "leginn" ;
|
||||
þiggja_V = irregV "þiggja" "þeginn" ;
|
||||
fara_V = irregV "fara" "farinn" ;
|
||||
ala_V = irregV "ala" "alinn" ;
|
||||
gala_V = irregV "gala" "galinn" ;
|
||||
grafa_V = irregV "grafa" "grafinn" ;
|
||||
hlaða_V = irregV "hlaða" "hlaðinn" ;
|
||||
kala_V = irregV "kala" "kalinn" ;
|
||||
mala_V = irregV "mala" "malinn" ;
|
||||
skafa_V = irregV "skafa" "skafinn" ;
|
||||
skapa_V = irregV "skapa" "skapaður" ;
|
||||
taka_V = irregV "taka" "tekinn" ;
|
||||
aka_V = irregV "aka" "ekinn" ;
|
||||
draga_V = irregV "draga" "dreginn" ;
|
||||
skaka_V = irregV "skaka" "skekinn" ;
|
||||
hefja_V = irregV "hefja" "hafinn" ;
|
||||
kefja_V = irregV "kefja" "kafinn" ;
|
||||
skekja_V = irregV "skekja" "skakinn" ;
|
||||
sverja_V = irregV "sverja" "svarinn" ;
|
||||
deyja_V = irregV "deyja" "dáinn" ;
|
||||
geyja_V = irregV "geyja" "geyjaður" ;
|
||||
hlæja_V = irregV "hlæja" "hleginn" ;
|
||||
klæja_V = irregV "klæja" "klæjaður" ;
|
||||
flá_V = irregV "flá" "fleginn" ;
|
||||
slá_V = irregV "slá" "sleginn" ;
|
||||
þvo_V = irregV "þvo" "þveginn" ;
|
||||
auka_V = irregV "auka" "jók" "jukum" "aukinn" ;
|
||||
ausa_V = irregV "ausa" "jós" "jusum" "ausinn" ;
|
||||
hlaupa_V = irregV (cBjóða "hlaupa" "hleyp" "hljóp" "hlupum" "hlypi") "hlaupa" "hlaupinn" ;
|
||||
heita_V = irregV "heita" "hét" "hétum" "heitinn" ;
|
||||
leika_V = irregV "leika" "lék" "lékum" "leikinn" ;
|
||||
falla_V = irregV "falla" "féll" "féllum" "fallinn" ;
|
||||
halda_V = irregV "halda" "hélt" "héldum" "haldinn" ;
|
||||
hanga_V = irregV "hanga" "hékk" "héngum" "hanginn" ;
|
||||
ganga_V = irregV "ganga" "gékk" "géngum" "genginn" ;
|
||||
--standa_V = irregV "standa" "staðinn" ;
|
||||
blása_V = irregV "blása" "blés" "blésum" "blásinn" ;
|
||||
gráta_V = irregV "gráta" "grét" "grétum" "grátinn" ;
|
||||
láta_V = irregV "láta" "lét" "létum" "látinn" ;
|
||||
ráða_V = irregV "ráða" "réð" "réðum" "ráðinn" ;
|
||||
syngja_V = irregV (cBresta "syngja" "syng" "söng" "sungum" "syngi") "syngja" "sunginn" ;
|
||||
sjá_V = irregV (cFara "sjá" "sé" "sá" "sáum" "sæi") "sjá" "séður" ;
|
||||
éta_V = irregV (cBresta "éta" "ét" "át" "átum" "æti") "éta" "étinn" ;
|
||||
búa_V = irregV (cFara "búa" "bý" "bjó" "bjuggum" "byggi") "búa" "búinn" ;
|
||||
spýja_V = irregV (cFara "spýja" "spý" "spjó" "spúðum" "spýði") "spúa" "spúinn" ;
|
||||
fá_V = irregV (cFara "fá" "fæ" "fékk" "fengum" "fengi") "fá" "fenginn" ;
|
||||
koma_V = irregV (cBresta "koma" "kem" "kom" "komum" "kæmi") "koma" "kominn" ;
|
||||
sofa_V = irregV (cBjóða "sofa" "sef" "svaf" "sváfum" "sæfi") "sofa" "sofinn" ;
|
||||
troða_V = irregV (cBresta "troða" "treð" "tróð" "tróðum" "træði") "troða" "troðinn" ;
|
||||
hrinda_V = irregV (cBresta "hrinda" "hrindi" "hratt" "hrundum" "hryndi") "hrinda" "hrundinn" ;
|
||||
vinda_V = irregV (cBresta "vinda" "vindi" "vatt" "undum" "yndi") "vinda" "undinn" ;
|
||||
binda_V = irregV (cBresta "binda" "bindi" "batt" "bundum" "byndi") "binda" "bundinn" ;
|
||||
springa_V = irregV (cBresta "springa" "spring" "sprakk" "sprungum" "spryngi") "springa" "sprunginn" ;
|
||||
stinga_V = irregV (cBresta "stinga" "sting" "stakk" "stungum" "styngi") "stinga" "stunginn" ;
|
||||
höggva_V = irregV (cBresta "höggva" "hegg" "hjó" "hjuggum" "hyggi") "höggva" "höggvinn" ;
|
||||
vaxa_V = irregV (cBresta "vaxa" "vex" "óx" "uxum" "yxi") "vaxa" "vaxinn" ;
|
||||
vega_V = irregV (cBresta "vega" "veg" "vó" "vógum" "vægi") "vega" "veginn" ;
|
||||
standa_V = irregV (cBresta "standa" "stend" "stóð" "stóðum" "stæði") "standa" "staðinn" ;
|
||||
}
|
||||
213
lib/src/icelandic/IrregIceAbs.gf
Normal file
213
lib/src/icelandic/IrregIceAbs.gf
Normal file
@@ -0,0 +1,213 @@
|
||||
abstract IrregIceAbs = Cat ** {
|
||||
fun
|
||||
|
||||
-- irregular/present preterite verbs
|
||||
eiga_V : V ;
|
||||
mega_V : V ;
|
||||
unna_V : V ;
|
||||
kunna_V : V ;
|
||||
þurfa_V : V ;
|
||||
vita_V : V ;
|
||||
vilja_V : V ;
|
||||
muna_V : V ;
|
||||
munu_V : V ;
|
||||
skulu_V : V ;
|
||||
|
||||
-- irregular/present preterite verb/special
|
||||
vera_V : V ;
|
||||
|
||||
-- irregular/-ri verbs
|
||||
róa_V : V ;
|
||||
gróa_V : V ;
|
||||
núa_V : V ;
|
||||
snúa_V : V ;
|
||||
|
||||
-- irregular/strong verbs
|
||||
biðja_V : V ;
|
||||
binda_V : V ;
|
||||
bíða_V : V ;
|
||||
bíta_V : V ;
|
||||
blása_V : V ;
|
||||
brenna_V : V ;
|
||||
bresta_V : V ;
|
||||
brjóta_V : V ;
|
||||
hníga_V : V ;
|
||||
míga_V : V ;
|
||||
detta_V : V ;
|
||||
deyja_V : V ;
|
||||
drekka_V : V ;
|
||||
drepa_V : V ;
|
||||
drífa_V : V ;
|
||||
fara_V : V ;
|
||||
falla_V : V ;
|
||||
finna_V : V ;
|
||||
fljóta_V : V ;
|
||||
fljúga_V : V ;
|
||||
frjósa_V : V ;
|
||||
ganga_V : V ;
|
||||
gefa_V : V ;
|
||||
grafa_V : V ;
|
||||
grípa_V : V ;
|
||||
halda_V : V ;
|
||||
hlaupa_V : V ;
|
||||
hlæja_V : V ;
|
||||
hrífa_V : V ;
|
||||
hrína_V : V ;
|
||||
hvína_V : V ;
|
||||
koma_V : V ;
|
||||
kvíða_V : V ;
|
||||
láta_V : V ;
|
||||
leika_V : V ;
|
||||
lesa_V : V ;
|
||||
líða_V : V ;
|
||||
líta_V : V ;
|
||||
ljúga_V : V ;
|
||||
ríða_V : V ;
|
||||
rísa_V : V ;
|
||||
síga_V : V ;
|
||||
sjá_V : V ;
|
||||
sjúga_V : V ;
|
||||
skína_V : V ;
|
||||
skríða_V : V ;
|
||||
slíta_V : V ;
|
||||
sníða_V : V ;
|
||||
sofa_V : V ;
|
||||
standa_V : V ;
|
||||
stíga_V : V ;
|
||||
strjúka_V : V ;
|
||||
svífa_V : V ;
|
||||
svíkja_V : V ;
|
||||
syngja_V : V ;
|
||||
sækja_V : V ;
|
||||
vinna_V : V ;
|
||||
vita_V : V ;
|
||||
víkja_V : V ;
|
||||
þrífa_V : V ;
|
||||
brjóta_V : V ;
|
||||
fljóta_V : V ;
|
||||
frjósa_V : V ;
|
||||
gjósa_V : V ;
|
||||
hljóta_V : V ;
|
||||
hnjóta_V : V ;
|
||||
kjósa_V : V ;
|
||||
njóta_V : V ;
|
||||
sjóða_V : V ;
|
||||
þjóta_V : V ;
|
||||
þrjóta_V : V ;
|
||||
drjúpa_V : V ;
|
||||
fjúka_V : V ;
|
||||
kljúfa_V : V ;
|
||||
ljúga_V : V ;
|
||||
ljúka_V : V ;
|
||||
rjúfa_V : V ;
|
||||
sjúga_V : V ;
|
||||
súpa_V : V ;
|
||||
lúka_V : V ;
|
||||
lúta_V : V ;
|
||||
fljúga_V : V ;
|
||||
smjúga_V : V ;
|
||||
detta_V : V ;
|
||||
skella_V : V ;
|
||||
skreppa_V : V ;
|
||||
sleppa_V : V ;
|
||||
smella_V : V ;
|
||||
snerta_V : V ;
|
||||
spretta_V : V ;
|
||||
verða_V : V ;
|
||||
hverfa_V : V ;
|
||||
svelgja_V : V ;
|
||||
svelta_V : V ;
|
||||
sverfa_V : V ;
|
||||
vella_V : V ;
|
||||
velta_V : V ;
|
||||
verpa_V : V ;
|
||||
þverra_V : V ;
|
||||
drekka_V : V ;
|
||||
brenna_V : V ;
|
||||
renna_V : V ;
|
||||
gjalda_V : V ;
|
||||
skjálfa_V : V ;
|
||||
gjalla_V : V ;
|
||||
bjarga_V : V ;
|
||||
spinna_V : V ;
|
||||
finna_V : V ;
|
||||
vinna_V : V ;
|
||||
hrökkva_V : V ;
|
||||
slökkva_V : V ;
|
||||
stökkva_V : V ;
|
||||
sökkva_V : V ;
|
||||
bera_V : V ;
|
||||
skera_V : V ;
|
||||
stela_V : V ;
|
||||
fela_V : V ;
|
||||
nema_V : V ;
|
||||
gefa_V : V ;
|
||||
drepa_V : V ;
|
||||
geta_V : V ;
|
||||
kveða_V : V ;
|
||||
leka_V : V ;
|
||||
lesa_V : V ;
|
||||
meta_V : V ;
|
||||
reka_V : V ;
|
||||
biðja_V : V ;
|
||||
sitja_V : V ;
|
||||
liggja_V : V ;
|
||||
þiggja_V : V ;
|
||||
binda_V : V ;
|
||||
vinda_V : V ;
|
||||
hrinda_V : V ;
|
||||
springa_V : V ;
|
||||
stinga_V : V ;
|
||||
syngja_V : V ;
|
||||
koma_V : V ;
|
||||
sofa_V : V ;
|
||||
troða_V : V ;
|
||||
sjá_V : V ;
|
||||
éta_V : V ;
|
||||
fara_V : V ;
|
||||
ala_V : V ;
|
||||
gala_V : V ;
|
||||
grafa_V : V ;
|
||||
hlaða_V : V ;
|
||||
kala_V : V ;
|
||||
mala_V : V ;
|
||||
skafa_V : V ;
|
||||
skapa_V : V ;
|
||||
taka_V : V ;
|
||||
aka_V : V ;
|
||||
draga_V : V ;
|
||||
skaka_V : V ;
|
||||
hefja_V : V ;
|
||||
kefja_V : V ;
|
||||
skekja_V : V ;
|
||||
sverja_V : V ;
|
||||
deyja_V : V ;
|
||||
geyja_V : V ;
|
||||
hlæja_V : V ;
|
||||
klæja_V : V ;
|
||||
flá_V : V ;
|
||||
slá_V : V ;
|
||||
þvo_V : V ;
|
||||
fela_V : V ;
|
||||
troða_V : V ;
|
||||
vega_V : V ;
|
||||
heita_V : V ;
|
||||
leika_V : V ;
|
||||
falla_V : V ;
|
||||
halda_V : V ;
|
||||
hanga_V : V ;
|
||||
fá_V : V ;
|
||||
ganga_V : V ;
|
||||
blása_V : V ;
|
||||
gráta_V : V ;
|
||||
láta_V : V ;
|
||||
ráða_V : V ;
|
||||
auka_V : V ;
|
||||
ausa_V : V ;
|
||||
hlaupa_V : V ;
|
||||
búa_V : V ;
|
||||
spýja_V : V ;
|
||||
höggva_V : V ;
|
||||
vaxa_V : V ;
|
||||
standa_V : V ;
|
||||
}
|
||||
6
lib/src/icelandic/LangIce.gf
Normal file
6
lib/src/icelandic/LangIce.gf
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
concrete LangIce of Lang =
|
||||
GrammarIce
|
||||
,LexiconIce
|
||||
--,ConstructionIce
|
||||
** {} ;
|
||||
361
lib/src/icelandic/LexiconIce.gf
Normal file
361
lib/src/icelandic/LexiconIce.gf
Normal file
@@ -0,0 +1,361 @@
|
||||
--# -path=.:prelude
|
||||
|
||||
concrete LexiconIce of Lexicon = CatIce **
|
||||
open ParadigmsIce, IrregIce, Prelude in {
|
||||
|
||||
lin
|
||||
bank_N = mkN "banki" masculine ;
|
||||
boss_N = mkN "stjóri" masculine ;
|
||||
cousin_N = mkN "frændi" masculine ; -- frænka is the feminine equivalent
|
||||
glove_N = mkN "hanski" masculine ;
|
||||
lamp_N = mkN "lampi" masculine ;
|
||||
pen_N = mkN "penni" masculine ;
|
||||
school_N = mkN "skóli" masculine ;
|
||||
student_N = mkN "nemandi" masculine ;
|
||||
teacher_N = mkN "kennari" masculine ;
|
||||
university_N = mkN "háskóli" masculine ;
|
||||
window_N = mkN "gluggi" masculine ;
|
||||
boat_N = mkN "bátur" masculine ;
|
||||
boy_N = mkN "strákur" masculine ;
|
||||
cheese_N = mkN "ostur" masculine ;
|
||||
dog_N = mkN "hundur" masculine ;
|
||||
fish_N = mkN "fiskur" masculine ;
|
||||
garden_N = mkN "garður" masculine ;
|
||||
glove_N = mkN "hanski" masculine ;
|
||||
hat_N = mkN "hattur" masculine ;
|
||||
horse_N = mkN "hestur" masculine ;
|
||||
king_N = mkN "konungur" masculine ;
|
||||
priest_N = mkN "prestur" masculine ;
|
||||
snake_N = mkN "snákur" masculine ;
|
||||
sock_N = mkN "sokkur" masculine ;
|
||||
belly_N = mkN "magi" masculine ;
|
||||
fire_N = mkN "eldur" "eldar" masculine ;
|
||||
chair_N = mkN "stóll" masculine ;
|
||||
car_N = mkN "bíll" masculine ;
|
||||
stone_N = mkN "steinn" masculine ;
|
||||
rock_N = mkN "klettur" masculine ;
|
||||
wing_N = mkN "vængur" masculine ;
|
||||
mouth_N = mkN "munnur" masculine ;
|
||||
sand_N = mkN "sandur" masculine ;
|
||||
wind_N = mkN "vindur" masculine ;
|
||||
worm_N = mkN "ormur" masculine ;
|
||||
friend_N = mkN "vinur" "vinar" "vinir" masculine ;
|
||||
brother_N2 = mkN2 (mkN "bróðir" "bróður" "bræður" masculine) (mkPrep [] genitive) ;
|
||||
father_N2 = mkN2 (mkN "faðir" "föður" "feður" masculine) (mkPrep [] genitive) ;
|
||||
man_N = mkN "maður" "mann" "menn" masculine ;
|
||||
husband_N = mkCompoundN "eigin" (man_N) ;
|
||||
policeman_N = mkCompoundN "lögreglu" (mkN "þjónn" masculine) ;
|
||||
smoke_N = mkN "reykur" "reykjar" "reykir" masculine;
|
||||
restaurant_N = mkCompoundN "veitinga" (mkN "staður" "staðar" "staðir" masculine) ;
|
||||
road_N = mkN "vegur" "vegar" "vegir" masculine ;
|
||||
forest_N = mkN "skógur" masculine ;
|
||||
enemy_N = mkCompoundN "ó" (friend_N) ;
|
||||
peace_N = mkN "friður" masculine ;
|
||||
industry_N = mkN "iðnaður" masculine ;
|
||||
leg_N = mkCompoundN "fót" (mkN "leggur" "leggjar" "leggir" masculine) ;
|
||||
beer_N = mkN "öl" neuter ;
|
||||
bird_N = mkN "fugl" masculine ;
|
||||
cat_N = mkN "köttur" "kattar" "kettir" masculine ;
|
||||
sky_N = mkN "himinn" masculine ;
|
||||
neck_N = mkN "háls" masculine ;
|
||||
snow_N = mkN "snjór" masculine ;
|
||||
ice_N = mkN "ís" masculine ;
|
||||
head_N = mkN "haus" masculine ;
|
||||
foot_N = mkN "fótur" "fætur" masculine ;
|
||||
day_N = mkN "dagur" masculine ;
|
||||
bark_N = mkN "börkur" "barkar" "berkir" masculine ;
|
||||
wood_N = mkN "viður" "viðar" "viðir" masculine ;
|
||||
fruit_N = mkN "ávöxtur" "ávaxtar" "ávextir" masculine ;
|
||||
shoe_N = mkN "skór" "skór" masculine ;
|
||||
sea_N = mkN "sjór" "sjó" "sjó" "sjós" "sjóir" "sjói" "sjóum" "sjóa" masculine ;
|
||||
paper_N = mkN "pappír" masculine ;
|
||||
doctor_N = mkN "læknir" "lækni" "lækni" "læknis" "læknar" "lækna" "læknum" "lækna" masculine ;
|
||||
fridge_N = mkCompoundN "ís" (mkN "skápur" "skáps" "skápar" masculine) ;
|
||||
cap_N = mkN "húfa" feminine ;
|
||||
fat_N = mkN "fita" feminine ;
|
||||
fog_N = mkN "þoka" feminine ;
|
||||
tail_N = mkN "rófa" feminine ;
|
||||
apple_N = mkN "epli" neuter ;
|
||||
baby_N = mkN "barn" neuter ;
|
||||
bike_N = mkN "hjól" neuter ;
|
||||
boot_N = mkN "sígvél" neuter ;
|
||||
bread_N = mkN "brauð" neuter ;
|
||||
butter_N = mkN "smjör" neuter ;
|
||||
carpet_N = mkN "teppi" neuter ;
|
||||
ceiling_N = mkN "loft" neuter ;
|
||||
child_N = mkN "barn" neuter ;
|
||||
country_N = mkN "land" neuter ;
|
||||
floor_N = mkN "gólf" neuter ;
|
||||
house_N = mkN "hús" neuter ;
|
||||
lake_N = mkN "vatn" neuter ;
|
||||
meat_N = mkN "kjöt" neuter ;
|
||||
moon_N = mkN "tungl" neuter ;
|
||||
mountain_N = mkN "fjall" neuter ;
|
||||
newspaper_N = mkN "dagblað" neuter ;
|
||||
plastic_N = mkN "plat" neuter ;
|
||||
radio_N = mkN "útvarp" neuter ;
|
||||
religion_N = mkN "trúarbragð" neuter ;
|
||||
roof_N = mkN "þak" neuter ;
|
||||
rubber_N = mkN "gúmmí" neuter ;
|
||||
ship_N = mkN "skip" neuter ;
|
||||
silver_N = mkN "silfur" neuter ;
|
||||
steel_N = mkN "stál" neuter ;
|
||||
table_N = mkN "borð" neuter ;
|
||||
television_N = mkN "sjónvarp" neuter ;
|
||||
village_N = mkN "þorp" neuter ;
|
||||
war_N = mkN "stríð" neuter ;
|
||||
water_N = mkN "vatn" neuter ;
|
||||
wine_N = mkN "vín" neuter ;
|
||||
song_N = mkN "lag" neuter ;
|
||||
number_N = mkN "númer" neuter ;
|
||||
animal_N = mkN "dýr" neuter ;
|
||||
back_N = mkN "bak" neuter ;
|
||||
blood_N = mkN "blóð" neuter ;
|
||||
bone_N = mkN "bein" neuter ;
|
||||
breast_N = mkN "brjóst" neuter ;
|
||||
dust_N = mkN "ryk" neuter ;
|
||||
ear_N = mkN "eyra" neuter ;
|
||||
egg_N = mkN "egg" neuter ;
|
||||
eye_N = mkN "auga" neuter ;
|
||||
flower_N = mkN "blóm" neuter ;
|
||||
grass_N = mkN "gras" neuter ;
|
||||
hair_N = mkN "hár" neuter ;
|
||||
heart_N = mkN "hjarta" neuter ;
|
||||
horn_N = mkN "horn" neuter ;
|
||||
knee_N = mkN "hné" neuter ;
|
||||
leaf_N = mkN "lauf" neuter ;
|
||||
name_N = mkN "nafn" neuter ;
|
||||
nose_N = mkN "nef" neuter ;
|
||||
rope_N = mkN "reipi" neuter ;
|
||||
salt_N = mkN "salt" neuter ;
|
||||
seed_N = mkN "fræ" neuter ;
|
||||
stick_N = mkN "prik" neuter ;
|
||||
year_N = mkN "ár" neuter ;
|
||||
language_N = mkN "tungumál" neuter ;
|
||||
gold_N = mkN "gull" neuter ;
|
||||
iron_N = mkN "járn" neuter ;
|
||||
leather_N = mkN "leður" neuter ;
|
||||
|
||||
|
||||
airplane_N = mkN "flugvél" "flugvélar" feminine ;
|
||||
apartment_N = mkN "íbúð" "íbúðir" feminine ;
|
||||
art_N = mkN "list" "listir" feminine ;
|
||||
camera_N = mkN "myndavél" "myndavélar" feminine ;
|
||||
church_N = mkN "kirkja" feminine ;
|
||||
city_N = mkN "borg" "borgir" feminine ;
|
||||
coat_N = mkN "kápa" feminine ;
|
||||
computer_N = mkN "tölva" feminine ;
|
||||
door_N = mkN "hurð" "hurðir" feminine ;
|
||||
girl_N = mkNPlGen "stelpa" feminine ;
|
||||
harbour_N = mkN "höfn" "hafnir" feminine ;
|
||||
hill_N = mkN "hæð" "hæðir" feminine ;
|
||||
love_N = mkN "ást" "ástir" feminine ;
|
||||
oil_N = mkN "olía" feminine ;
|
||||
planet_N = mkN "pláneta" feminine ;
|
||||
queen_N = mkN "drottning" feminine ;
|
||||
shirt_N = mkN "skyrta" feminine ;
|
||||
shop_N = mkN "búð" "búðir" feminine ;
|
||||
sister_N = mkN "systir" "systur" feminine ;
|
||||
star_N = mkN "stjarna" feminine ;
|
||||
stove_N = mkN "eldavél" "eldavélar" feminine ;
|
||||
sun_N = mkN "sól" "sólir" feminine ;
|
||||
train_N = mkN "lest" "lestir" feminine ;
|
||||
earth_N = mkN "jörð" "jarðir" feminine ;
|
||||
feather_N = mkN "fjöður" "fjaðrir" feminine ;
|
||||
fog_N = mkN "þoka" feminine ;
|
||||
guts_N = mkN "görn" "garnir" feminine ;
|
||||
liver_N = mkN "lifur" "lifrar" feminine ;
|
||||
person_N = mkN "persóna" feminine ;
|
||||
rain_N = mkN "rigning" feminine ;
|
||||
skin_N = mkN "húð" "húðir" feminine ;
|
||||
tongue_N = mkNPlGen "tunga" feminine ;
|
||||
rule_N = mkN "regla" feminine ;
|
||||
question_N = mkN "spurning" feminine ;
|
||||
reason_N = mkNPlGen "ástæða" feminine ;
|
||||
river_N = mkN "á" "ár" feminine ;
|
||||
louse_N = mkN "lús" "lýs" feminine ;
|
||||
book_N = mkN "bók" "bókar" "bækur" feminine ;
|
||||
night_N = mkN "nótt" "nætur" "nætur" "nótta" feminine ;
|
||||
root_N = mkN "rót" "rótar" "rætur" feminine ;
|
||||
factory = mkN "verksmiðja" feminine ;
|
||||
fingernail_N = mkN "nögl" "naglar" "neglur" feminine ;
|
||||
sheep_N = mkN "kind" "kindar" "kindur" feminine ;
|
||||
tooth_N = mkN "tönn" "tannar" "tennur" feminine ;
|
||||
mother_N2 = mkN2 (mkN "móðir" "mæður" feminine) (mkPrep [] genitive) ;
|
||||
distance_N3 = mkN3 (mkN "vegalend" "vegalengdir" feminine) (mkPrep "frá" dative) (mkPrep "til" genitive) ;
|
||||
ashes_N = mkN "aska" feminine ;
|
||||
woman_N = mkN "kona" "konu" "konur" "kvenna" feminine ;
|
||||
wife_N = mkCompoundN "eigin" (woman_N) ;
|
||||
cow_N = mkN "belja" feminine ;
|
||||
factory_N = mkN "verksmiðja" feminine ;
|
||||
milk_N = mkN "mjólk" "mjólk" "mjólk" "mjólkur" "mjólk" "mjólk" "mjólk" "mjólkur" feminine ;
|
||||
music_N = mkN "tónlist" "tónlist" "tónlist" "tónlistar" "tónlist" "tónlist" "tónlist" "tónlistar" feminine ;
|
||||
fat_N = mkN "fita" feminine ;
|
||||
hand_N = mkN "hönd" "hönd" "hendi" "handar" "hendur" "hendur" "höndum" "handa" feminine ;
|
||||
grammar_N = mkN "málfræði" "málfræði" "málfræði" "málfræði" "málfræði" "málfræði" "málfræði" "málfræði" feminine ;
|
||||
tree_N = mkN "tré" neuter ;
|
||||
-- either vísindi (neuter and only in plural) or fræði (feminine and only in singular) :)
|
||||
--science_N
|
||||
paris_PN = mkPN "París" feminine ;
|
||||
cloud_N = mkN "ský" neuter ;
|
||||
-- left_Ord =
|
||||
bad_A = mkA "vondur" "vond" "verri" ;
|
||||
beautiful_A = mkA "fallegur" ;
|
||||
big_A = mkA "stór" "stór" "stærri" ;
|
||||
black_A = mkA "svartur" ;
|
||||
blue_A = mkA "blár" "blá" ;
|
||||
broad_A = mkA "breiður" ;
|
||||
brown_A = mkA "brúnn" ;
|
||||
clean_A = mkA "hreinn" ;
|
||||
clever_A = mkA "klár" "klár" ;
|
||||
cold_A = mkA "kaldur" ;
|
||||
dirty_A = mkA "skítugur" ;
|
||||
empty_A = mkA "tómur" ;
|
||||
easy_A2V = mkA2 (mkA "auðveldur") (lin Prep {s = "fyrir"; c = accusative}) ;
|
||||
fun_AV = mkA "skemmtilegur" ;
|
||||
good_A = mkA "góður" "góð" "betri" ;
|
||||
green_A = mkA "grænn" ;
|
||||
hot_A = mkA "heitur" ;
|
||||
important_A = mkA "mikilvægur" ;
|
||||
long_A = mkA "langur" ;
|
||||
married_A2 = mkA2 (mkA "giftur") (lin Prep {s = []; c = dative}) ;
|
||||
narrow_A = mkA "þröngur" ;
|
||||
new_A = mkA "nýr" "ný" ;
|
||||
--old_A = mkA "gamall"
|
||||
probable_AS = mkA "líklegur" ;
|
||||
red_A = mkA "rauður" ;
|
||||
short_A = mkA "stuttur" "stutt" "syttri" ;
|
||||
small_A = mkA "lítill" "lítil" "minni" ;
|
||||
stupid_A = mkA "heimskur" ;
|
||||
thick_A = mkA "þykkur" ;
|
||||
thin_A = mkA "þunnur" "þunn" "þynnri" ;
|
||||
ugly_A = mkA "ljótur" ;
|
||||
warm_A = mkA "heitur" ;
|
||||
white_A = mkA "hvítur" ;
|
||||
yellow_A = mkA "gulur" ;
|
||||
young_A = mkA "ungur" "ung" "yngri" ;
|
||||
correct_A = mkA "réttur" ;
|
||||
dry_A = mkA "þurr" "þurr" ;
|
||||
dull_A = mkA "leðinilegur" ;
|
||||
full_A = mkA "fullur" ;
|
||||
heavy_A = mkA "þungur" "þung" "þyngri" ;
|
||||
near_A = mkA "nálægur" ;
|
||||
rotten_A = mkA "rotinn" ;
|
||||
round_A = mkA "kringlóttur" ;
|
||||
sharp_A = mkA "beittur" ;
|
||||
smooth_A = mkA "sléttur" ;
|
||||
straight_A = mkA "beinn" ;
|
||||
wet_A = mkA "blautur" ;
|
||||
wide_A = mkA "víður" ;
|
||||
ready_A = mkA "tilbúinn" ;
|
||||
uncertain_A = mkA "óviss" "óviss" "óvissari" ;
|
||||
--other_A = regA "other" ;
|
||||
|
||||
-- Old paradigms
|
||||
already_Adv = mkAdv "þegar" ;
|
||||
far_Adv = mkAdv "langt" ;
|
||||
fly_V = IrregIce.fljúga_V ;
|
||||
john_PN = mkPN "Jón" masculine ;
|
||||
|
||||
now_Adv = mkAdv "núna" ;
|
||||
today_Adv = mkAdv "í dag" ;
|
||||
|
||||
|
||||
live_V = mkV "lifa" ;
|
||||
stop_V = mkV "stansa" "stansa" "stansaði" "stansaður" ;
|
||||
jump_V = mkV "hoppa" "hoppa" ;
|
||||
breathe_V = mkV "anda" "anda" "andaði" "andaður"; -- some bug somewhere...
|
||||
sew_V = mkV "sauma" "sauma" "saumaði" "saumaður" ;
|
||||
smell_V = mkV "þefa" "þefa" "þefaði" "þefaður" ;
|
||||
spit_V = mkV "hrækja" ;
|
||||
swell_V = mkV "bólgna" "bólgna" "bólgnaði" "bólgnaður" ;
|
||||
swim_V = mkV "synda" ;
|
||||
think_V = mkV "hugsa" "hugsa" "hugsaði" "hugsaður" ;
|
||||
vomit_V = mkV "æla" ;
|
||||
|
||||
love_V2 = mkV2 (mkV "elska" "elska" "elskaði" "elskaður") ;
|
||||
listen_V2 = mkV2 (mkV "hlusta" "hlusta" "hlustaði" "hlustaður") (mkPrep "á" accusative) ;
|
||||
close_V2 = mkV2 (mkV "loka" "loka" "lokaði" "lokaður") ;
|
||||
answer_V2S = mkV2 (mkV "svara" "svara" "svaraði" "svaraður") (mkPrep "" dative) ;
|
||||
eat_V2 = mkV2 (mkV "borða" "borða" "borðaði" "borðaður") ;
|
||||
forget_V2 = mkV2 (mkV "gleyma") ;
|
||||
hate_V2 = mkV2 (mkV "hata" "hata" "hataði" "hataður") ;
|
||||
hear_V2 = mkV2 (mkV "heyra") ;
|
||||
learn_V2 = mkV2 (mkV "læra") ;
|
||||
lose_V2 = mkV2 (mkV "týna") ;
|
||||
open_V2 = mkV2 (mkV "opna" "opna" "opnaði" "opnaður") ;
|
||||
paint_V2A = mkV2 (mkV "mála" "mála" "málaði" "málaður") ;
|
||||
speak_V2 = mkV2 (mkV "tala" "tala" "talaði" "talaður") ;
|
||||
teach_V2 = mkV2 (mkV "kenna") ;
|
||||
understand_V2 = mkV2 (mkV "skilja") ;
|
||||
watch_V2 = mkV2 (mkV "horfa") ;
|
||||
write_V2 = mkV2 (mkV "skrifa" "skrifa" "skrifaði" "skrifaður") ;
|
||||
do_V2 = mkV2 (mkV "gera") ;
|
||||
count_V2 = mkV2 (mkV "telja") ;
|
||||
cut_V2 = mkV2 (mkV "klippa") ;
|
||||
hit_V2 = mkV2 (mkV "berja") ;
|
||||
hunt_V2 = mkV2 (mkV "veiða") ;
|
||||
pull_V2 = mkV2 (mkV "toga" "toga" "togaði" "togaður") ;
|
||||
push_V2 = mkV2 (mkV "ýta") ;
|
||||
rub_V2 = mkV2 (mkV "nudda" "nudda" "nuddaði" "nuddaður") ;
|
||||
scratch_V2 = mkV2 (mkV "klóra" "klóra" "klóraði" "klóraður") ;
|
||||
split_V2 = mkV2 (mkV "skipta") ;
|
||||
squeeze_V2 = mkV2 (mkV "kreista") ;
|
||||
throw_V2 = mkV2 (mkV "kasta" "kasta" "kastaði" "kastaður") ;
|
||||
|
||||
turn_V = mkV "beygja" "beygi" ;
|
||||
bite_V2 = mkV2 IrregIce.bíta_V ;
|
||||
break_V2 = mkV2 IrregIce.brjóta_V ;
|
||||
wait_V2 = mkV2 (IrregIce.bíða_V) (mkPrep "eftir" dative) ;
|
||||
wash_V2 = mkV2 IrregIce.þrífa_V ;
|
||||
suck_V2 = mkV2 IrregIce.sjúga_V ;
|
||||
wipe_V2 = mkV2 IrregIce.strjúka_V ;
|
||||
lie_V = IrregIce.ljúga_V ;
|
||||
freeze_V = IrregIce.frjósa_V ;
|
||||
float_V = IrregIce.fljóta_V ;
|
||||
flow_V = mkV "flæða" ;
|
||||
go_V = IrregIce.fara_V ;
|
||||
leave_V2 = mkV2 IrregIce.fara_V ;
|
||||
seek_V2 = mkV2 (mkV "leita" "leita" "leitaði" "leitaður") ;
|
||||
travel_V = mkV "ferða" "ferða" "ferðaði" "ferðaður" ; -- this verb only exists in the middle voice
|
||||
know_V2 = mkV2 IrregIce.vita_V ;
|
||||
know_VQ = IrregIce.vita_V ;
|
||||
know_VS = IrregIce.vita_V ;
|
||||
ask_V2Q = mkV2 (mkV "spyrja" "spyr" "spurði" "spurður") (mkPrep "" accusative) ;
|
||||
find_V2 = mkV2 IrregIce.finna_V ;
|
||||
win_V2 = mkV2 IrregIce.vinna_V ;
|
||||
fall_V = IrregIce.detta_V ;
|
||||
burn_V = IrregIce.brenna_V ;
|
||||
drink_V2 = mkV2 IrregIce.drekka_V ;
|
||||
add_V3 = mkV3 (mkV "bæta" "bæti" "bætti" "bættur") (mkPrep "" dative) (mkPrep "við" accusative) ;
|
||||
beg_V2V = mkV3 IrregIce.biðja_V (mkPrep "" accusative) (mkPrep "um að" accusative) ;
|
||||
read_V2 = mkV2 IrregIce.lesa_V ;
|
||||
kill_V2 = mkV2 IrregIce.drepa_V ;
|
||||
give_V3 = mkV3 IrregIce.gefa_V ;
|
||||
sit_V = IrregIce.sitja_V ;
|
||||
hope_VS = mkV "vona" "vona" "vonaði" "vonaður" ;
|
||||
wonder_VQ = mkV "velta" ;
|
||||
play_V2 = mkV2 IrregIce.leika_V ;
|
||||
laugh_V = IrregIce.hlæja_V ;
|
||||
hold_V2 = mkV2 IrregIce.halda_V ;
|
||||
die_V = IrregIce.deyja_V ;
|
||||
run_V = IrregIce.hlaupa_V ;
|
||||
walk_V = IrregIce.ganga_V ;
|
||||
dig_V = IrregIce.grafa_V ;
|
||||
see_V2 = mkV2 IrregIce.sjá_V ;
|
||||
blow_V = IrregIce.blása_V ;
|
||||
sleep_V = IrregIce.sofa_V ;
|
||||
put_V2 = mkV2 IrregIce.láta_V ;
|
||||
buy_V2 = mkV2 (mkV "kaupa" "kaupi" "keypti" "keyptur" "keypt") ;
|
||||
tie_V2 = mkV2 IrregIce.binda_V ;
|
||||
stab_V2 = mkV2 IrregIce.stinga_V ;
|
||||
come_V = IrregIce.koma_V ;
|
||||
play_V = IrregIce.leika_V ;
|
||||
sing_V = IrregIce.syngja_V ;
|
||||
stand_V = IrregIce.standa_V ;
|
||||
become_VA = IrregIce.verða_V ;
|
||||
talk_V3 = mkV3 (mkV "tala" "tala" "talaði" "talaður") (mkPrep "við" accusative) (mkPrep "um" accusative) ;
|
||||
send_V3 = mkV3 (mkV "senda") (mkPrep "" accusative) (mkPrep "með" accusative) ;
|
||||
say_VS = mkV "segja" "segi" "sagði" "sagður";
|
||||
sell_V3 = mkV3 (mkV "selja") (mkPrep "" dative) (mkPrep "" dative) ;
|
||||
} ;
|
||||
4
lib/src/icelandic/MakeStructuralIce.gf
Normal file
4
lib/src/icelandic/MakeStructuralIce.gf
Normal file
@@ -0,0 +1,4 @@
|
||||
--# -path=.:../common:../abstract
|
||||
|
||||
resource MakeStructuralIce = open CatIce, ParadigmsIce, ResIce, MorphoIce, Prelude in {
|
||||
}
|
||||
48
lib/src/icelandic/Miniresource.gf
Normal file
48
lib/src/icelandic/Miniresource.gf
Normal file
@@ -0,0 +1,48 @@
|
||||
abstract Miniresource = {
|
||||
|
||||
-- module Grammar in GF book, Chapter 9: syntax and structural words
|
||||
|
||||
flags startcat = S ;
|
||||
|
||||
cat
|
||||
S ; Cl ; NP ; VP ; AP ; CN ;
|
||||
Det ; N ; A ; V ; V2 ; AdA ;
|
||||
Tense ; Pol ;
|
||||
Conj ;
|
||||
data
|
||||
UseCl : Tense -> Pol -> Cl -> S ;
|
||||
PredVP : NP -> VP -> Cl ;
|
||||
ComplV2 : V2 -> NP -> VP ;
|
||||
DetCN : Det -> CN -> NP ;
|
||||
ModCN : AP -> CN -> CN ;
|
||||
|
||||
CompAP : AP -> VP ;
|
||||
AdAP : AdA -> AP -> AP ;
|
||||
|
||||
ConjS : Conj -> S -> S -> S ;
|
||||
ConjNP : Conj -> NP -> NP -> NP ;
|
||||
|
||||
UseV : V -> VP ;
|
||||
UseN : N -> CN ;
|
||||
UseA : A -> AP ;
|
||||
|
||||
a_Det, the_Det, every_Det : Det ;
|
||||
this_Det, these_Det : Det ;
|
||||
that_Det, those_Det : Det ;
|
||||
i_NP, youSg_NP, he_NP, she_NP, we_NP, youPl_NP, they_NP : NP ;
|
||||
very_AdA : AdA ;
|
||||
|
||||
Pos, Neg : Pol ;
|
||||
Pres, Perf : Tense ;
|
||||
|
||||
and_Conj, or_Conj : Conj ;
|
||||
|
||||
-- module Test: content word lexicon for testing
|
||||
|
||||
man_N, woman_N, house_N, tree_N : N ;
|
||||
big_A, small_A, green_A : A ;
|
||||
walk_V, arrive_V : V ;
|
||||
love_V2, please_V2 : V2 ;
|
||||
|
||||
}
|
||||
|
||||
498
lib/src/icelandic/MiniresourceIce.gf
Normal file
498
lib/src/icelandic/MiniresourceIce.gf
Normal file
@@ -0,0 +1,498 @@
|
||||
concrete MiniresourceIce of Miniresource = open Prelude in {
|
||||
|
||||
-- module GrammarIce
|
||||
|
||||
lincat
|
||||
S = {s : Str};
|
||||
Tense = {s : Str ; t : TTense};
|
||||
Pol = {s : Str ; b : Bool};
|
||||
Cl = {s : TTense => Bool => Str};
|
||||
VP = VerbPhrase;
|
||||
V = Verb;
|
||||
V2 = Verb ** {c : Case};
|
||||
NP = NounPhrase;
|
||||
Det = {s : Gender => Case => Str ; n : Number ; b : Bool ; d : Declension};
|
||||
CN = CommonNoun;
|
||||
N = Noun;
|
||||
AP = Adj;
|
||||
A = Adj;
|
||||
AdA = {s : Str};
|
||||
Conj = {s : Str ; n : Number};
|
||||
lin
|
||||
--Build a sentence from a tense, a polarity and a clause:
|
||||
--Tense -> Pol -> Cl -> S
|
||||
UseCl t p cl = {
|
||||
s = cl.s ! t.t ! p.b ++ t.s ++ p.s
|
||||
};
|
||||
|
||||
--Build a new sentence by connecting two existing sentences with a conjunction:
|
||||
--Conj -> S -> S -> S
|
||||
ConjS co sx sy = {
|
||||
s = sx.s ++ co.s ++ sy.s
|
||||
};
|
||||
|
||||
--Two prefabricated tenses:
|
||||
Pres = {s = [] ; t = TPres};
|
||||
Perf = {s = [] ; t = TPerf};
|
||||
|
||||
--Two prefabricated polarities:
|
||||
Pos = {s = [] ; b = True};
|
||||
Neg = {s = [] ; b = False};
|
||||
|
||||
--Build a clause from a noun phrase (= the subject) and a verb phrase:
|
||||
--NP -> VP -> Cl
|
||||
PredVP np vp = {
|
||||
s = \\t,p =>
|
||||
let
|
||||
-- 1 The Nominative case is the 'unmarked' case for the subject
|
||||
-- in Icelandic - therefore it is hardcoded atm.
|
||||
subj = np.s ! Nom;
|
||||
verb = agrV vp.s np.a t p;
|
||||
obj = vp.obj ! np.a
|
||||
in case <t,p> of {
|
||||
-- In case of TPerf, the negation goes between the auxilary verb
|
||||
-- and the main verb - done in agrV.
|
||||
<TPres, False> => subj ++ verb ++ "ekki" ++ obj;
|
||||
_ => subj ++ verb ++ obj
|
||||
};
|
||||
};
|
||||
|
||||
--Build a verb phrase by elevating a verb:
|
||||
--V -> VP
|
||||
UseV v = {
|
||||
s = v;
|
||||
obj = \\_ => []
|
||||
};
|
||||
|
||||
|
||||
--Build a verb phrase from a two-place verb and a noun phrase (= the object):
|
||||
--V2 -> NP -> VP
|
||||
ComplV2 v2 np = {
|
||||
s = v2;
|
||||
obj = \\_ => np.s ! v2.c
|
||||
};
|
||||
|
||||
--Build a verb phrase from an adjective phrase, using the verb 'að vera' ("stór" --> "er stór"):
|
||||
--AP -> VP
|
||||
CompAP ap = {
|
||||
s = mkVerb "vera" "er" "ert" "er" "erum" "eruð" "eru" "var" "varst" "var" "vorum" "voruð" "voru" "verið";
|
||||
-- As far as I know, the verb "að vera" ("to be") always inflects the object into the Nominative case.
|
||||
-- And the Srong being the 'unmarked' declension is dominant here.
|
||||
obj = \\a => case a of {
|
||||
Ag g n _ => ap.s ! n ! g ! Nom ! Strong
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
--Build a noun phrase from a determiner and a common noun:
|
||||
--Det -> CN -> NP
|
||||
DetCN det cn = {
|
||||
s = \\c => case det.b of {
|
||||
False => det.s ! cn.g ! c ++ cn.adj ! det.n ! c ! det.d ++ cn.noun ! det.n ! c ! det.b;
|
||||
True => cn.adj ! det.n ! c ! det.d ++ cn.noun ! det.n ! c ! det.b
|
||||
};
|
||||
a = Ag cn.g det.n Per3
|
||||
};
|
||||
|
||||
--Build a new noun phrase by connecting two existing noun phrases with a conjunction:
|
||||
--Conj -> NP -> NP -> NP
|
||||
ConjNP co nx ny = {
|
||||
s = \\c => nx.s ! c ++ co.s ++ ny.s ! c;
|
||||
a = conjAgr co.n nx.a ny.a
|
||||
};
|
||||
|
||||
--Build a common noun by elevating a noun:
|
||||
--N -> CN
|
||||
UseN n = {
|
||||
noun = n.s;
|
||||
adj = \\_,_,_ => [];
|
||||
g = n.g;
|
||||
isPre = True
|
||||
};
|
||||
|
||||
--Build a new common noun by adding an adjective phrase to an existing common noun:
|
||||
--AP -> CN -> CN
|
||||
ModCN ap cn = {
|
||||
noun = \\n,c,b => cn.noun ! n ! c ! b;
|
||||
adj = \\n,c,d => ap.s ! n ! cn.g ! c ! d;
|
||||
g = cn.g;
|
||||
isPre = ap.isPre
|
||||
};
|
||||
|
||||
--Build an adjective phrase by elevating an adjective:
|
||||
--A -> AP
|
||||
UseA a = a;
|
||||
|
||||
--Build a new adjective phrase by adding an ad-adjective to an existing adjective phrase:
|
||||
--AdA -> AP -> AP
|
||||
AdAP ad ap = {
|
||||
s = \\n,g,d,c => ad.s ++ ap.s ! n ! g ! d ! c;
|
||||
isPre = ap.isPre
|
||||
};
|
||||
|
||||
--A prefabricated ad-adjective:
|
||||
very_AdA = {s = "mjög"};
|
||||
|
||||
--Some prefabricated noun phrases:
|
||||
-- not sure how to treat some of the pronouns gender vice - so I put Masc as the 'unmarked' gender
|
||||
i_NP = pronNP "ég" "mig" "mér" "mín" Masc Sg Per1 ;
|
||||
youSg_NP = pronNP "þú" "þig" "þér" "þín" Masc Sg Per2 ;
|
||||
he_NP = pronNP "hann" "hann" "honum" "hans" Masc Sg Per3 ;
|
||||
she_NP = pronNP "hún" "hana" "henni" "hennar" Fem Sg Per3 ;
|
||||
-- the 3rd person neuter pronoun seems not to be included in the miniature resource
|
||||
--it_NP = pronNP "það" "það" "því" "þess" Neut Sg Per3 ;
|
||||
we_NP = pronNP "við" "okkur" "okkur" "okkar" Masc Pl Per1 ;
|
||||
youPl_NP = pronNP "þið" "ykkur" "ykkur" "ykkar" Masc Pl Per2 ;
|
||||
-- only have the masculine form of the plural 3rd person pronouns
|
||||
they_NP = pronNP "þeir" "þá" "þeim" "þeirra" Masc Pl Per3 ;
|
||||
|
||||
--Some prefabricated determiners:
|
||||
a_Det = mkDet [] [] [] [] [] [] [] [] [] [] [] [] Sg False Strong;
|
||||
-- The definate article is usually used as a suffix (for all genders) e.g.
|
||||
-- X-inn in Masculinn Nominative (I think its always -inn).
|
||||
-- As a matter of fact, the free standing version of the definate article can only be
|
||||
-- followed by and adjective, i.e. det ++ adj ++ noun, and is rare. I am not quite sure
|
||||
-- how to implement this functionality, i.e. having both options with the same meaning.
|
||||
-- Therefore, the suffixed version is always used for the time being.
|
||||
the_Det = mkDet "hinn" "hinn" "hinum" "hins" "hin" "hina" "hinni" "hinnar" "hið" "hið" "hinu" "hins" Sg True Weak;
|
||||
-- For the Neuter, both "sérhvert" or "sérhvað" is used in the Nominative and Accusative cases.
|
||||
every_Det = mkDet "sérhver" "sérhvern" "sérhverjum" "sérhvers" "sérhver" "sérhverja" "sérhverri" "sérhverrar" "sérhvert" "sérhvert" "sérhverju" "sérhvers" Sg False Weak;
|
||||
-- To my knowledge there is no special difference when reffering to a specific known object (or person)
|
||||
-- that is far away or close (emotionally or physically) in Icelandic - without specifiying the distance further,
|
||||
-- e.g., with an adverb "þessi hlutur hérna" = "this object here" and "þessi hlutur þarna" = "that object there".
|
||||
-- But one could argue that "þessi/sá" =~ "this/that". There is also another demonstrative determiner in
|
||||
-- Icelandic, "hinn" = "the other one". For the sake of simplisity and clarity I use the "þessi/sá" = "this/that".
|
||||
this_Det = mkDet "þessi" "þennan" "þessum" "þessa" "þessi" "þessa" "þessari" "þessarar" "þetta" "þetta" "þessu" "þessa" Sg False Weak;
|
||||
these_Det = mkDet "þessir" "þessa" "þessum" "þessara" "þessar" "þessar" "þessum" "þessara" "þessi" "þessi" "þessum" "þessara" Pl False Weak;
|
||||
that_Det = mkDet "sá" "þann" "þeim" "þess" "sú" "þá" "þeirri" "þeirrar" "það" "það" "því" "þess" Sg False Weak;
|
||||
those_Det = mkDet "þeir" "þá" "þeim" "þeirra" "þær" "þær" "þeim" "þeirra" "þau" "þau" "þeim" "þeirra" Pl False Weak;
|
||||
|
||||
--Two prefabricated conjunctions:
|
||||
and_Conj = {s = "og" ; n = Pl};
|
||||
or_Conj = {s = "eða" ; n = Sg};
|
||||
|
||||
-- moduel TestIce
|
||||
|
||||
--Some prefabricated verbs:
|
||||
walk_V = mkVerb "ganga" "geng" "gengur" "gengur" "göngum" "gangið" "ganga" "gekk" "gekkst" "gekk" "gengum" "genguð" "gengu" "gengið";
|
||||
arrive_V = mkVerb "koma" "kem" "kemur" "kemur" "komum" "komið" "koma" "kom" "komst" "kom" "komum" "komuð" "komu" "komið";
|
||||
|
||||
--Some prefabricated two-place verbs (the acc is taken, as far as I know that is the "unmarked" case that verbs inlfect? on the subject):
|
||||
love_V2 = mkV2 "elska" "elska" "elskar" "elskar" "elskum" "elskið" "elska" "elskaði" "elskaðir" "elskaði" "elskuðum" "elskuðuð" "elskuðu" "elskað" Acc;
|
||||
please_V2 = mkV2 "gleðja" "gleð" "gleður" "gleður" "gleðjum" "gleðjið" "gleðja" "gladdi" "gladdir" "gladdi" "glöddum" "glödduð" "glöddu" "glatt" Acc;
|
||||
|
||||
--Some prefabricated nouns:
|
||||
man_N = mkNoun "maður" "mann" "manni" "manns" "menn" "menn" "mönnum" "manna" Masc;
|
||||
woman_N = mkNoun "kona" "konu" "konu" "konu" "konur" "konur" "konum" "kvenna" Fem;
|
||||
house_N = mkNoun "hús" "hús" "húsi" "húss" "hús" "hús" "húsum" "húsa" Neut;
|
||||
tree_N = mkNoun "tré" "tré" "tré" "trés" "tré" "tré" "trjáum" "trjáa" Neut;
|
||||
|
||||
--Some prefabricated adjectives:
|
||||
big_A = mkAdj "stór" "stóran" "stórum" "stórs" "stór" "stóra" "stórri" "stórrar" "stórt" "stórt" "stóru" "stórs" "stórir" "stóra" "stórum" "stórra" "stórar" "stórar" "stórum" "stórra" "stór" "stór" "stórum" "stórra" "stóri" "stóra" "stóra" "stóru" "stóra" "stóru" True;
|
||||
small_A = mkAdj "lítill" "lítinn" "litlum" "lítils" "lítil" "litla" "lítilli" "lítillar" "lítið" "lítið" "litlu" "lítils" "litlir" "litla" "litlum" "lítilla" "litlar" "litlar" "litlum" "lítilla" "lítil" "lítil" "litlum" "lítilla" "litli" "litla" "litla" "litlu" "litla" "litlu" True;
|
||||
green_A = mkAdj "grænn" "grænan" "grænum" "grænans" "græn" "græna" "grænni" "grænnar" "grænt" "grænt" "grænu" "græns" "grænir" "græna" "grænum" "grænna" "grænar" "grænar" "grænum" "grænna" "græn" "græn" "grænum" "grænna" "græni" "græna" "græna" "grænu" "græna" "grænu" True;
|
||||
|
||||
-- module ResIce
|
||||
|
||||
param
|
||||
Number = Sg | Pl;
|
||||
Case = Nom | Acc | Dat | Gen;
|
||||
Gender = Masc | Fem | Neut;
|
||||
Agr = Ag Gender Number Person;
|
||||
Person = Per1 | Per2 | Per3;
|
||||
TTense = TPres | TPerf;
|
||||
VForm = VInf | VPres Number Person | VPast Number Person | V1Part;
|
||||
Declension = Weak | Strong;
|
||||
oper
|
||||
-- NOUN PHRASE
|
||||
NounPhrase = {
|
||||
s : Case => Str;
|
||||
a : Agr
|
||||
};
|
||||
|
||||
-- COMMON NOUN
|
||||
CommonNoun = {
|
||||
noun : Number => Case => Bool => Str;
|
||||
adj : Number => Case => Declension => Str;
|
||||
g : Gender;
|
||||
isPre : Bool
|
||||
};
|
||||
|
||||
-- NOUNS
|
||||
Noun : Type = { s : Number => Case => Bool => Str ; g : Gender};
|
||||
|
||||
-- A worst-case function for Noun
|
||||
mkNoun : (_, _, _, _, _, _, _, _ : Str) -> Gender -> Noun =
|
||||
\hestur,hest,hesti,hests,hestar,hestaAcc,hestum,hestaGen,g -> {
|
||||
s = table {
|
||||
Sg => table {
|
||||
Nom => table {
|
||||
False => hestur;
|
||||
True => case <hestur,g> of {
|
||||
<base + noIVowel,Masc> => hestur + "nn";
|
||||
<base + noIVowel,Fem> => hestur + "n";
|
||||
<base + noIVowel,Neut> => hestur + "ð";
|
||||
<_,Masc> => hestur + "inn";
|
||||
-- I think this only applies to feminine and neuter nouns
|
||||
-- ending with "-ur" - but in all cases.
|
||||
<base + "ur",Fem> => base + "rin";
|
||||
<_,Fem> => hestur + "in";
|
||||
<base + "ur",Neut> => base + "rið";
|
||||
<_,Neut> => hestur + "ið"
|
||||
}
|
||||
};
|
||||
Acc => table {
|
||||
False => hest;
|
||||
True => case <hest,g> of {
|
||||
<base + noIVowel,Masc> => hest + "nn";
|
||||
<base + vowel,Fem> => hest + "na";
|
||||
<base + noIVowel,Neut> => hest + "ð";
|
||||
<_,Masc> => hest + "inn";
|
||||
<base + "ur",Fem> => base + "rina";
|
||||
<_,Fem> => hest + "ina";
|
||||
<base + "ur",Neut> => base + "rið";
|
||||
<_,Neut> => hest + "ið"
|
||||
}
|
||||
};
|
||||
Dat => table {
|
||||
False => hesti;
|
||||
True => case <hesti,g> of {
|
||||
<_,Masc> => hesti + "num";
|
||||
<base + vowel,Fem> => hesti + "nni";
|
||||
<base + "ur",Fem> => base + "rinni";
|
||||
<_,Fem> => hesti + "inni";
|
||||
<base + "ur",Neut> => base + "rinu";
|
||||
<_,Neut> => hesti + "nu"
|
||||
}
|
||||
};
|
||||
Gen => table {
|
||||
False => hests;
|
||||
True => case <hests,g> of {
|
||||
<base + vowel,Fem> => hests + "nnar";
|
||||
<base + "ur",Fem> => base + "rinnar";
|
||||
<_,Fem> => hests + "innar";
|
||||
<base + "ur", Neut> => base + "rins";
|
||||
<base + noIVowel, _> => hests + "ns";
|
||||
_ => hests + "ins"
|
||||
}
|
||||
}
|
||||
} ;
|
||||
Pl => table {
|
||||
Nom => table {
|
||||
False => hestar;
|
||||
True => case <hestar,g> of {
|
||||
<_,Masc> => hestar + "nir";
|
||||
<base + "ur",Fem> => base + "rinar";
|
||||
<_,Fem> => hestar + "nar";
|
||||
<base + "ur",Neut> => base + "rin";
|
||||
<base + noIVowel,Neut> => hestar + "n";
|
||||
<_,Neut> => hestar + "in"
|
||||
}
|
||||
};
|
||||
Acc => table {
|
||||
False => hestaAcc;
|
||||
True => case <hestaAcc,g> of {
|
||||
<_,Masc> => hestaAcc + "na";
|
||||
<base + "ur",Fem> => base + "rinar";
|
||||
<_,Fem> => hestaAcc + "nar";
|
||||
<base + "ur",Neut> => base + "rin";
|
||||
<base + noIVowel,Neut> => hestaAcc + "n";
|
||||
<_,Neut> => hestaAcc + "in"
|
||||
}
|
||||
};
|
||||
Dat => table {
|
||||
False => hestum;
|
||||
True => case <hestum,g> of {
|
||||
<base + "ur",Fem> => base + "rinum";
|
||||
<base + "ur",Neut> => base + "rinum";
|
||||
<base + "m",_> => base + "num"
|
||||
}
|
||||
};
|
||||
Gen => table {
|
||||
False => hestaGen;
|
||||
-- I think its like this for all genders
|
||||
True => case <hestaGen,g> of {
|
||||
<base + "áa",Fem> => base + "ánna";
|
||||
<base + "óa",Fem> => base + "ónna";
|
||||
<base + "úa",Fem> => base + "únna";
|
||||
_ => hestaGen + "nna"
|
||||
}
|
||||
}
|
||||
}
|
||||
} ;
|
||||
g = g
|
||||
} ;
|
||||
|
||||
-- ADJECTIVES
|
||||
Adj : Type = { s : Number => Gender => Case => Declension => Str ; isPre : Bool};
|
||||
|
||||
-- The strong declension is used when the adjective modifies indefinite nouns,
|
||||
-- or when the adjective is predictive. The weak declension is used when the
|
||||
-- adjective modifies a noun that is defined or determined in some way.
|
||||
mkAdj : (_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_ : Str) -> Bool -> Adj =
|
||||
-- variable names turned into a soup, so for this particular function variable names will be :
|
||||
-- sgMascNom - the singular masculine Nominative, etc.
|
||||
\sgMascNom,sgMascAcc,sgMascDat,sgMascGen,sgFemNom,sgFemAcc,sgFemDat,sgFemGen,sgNeutNom,sgNeutAcc,sgNeutDat,sgNeutGen,plMascNom,plMascAcc,plMascDat,plMascGen,plFemNom,plFemAcc,plFemDat,plFemGen,plNeutNom,plNeutAcc,plNeutDat,plNeutGen,weakSgMascNom,weakSgMascAccDatGen,weakSgFemNom,weakSgFemAccDatGen,weakSgNeut,weakPl,b -> {
|
||||
s = table {
|
||||
Sg => table {
|
||||
Masc => table {
|
||||
Nom => table {Strong => sgMascNom ; Weak => weakSgMascNom};
|
||||
Acc => table {Strong => sgMascAcc ; Weak => weakSgMascAccDatGen};
|
||||
Dat => table {Strong => sgMascDat ; Weak => weakSgMascAccDatGen};
|
||||
Gen => table {Strong => sgMascGen ; Weak => weakSgMascAccDatGen}
|
||||
};
|
||||
Fem => table {
|
||||
Nom => table {Strong => sgFemNom ; Weak => weakSgFemNom};
|
||||
Acc => table {Strong => sgFemAcc ; Weak => weakSgFemAccDatGen};
|
||||
Dat => table {Strong => sgFemGen ; Weak => weakSgFemAccDatGen};
|
||||
Gen => table {Strong => sgFemGen ; Weak => weakSgFemAccDatGen}
|
||||
};
|
||||
Neut => table {
|
||||
Nom => table {Strong => sgNeutNom ; Weak => weakSgNeut};
|
||||
Acc => table {Strong => sgNeutAcc ; Weak => weakSgNeut};
|
||||
Dat => table {Strong => sgNeutDat ; Weak => weakSgNeut};
|
||||
Gen => table {Strong => sgNeutGen ; Weak => weakSgNeut}
|
||||
}
|
||||
};
|
||||
Pl => table {
|
||||
Masc => table {
|
||||
Nom => table {Strong => plMascNom ; Weak => weakPl};
|
||||
Acc => table {Strong => plMascAcc ; Weak => weakPl};
|
||||
Dat => table {Strong => plMascDat ; Weak => weakPl};
|
||||
Gen => table {Strong => plMascGen ; Weak => weakPl}
|
||||
};
|
||||
Fem => table {
|
||||
Nom => table {Strong => plFemNom ; Weak => weakPl};
|
||||
Acc => table {Strong => plFemAcc ; Weak => weakPl};
|
||||
Dat => table {Strong => plFemDat ; Weak => weakPl};
|
||||
Gen => table {Strong => plFemGen ; Weak => weakPl}
|
||||
};
|
||||
Neut => table {
|
||||
Nom => table {Strong => plNeutNom ; Weak => weakPl};
|
||||
Acc => table {Strong => plNeutAcc ; Weak => weakPl};
|
||||
Dat => table {Strong => plNeutDat ; Weak => weakPl};
|
||||
Gen => table {Strong => plNeutGen ; Weak => weakPl}
|
||||
}
|
||||
}
|
||||
};
|
||||
isPre = b
|
||||
};
|
||||
|
||||
-- DET
|
||||
|
||||
mkDet : (_,_,_,_,_,_,_,_,_,_,_,_ : Str) -> Number -> Bool -> Declension -> {s : Gender => Case => Str ; n : Number ; b : Bool ; d : Declension} =
|
||||
\hinnNom,hinnAcc,hinum,hins,hin,hina,hinni,hinnar,hiðNom,hiðAcc,hinu,hins,n,b,d -> {
|
||||
s = table {
|
||||
Masc => table {Nom => hinnNom ; Acc => hinnAcc ; Dat => hinum ; Gen => hins} ;
|
||||
Fem => table {Nom => hin ; Acc => hina ; Dat => hinni ; Gen => hinnar} ;
|
||||
Neut => table {Nom => hiðNom ; Acc => hiðAcc ; Dat => hinu ; Gen => hins}
|
||||
};
|
||||
n = n;
|
||||
b = b;
|
||||
d = d
|
||||
};
|
||||
|
||||
|
||||
-- PRONOUNS
|
||||
|
||||
pronNP : (n,a,d,g : Str) -> Gender -> Number -> Person -> NounPhrase =
|
||||
\ég,mig,mér,mín,g,n,p -> {
|
||||
s = table {
|
||||
Nom => ég ;
|
||||
Acc => mig ;
|
||||
Dat => mér ;
|
||||
Gen => mín
|
||||
} ;
|
||||
a = Ag g n p ;
|
||||
} ;
|
||||
|
||||
|
||||
-- VERBS
|
||||
|
||||
Verb : Type = {s : VForm => Str};
|
||||
|
||||
-- A worst-case function for mkVerb
|
||||
mkVerb : (_,_,_,_,_,_,_,_,_,_,_,_,_,_ : Str) -> Verb =
|
||||
\vera,er1,ert,er3,erum,eruð,eru,var1,varst,var3,vorum,voruð,voru,verið -> {
|
||||
s = table {
|
||||
VInf => vera ;
|
||||
VPres Sg Per1 => er1 ;
|
||||
VPres Sg Per2 => ert ;
|
||||
VPres Sg Per3 => er3 ;
|
||||
VPres Pl Per1 => erum ;
|
||||
VPres Pl Per2 => eruð ;
|
||||
VPres Pl Per3 => eru ;
|
||||
VPast Sg Per1 => var1 ;
|
||||
VPast Sg Per2 => varst ;
|
||||
VPast Sg Per3 => var3 ;
|
||||
VPast Pl Per1 => vorum ;
|
||||
VPast Pl Per2 => voruð ;
|
||||
VPast Pl Per3 => voru;
|
||||
V1Part => verið
|
||||
} ;
|
||||
} ;
|
||||
|
||||
VerbPhrase = {
|
||||
s : Verb;
|
||||
obj : Agr => Str;
|
||||
};
|
||||
|
||||
-- For Predication
|
||||
agrV : Verb -> Agr -> TTense -> Bool -> Str = \v,a,t,neg ->
|
||||
-- 1 In these scenarios, the only auxilary verb used (as far as I know)
|
||||
-- is 'að hafa' ('to have') - therefore it is hardcoded atm.
|
||||
-- 2 'hef' and 'hefur' are dominant in modern Icelandic - but 'hefi' and
|
||||
-- 'hefir' are rather common in written texts.
|
||||
let
|
||||
aux = mkVerb "hafa" "hef" "hefur" "hefur" "höfum" "hafið" "hafa" "hafði" "hafðir" "hafði" "höfðum" "höfðuð" "höfðu" "haft"
|
||||
in case <t,a,neg> of {
|
||||
<TPres,Ag _ n p,_> => v.s ! VPres n p ;
|
||||
<TPerf,Ag _ n p,True> => aux.s ! VPres n p ++ v.s ! V1Part;
|
||||
<TPerf,Ag _ n p,False> => aux.s ! VPres n p ++ "ekki" ++ v.s ! V1Part
|
||||
};
|
||||
|
||||
-- Coordination
|
||||
|
||||
conjAgr : Number -> Agr -> Agr -> Agr = \n,xa,ya ->
|
||||
let
|
||||
x = agrFeatures xa ; y = agrFeatures ya
|
||||
in Ag
|
||||
(conjGender x.g y.g)
|
||||
(conjNumber (conjNumber x.n y.n) n)
|
||||
(conjPerson x.p y.p) ;
|
||||
|
||||
agrFeatures : Agr -> {g : Gender ; n : Number ; p : Person} = \a ->
|
||||
case a of {Ag g n p => {g = g ; n = n ; p = p}} ;
|
||||
|
||||
conjGender : Gender -> Gender -> Gender = \g,h -> case <g,h> of {
|
||||
<Masc,Masc> => Masc;
|
||||
<Fem,Fem> => Fem;
|
||||
_ => Neut
|
||||
};
|
||||
|
||||
conjNumber : Number -> Number -> Number = \m,n ->
|
||||
case m of {Pl => Pl ; _ => n} ;
|
||||
|
||||
conjPerson : Person -> Person -> Person = \p,q ->
|
||||
case <p,q> of {
|
||||
<Per1,_> | <_,Per1> => Per1 ;
|
||||
<Per2,_> | <_,Per2> => Per2 ;
|
||||
_ => Per3
|
||||
} ;
|
||||
|
||||
-- For pattern matching nouns to suffix the definate article.
|
||||
-- The suffix , "-inn","-in","-ið", loses the "-i-" when the noun ends with
|
||||
-- "-a", "-i", "-u", and most cases of "-é".
|
||||
noIVowel : pattern Str = #("a" | "i" | "u" | "é") ;
|
||||
|
||||
vowel : pattern Str = #("a" | "á" | "e" | "é" | "i" | "í" | "o" | "ó" | "u" | "ú" | "y" | "ý" | "æ" | "ö");
|
||||
|
||||
-- module ParadigmsEng
|
||||
|
||||
oper
|
||||
mkV2 = overload {
|
||||
mkV2 : (_,_,_,_,_,_,_,_,_,_,_,_,_,_ : Str) -> Case -> V2
|
||||
= \vera,er1,ert,er3,erum,eruð,eru,var1,varst,var3,vorum,voruð,voru,verið,c ->
|
||||
lin V2 (mkVerb vera er1 ert er3 erum eruð eru var1 varst var3 vorum voruð voru verið ** {c = c});
|
||||
};
|
||||
}
|
||||
1084
lib/src/icelandic/MorphoIce.gf
Normal file
1084
lib/src/icelandic/MorphoIce.gf
Normal file
File diff suppressed because it is too large
Load Diff
249
lib/src/icelandic/NounIce.gf
Normal file
249
lib/src/icelandic/NounIce.gf
Normal file
@@ -0,0 +1,249 @@
|
||||
concrete NounIce of Noun = CatIce ** open MorphoIce, ResIce, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
-- Noun phrases
|
||||
|
||||
DetCN det cn = {
|
||||
s = \\c => det.s ! cn.g ! npcaseToCase c
|
||||
++ cn.s ! det.n ! det.b ! det.d ! npcaseToCase c
|
||||
++ det.pron ! cn.g ! npcaseToCase c
|
||||
++ cn.comp ! det.n ! npcaseToCase c ;
|
||||
a = gennumperToAgr cn.g det.n P3 ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
UsePN pn = {
|
||||
s = \\c => pn.s ! npcaseToCase c ;
|
||||
a = gennumperToAgr pn.g Sg P3 ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
UsePron p = p ** {isPron = True};
|
||||
|
||||
PredetNP pred np = {
|
||||
s = \\c => pred.s ! np.a.n ! np.a.g ! (npcaseToCase c) ++ np.s ! c ;
|
||||
a = np.a ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
PPartNP np v2 = {
|
||||
s = \\c => np.s ! c ++ v2.p ! PStrong np.a.n np.a.g (npcaseToCase c) ;
|
||||
a = np.a ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
AdvNP np adv = np ** {s = \\c => np.s ! c ++ adv.s} ;
|
||||
|
||||
ExtAdvNP np adv = np ** {s = \\c => np.s ! c ++ adv.s} ;
|
||||
|
||||
RelNP np rs = np ** {s = \\c => np.s ! c ++ rs.s ! np.a} ;
|
||||
|
||||
DetNP det = {
|
||||
s = \\c => det.s ! Neutr ! npcaseToCase c ++ det.pron ! Neutr ! npcaseToCase c ;
|
||||
a = gennumperToAgr Neutr det.n P3 ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
-- Determiners
|
||||
|
||||
DetQuant quant num = {
|
||||
s = \\g,c => case quant.b of {
|
||||
Free => quant.s ! num.n ! g ! c ++ num.s ! g ! c ;
|
||||
Suffix => num.s ! g ! c
|
||||
} ;
|
||||
pron = \\g,c => case quant.isPron of {
|
||||
False => [] ;
|
||||
True => quant.s ! num.n ! g ! c
|
||||
} ;
|
||||
n = num.n ;
|
||||
b = quant.b ;
|
||||
d = quant.d
|
||||
} ;
|
||||
|
||||
DetQuantOrd quant num ord = {
|
||||
s = \\g,c => case quant.b of {
|
||||
Free => quant.s ! num.n ! g ! c ++ num.s ! g ! c ++ ord.s ! quant.d ! num.n ! g ! c ;
|
||||
Suffix => num.s ! g ! c ++ ord.s ! quant.d ! num.n ! g ! c
|
||||
} ;
|
||||
pron = \\g,c => case quant.isPron of {
|
||||
False => [] ;
|
||||
True => quant.s ! num.n ! g ! c
|
||||
} ;
|
||||
n = num.n ;
|
||||
b = quant.b ;
|
||||
d = quant.d ;
|
||||
} ;
|
||||
|
||||
NumSg = {s = \\g,c => []; n = Sg ; hasCard = False} ;
|
||||
|
||||
NumPl = {s = \\g,c => []; n = Pl ; hasCard = False} ;
|
||||
|
||||
NumCard n = n ** {hasCard = True} ;
|
||||
|
||||
NumDigits d = {
|
||||
s = \\g,c => d.s ! NCard d.n g c;
|
||||
n = d.n
|
||||
} ;
|
||||
|
||||
NumNumeral d = {
|
||||
s = \\g,c => d.s ! NCard Sg g c;
|
||||
n = d.n
|
||||
} ;
|
||||
|
||||
AdNum adn num = {
|
||||
s = \\g,c => adn.s ++ num.s ! g ! c ;
|
||||
n = num.n
|
||||
} ;
|
||||
|
||||
OrdDigits d = {
|
||||
s = \\_,n,g,c => d.s ! NOrd n g c ;
|
||||
} ;
|
||||
|
||||
OrdNumeral d = {
|
||||
s = \\_,n,g,c => d.s ! NOrd n g c ;
|
||||
} ;
|
||||
|
||||
OrdSuperl a = {s = \\d,n,g,c => a.s ! ASuperl d n g c} ;
|
||||
|
||||
OrdNumeralSuperl num a = {s = \\d,n,g,c => num.s ! NOrd n g c ++ a.s ! ASuperl d n g c} ;
|
||||
|
||||
|
||||
DefArt = {
|
||||
s = table {
|
||||
Sg => table {
|
||||
Masc => caseList "hinn" "hinn" "hinum" "hins" ;
|
||||
Fem => caseList "hin" "hina" "hinni" "hinnar" ;
|
||||
Neutr => caseList "hið" "hið" "hinu" "hins"
|
||||
} ;
|
||||
Pl => table {
|
||||
Masc => caseList "hinir" "hina" "hinum" "hinna" ;
|
||||
Fem => caseList "hinar" "hinar" "hinum" "hinna" ;
|
||||
Neutr => caseList "hin" "hin" "hinum" "hinna"
|
||||
}
|
||||
} ;
|
||||
b = Suffix;
|
||||
d = Weak ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
IndefArt = {
|
||||
s = \\_,_,_ => [] ;
|
||||
b = Free ;
|
||||
d = Strong ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
MassNP cn = {
|
||||
s = \\c => cn.s ! Sg ! Free ! Strong ! npcaseToCase c ++ cn.comp ! Sg ! npcaseToCase c;
|
||||
a = gennumperToAgr cn.g Sg P3 ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
PossPron p = {
|
||||
s = \\n,g,c => p.s ! NPPoss n g c ;
|
||||
b = Suffix ;
|
||||
d = Weak ;
|
||||
isPron = True
|
||||
} ;
|
||||
|
||||
|
||||
-- Common Noun
|
||||
|
||||
UseN, UseN2 = \noun -> {
|
||||
s = \\n,s,_,c => noun.s ! n ! s ! c ;
|
||||
comp = \\_,_ => [] ;
|
||||
g = noun.g
|
||||
} ;
|
||||
|
||||
ComplN2 n2 np = {
|
||||
s = \\n,s,_,c => n2.s ! n ! Free ! c ++ n2.c2.s ++ np.s ! NCase n2.c2.c ;
|
||||
comp = \\_,_ => [] ;
|
||||
g = n2.g
|
||||
} ;
|
||||
|
||||
ComplN3 n3 np = {
|
||||
s = \\n,s,c => n3.s ! n ! s ! c ++ n3.c2.s ++ np.s ! NCase n3.c2.c ;
|
||||
g = n3.g ;
|
||||
c2 = n3.c3
|
||||
|
||||
} ;
|
||||
|
||||
Use2N3 n3 = {
|
||||
s = \\n,s,c => n3.s ! n ! s ! c ;
|
||||
g = n3.g ;
|
||||
c2 = n3.c2
|
||||
} ;
|
||||
|
||||
Use3N3 n3 = {
|
||||
s = \\n,s,c => n3.s ! n ! s ! c ;
|
||||
g = n3.g ;
|
||||
c2 = n3.c3
|
||||
} ;
|
||||
|
||||
AdjCN ap cn = {
|
||||
s = \\n,s,d,c => ap.s ! n ! cn.g ! d ! c ++ cn.s ! n ! s ! d ! c ;
|
||||
comp = cn.comp ;
|
||||
g = cn.g
|
||||
} ;
|
||||
|
||||
RelCN cn rs = cn ** {
|
||||
s = \\n,s,d,c => cn.s ! n ! s ! d ! c ;
|
||||
comp = \\n,c => cn.comp ! n ! c ++ rs.s ! gennumperToAgr cn.g n P3
|
||||
} ;
|
||||
|
||||
AdvCN cn adv = cn ** {
|
||||
s = \\n,s,d,c => cn.s ! n ! s ! d ! c ;
|
||||
comp = \\n,c => cn.comp ! n ! c ++ adv.s
|
||||
} ;
|
||||
|
||||
SentCN cn sc = {
|
||||
s = \\n,s,d,c => cn.s ! n ! s ! d ! c ;
|
||||
comp = \\n,c => cn.comp ! n ! c ++ sc.s ;
|
||||
g = cn.g
|
||||
} ;
|
||||
|
||||
-- 2 Apposition
|
||||
|
||||
ApposCN cn np = {
|
||||
s = \\n,s,d,c => cn.s ! n ! s ! d ! Nom ;
|
||||
comp = \\n,c => cn.comp ! n ! c ++ np.s ! NCase c ;
|
||||
g = cn.g
|
||||
} ;
|
||||
|
||||
-- 2 Possessive and partitive constructs
|
||||
|
||||
PossNP cn np = {
|
||||
s = \\n,s,d,c => case np.isPron of {
|
||||
True => cn.s ! n ! Suffix ! d ! Nom ++ np.s ! NPPoss n cn.g c ;
|
||||
False => cn.s ! n ! Free ! d ! c ++ np.s ! NPPoss n cn.g Gen
|
||||
} ;
|
||||
comp = cn.comp ;
|
||||
g = cn.g
|
||||
} ;
|
||||
|
||||
PartNP cn np = {
|
||||
s = \\n,s,d,c => cn.s ! n ! s ! d ! Nom ;
|
||||
comp = \\n,c => cn.comp ! n ! Nom ++ "af" ++ np.s ! NCase Dat ;
|
||||
g = cn.g
|
||||
} ;
|
||||
|
||||
CountNP det np = {
|
||||
s = \\c => det.s ! np.a.g ! npcaseToCase c ++ "af" ++ np.s ! NCase Dat ;
|
||||
a = np.a ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
|
||||
-- 3 Conjoinable determiners and ones with adjectives
|
||||
|
||||
AdjDAP dap ap = {
|
||||
s = \\g,c => dap.s ! g ! c ++ ap.s ! dap.n ! g ! dap.d ! c ;
|
||||
n = dap.n ;
|
||||
b = dap.b ;
|
||||
d = dap.d
|
||||
} ;
|
||||
|
||||
DetDAP det = det ;
|
||||
}
|
||||
224
lib/src/icelandic/NumeralIce.gf
Normal file
224
lib/src/icelandic/NumeralIce.gf
Normal file
@@ -0,0 +1,224 @@
|
||||
concrete NumeralIce of Numeral = CatIce [Numeral,Digits] ** open Prelude, ResIce in {
|
||||
|
||||
param
|
||||
DForm = unit | teen | ten ;
|
||||
Size = sg | less10 | pl ;
|
||||
|
||||
lincat
|
||||
Digit = {s : DForm => CardOrd => Str} ;
|
||||
Sub10 = {s : DForm => CardOrd => Str ; size : Size} ;
|
||||
Sub100, Sub1000, Sub1000000 = {s : CardOrd => Str ; size : Size} ;
|
||||
|
||||
lin
|
||||
num x = {
|
||||
s = \\ngc => x.s ! ngc ;
|
||||
n = sizeToNumber x.size
|
||||
} ;
|
||||
|
||||
n2 = {s = table {
|
||||
unit => table {
|
||||
NCard _ Masc c => caseList "tveir" "tvo" "tveimur" "tveggja" ! c ;
|
||||
NCard _ Fem c => caseList "tvær" "tvær" "tveimur" "tveggja" ! c ;
|
||||
NCard _ Neutr c => caseList "tvö" "tvö" "tveimur" "tveggja" ! c ;
|
||||
NOrd Sg Masc c => caseList "annar" "annan" "öðrum" "annars" ! c ;
|
||||
NOrd Sg Fem c => caseList "önnur" "aðra" "annarri" "annarrar" ! c ;
|
||||
NOrd Sg Neutr c => caseList "annað" "annað" "öðru" "annars" ! c ;
|
||||
NOrd Pl Masc c => caseList "aðrir" "aðra" "öðrum" "annarra" ! c ;
|
||||
NOrd Pl Fem c => caseList "aðrar" "aðrar" "öðrum" "annarra" ! c ;
|
||||
NOrd Pl Neutr c => caseList "önnur" "önnur" "öðrum" "annarra" ! c
|
||||
} ;
|
||||
teen => table {
|
||||
NCard _ _ _ => "tólf" ;
|
||||
NOrd n g c => (mkRegOrd "tólft" "tólft") ! n ! g ! c
|
||||
} ;
|
||||
ten => table {
|
||||
NCard _ _ _ => "tuttugu" ;
|
||||
NOrd n g c => (mkRegOrd "tuttugast" "tuttugust") ! n ! g ! c
|
||||
}}};
|
||||
n3 = {s = table {
|
||||
unit => table {
|
||||
NCard _ Masc c => caseList "þrír" "þrjá" "þremur" "þriggja" ! c ;
|
||||
NCard _ Fem c => caseList "þrjár" "þrjár" "þremur" "þriggja" ! c ;
|
||||
NCard _ Neutr c => caseList "þrjú" "þrjú" "þremur" "þriggja" ! c ;
|
||||
NOrd n g c => (mkRegOrd "þriðj" "þriðj") ! n ! g ! c
|
||||
} ;
|
||||
teen => table {
|
||||
NCard _ _ _ => "þrettán" ;
|
||||
NOrd n g c => (mkRegOrd "þráttánd" "þrettánd") ! n ! g ! c
|
||||
} ;
|
||||
ten => table {
|
||||
NCard _ _ _ => "þrjátíu" ;
|
||||
NOrd n g c => (mkRegOrd "þrítugast" "þrítugust") ! n ! g ! c
|
||||
}}};
|
||||
n4 = {s = table {
|
||||
unit => table {
|
||||
NCard _ Masc c => caseList "fjórir" "fjóra" "fjórum" "fjögurra" ! c ;
|
||||
NCard _ Fem c => caseList "fjórar" "fjórar" "fjórum" "fjögurra" ! c ;
|
||||
NCard _ Neutr c => caseList "fjögur" "fjögur" "fjórum" "fjögurra" ! c ;
|
||||
NOrd n g c => (mkRegOrd "fjórð" "fjórð") ! n ! g ! c
|
||||
} ;
|
||||
teen => table {
|
||||
NCard _ _ _ => "fjórtán" ;
|
||||
NOrd n g c => (mkRegOrd "fjórtánd" "fjórtánd") ! n ! g ! c
|
||||
} ;
|
||||
ten => table {
|
||||
NCard _ _ _ => "fjörutíu" ;
|
||||
NOrd n g c => (mkRegOrd "fertugast" "fertugust") ! n ! g ! c
|
||||
}}};
|
||||
n5 = mkRegNum "fimm" "fimmtán" "fimmtíu" "fimmti" ;
|
||||
n6 = mkRegNum "sex" "sextán" "sextíu" "sjötti" ;
|
||||
n7 = mkRegNum "sjö" "sautján" "sjötíu" "sjöundi" ;
|
||||
n8 = mkRegNum "átta" "átján" "áttatíu" "áttundi" ;
|
||||
n9 = mkRegNum "níu" "nítján" "níutíu" "níundi" ;
|
||||
|
||||
pot01 = {s = table {
|
||||
unit => table {
|
||||
NCard Sg Masc c => caseList "einn" "einn" "einum" "eins" ! c ;
|
||||
NCard Sg Fem c => caseList "ein" "eina" "einni" "einnar" ! c ;
|
||||
NCard Sg Neutr c => caseList "eitt" "eitt" "einu" "eins" ! c ;
|
||||
NCard Pl Masc c => caseList "einir" "eina" "einum" "einna" ! c ;
|
||||
NCard Pl Fem c => caseList "einar" "einar" "einum" "einna" ! c ;
|
||||
NCard Pl Neutr c => caseList "ein" "ein" "einum" "einna" ! c ;
|
||||
NOrd n g c => (mkRegOrd "fyrst" "fyrst") ! n ! g ! c
|
||||
} ;
|
||||
teen => table {
|
||||
NCard _ _ _ => "ellefu" ;
|
||||
NOrd n g c => (mkRegOrd "elleft" "elleft") ! n ! g ! c
|
||||
} ;
|
||||
ten => table {
|
||||
NCard _ _ _ => "tíu" ;
|
||||
NOrd n g c => (mkRegOrd "tíund" "tíund") ! n ! g ! c
|
||||
}
|
||||
} ;
|
||||
size = sg
|
||||
} ;
|
||||
pot0 d = d ** {size = less10} ;
|
||||
pot110 = {s = pot01.s ! ten ; size = pl} ;
|
||||
pot111 = {s = pot01.s ! teen ; size = pl} ;
|
||||
pot1to19 d = {s = d.s ! teen ; size = pl} ;
|
||||
pot0as1 n = {s = n.s ! unit ; size = n.size} ;
|
||||
pot1 d = {s = d.s ! ten ; size = pl} ;
|
||||
pot1plus d e = { s = \\ngc => d.s ! ten ! ngc ++ "og" ++ e.s ! unit ! ngc ; size = pl} ;
|
||||
pot1as2 n = n ;
|
||||
pot2 d = { s = \\ngc => (omitsg (d.s ! unit ! NCard Sg Neutr Nom) d.size) ++ hundrað ! ngc ; size = pl} ;
|
||||
pot2plus d e = {
|
||||
s = table {
|
||||
NCard n g c => (omitsg (d.s ! unit ! NCard Sg Neutr Nom) d.size) ++ "hundrað" ++ (maybeog e.size) ++ e.s ! NCard n g c ;
|
||||
NOrd n g c => (omitsg (d.s ! unit ! NCard Sg Neutr Nom) d.size) ++ (omitOrd (hundrað ! NOrd n g c) "hundrað" e.size) ++ e.s ! NOrd n g c
|
||||
} ;
|
||||
size = pl
|
||||
} ;
|
||||
pot2as3 n = n ;
|
||||
pot3 d = { s = \\ngc => (omitsg (d.s ! NCard Sg Neutr Nom) d.size) ++ þúsund ! ngc ; size = pl} ;
|
||||
pot3plus d e = {
|
||||
s = table {
|
||||
NCard n g c => (omitsg (d.s ! NCard Sg Neutr Nom) d.size) ++ "þúsund" ++ (maybeog e.size) ++ e.s ! NCard n g c ;
|
||||
NOrd n g c => (omitsg (d.s ! NCard Sg Neutr Nom) d.size) ++ (omitOrd (þúsund ! NOrd n g c) "þúsund" e.size) ++ e.s ! NOrd n g c
|
||||
} ;
|
||||
size = pl
|
||||
} ;
|
||||
|
||||
oper
|
||||
|
||||
mkRegNum : (_,_,_,_ : Str) -> {s : DForm => CardOrd => Str} = --Digit =
|
||||
\sex,sextán,sextíu,sjötti -> {s = table {
|
||||
unit => regCardOrd sex sjötti ;
|
||||
teen => regCardOrd sextán (sextán + "di") ;
|
||||
ten => table {
|
||||
NOrd n g c => (mkRegOrd (mkTenOrd sex).p1 (mkTenOrd sex).p2) ! n ! g ! c ;
|
||||
NCard _ _ _ => sextíu
|
||||
}
|
||||
}};
|
||||
|
||||
regCardOrd : (_,_ : Str) -> CardOrd => Str = \sex,sjötti ->
|
||||
let
|
||||
sjött = init sjötti
|
||||
in table {
|
||||
NOrd n g c => (mkRegOrd sjött sjött) ! n ! g ! c ;
|
||||
NCard _ _ _ => sex
|
||||
} ;
|
||||
|
||||
mkRegOrd : (_,_ : Str) -> Number => Gender => Case => Str = \stem,stemu -> table {
|
||||
Sg => table {
|
||||
Masc => caseList (stem + "i") (stem + "a") (stem + "a") (stem + "a") ;
|
||||
Fem => caseList (stem + "a") (stemu + "u") (stemu + "u") (stemu + "u") ;
|
||||
Neutr => caseList (stem + "a") (stem + "a") (stem + "a") (stem + "a")
|
||||
} ;
|
||||
Pl => table {
|
||||
_ => caseList (stemu + "u") (stemu + "u") (stemu + "u") (stemu + "u")
|
||||
}
|
||||
} ;
|
||||
|
||||
mkTenOrd : Str -> Str * Str = \sex -> case sex of {
|
||||
"átta" => <"átttugast","átttugust"> ;
|
||||
"níu" => <"nítugast","nítugust"> ;
|
||||
_ => <sex + "tugast",sex + "tugust">
|
||||
} ;
|
||||
|
||||
hundrað : CardOrd => Str = table {
|
||||
NCard _ _ _ => "hundrað" ;
|
||||
NOrd n g c => (mkRegOrd "hundraðast" "hundruðust") ! n ! g ! c
|
||||
} ;
|
||||
|
||||
þúsund : CardOrd => Str = table {
|
||||
NCard _ _ _ => "þúsund" ;
|
||||
NOrd n g c => (mkRegOrd "þúsundast" "þúsundust") ! n ! g ! c
|
||||
} ;
|
||||
|
||||
sizeToNumber : Size -> Number = \size -> case size of {
|
||||
sg => Sg ;
|
||||
_ => Pl
|
||||
} ;
|
||||
|
||||
omitOrd : (_,_ : Str) -> Size -> Str = \ord,card,size -> case size of {
|
||||
pl => card ;
|
||||
_ => ord
|
||||
} ;
|
||||
|
||||
maybeog : Size -> Str = \sz -> table {pl => [] ; _ => "og" } ! sz ;
|
||||
omitsg : Str -> Size -> Str = \s -> \sz -> table {sg => [] ; _ => s } ! sz ;
|
||||
lincat
|
||||
Dig = TDigit ;
|
||||
lin
|
||||
-- Dig -> Digits
|
||||
IDig d = d ;
|
||||
|
||||
-- Dig -> Digits -> Digits
|
||||
IIDig d ds = {
|
||||
s = table {
|
||||
NCard _ _ _ => d.s ! NCard Sg Masc Nom ++ BIND ++ ds.s ! NCard Sg Masc Nom ;
|
||||
NOrd _ _ _ => d.s ! NCard Sg Masc Nom ++ BIND ++ ds.s ! NCard Sg Masc Nom ++ "."
|
||||
} ;
|
||||
n = Pl
|
||||
} ;
|
||||
|
||||
D_0 = mkDig "0" ;
|
||||
D_1 = mk3Dig "1" "1." Sg ;
|
||||
D_2 = mkDig "2" ;
|
||||
D_3 = mkDig "3" ;
|
||||
D_4 = mkDig "4" ;
|
||||
D_5 = mkDig "5" ;
|
||||
D_6 = mkDig "6" ;
|
||||
D_7 = mkDig "7" ;
|
||||
D_8 = mkDig "8" ;
|
||||
D_9 = mkDig "9" ;
|
||||
|
||||
oper
|
||||
|
||||
mkDig : Str -> TDigit = \c -> mk2Dig c (c + ".") ;
|
||||
|
||||
mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ;
|
||||
|
||||
mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> {
|
||||
s = table {
|
||||
NCard _ _ _ => c ;
|
||||
NOrd _ _ _ => o
|
||||
} ;
|
||||
n = n
|
||||
} ;
|
||||
|
||||
TDigit = {
|
||||
s : CardOrd => Str ;
|
||||
n : Number
|
||||
} ;
|
||||
}
|
||||
799
lib/src/icelandic/ParadigmsIce.gf
Normal file
799
lib/src/icelandic/ParadigmsIce.gf
Normal file
@@ -0,0 +1,799 @@
|
||||
--# -path=.:../abstract:../../prelude:../common
|
||||
|
||||
--1 Icelandic Lexical Paradigms
|
||||
--
|
||||
-- This is an API for the user of the resource grammar
|
||||
-- for adding lexical items. It gives functions for forming
|
||||
-- expressions of open categories: nouns, adjectives, verbs.
|
||||
--
|
||||
-- Closed categories (determiners, pronouns, conjunctions) are
|
||||
-- accessed through the resource syntax API, $Structural.gf$.
|
||||
--
|
||||
-- The main difference with $MorphoIce.gf$ is that the types
|
||||
-- referred to are compiled resource grammar types. We have moreover
|
||||
-- had the design principle of always having existing forms, rather
|
||||
-- than stems, as string arguments of the paradigms.
|
||||
--
|
||||
-- The structure of functions for each word class $C$ is the following:
|
||||
-- first we give a handful of patterns that aim to cover all
|
||||
-- regular cases. Then we give a worst-case function $mkC$, which serves as an
|
||||
-- escape to construct the most irregular words of type $C$.
|
||||
-- However, this function should only seldom be needed: we have a
|
||||
-- separate module [``IrregIce`` ../../icelandic/IrregIce.gf],
|
||||
-- which covers irregular verbss.
|
||||
|
||||
resource ParadigmsIce = open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
MorphoIce,
|
||||
ResIce,
|
||||
CatIce
|
||||
in {
|
||||
--2 Parameters
|
||||
|
||||
oper
|
||||
-- To abstract over gender names, we define the following identifiers.
|
||||
|
||||
Gender : Type ;
|
||||
|
||||
masculine : Gender ;
|
||||
feminine : Gender ;
|
||||
neuter : Gender ;
|
||||
|
||||
--- To abstract over number names, we define the following.
|
||||
|
||||
Number : Type ;
|
||||
|
||||
singular : Number ;
|
||||
plural : Number ;
|
||||
|
||||
-- To abstract over case names, we define the following.
|
||||
|
||||
Case : Type ;
|
||||
|
||||
nominative : Case ;
|
||||
accusative : Case ;
|
||||
dative : Case ;
|
||||
genitive : Case ;
|
||||
|
||||
--2 Nouns
|
||||
|
||||
-- Nouns are constructed by the function $mkN$, which takes a varying
|
||||
-- number of arguments.
|
||||
|
||||
mkN = overload {
|
||||
|
||||
-- Given Sg.Nom.
|
||||
mkN : Str -> Gender -> N = mk1N ;
|
||||
|
||||
-- Given Sg.Nom and Pl.Nom - different Pl.Nom part
|
||||
mkN : (_,_ : Str) -> Gender -> N = mk2N ;
|
||||
|
||||
-- Given Sg.Nom, Sg.Gen, and Pl.Nom - also different Sg.Gen part
|
||||
mkN : (_,_,_ : Str) -> Gender -> N = mk3N ;
|
||||
|
||||
-- Given Sg.Nom, Sg.Gen, Pl.Nom and Pl.Gen - also different Pl.Gen part
|
||||
mkN : (_,_,_,_ : Str) -> Gender -> N = mk4N ;
|
||||
|
||||
-- Worst case, all eight forms.
|
||||
mkN : (x1,_,_,_,_,_,_,x8 : Str) -> Gender -> N = mk8N ;
|
||||
|
||||
} ;
|
||||
|
||||
-- compound nouns - the last noun leads the inflexion, the rest stays the same
|
||||
mkCompoundN : Str -> N -> N = \front,lead -> lin N {
|
||||
s = \\n,s,c => front + lead.s ! n ! s ! c ;
|
||||
g = lead.g
|
||||
} ;
|
||||
|
||||
|
||||
-- Some weak declensions of neuter and feminine nouns differ in the Pl Gen
|
||||
-- with a "-n-" in the ending but differ in no other way.
|
||||
-- This goes only for weak feminine and neuter nouns, the operation is not for
|
||||
-- masculine nouns.
|
||||
mkNPlGen : Str -> Gender -> N = \stelpa,g -> case <stelpa,g> of {
|
||||
<front + "a",Fem> => lin N (nForms2FemNoun (dSaga stelpa (front + "na"))) ;
|
||||
<front + "a",_> => lin N (nForms2NeutrNoun (dAuga stelpa (front + "na")))
|
||||
} ;
|
||||
|
||||
|
||||
mk1N : Str -> Gender -> N = \s,g -> case g of {
|
||||
Neutr => lin N (nForms2NeutrNoun (neutrNForms1 s)) ;
|
||||
Masc => lin N (nForms2MascNoun (mascNForms1 s)) ;
|
||||
Fem => lin N (nForms2FemNoun (femNForms1 s))
|
||||
} ;
|
||||
|
||||
mk2N : (_,_ : Str) -> Gender -> N = \x,y,g -> case g of {
|
||||
Neutr => lin N (nForms2NeutrNoun (neutrNForms2 x y)) ;
|
||||
Masc => lin N (nForms2MascNoun (mascNForms2 x y)) ;
|
||||
Fem => lin N (nForms2FemNoun (femNForms2 x y))
|
||||
} ;
|
||||
|
||||
mk3N : (_,_,_ : Str) -> Gender -> N =\x,y,z,g -> case g of {
|
||||
Neutr => lin N (nForms2NeutrNoun (neutrNForms3 x y z)) ;
|
||||
Masc => lin N (nForms2MascNoun (mascNForms3 x y z)) ;
|
||||
Fem => lin N (nForms2FemNoun (femNForms3 x y z))
|
||||
} ;
|
||||
|
||||
mk4N : (_,_,_,_ : Str) -> Gender -> N =\a,b,c,d,g -> case g of {
|
||||
Neutr => lin N (nForms2NeutrNoun (neutrNForms4 a b c d)) ;
|
||||
Masc => lin N (nForms2MascNoun (mascNForms4 a b c d)) ;
|
||||
Fem => lin N (nForms2FemNoun (femNForms4 a b c d))
|
||||
} ;
|
||||
|
||||
neutrNForms1 : Str -> NForms = \s -> case s of {
|
||||
"tré" | "hné" | "fé" => dTré s ;
|
||||
front + middle@("g" | "k") + "j" + "a" => dAuga s (front + middle + "na") ;
|
||||
_ + ("r" | "s" | "n" | "j") + "a" => dAuga s s ;
|
||||
stem + "a" => dAuga s (stem + "na") ;
|
||||
-- stem + "a" - I Don't think this is the general case, a counter example
|
||||
-- would be "þema" - "þema". Contacted a linguist about this and am waiting
|
||||
-- for an answer.
|
||||
front + ("ki" | "gi") => dKvæði s ((a2ö front) + "jum") ;
|
||||
front + "i" => dKvæði s ((a2ö front) + "um") ;
|
||||
front + "ur" => dSumar s s ;
|
||||
front + "ar" => dSumar s (front + "ur") ;
|
||||
--front + end@("að" | "al" | "ald" | "an" | "ang") =>
|
||||
_ => dBarn s (a2ö s)
|
||||
} ;
|
||||
|
||||
-- Currently not used! Should be added at least some cases for 2 forms and maybe for 3 forms as well.
|
||||
neutrNForms2 : (_,_ : Str) -> NForms = \sg,pl -> case <sg,pl> of {
|
||||
_ => dBarn sg pl
|
||||
} ;
|
||||
|
||||
neutrNForms3 : (_,_,_ : Str) -> NForms = \nom,gen,pl -> case <nom,gen,pl> of {
|
||||
_ => dBarn nom pl
|
||||
} ;
|
||||
|
||||
neutrNForms4 : (_,_,_,_ : Str) -> NForms = \sgNom,sgGen,plNom,plGen -> case <sgNom,sgGen,plNom,plGen> of {
|
||||
_ => dBarn sgNom plNom
|
||||
} ;
|
||||
|
||||
mascNForms1 : Str -> NForms = \s -> case s of {
|
||||
front + "andi" => dNemandi s (front + "endur") ;
|
||||
front + "óndi" => dNemandi s (front + "ændur") ;
|
||||
front + "ndi" => dNemandi s s ;
|
||||
front + middle@("ing" | "ung" | "dóm") + "ur" => dArmur s (front + middle + "ar") ;
|
||||
front + middle@"und" + "ur" => dHöfundur s (front + middle + "ar") ;
|
||||
front + middle@("ang" | "ald") + "ur" => dAkur s (front + middle + "rar") ;
|
||||
front + ("a" | "i" | "u") + end@("nn" | "ll") => dHiminn s (front + (init end) + "ar") ;
|
||||
#consonant* + #vowel + ("ll" | "nn") => dStóll s ;
|
||||
stem + "ur" => dArmur s (stem + "ar") ; -- the most common masc noun type
|
||||
front@(_ + "ó") + "r" => dMór s (front + "ar") ;
|
||||
_ + "i" => dSími s ;
|
||||
_ => dBiskup s
|
||||
} ;
|
||||
|
||||
mascNForms2 : (_,_ : Str) -> NForms = \sg,pl -> case <sg,pl> of {
|
||||
<_ + "ó" + _ + "ur",_ + "æ" + _ + "ur"> => dFótur sg pl ;
|
||||
<_ + "ór",_> => dMór sg pl ;
|
||||
<_ + "i",_ + "ir"> => dDani sg pl ;
|
||||
<_ + "ur",_ + "rar"> => dAkur sg pl ;
|
||||
<_ + "ur",_ + "ar"> => dArmur sg pl ;
|
||||
<_ + ("a" | "i" | "u") + end@("nn" | "ll"), _ + "ar"> => dHiminn sg pl -- for words like himinn that have a i-shift in the plural
|
||||
} ;
|
||||
|
||||
mascNForms3 : (_,_,_ : Str) -> NForms =\nom,gen,pl -> case <nom,gen,pl> of {
|
||||
<_ + "ö" + _,_ + "ar",_ + "ir"> => dFjörður nom gen pl ;
|
||||
<"faðir" | "bróðir",_,_> => dFaðir nom gen pl ;
|
||||
<"maður",_,_> => dMaður nom gen pl ;
|
||||
<_ + "ur", _ + "s", _ + "ir"> => dDalur nom pl ;
|
||||
<_ + "ur", _ + "ar", _ + "ar"> => dHöfundur nom pl ;
|
||||
<_ + "ur", _ + "ar", _ + "ir"> => dSöfnuður nom gen pl ;
|
||||
<_ + "ur", _ + "s" , _ + "ar"> => dArmur nom pl
|
||||
} ;
|
||||
|
||||
mascNForms4 : (_,_,_,_ : Str) -> NForms = \sgNom,sgGen,plNom,plGen -> case <sgNom,sgGen,plNom,plGen> of {
|
||||
_ => dNemandi sgNom plNom -- dummy case so the operation doesn't give error
|
||||
} ;
|
||||
|
||||
femNForms1 : Str -> NForms = \s -> case s of {
|
||||
_ + "ing" => dFylking s (s + "ar") ;
|
||||
front + middle@("g" | "k") + "j" + "a" => dSaga s (front + middle + "na") ;
|
||||
_ + ("r" | "s" | "n" | "j") + "a" => dSaga s s ; -- I Don't think this is the general case
|
||||
stem + "a" => dSaga s s -- I Don't think this is the general case
|
||||
} ;
|
||||
|
||||
femNForms2 : (_,_ : Str) -> NForms = \sg,pl -> case <sg,pl> of {
|
||||
<_ + "un",_ + "ir"> => dVerslun sg pl ;
|
||||
<_ + "i",_ + "ir"> => dKeppni sg pl ;
|
||||
<_ + "ur",_ + "rir"> => dFjöður sg pl ;
|
||||
<_ + "ur",_ + "ir"> => dBrúður sg pl ;
|
||||
<_,_ + "ir"> => dÞökk sg pl ;
|
||||
<_,_ + ("rar" | "var" | "jar")> => dLifur sg pl ;
|
||||
<_ + "ur", _ + "ar"> => dÆður sg pl ;
|
||||
<_,_ + "ar"> => dNál sg pl ;
|
||||
|
||||
-- this is not general
|
||||
--<_ + ("í" | "ú" | "ei" | "æ" | "á" | "ó" | "au") + ("t"* | "k"*),_> => dBók sg pl ;
|
||||
|
||||
<"móðir" | "dóttir" | "systir",_> => dMóðir sg pl ;
|
||||
<_ + "á", _ + "ær"> => dTá sg pl ;
|
||||
<_ + "ó", _ + "ær"> => dTá sg pl ;
|
||||
<_ + "ú", _ + "ýr"> => dTá sg pl ;
|
||||
<_ + "á", _ + "á" + _> => dÁ sg pl ;
|
||||
<_ + "ó", _ + "ó" + _> => dÁ sg pl ;
|
||||
|
||||
<_ + "ú", _ + "ú" + _> => dÁ sg pl ;-- in some cases the Sg.Gen becomes ú-ar instead of ú-r, I do not know atm why.
|
||||
|
||||
<_ + "ús",_> => dMús sg pl
|
||||
} ;
|
||||
|
||||
femNForms3 : (_,_,_ : Str) -> NForms = \nom,gen,pl -> case <nom,gen,pl> of {
|
||||
<_ + "i" , _ + "ar", _ + "ar"> => dHeiði nom pl ;
|
||||
<_ + "i" , _ , _ + "ar"> => dLygi nom pl ;
|
||||
<_ , _ + "ar" , _ + "ur"> => dNögl nom gen pl
|
||||
} ;
|
||||
|
||||
femNForms4 : (_,_,_,_ : Str) -> NForms = \sgNom,sgGen,plNom,plGen -> case <sgNom,sgGen,plNom,plGen> of {
|
||||
<"kona",_,_,"kvenna"> => dKona sgNom plGen ;
|
||||
<_,_ + "ur",_ + "ur",_> => dMörk sgNom plNom plGen
|
||||
} ;
|
||||
|
||||
mk8N : (x1,_,_,_,_,_,_,x8 : Str) -> Gender -> N = \a,b,c,d,e,f,g,h,gend ->
|
||||
let nfs = nForms8 a b c d e f g h
|
||||
in lin N (nForms2Noun nfs (nForms2Suffix nfs gend) gend) ;
|
||||
|
||||
mkPN = overload {
|
||||
|
||||
-- this should be merged or swithced with N -> Gender
|
||||
mkPN : Str -> Gender -> PN =
|
||||
\name,g -> regPN name g ;
|
||||
|
||||
} ;
|
||||
|
||||
mkN2 : N -> Preposition -> N2 = \n,prep -> lin N2 (n ** {c2 = prep}) ;
|
||||
|
||||
mkN3 : N -> (_,_ : Preposition) -> N3 = \n,c2,c3 -> lin N3 (n ** {c2 = c2; c3 = c3}) ;
|
||||
|
||||
--2 Adjectives
|
||||
|
||||
-- Adjectives are constructed by the function $mkA$, which takes a varying
|
||||
-- number of arguments.
|
||||
|
||||
mkA = overload {
|
||||
|
||||
-- Given Sg.Masc.Nom of the positive comparision
|
||||
mkA : Str -> A = mk1A ;
|
||||
|
||||
-- Given also the Sg.fem.Nom of the positive comparision
|
||||
mkA : (_,_ : Str) -> A = mk2A ;
|
||||
|
||||
-- Given also the Sg.Masc.Nom of the comparitive comparision
|
||||
mkA : (_,_,_ : Str) -> A = mk3A ;
|
||||
} ;
|
||||
|
||||
mk1A : Str -> A = \s -> lin A (aForms2Adjective
|
||||
(weakPosit s []) (strongPosit1 s) (compar1 s) (weakSuperl s []) (strongSuperl1 s) (regAAdv1 s)) ;
|
||||
|
||||
mk2A : (_,_ : Str) -> A = \mas,fem -> lin A (aForms2Adjective
|
||||
(weakPosit mas fem) (strongPosit2 mas fem) (compar2 mas fem) (weakSuperl mas fem) (strongSuperl2 mas fem) (regAAdv2 mas fem)) ;
|
||||
|
||||
mk3A : (_,_,_ : Str) -> A = \mas,fem,com -> lin A (aForms2Adjective
|
||||
(weakPosit mas fem) (strongPosit2 mas fem) (compar1 com) (weakSuperl com []) (strongSuperl1 com) (regAAdv2 mas fem)) ;
|
||||
|
||||
strongPosit1 : Str -> AForms = \s -> case s of {
|
||||
#consonant* + "ei" + ("ll" | "nn") => dSeinn s ;
|
||||
_ + "inn" => dFarinn s ;
|
||||
_ + "ill" => dLítill s ;
|
||||
#consonant* + #vowel + ("ll" | "nn") => dSeinn s ;
|
||||
stem + "ur" => dFalur s (a2ö stem)
|
||||
} ;
|
||||
|
||||
strongPosit2 : (_,_ : Str) -> AForms = \mas,fem -> case <mas,fem> of {
|
||||
<_,_ + ("á" | "ó" | "ú")> => dSmár fem ;
|
||||
<front + "ur",_ + "ur"> => dFagur mas fem ;
|
||||
<front + "ur",_> => dFalur mas fem ;
|
||||
<_,_ + ("r" | "s" | (#consonant + "n"))> => dDýr mas ; -- Should this also be moved to strongPosit1 ?
|
||||
<_, _ + ("ý" | "æ")> => dNýr fem ;
|
||||
<_ + "ill",_> => dLítill mas ;
|
||||
<_ + "inn",_> => dFarinn mas
|
||||
} ;
|
||||
|
||||
weakPosit : (_,_ : Str) -> AForms = \mas,fem -> case <mas,fem> of {
|
||||
<front + "ur",_ + "ur"> => dPositW (front + "r") ;
|
||||
<stem + "ur",_> => dPositW stem ;
|
||||
<front + "ill",_> => dPositW (í2i front + "l") ;
|
||||
<front + "inn",_> => dPositW (front + "n") ;
|
||||
_ => dPositW fem
|
||||
} ;
|
||||
|
||||
compar1 : Str -> AForms = \s -> case s of {
|
||||
front + "ni" => dI (init s) ;
|
||||
stem + "ari" => dAri stem ;
|
||||
stem + "ri" => dRi stem ;
|
||||
front + mid@("leg" | "ug") + "ur" => dRi (front + mid) ;
|
||||
stem + "ur" => dAri stem ;
|
||||
front + "inn" => dAri (front + "n") ;
|
||||
_ + ("ll" | "nn") => dI s
|
||||
} ;
|
||||
|
||||
compar2 : (_,_ : Str) -> AForms = \mas,fem -> case <mas,fem> of {
|
||||
<front + "ur",_ + "ur"> => dAri (front + "r") ;
|
||||
<front + mid@("leg" | "ug") + "ur",_> => dRi (front + mid) ;
|
||||
<stem + "ur", _> => dAri stem ;
|
||||
<front + "inn",_> => dAri (front + "n") ;
|
||||
<_ + ("ll" | "nn"),_> => dI mas ;
|
||||
<_ + "r", _ + ("á" | "ó" | "ú" | "ý" | "æ")> => dRi fem ;
|
||||
<_,_ + ("r" | "s" | (#consonant + "n"))> => dAri fem
|
||||
} ;
|
||||
|
||||
weakSuperl : (_,_ : Str) -> AForms = \mas,fem -> case <mas,fem> of {
|
||||
<front + "ni",_> => dSuperlW (front + "nst") (front + "nust") ;
|
||||
<stem + "ari",_> => dSuperlW (stem + "ast") (stem + "ust") ;
|
||||
<stem + "rri",_> => dSuperlW (stem + "st") (stem + "st") ;
|
||||
<stem + "t" + "ri",_> => dSuperlW (stem + "st") (stem + "st") ;
|
||||
<stem + "ri",_> => dSuperlW (stem + "st") (stem + "st") ;
|
||||
<frontm + "ur",frontf + "ur"> => dSuperlW (frontm + "rast") (frontf + "rust") ;
|
||||
<front + "ur",_> => dSuperlW (front + "ast") (front + "ust") ;
|
||||
<front + end@("ll" | "nn"),_> => dSuperlW (front + (init end) + "ast") ((a2ö front) + (init end) + "ust") ;
|
||||
<_,_ + ("ý" | "æ")> => dSuperlW (fem + "jast") (fem + "just") ;
|
||||
_ => dSuperlW (fem + "ast") (fem + "ust")
|
||||
} ;
|
||||
|
||||
strongSuperl1 : Str -> AForms = \s -> case s of {
|
||||
front + "ni" => dFalastur (front + "nstur") (front + "nst") ;
|
||||
stem + "ari" => dFalastur (stem + "astur") (stem + "ust") ;
|
||||
stem + "rri" => dFalastur (stem + "stur") (stem + "st") ;
|
||||
stem + "ri" => dFalastur (stem + "stur") (stem + "st") ;
|
||||
front + "inn" => dFalastur (front + "nastur") ((a2ö front) + "nust") ;
|
||||
stem + "ur" => dFalastur (stem + "astur") ((a2ö stem) + "ust") ;
|
||||
front + end@("ll" | "nn") => dFalastur (front + (init end) + "astur") ((a2ö front) + (init end) + "ust")
|
||||
} ;
|
||||
|
||||
strongSuperl2 : (_,_ : Str) -> AForms = \mas,fem -> case <mas,fem> of {
|
||||
<frontm + "ur",frontf + "ur"> => dFalastur (frontm + "rastur") (frontf + "rust") ;
|
||||
<frontm + "ur", _> => dFalastur (frontm + "astur") (fem + "ust") ;
|
||||
<_, _ + ("á" | "ú" | "ó")> => dFalastur (fem + "astur") (fem + "ust") ;
|
||||
<_, _ + ("ý" | "æ")> => dFalastur (fem + "jastur") (fem + "just") ;
|
||||
<front + end@("ll" | "nn"),_> => dFalastur (front + (init end) + "astur") ((a2ö front) + (init end) + "ust") ;
|
||||
<_,_ + ("r" | "s" | (#consonant + "n"))> => dFalastur (fem + "astur") (fem + "ust")
|
||||
} ;
|
||||
|
||||
-- Adverb construction from adjectives. Below (regAAdv*) is used a regular way to
|
||||
-- form adverb from adjectives. That way suffixes -lega to the stem similarily to
|
||||
-- -ly in english. Other ways, regular or irregular, are given via addAdv.
|
||||
|
||||
regAAdv1 : Str -> Str = \s -> case s of {
|
||||
front + "einn" => front + "einlega" ;
|
||||
front + "eill" => front + "eillega" ;
|
||||
front + "inn" => front + "lega" ;
|
||||
front + "ll" => front + "llega" ;
|
||||
front + "nn" => front + "nlega" ;
|
||||
front + "leg" + "ur" => front + "lega" ;
|
||||
front + "ur" => front + "lega"
|
||||
} ;
|
||||
|
||||
regAAdv2 : (_,_ : Str) -> Str = \mas,fem -> case <mas,fem> of {
|
||||
<_,_ + ("á" | "ó" | "ú" | "ý" | "æ")> => fem + "lega" ;
|
||||
<front + "ur",_ + "ur"> => mas + "lega" ;
|
||||
<front + "ur", _> => front + "lega" ;
|
||||
<front + ("ll" | "nn"),_> => mas + "ega" ;
|
||||
_ => mas + "lega"
|
||||
} ;
|
||||
|
||||
addAdv : A -> Str -> A = \a,adv -> a ** {adv = adv} ;
|
||||
|
||||
mkA2 : A -> Prep -> A2 = \adj,prep -> adj ** {c2 = prep} ;
|
||||
|
||||
--2 Verbs
|
||||
|
||||
-- Verbs are constructed by the functions $mkV$ and $irregV$ which take a varying
|
||||
-- number of arguments.
|
||||
|
||||
mkV = overload {
|
||||
|
||||
-- Given the infinitive
|
||||
mkV : Str -> V = \telja -> mk1V telja;
|
||||
|
||||
-- Given also the first person singular present tense indicative mood
|
||||
mkV : (_,_ : Str) -> V = \telja,tel -> mk2V telja tel ;
|
||||
|
||||
-- Given also the first persons singular past tense indicative mood
|
||||
mkV : (_,_,_ : Str) -> V = \telja,tel,taldi -> mk3V telja tel taldi ;
|
||||
|
||||
-- Given also the past participle (strong declension) in the singular masculine nominative.
|
||||
mkV : (_,_,_,_ : Str) -> V = \telja,tel,taldi,talinn -> mk4V telja tel taldi talinn ;
|
||||
|
||||
-- Given also the supine
|
||||
mkV : (_,_,_,_,_ : Str) -> V = \telja,tel,taldi,talinn,talið -> mk5V telja tel taldi talinn talið ;
|
||||
|
||||
-- will be taken out, not to worry...
|
||||
-- The theoretical worst case
|
||||
mkV : (x1,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,x59 : Str) -> V =
|
||||
\fljúga,flýg,flýgur2,flýgur3,fljúgum,fljúgið,fljúga,flaug1,flaugst,flaug2,flugum,fluguð,flugu,
|
||||
fljúgi1,fljúgir,fljúgi3,fljúgumS,fljúgiðS,fljúgi,flygi1,flygir,flygi2,flygjum,flygjuð,flygju,
|
||||
fljúgðu,fljúgið,fljúgandi,floginn,sgMascAcc,sgMascDat,sgMascGen,sgFemNom,sgFemAcc,sgFemDat,sgFemGen,
|
||||
sgNeutNom,sgNeutAcc,sgNeutDat,sgNeutGen,plMascNom,plMascAcc,plMascDat,plMascGen,
|
||||
plFemNom,plFemAcc,plFemDat,plFemGen,plNeutNom,plNeutAcc,plNeutDat,plNeutGen,
|
||||
weakSgMascNom,weakSgMascAccDatGen,weakSgFemNom,weakSgFemAccDatGen,weakSgNeut,weakPl,flogið ->
|
||||
lin V (mkVerb fljúga flýg flýgur2 flýgur3 fljúgum fljúgið fljúga flaug1 flaugst flaug2 flugum fluguð flugu
|
||||
fljúgi1 fljúgir fljúgi3 fljúgumS fljúgiðS fljúgi flygi1 flygir flygi2 flygjum flygjuð flygju
|
||||
fljúgðu fljúgið fljúgandi floginn sgMascAcc sgMascDat sgMascGen sgFemNom sgFemAcc sgFemDat sgFemGen
|
||||
sgNeutNom sgNeutAcc sgNeutDat sgNeutGen plMascNom plMascAcc plMascDat plMascGen
|
||||
plFemNom plFemAcc plFemDat plFemGen plNeutNom plNeutAcc plNeutDat plNeutGen
|
||||
weakSgMascNom weakSgMascAccDatGen weakSgFemNom weakSgFemAccDatGen weakSgNeut weakPl flogið) ;
|
||||
};
|
||||
|
||||
mk1V : Str -> V = \inf ->
|
||||
lin V (vForms2Verb inf (indsub1 inf) (impSg inf) (impPl inf) (presPart inf) (sup inf) (weakPP inf) (strongPP inf)) ;
|
||||
|
||||
mk2V : (_,_ : Str) -> V = \telja,tel ->
|
||||
lin V (vForms2Verb telja (indsub2 telja tel) (impSg telja) (impPl telja) (presPart telja) (sup telja) (weakPP telja) (strongPP telja)) ;
|
||||
|
||||
mk3V : (_,_,_ : Str) -> V = \telja,tel,taldi ->
|
||||
lin V (vForms2Verb telja (indsub3 telja tel taldi) (impSg taldi) (impPl telja) (presPart telja) (sup telja) (weakPP telja) (strongPP telja));
|
||||
|
||||
mk4V : (_,_,_,_ : Str) -> V = \telja,tel,taldi,talinn ->
|
||||
lin V (vForms2Verb telja (indsub3 telja tel taldi) (impSg taldi) (impPl telja) (presPart telja) (sup telja) (weakPP talinn) (strongPP talinn)) ;
|
||||
|
||||
mk5V : (_,_,_,_,_ : Str) -> V = \telja,tel,taldi,talinn,talið ->
|
||||
lin V (vForms2Verb telja (indsub3 telja tel taldi) (impSg taldi) (impPl telja) (presPart telja) talið (weakPP talinn) (strongPP talinn)) ;
|
||||
|
||||
indsub1 : Str -> MForms = \inf -> case inf of {
|
||||
stem@(front + "e" + c) + "ja" => cTelja inf stem (ðiditi (front + "a" + c)) ;
|
||||
stem@(front + "y" + c) + "ja" => cTelja inf stem (ðiditi (front + "u" + c)) ;
|
||||
stem@(front + "ý" + c) + "ja" => cTelja inf stem (ðiditi (front + "ú" + c)) ;
|
||||
stem@(front + "æ" + c) + "ja" => cTelja inf stem (ðiditi (front + "á" + c)) ;
|
||||
stem + "ja" => cTelja inf stem (ðiditi stem) ;
|
||||
stem + "a" => cDæma inf (stem + "i") (ðiditi stem)
|
||||
} ;
|
||||
|
||||
indsub2 : (_,_ : Str) -> MForms = \telja,tel -> case <telja,tel> of {
|
||||
<_ + "a",stem + "i"> => cDæma telja tel (ðiditi stem) ;
|
||||
<_ + "a",_ + "a"> => cKalla telja (ðiditi telja) ;
|
||||
<_ + "ja",_> => cTelja telja tel (ðiditi tel)
|
||||
} ;
|
||||
|
||||
indsub3 : (_,_,_ : Str) -> MForms = \telja,tel,taldi -> case <telja,tel,taldi> of {
|
||||
<_ + "a",_ + "i",_> => cDæma telja tel taldi ;
|
||||
<_ + "a",_ + "a",_> => cKalla telja taldi ;
|
||||
<_ + "a",_,_> => cTelja telja tel taldi
|
||||
} ;
|
||||
|
||||
impSg : Str -> Str = \inf -> case inf of {
|
||||
front + "i" => front + "u" ;
|
||||
front + "ja" => (init (ðiditi front)) + "u" ;
|
||||
front + "a" => (init (ðiditi front)) + "u" ;
|
||||
_ => inf + "ðu"
|
||||
} ;
|
||||
|
||||
impPl : Str -> Str = \inf -> case inf of {
|
||||
front + "a" => front + "ið" ;
|
||||
_ => inf + "ið"
|
||||
} ;
|
||||
|
||||
sup : Str -> Str = \inf -> case inf of {
|
||||
front + "e" + c + "ja" => front + "a" + c + "ið" ;
|
||||
front + "y" + c + "ja" => front + "u" + c + "ið" ;
|
||||
front + "ý" + c + "ja" => front + "ú" + c + "ið" ;
|
||||
front + "æ" + c + "ja" => front + "á" + c + "ið" ;
|
||||
front + ("a" | "ja" | "u") => front + "ið" ;
|
||||
_ => inf + "ð"
|
||||
} ;
|
||||
|
||||
presPart : Str -> Str = \telja -> case telja of {
|
||||
telj + "a" => telj + "andi" ;
|
||||
_ => telja + "andi"
|
||||
} ;
|
||||
|
||||
strongPP : Str -> AForms = \inf -> case inf of {
|
||||
-- first two cases are not in the inf, but the pp in cases
|
||||
-- when it is needed to give it explicitly
|
||||
front + "inn" => dTalinn inf ;
|
||||
front + "aður" => dFalur inf ((a2ö front) + "uð") ;
|
||||
stem + "ur" => dFalur inf stem ;
|
||||
front + "e" + c + "ja" => dTalinn (front + "a" + c + "inn") ;
|
||||
front + "y" + c + "ja" => dTalinn (front + "u" + c + "inn") ;
|
||||
front + "ý" + c + "ja" => dTalinn (front + "ú" + c + "inn") ;
|
||||
front + "æ" + c + "ja" => dTalinn (front + "á" + c + "inn") ;
|
||||
stem + "ja" => dTalinn (stem + "inn") ;
|
||||
stem + "a" => dFalur (stem + "ur") (a2ö stem)
|
||||
} ;
|
||||
|
||||
weakPP : Str -> AForms = \inf -> case inf of {
|
||||
-- first three cases are not in the inf, but the pp in cases
|
||||
-- when it is needed to give it explicitly
|
||||
stem + "inn" => dPositW stem ;
|
||||
front + "aður" => dPositWW (front + "aði") ((a2ö front) + "uðu") ;
|
||||
stem + "ur" => dPositW stem ;
|
||||
front + "e" + c + "ja" => dPositW (init (ðiditi (front + "a" + c))) ;
|
||||
front + "y" + c + "ja" => dPositW (init (ðiditi (front + "u" + c))) ;
|
||||
front + "ý" + c + "ja" => dPositW (init (ðiditi (front + "ú" + c))) ;
|
||||
front + "æ" + c + "ja" => dPositW (init (ðiditi (front + "á" + c))) ;
|
||||
stem + "a" => dPositW (init (ðiditi stem))
|
||||
} ;
|
||||
|
||||
-- Irregular verbs, made with irregV, are mostly kept in IrregIce.gf.
|
||||
-- The name is a bit misleading, i.e. irregular. These verbs are regular
|
||||
-- in the sense that they can be predicted and have patterns. The verbs that
|
||||
-- are considered irregular here are : those that are consiederd to strong
|
||||
-- verbs, preterite presents and the so called -ri verbs. All these group
|
||||
-- of verbs are countable and closed.
|
||||
|
||||
irregV = overload {
|
||||
|
||||
-- given the infinitive
|
||||
irregV : Str -> V = \bjóða -> irreg1V bjóða;
|
||||
|
||||
-- given also the past participle (Strong.Sg.Masc.Nom)
|
||||
irregV : (_,_ : Str) -> V = \bjóða,boðinn -> irreg2V bjóða boðinn ;
|
||||
|
||||
-- given also the singular and plural past indicative
|
||||
irregV : (_,_,_,_ : Str) -> V = \ausa,jós,jusum,ausinn -> irreg4V ausa jós jusum ausinn ;
|
||||
|
||||
irregV : (_,_,_,_,_,_ : Str) -> V = \vera,er,var,sé,væri,verinn -> irreg6V vera er var sé væri verinn ;
|
||||
|
||||
-- when the pattern is pretty rather unique or hard to pattern match - left over verbs
|
||||
irregV : MForms -> (_,_ : Str) -> V = \mforms,éta,etinn -> irreg9V mforms éta etinn ;
|
||||
|
||||
};
|
||||
|
||||
irreg1V : Str -> V = \inf ->
|
||||
lin V (vForms2Verb inf (irregindsub inf) (impIrregSg inf) (impPl inf) (presPart inf) (sup inf) (weakPP inf) (strongPP inf)) ;
|
||||
|
||||
irreg2V : (_,_ : Str) -> V = \bjóða,boðinn ->
|
||||
lin V (vForms2Verb bjóða (irregindsub bjóða) (impIrregSg bjóða) (impPl bjóða) (presPart bjóða) (sup bjóða) (weakPP boðinn) (strongPP boðinn)) ;
|
||||
|
||||
irreg4V : (_,_,_,_ : Str) -> V = \ausa,jós,jusum,ausinn ->
|
||||
lin V (vForms2Verb ausa (irregindsub3 ausa jós jusum) (impIrregSg ausa) (impPl ausa) (presPart ausa) (sup ausa) (weakPP ausinn) (strongPP ausinn)) ;
|
||||
|
||||
irreg6V : (_,_,_,_,_,_ : Str) -> V = \vera,er,var,sé,væri,verinn ->
|
||||
lin V (vForms2Verb vera (irregindsub5 vera er var sé væri) (impIrregSg vera) (impPl vera) (presPart vera) (sup vera) (weakPP verinn) (strongPP verinn)) ;
|
||||
|
||||
irreg9V : MForms -> (_,_ : Str) -> V = \mforms,éta,etinn ->
|
||||
lin V (vForms2Verb éta mforms (impIrregSg éta) (impPl éta) (presPart éta) (sup éta) (weakPP etinn) (strongPP etinn)) ;
|
||||
|
||||
impIrregSg : Str -> Str = \inf -> case inf of {
|
||||
front + "a" => front + "ðu" ;
|
||||
_ => inf + "ðu"
|
||||
} ;
|
||||
|
||||
irregindsub : Str -> MForms = \inf -> case inf of {
|
||||
-- biðja, sitja..
|
||||
front@("b" | "s") + "i" + back@("t"| "ð") + "j" + #vowel => cBresta inf
|
||||
(front + "i" + back)
|
||||
(front + "a" + back)
|
||||
(front + "á" + back + "um")
|
||||
(front + "æ" + back + "i") ;
|
||||
-- þiggja, liggja..
|
||||
front@("þ" | "l") + "i" + back@("gg") + "j" + #vowel => cBresta inf
|
||||
(front + "i" + back)
|
||||
(front + "á")
|
||||
(front + "á" + back + "um")
|
||||
(front + "æ" + back + "i") ;
|
||||
-- flá, slá, þvo..
|
||||
front@("fl" | "sl" | "þv") + middle@("á" | "o") => cFara inf
|
||||
(front + "æ")
|
||||
(front + "ó")
|
||||
(front + "ógum")
|
||||
(front + "ægi") ;
|
||||
-- í - ei - i - i
|
||||
front + "í" + back + #vowel => cBíta inf (front + "ei" + back) (front + "i" + back + "um") ;
|
||||
-- jó - au - u - o
|
||||
front + ("jó" | "jú" | "ú") + back@(#consonant*) + #vowel => cBjóða inf
|
||||
(front + "ý" + back)
|
||||
(front + "au" + back)
|
||||
(front + "u" + back + "um")
|
||||
(front + "y" + back + "i") ;
|
||||
-- (v)e - a - u - o
|
||||
front@(f + "v") + "e" + back@(#consonant + #consonant) + #vowel => cBresta inf
|
||||
(front + "e" + back)
|
||||
(front + "a" + back)
|
||||
(f + "u" + back + "um")
|
||||
(f + "y" + back + "i") ;
|
||||
-- e - a - u - o
|
||||
front + "e" + back@(#consonant + #consonant) + #vowel => cBresta inf
|
||||
(front + "e" + back)
|
||||
(front + "a" + back)
|
||||
(front + "u" + back + "um")
|
||||
(front + "y" + back + "i") ;
|
||||
|
||||
-- e - a - á - o
|
||||
front@("b" | "sk") + "e" + back@("r") + #vowel => cFara inf
|
||||
(front + "e" + back)
|
||||
(front + "a" + back)
|
||||
(front + "á" + back + "um")
|
||||
(front + "e" + back + "i") ;
|
||||
-- e - a - á - o
|
||||
front@("st" | "f" | "n") + "e" + back@("l" | "m") + #vowel => cBresta inf
|
||||
(front + "e" + back)
|
||||
(front + "a" + back)
|
||||
(front + "á" + back + "um")
|
||||
(front + "e" + back + "i") ;
|
||||
-- e - a - á - e
|
||||
front + "e" + back@(#consonant) + #vowel => cBresta inf
|
||||
(front + "e" + back)
|
||||
(front + "a" + back)
|
||||
(front + "á" + back + "um")
|
||||
(front + "e" + back + "i") ;
|
||||
-- a - ó - ó - a
|
||||
front + "a" + back@(#consonant) + #vowel => cFara inf
|
||||
(front + "e" + back)
|
||||
(front + "ó" + back)
|
||||
(front + "ó" + back + "um")
|
||||
(front + "æ" + back + "i") ;
|
||||
-- e + j - ó - ó - a
|
||||
front + "e" + back@(#consonant) + "j" + #vowel => cFara inf
|
||||
(front + "e" + back)
|
||||
(front + "ó" + back)
|
||||
(front + "ó" + back + "um")
|
||||
(front + "æ" + back + "i") ;
|
||||
-- ey/æ + j - ó - ó - a
|
||||
front + middle@("ey" | "æ") + "j" + #vowel => cFara inf
|
||||
(front + middle)
|
||||
(front + "ó" )
|
||||
(front + "ó" + "um")
|
||||
(front + "æ" + "i") ;
|
||||
|
||||
-- já/ja -e - a - u - o
|
||||
front + ("já" | "ja") + back@(#consonant*) + #vowel => cBresta inf
|
||||
(front + "e" + back)
|
||||
(front + "a" + back)
|
||||
(front + "u" + back + "um")
|
||||
(front + "y" + back + "i") ;
|
||||
-- i - a - u - u
|
||||
front@(f + "v") + "i" + back@("n" + #consonant) + #vowel => cBresta inf
|
||||
(front + "e" + back)
|
||||
(front + "a" + back)
|
||||
(f + "u" + back + "um")
|
||||
(f + "y" + back + "i") ;
|
||||
-- i - a - u - u
|
||||
front + "i" + back@("n" + #consonant) + #vowel => cBresta inf
|
||||
(front + "e" + back)
|
||||
(front + "a" + back)
|
||||
(front + "u" + back + "um")
|
||||
(front + "y" + back + "i") ;
|
||||
-- e - a - u - u
|
||||
front + "e" + back@("kk" | "nn") + #vowel => cBresta inf
|
||||
(front + "e" + back)
|
||||
(front + "a" + back)
|
||||
(front + "u" + back + "um")
|
||||
(front + "y" + back + "i") ;
|
||||
-- ö (-e) - ö - u - o - cBresta
|
||||
front + "ö" + back@("kk") + "v" + #vowel => cBresta inf
|
||||
(front + "e" + back)
|
||||
(front + "ö" + back)
|
||||
(front + "u" + back + "um")
|
||||
-- i) á - é - é - á
|
||||
-- gráta grét grétum grátið
|
||||
-- front + "á" + tannhljóð + #vowel => c? inf (front + "é" + back) (front + "é" + back + "um") ;
|
||||
(front + "y" + back + "i")
|
||||
} ;
|
||||
|
||||
irregindsub3 : (_,_,_ : Str) -> MForms = \ausa,jós,jusum -> case <ausa,jós,jusum> of {
|
||||
<front + "au" + back + #vowel,_ + "jó" + _, _ + "u" + _> => cAusa ausa
|
||||
(front + "ey" + back)
|
||||
jós
|
||||
jusum
|
||||
(front + "y" + back + "i") ;
|
||||
<front + "ei" + back + #vowel, _ + "é" + _, _ + "é" + _> => cBresta ausa
|
||||
(front + "ei" + back)
|
||||
jós
|
||||
jusum
|
||||
(front + "é" + back + "i") ;
|
||||
<front + "a" + back + #vowel, _ + "é" + _, _ + "é" + _> => cBresta ausa
|
||||
(front + "e" + back)
|
||||
jós
|
||||
jusum
|
||||
(front + "é" + back + "i") ;
|
||||
<front + "á" + back + #vowel, _ + "é" + _, _ + "é" + _> => cBresta ausa
|
||||
(front + "æ" + back)
|
||||
jós
|
||||
jusum
|
||||
(front + "é" + back + "i")
|
||||
} ;
|
||||
|
||||
irregindsub5 : (_,_,_,_,_ : Str) -> MForms = \vera,er,var,sé,væri -> case <vera,er,var,sé,væri> of {
|
||||
<"vera",_,_,_,_> => cVera er var "voru" sé væri ;
|
||||
<"róa"|"gróa"|"núa"|"snúa",_,_,_,_> => cRóa vera er var sé ;
|
||||
_ => cMuna vera er var sé væri
|
||||
} ;
|
||||
|
||||
--3 Two-place verbs
|
||||
|
||||
-- Two-place verbs need a preposition, except the special case with direct object.
|
||||
-- (transitive verbs).
|
||||
|
||||
prepV2 : V -> Preposition -> V2 = \v,prep -> v ** {c2 = prep} ;
|
||||
|
||||
prepV3 : V -> Preposition -> Preposition -> V3 = \v,p1,p2 -> v ** {c2 = p1 ; c3 = p2} ;
|
||||
|
||||
accPrep : Preposition = {s = []; c = Acc} ;
|
||||
|
||||
mkV2 = overload {
|
||||
-- also constructed like V2 are : VV, V2A, V2S, V2Q
|
||||
|
||||
-- Two-place regular verbs with direct object (accusative, transitive verbs).
|
||||
|
||||
mkV2 : V -> V2 = \v -> prepV2 v accPrep ;
|
||||
|
||||
-- Two-place with a preposition or object in a given case
|
||||
|
||||
mkV2 : V -> Preposition -> V2 = \v,prep -> prepV2 v prep;
|
||||
};
|
||||
|
||||
|
||||
--3 Three-place verbs
|
||||
|
||||
-- Three-place (ditransitive) verbs need two prepositions, of which
|
||||
-- the first one or both can be absent.
|
||||
|
||||
mkV3 = overload {
|
||||
-- also constructed like V3 is V2V
|
||||
|
||||
-- ditransitive, e.g. give,_,_
|
||||
mkV3 : V -> V3 = \v -> prepV3 v (mkPrep "" dative) (mkPrep "" accusative) ;
|
||||
|
||||
-- ditransitive, e.g. give,_,to
|
||||
mkV3 : V -> Prep -> V3 = \v,p2 -> prepV3 v (mkPrep "" dative) p2 ;
|
||||
|
||||
-- ditransitive, e.g. speak,with,about
|
||||
mkV3 : V -> Prep -> Prep -> V3 = \v,p1,p2 -> prepV3 v p1 p2 ;
|
||||
|
||||
};
|
||||
|
||||
--2 Definitions of paradigms
|
||||
|
||||
-- The definitions should not bother the user of the API. So they are
|
||||
-- hidden from the document.
|
||||
|
||||
Gender = ResIce.Gender ;
|
||||
Number = ResIce.Number ;
|
||||
Case = ResIce.Case ;
|
||||
masculine = Masc ;
|
||||
feminine = Fem ;
|
||||
neuter = Neutr ;
|
||||
singular = Sg ;
|
||||
plural = Pl ;
|
||||
nominative = Nom ;
|
||||
accusative = Acc ;
|
||||
dative = Dat ;
|
||||
genitive = Gen ;
|
||||
|
||||
--N = ResIce.N ;
|
||||
--A = ResIce.A ;
|
||||
--V = ResIce.V ;
|
||||
|
||||
vowel : pattern Str = #("a" | "á" | "e" | "é" | "i" | "í" | "o" | "ó" | "u" | "ú" | "y" | "ý" | "æ" | "ö") ;
|
||||
|
||||
consonant : pattern Str = #("b" | "d" | "ð" | "f" | "g" | "h" | "j" | "k" | "l" | "m" | "n" | "p" | "r" | "s" | "t" | "v" | "x" | "þ") ;
|
||||
|
||||
regPN : Str -> Gender -> PN = \name,g -> case <name,g> of {
|
||||
<base + "i",Masc> => lin PN {s = caseList name (base + "a") (base + "a") (base + "a") ; g = Masc} ;
|
||||
<base + "a",Masc> => lin PN {s = caseList name (base + "u") (base + "u") (base + "u") ; g = Masc} ;
|
||||
<base + "ur",Masc> => lin PN {s = caseList name base (base + "i") (base + "s") ; g = Masc} ;
|
||||
<base + "l",Masc> => lin PN {s = caseList name name name (name + "s") ; g = Masc} ;
|
||||
<base + "s",Masc> => lin PN {s = caseList name name (name + "i") (name + "ar") ; g = Masc} ;
|
||||
<base + #consonant,Masc> => lin PN {s = caseList name name (name + "i") (name + "s") ; g = Masc} ;
|
||||
<base + #consonant,Fem> => lin PN {s = caseList name name name (name + "ar") ; g = Fem} ;
|
||||
<base + #consonant,Neutr> => lin PN {s = caseList name name (name + "i") (name + "s") ; g = Neutr}
|
||||
} ;
|
||||
|
||||
-- 3 Adverbs
|
||||
|
||||
mkAdv : Str -> Adv = \x -> lin Adv (ss x) ;
|
||||
|
||||
mkAdA : Str -> AdA = \x -> lin AdA (ss x) ;
|
||||
|
||||
mkAdN : CAdv -> AdN = \cadv -> lin AdN {s = cadv.s ++ cadv.p } ;
|
||||
|
||||
mkAdV : Str -> AdV = \x -> lin AdV (ss x) ;
|
||||
|
||||
-- 3 Prepositions
|
||||
|
||||
mkPrep : Str -> Case -> Prep = \s,c -> lin Prep {s = s ; c = c } ;
|
||||
|
||||
-- 2 Conjunctions
|
||||
|
||||
mkConj = overload {
|
||||
mkConj : Str -> Conj = \y -> mk2Conj [] y plural ;
|
||||
mkConj : Str -> Number -> Conj =\y,n -> mk2Conj [] y n ;
|
||||
mkConj : Str -> Str -> Conj =\x,y -> mk2Conj x y plural ;
|
||||
mkConj : Str -> Str -> Number -> Conj =\x,y,n -> mk2Conj x y n ;
|
||||
} ;
|
||||
|
||||
mk2Conj : Str -> Str -> Number -> Conj = \x,y,n ->
|
||||
lin Conj (sd2 x y ** {n = n}) ;
|
||||
} ;
|
||||
41
lib/src/icelandic/PhraseIce.gf
Normal file
41
lib/src/icelandic/PhraseIce.gf
Normal file
@@ -0,0 +1,41 @@
|
||||
concrete PhraseIce of Phrase = CatIce ** open Prelude, ResIce in {
|
||||
lin
|
||||
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
||||
|
||||
UttS s = {s = s.s} ;
|
||||
|
||||
UttImpSg pol imp = {s = imp.s ! pol.p ! Sg} ;
|
||||
|
||||
UttImpPl pol imp = {s = imp.s ! pol.p ! Pl} ;
|
||||
|
||||
UttImpPol pol imp = {s = imp.s ! pol.p ! Sg} ;
|
||||
|
||||
UttIP ip = {s = ip.s ! Masc ! Nom} ;
|
||||
|
||||
UttQS qs = {s = qs.s ! QDir} ;
|
||||
|
||||
UttIAdv adv = adv ;
|
||||
|
||||
UttNP np = {s = np.s ! NCase Nom} ;
|
||||
|
||||
UttAdv adv = adv ;
|
||||
|
||||
UttVP vp = let verb = vp.s ! VPInf ! Pos ! {g = Masc ; n = Sg ; p = P3}
|
||||
in {s = verb.fin ++ verb.a1.p1 ++ verb.inf ++ verb.a1.p2} ;
|
||||
|
||||
UttCN cn = {s = cn.s ! Sg ! Free ! Strong ! Nom ++ cn.comp ! Sg ! Nom} ;
|
||||
|
||||
UttCard card = {s = card.s ! Masc ! Nom };
|
||||
|
||||
UttAP ap = {s = ap.s ! Sg ! Neutr ! Strong ! Nom} ;
|
||||
|
||||
UttInterj i = i ;
|
||||
|
||||
NoPConj = {s = []} ;
|
||||
|
||||
PConjConj conj = {s = conj.s2} ;
|
||||
|
||||
NoVoc = {s = []} ;
|
||||
|
||||
VocNP np = {s = "," ++ np.s ! NCase Nom} ;
|
||||
}
|
||||
92
lib/src/icelandic/QuestionIce.gf
Normal file
92
lib/src/icelandic/QuestionIce.gf
Normal file
@@ -0,0 +1,92 @@
|
||||
concrete QuestionIce of Question = CatIce ** open ResIce, Prelude in {
|
||||
|
||||
lin
|
||||
QuestCl cl = {
|
||||
s = \\ten,ant,pol => table {
|
||||
QDir => cl.s ! ten ! ant ! pol ! OQuestion ;
|
||||
QIndir => "ef" ++ cl.s ! ten ! ant ! pol ! ODir
|
||||
}
|
||||
} ;
|
||||
|
||||
QuestVP ip vp =
|
||||
let
|
||||
cl = mkClause (ip.s ! Masc ! Nom) vp {g = Masc; n = ip.n; p = P3}
|
||||
|
||||
in {s = \\ten,ant,pol,_ => cl.s ! ten ! ant ! pol ! ODir} ;
|
||||
|
||||
QuestSlash ip cls = {
|
||||
s = \\ten,ant,pol,_ => ip.s ! Masc ! Nom ++ cls.s ! ten ! ant ! pol ! ODir ++ cls.c2.s
|
||||
} ;
|
||||
|
||||
QuestIComp icomp np =
|
||||
let
|
||||
cl = mkClause (np.s ! NCase Nom) (predV verbBe) np.a ;
|
||||
why = icomp.s ! np.a.n ! np.a.g ! Nom
|
||||
in {
|
||||
s = \\ten,ant,pol => table {
|
||||
QDir => why ++ cl.s ! ten ! ant ! pol ! OQuestion ;
|
||||
QIndir => why ++ cl.s ! ten ! ant ! pol ! ODir
|
||||
}
|
||||
} ;
|
||||
|
||||
QuestIAdv adv cl = {
|
||||
s = \\ten,ant,pol => table {
|
||||
QDir => adv.s ++ cl.s ! ten ! ant ! pol ! OQuestion ;
|
||||
QIndir => adv.s ++ "ef" ++ cl.s ! ten ! ant ! pol ! ODir
|
||||
}
|
||||
} ;
|
||||
|
||||
IdetCN idet cn = {
|
||||
s = \\_,c => idet.s ! cn.g ! c ++ cn.s ! idet.n ! Free ! Weak ! c ;
|
||||
n = idet.n
|
||||
} ;
|
||||
|
||||
IdetIP idet = {
|
||||
s = \\g,c => idet.s ! g ! c ;
|
||||
n = idet.n
|
||||
} ;
|
||||
|
||||
AdvIP ip adv = {
|
||||
s = \\g,c => ip.s ! g ! c ++ adv.s ;
|
||||
n = ip.n
|
||||
} ;
|
||||
|
||||
IdetQuant iquant num = {
|
||||
s = \\g,c => iquant.s ! num.n ! g ! c ++ num.s ! g ! c ;
|
||||
n = num.n
|
||||
} ;
|
||||
|
||||
-- for feminine and neuter version, see Extra
|
||||
PrepIP prep ip = {
|
||||
s = prep.s ++ ip.s ! Masc ! prep.c
|
||||
} ;
|
||||
|
||||
AdvIAdv iadv adv = {s = iadv.s ++ adv.s} ;
|
||||
|
||||
CompIAdv iadv = {s = \\_,_,_ => iadv.s} ;
|
||||
|
||||
CompIP ip = {s = \\_,_,_ => ip.s ! Masc ! Nom} ;
|
||||
|
||||
lincat
|
||||
QVP = ResIce.VP ;
|
||||
lin
|
||||
ComplSlashIP vps ip = {
|
||||
s = vps.s ;
|
||||
indObj = vps.indObj ;
|
||||
dirObj = \\a => ip.s ! a.g ! vps.c2.c ++ vps.dirObj ! a ;
|
||||
p = vps.p ;
|
||||
a2 = vps.a2 ;
|
||||
indShift = vps.indShift ;
|
||||
dirShift = vps.dirShift
|
||||
} ;
|
||||
|
||||
AdvQVP vp iadv = vp ** {dirObj = \\a => vp.dirObj ! a ++ iadv.s} ;
|
||||
|
||||
AddAdvQVP qvp iadv = qvp ** {dirObj = \\a => qvp.dirObj ! a ++ iadv.s} ;
|
||||
|
||||
QuestQVP ip vp =
|
||||
let
|
||||
cl = mkClause (ip.s ! Masc ! Nom) vp {g = Masc; n = ip.n; p = P3}
|
||||
in { s = \\ten,ant,pol,_ => cl.s ! ten ! ant ! pol ! ODir } ;
|
||||
|
||||
}
|
||||
2
lib/src/icelandic/README.md
Normal file
2
lib/src/icelandic/README.md
Normal file
@@ -0,0 +1,2 @@
|
||||
# GF-Icelandic
|
||||
# GF-Icelandic
|
||||
25
lib/src/icelandic/RelativeIce.gf
Normal file
25
lib/src/icelandic/RelativeIce.gf
Normal file
@@ -0,0 +1,25 @@
|
||||
concrete RelativeIce of Relative = CatIce ** open ResIce in {
|
||||
|
||||
lin
|
||||
RelCl cl = {
|
||||
s = \\ten,ant,pol,_ => "þannig að" ++ cl.s ! ten ! ant ! pol ! ODir
|
||||
} ;
|
||||
|
||||
RelVP rp vp = {
|
||||
s = \\ten,ant,pol,agr =>
|
||||
let
|
||||
cl = mkClause rp.s vp agr
|
||||
in
|
||||
cl.s ! ten ! ant ! pol ! ODir
|
||||
} ;
|
||||
|
||||
RelSlash rp cls = {
|
||||
s = \\ten,ant,pol,agr => rp.s ++ cls.s ! ten ! ant ! pol ! ODir ++ cls.c2.s
|
||||
} ;
|
||||
|
||||
IdRP = {s = "sem" } ;
|
||||
|
||||
FunRP prep np rp = {
|
||||
s = prep.s ++ np.s ! NCase prep.c ++ rp.s
|
||||
} ;
|
||||
}
|
||||
413
lib/src/icelandic/ResIce.gf
Normal file
413
lib/src/icelandic/ResIce.gf
Normal file
@@ -0,0 +1,413 @@
|
||||
--1 Icelandic auxiliary operations.
|
||||
|
||||
-- This module contains operations that are needed to make the
|
||||
-- resource syntax work. To define everything that is needed to
|
||||
-- implement $Test$, it moreover contains regular lexical
|
||||
-- patterns needed for $Lex$.
|
||||
|
||||
resource ResIce = ParamX ** open Prelude in {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
--------------------------------------------
|
||||
--PARAMETERS DEFINITIONS
|
||||
--------------------------------------------
|
||||
|
||||
-- Some parameters, such as $Number$, are inherited from $ParamX$.
|
||||
|
||||
--2 For $Noun$
|
||||
|
||||
param
|
||||
|
||||
-- These are the standard four-value case and three-value gender as needed when inflecting nouns.
|
||||
Case = Nom | Acc | Dat | Gen ;
|
||||
Gender = Masc | Fem | Neutr ;
|
||||
|
||||
-- There is no indefinite article in Icelandic, i.e. "a house" will "hús". The definite
|
||||
-- article on the other hand can be either freestanding or used as a suffix (for all genders).
|
||||
-- The freestanding version is rare and can only be followed by an adjective and the suffix
|
||||
-- depends on gender and the ending of the noun.
|
||||
|
||||
Species = Free | Suffix ;
|
||||
|
||||
NPCase = NCase Case | NPPoss Number Gender Case ;
|
||||
|
||||
--2 For $Verb$
|
||||
|
||||
Mood = Indicative | Subjunctive ;
|
||||
|
||||
Voice = Active | Middle ;
|
||||
|
||||
PForm = PWeak Number Gender Case | PStrong Number Gender Case | PPres ;
|
||||
|
||||
VForm =
|
||||
VInf
|
||||
| VPres Voice Mood Number Person
|
||||
| VPast Voice Mood Number Person
|
||||
| VImp Voice Number
|
||||
;
|
||||
|
||||
VPForm = VPInf
|
||||
| VPImp
|
||||
| VPMood Tense Anteriority -- is this a describing name ?
|
||||
;
|
||||
|
||||
--2 For $Adjective$
|
||||
|
||||
Declension = Weak | Strong ;
|
||||
|
||||
AForm =
|
||||
APosit Declension Number Gender Case
|
||||
| ACompar Number Gender Case
|
||||
| ASuperl Declension Number Gender Case
|
||||
;
|
||||
|
||||
--2 For $Sentence$
|
||||
|
||||
Order = ODir | OQuestion ;
|
||||
|
||||
--2 For $Numerals$
|
||||
|
||||
CardOrd = NOrd Number Gender Case | NCard Number Gender Case ; -- only "einn" ("one") inflects for gender as a cardinal
|
||||
|
||||
--------------------------------------------
|
||||
--TYPE DEFINITIONS + WORST-CASE CONSTRUCTORS
|
||||
--------------------------------------------
|
||||
|
||||
-- For $Lex$.
|
||||
oper
|
||||
-- Agreement of noun phrases has three parts
|
||||
Agr : PType = {g : Gender ; n : Number ; p : Person} ;
|
||||
|
||||
gennumperToAgr : Gender -> Number -> Person -> Agr =
|
||||
\g,n,p -> {g = g ; n = n ; p = p} ;
|
||||
|
||||
caseList : (_,_,_,_ : Str) -> Case => Str =
|
||||
\n,a,d,g -> table {
|
||||
Nom => n ;
|
||||
Acc => a ;
|
||||
Dat => d ;
|
||||
Gen => g
|
||||
} ;
|
||||
|
||||
persList : (_,_,_ : Str) -> Person => Str =
|
||||
\p1,p2,p3 -> table {
|
||||
P1 => p1 ;
|
||||
P2 => p2 ;
|
||||
P3 => p3
|
||||
} ;
|
||||
|
||||
npcaseToCase : NPCase -> Case = \npc -> case npc of {
|
||||
NCase c => c ;
|
||||
NPPoss _ _ c => c
|
||||
} ;
|
||||
|
||||
-- For $Nouns$
|
||||
|
||||
N : Type = {
|
||||
s : Number => Species => Case => Str ;
|
||||
g : Gender
|
||||
} ;
|
||||
|
||||
NP : Type = {
|
||||
s : NPCase => Str ;
|
||||
a : Agr ;
|
||||
isPron : Bool
|
||||
} ;
|
||||
|
||||
-- For $Adjectives$
|
||||
|
||||
A : Type = {
|
||||
s : AForm => Str ;
|
||||
adv : Str
|
||||
} ;
|
||||
|
||||
-- For $Verb$.
|
||||
|
||||
V : Type = {
|
||||
s : VForm => Str ;
|
||||
p : PForm => Str ;
|
||||
sup : Voice => Str
|
||||
} ;
|
||||
|
||||
mkVoice : Voice -> Str -> Str = \v,s ->
|
||||
case v of {
|
||||
Active => s ;
|
||||
Middle => case s of {
|
||||
base + "ur" => base + "st" ;
|
||||
base + "r" => base + "st" ;
|
||||
base + "ð" => base + "st" ;
|
||||
base + "ðu" => base + "stu" ;
|
||||
_ => s + "st"
|
||||
}
|
||||
} ;
|
||||
|
||||
-- is this needed for anything else but the auxiliary verbs below?
|
||||
mkVerb : (x1,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,x59 : Str) -> V =
|
||||
\fljúga1,flýg,flýgur2,flýgur3,fljúgum,fljúgið,fljúga2,flaug1,flaugst,flaug2,flugum,fluguð,flugu,
|
||||
fljúgi1,fljúgir,fljúgi3,fljúgumS,fljúgiðS,fljúgi,flygi1,flygir,flygi2,flygjum,flygjuð,flygju,
|
||||
fljúgðu,fljúgið,fljúgandi,floginn,sgMascAcc,sgMascDat,sgMascGen,sgFemNom,sgFemAcc,sgFemDat,sgFemGen,
|
||||
sgNeutNom,sgNeutAcc,sgNeutDat,sgNeutGen,plMascNom,plMascAcc,plMascDat,plMascGen,
|
||||
plFemNom,plFemAcc,plFemDat,plFemGen,plNeutNom,plNeutAcc,plNeutDat,plNeutGen,
|
||||
weakSgMascNom,weakSgMascAccDatGen,weakSgFemNom,weakSgFemAccDatGen,weakSgNeut,weakPl,flogið -> {
|
||||
s = table {
|
||||
VInf => fljúga1 ;
|
||||
VPres v Indicative Sg P1 => mkVoice v flýg ;
|
||||
VPres v Indicative Sg P2 => mkVoice v flýgur2 ;
|
||||
VPres v Indicative Sg P3 => mkVoice v flýgur3 ;
|
||||
VPres v Indicative Pl P1 => mkVoice v fljúgum ;
|
||||
VPres v Indicative Pl P2 => mkVoice v fljúgið ;
|
||||
VPres v Indicative Pl P3 => mkVoice v fljúga2 ;
|
||||
VPast v Indicative Sg P1 => mkVoice v flaug1 ;
|
||||
VPast v Indicative Sg P2 => mkVoice v flaugst ;
|
||||
VPast v Indicative Sg P3 => mkVoice v flaug2 ;
|
||||
VPast v Indicative Pl P1 => mkVoice v flugum ;
|
||||
VPast v Indicative Pl P2 => mkVoice v fluguð ;
|
||||
VPast v Indicative Pl P3 => mkVoice v flugu ;
|
||||
VPres v Subjunctive Sg P1 => mkVoice v fljúgi1 ;
|
||||
VPres v Subjunctive Sg P2 => mkVoice v fljúgir ;
|
||||
VPres v Subjunctive Sg P3 => mkVoice v fljúgi3 ;
|
||||
VPres v Subjunctive Pl P1 => mkVoice v fljúgumS ;
|
||||
VPres v Subjunctive Pl P2 => mkVoice v fljúgiðS ;
|
||||
VPres v Subjunctive Pl P3 => mkVoice v fljúgi ;
|
||||
VPast v Subjunctive Sg P1 => mkVoice v flygi1 ;
|
||||
VPast v Subjunctive Sg P2 => mkVoice v flygir ;
|
||||
VPast v Subjunctive Sg P3 => mkVoice v flygi2 ;
|
||||
VPast v Subjunctive Pl P1 => mkVoice v flygjum ;
|
||||
VPast v Subjunctive Pl P2 => mkVoice v flygjuð ;
|
||||
VPast v Subjunctive Pl P3 => mkVoice v flygju ;
|
||||
VImp v Sg => mkVoice v fljúgðu ;
|
||||
VImp v Pl => mkVoice v fljúgið
|
||||
} ;
|
||||
p = table {
|
||||
PWeak Sg Masc Nom => weakSgMascNom ;
|
||||
PWeak Sg Masc _ => weakSgMascAccDatGen ;
|
||||
PWeak Sg Fem Nom => weakSgFemNom ;
|
||||
PWeak Sg Fem _ => weakSgFemAccDatGen ;
|
||||
PWeak Sg Neutr _ => weakSgNeut ;
|
||||
PWeak Pl _ _ => weakPl ;
|
||||
PStrong Sg Masc c => caseList floginn sgMascAcc sgMascDat sgMascGen ! c ;
|
||||
PStrong Sg Fem c => caseList sgFemNom sgFemAcc sgFemDat sgFemGen ! c ;
|
||||
PStrong Sg Neutr c => caseList sgNeutNom sgNeutAcc sgNeutDat sgNeutGen ! c ;
|
||||
PStrong Pl Masc c => caseList plMascNom plMascAcc plMascDat plMascGen ! c ;
|
||||
PStrong Pl Fem c => caseList plFemNom plFemAcc plFemDat plFemGen ! c ;
|
||||
PStrong Pl Neutr c => caseList plNeutNom plNeutAcc plNeutDat plNeutGen ! c ;
|
||||
PPres => fljúgandi
|
||||
} ;
|
||||
sup =\\v => mkVoice v flogið
|
||||
} ;
|
||||
|
||||
VP : Type = {
|
||||
s : VPForm => Polarity => Agr => {
|
||||
fin : Str ;
|
||||
inf : Str ;
|
||||
a1 : Str * Str -- p1 : with inf - ég hef ekki elskað þig
|
||||
-- p2 : without inf - ég elska þig ekki (obj shift) or ég elska ekki Gunnu (no shift)
|
||||
} ;
|
||||
p : PForm => Str ; -- past and present participles
|
||||
indObj : Agr => Str ; -- Indirect object
|
||||
dirObj : Agr => Str ; -- Direct object
|
||||
a2 : Str ; -- Bound adverbials
|
||||
indShift : Bool ; -- indicates if the indirect object is shifted, e.g. if it is an unstressed pronoun (hann/hún/það/ég/þú/sig)
|
||||
dirShift : Bool -- indicates if the direct object (and the indirect) is shifted, e.g. if its an unstressed pronoun
|
||||
} ;
|
||||
|
||||
infVP : VP -> Str = \vp -> infVPPlus vp VPInf Pos {g = Neutr; n = Sg ; p = P3} ;
|
||||
|
||||
infVPPlus : VP -> VPForm -> Polarity -> Agr -> Str = \vp,vpform,pol,ag ->
|
||||
let
|
||||
s = vp.s ! vpform ! pol ! ag ;
|
||||
ind = vp.indObj ! ag ;
|
||||
dir = vp.dirObj ! ag
|
||||
in case <vp.indShift,vp.dirShift> of {
|
||||
<False,False> => s.fin ++ s.a1.p1 ++ s.inf ++ s.a1.p2 ++ ind ++ dir ++ vp.a2 ;
|
||||
<True,False> => s.fin ++ s.a1.p1 ++ s.inf ++ ind ++ s.a1.p2 ++ dir ++ vp.a2 ;
|
||||
<_,True> => s.fin ++ s.a1.p1 ++ s.inf ++ ind ++ dir ++ s.a1.p2 ++ vp.a2
|
||||
} ;
|
||||
|
||||
predV : V -> VP = \v -> {
|
||||
s = \\vpform,pol,agr => case vpform of {
|
||||
VPInf => vf (v.s ! VInf) [] (negation pol) False ;
|
||||
VPImp => vf (v.s ! VImp Active agr.n) [] (negation pol) False ;
|
||||
VPMood ten ant => vff v ten ant pol agr
|
||||
} ;
|
||||
p = \\pform => v.p ! pform ;
|
||||
indObj = \\_ => [] ;
|
||||
dirObj = \\_ => [] ;
|
||||
a2 = [] ;
|
||||
indShift = False ;
|
||||
dirShift = False
|
||||
} ;
|
||||
|
||||
predVV : { s : VForm => Str ; p : PForm => Str ; sup : Voice => Str ; c2 : Preposition } -> VP = \vv ->
|
||||
predV {s = vv.s ; p = vv.p ; sup = vv.sup} ;
|
||||
|
||||
|
||||
negation : Polarity -> Str = \pol -> case pol of {
|
||||
Pos => [] ;
|
||||
Neg => "ekki"
|
||||
} ;
|
||||
|
||||
vf : Str -> Str -> Str -> Bool -> { fin,inf : Str ; a1 : Str * Str } =\fin,inf,a1,hasInf -> {
|
||||
fin = fin ;
|
||||
inf = inf ;
|
||||
a1 = case hasInf of {
|
||||
True => <a1,[]> ;
|
||||
False => <[],a1>
|
||||
} ;
|
||||
} ;
|
||||
|
||||
vff : V -> Tense -> Anteriority -> Polarity -> Agr -> {fin,inf : Str ; a1 : Str * Str}
|
||||
=\v,ten,ant,pol,agr -> case <ten,ant> of {
|
||||
-- hann sefur []/ekki - he []/doesn't sleep
|
||||
<Pres,Simul> => vf (v.s ! VPres Active Indicative agr.n agr.p) [] (negation pol) False;
|
||||
-- hann hefur []/ekki sofið - he has/hasn't slept
|
||||
<Pres,Anter> => vf (verbHave.s ! VPres Active Indicative agr.n agr.p) (v.sup ! Active) (negation pol) True ;
|
||||
-- hann svaf []/ekki - he []/didn't sleep
|
||||
<Past,Simul> => vf (v.s ! VPast Active Indicative agr.n agr.p) [] (negation pol) False ;
|
||||
-- hann hafði []/ekki sofið - he had/hadn't slept
|
||||
<Past,Anter> => vf (verbHave.s ! VPast Active Indicative agr.n agr.p) (v.sup ! Active) (negation pol) True ;
|
||||
-- hann mun []/ekki sofa - he will/won't sleep
|
||||
<Fut,Simul> => vf (verbWill.s ! VPres Active Indicative agr.n agr.p) (v.s ! VInf) (negation pol) True ;
|
||||
-- hann mun []/ekki hafa sofið - 'he will/won't have slept'
|
||||
<Fut,Anter> => vf (verbWill.s ! VPres Active Indicative agr.n agr.p) (verbHave.s ! VInf ++ v.sup ! Active) (negation pol) True ;
|
||||
-- hann myndi []/ekki sofa 'he would/wouldn't sleep'
|
||||
<Cond,Simul> => vf (verbWill.s ! VPast Active Subjunctive agr.n agr.p) (v.s ! VInf) (negation pol) True ;
|
||||
-- hann myndi []/ekki hafa sofið 'he would/wouldn't have slept'
|
||||
<Cond,Anter> => vf (verbWill.s ! VPast Active Subjunctive agr.n agr.p) (verbHave.s ! VInf ++ v.sup ! Active) (negation pol) True
|
||||
} ;
|
||||
|
||||
-- Auxilary verbs --
|
||||
|
||||
-- these have no all been defined in other places. I think they should be moved or redefined somehow..
|
||||
|
||||
-- Auxilary verbs do not forma special group in Icelandic. But many of them do have or rather dont have
|
||||
-- the same forms as other verbs. As an example the verb "að vera" (e. to be) does not have the past
|
||||
-- participle nor does it exist in the middle voice or passive voice. Therefore, I will (for the time being)
|
||||
-- fill in the remaining with the infinitive "vera". This goes also for the rest of the auxileries.
|
||||
|
||||
verbBe : V = mkVerb "vera" "er" "ert" "er" "erum" "eruð" "eru" "var" "varst" "var" "vorum" "voruð" "voru"
|
||||
"sé" "sért" "sé" "séum" "séuð" "séu" "væri" "værir" "væri" "værum" "voruð" "væru"
|
||||
"vertu" "verið" "verandi" "vera" "vera" "vera" "vera" "vera" "vera" "vera" "vera"
|
||||
"vera" "vera" "vera" "vera" "vera" "vera" "vera" "vera"
|
||||
"vera" "vera" "vera" "vera" "vera" "vera" "vera" "vera"
|
||||
"vera" "vera" "vera" "vera" "vera" "vera" "verið" ;
|
||||
|
||||
verbBecome : V = mkVerb "verða" "verð" "verður" "verður" "verðum" "verðið" "verða" "varð" "varðst" "varð" "urðum" "urðuð" "urðu"
|
||||
"verði" "verðir" "verði" "verðum" "verðið" "verði" "yrði" "yrðir" "yrði" "yrðum" "yrðuð" "yrðu"
|
||||
"verðið" "verðið" "verðandi" "orðinn" "orðinn" "orðnum" "orðsins" "orðin" "orðna" "orðinni" "orðinnar"
|
||||
"orðið" "orðið" "orðnu" "orðins" "orðnir" "orðna" "orðnum" "orðinna" "orðnar" "orðnar" "orðnum" "orðinna"
|
||||
"orðin" "orðin" "orðnum" "orðinna" "orðni" "orðna" "orðna" "orðnu" "orðna" "orðnu" "orðið" ;
|
||||
|
||||
verbHave : V = mkVerb "hafa" "hef" "hefur" "hefur" "höfum" "hafið" "hafa" "hafði" "hafðir" "hafði" "höfðum" "höfðuð" "höfðu"
|
||||
"hafi" "hafir" "hafi" "höfðum" "hafið" "hafi" "hefði" "hefðir" "hefði" "hefðum" "hefðuð" "hefðu"
|
||||
"hafðu" "hafið" "hafandi" "hafður" "hafðan" "höfðum" "hafðs" "höfð" "hafða" "hafðri" "hafðrar" "haft"
|
||||
"haft" "höfðu" "hafðs" "hafðir" "hafða" "höfðum" "hafðra" "hafðar" "hafðar" "höfðum" "hafðra" "höfð"
|
||||
"höfð" "höfðum" "hafðra" "hafa" "hafa" "hafa" "hafa" "hafa" "hafa" "haft" ;
|
||||
|
||||
verbWill : V = mkVerb "munu" "mun" "munt" "mun" "munum" "munuð" "munu" "munu" "munu" "munu" "munu" "munu" "munu"
|
||||
"muni" "munir" "muni" "munum" "munið" "muni" "myndi" "myndir" "myndi" "myndum" "mynduð" "myndu"
|
||||
"munu" "munu" "munu" "munu" "munu" "munu" "munu" "munu" "munu" "munu" "munu" "munu"
|
||||
"munu" "munu" "munu" "munu" "munu" "munu" "munu" "munu" "munu" "munu" "munu" "munu"
|
||||
"munu" "munu" "munu" "munu" "munu" "munu" "munu" "munu" "munu" "munu" ;
|
||||
|
||||
-- Not really an axuilary verb but then again there is no exclusive club of axuilary verbs in Icelandic (or so have I been told).
|
||||
-- verbLet is nevertheless needed in Idiom. - or is it?
|
||||
verbLet : V = mkVerb "láta" "læt" "lætur" "lætur" "látum" "látið" "láta" "lét" "lést" "lét" "létum" "létuð" "létu"
|
||||
"láti" "látir" "láti" "látum" "látið" "láti" "léti" "létir" "léti" "létum" "létuð" "létu" "láttu" "látið"
|
||||
"látandi" "látinn" "látinn" "látnum" "látins" "látin" "látna" "látinni" "látinnar" "látið" "látið"
|
||||
"látnu" "látins" "látnir" "látna" "látnum" "látinna" "látnar" "látnar" "látnum" "látinnar" "látin"
|
||||
"látin" "látnum" "látinna" "látni" "látna" "látna" "látnu" "látna" "látnu" "látið" ;
|
||||
|
||||
Preposition : Type = {
|
||||
s : Str ;
|
||||
c : Case
|
||||
} ;
|
||||
|
||||
Cl : Type = {
|
||||
s : Tense => Anteriority => Polarity => Order => Str
|
||||
} ;
|
||||
|
||||
mkClause : Str -> VP -> Agr -> Cl = \subj,vp,agr -> {
|
||||
s = \\ten,ant,pol,order =>
|
||||
let
|
||||
verb = vp.s ! VPMood ten ant ! pol ! agr ;
|
||||
ind = vp.indObj ! agr ;
|
||||
dir = vp.dirObj ! agr ;
|
||||
adv = vp.a2 ;
|
||||
finInf = verb.fin ++ verb.a1.p1 ++ verb.inf ;
|
||||
finSubjInf = verb.fin ++ subj ++ verb.a1.p1 ++ verb.inf
|
||||
in case <order,vp.indShift,vp.dirShift> of {
|
||||
<ODir,False,False> => subj ++ finInf ++ verb.a1.p2 ++ ind ++ dir ++ adv ;
|
||||
<ODir,True,False> => subj ++ finInf ++ ind ++ verb.a1.p2 ++ dir ++ adv ;
|
||||
<Odir,_,True> => subj ++ finInf ++ ind ++ dir ++ verb.a1.p2 ++ adv ;
|
||||
<OQuestion,False,False> => finSubjInf ++ verb.a1.p2 ++ ind ++ dir ++ adv ;
|
||||
<OQuestion,True,False> => finSubjInf ++ ind ++ verb.a1.p2 ++ dir ++ adv ;
|
||||
<OQuestion,_,True> => finSubjInf ++ ind ++ dir ++ verb.a1.p2 ++ adv
|
||||
} ;
|
||||
} ;
|
||||
|
||||
|
||||
-- 2 Pronouns
|
||||
|
||||
Pron : Type = {
|
||||
s : NPCase => Str ;
|
||||
a : Agr
|
||||
} ;
|
||||
|
||||
mkPronPers : (ég,mig,mér,mín,minn1,minn2,mínum,míns,mínF,mína,minni,minnar,mitt1,mitt2,mínu,mínsN,mínir,mínaPl,mínumPl,minnaPl,mínar1,mínar2,mínPl1,mínPl2 : Str) -> Gender -> Number -> Person -> Pron =
|
||||
\ég,mig,mér,mín,minn1,minn2,mínum,míns,mínF,mína,minni,minnar,mitt1,mitt2,mínu,mínsN,mínir,mínaPl,mínumPl,minnaPl,mínar1,mínar2,mínPl1,mínPl2,g,n,p -> {
|
||||
s = table {
|
||||
NCase c => caseList ég mig mér mín ! c ;
|
||||
NPPoss Sg Masc c => caseList minn1 minn2 mínum míns ! c ;
|
||||
NPPoss Pl Masc c => caseList mínir mínaPl mínumPl minnaPl ! c ;
|
||||
NPPoss Sg Fem c => caseList mínF mína minni minnar ! c ;
|
||||
NPPoss Pl Fem c => caseList mínar1 mínar2 mínumPl minnaPl ! c ;
|
||||
NPPoss Sg Neutr c => caseList mitt1 mitt2 mínu mínsN ! c ;
|
||||
NPPoss Pl Neutr c => caseList mínPl1 mínPl2 mínumPl minnaPl ! c
|
||||
} ;
|
||||
a = gennumperToAgr g n p ;
|
||||
} ;
|
||||
|
||||
reflPron : Person -> Number -> Gender -> Case -> Str =
|
||||
\p,n,g,c -> case <p,n,g,c> of {
|
||||
<P1,Sg,_,Nom> => "ég" ;
|
||||
<P1,Sg,_,Acc> => "mig" ;
|
||||
<P1,Sg,_,Dat> => "mér" ;
|
||||
<P1,Sg,_,Gen> => "mín" ;
|
||||
<P1,Pl,_,Nom> => "við" ;
|
||||
<P1,Pl,_,Acc> => "okkur" ;
|
||||
<P1,Pl,_,Dat> => "okkur" ;
|
||||
<P1,Pl,_,Gen> => "okkar" ;
|
||||
<P2,Sg,_,Nom> => "þú" ;
|
||||
<P2,Sg,_,Acc> => "þig" ;
|
||||
<P2,Sg,_,Dat> => "þér" ;
|
||||
<P2,Sg,_,Gen> => "þín" ;
|
||||
<P2,Pl,_,Nom> => "þið" ;
|
||||
<P2,Pl,_,Acc> => "ykkur" ;
|
||||
<P2,Pl,_,Dat> => "ykkur" ;
|
||||
<P2,Pl,_,Gen> => "ykkar" ;
|
||||
<_,Sg,Masc,Nom> => "hann" ++ "sjálfur" ;
|
||||
<_,Pl,Masc,Nom> => "þeir" ++ "sjálfir" ;
|
||||
<_,Sg,Fem,Nom> => "hún" ++ "sjálf" ;
|
||||
<_,Pl,Fem,Nom> => "þær" ++ "sjálfar" ;
|
||||
<_,Sg,Neutr,Nom> => "það" ++ "sjálft" ;
|
||||
<_,Pl,Neutr,Nom> => "þau" ++ "sjálf" ;
|
||||
<_,_,_,Acc> => "sig" ;
|
||||
<_,_,_,Dat> => "sér" ;
|
||||
<_,_,_,Gen> => "sín"
|
||||
};
|
||||
|
||||
-- thoughts on "or" conjugation with agreement in gender
|
||||
conjGender : Gender -> Gender -> Gender = \g,h -> case <g,h> of {
|
||||
<Masc,Masc> => Masc;
|
||||
<Fem,Fem> => Fem;
|
||||
_ => Neutr
|
||||
};
|
||||
|
||||
conjAgr : (_,_ : Agr) -> Agr = \a,b -> {
|
||||
g = conjGender a.g b.g ;
|
||||
n = conjNumber a.n b.n ;
|
||||
p = conjPerson a.p b.p
|
||||
} ;
|
||||
}
|
||||
90
lib/src/icelandic/SentenceIce.gf
Normal file
90
lib/src/icelandic/SentenceIce.gf
Normal file
@@ -0,0 +1,90 @@
|
||||
concrete SentenceIce of Sentence = CatIce ** open Prelude, ResIce in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
PredVP np vp = mkClause (np.s ! NCase Nom) vp np.a ;
|
||||
|
||||
PredSCVP sc vp = mkClause sc.s vp {g = Neutr; n = Sg ; p = P3} ;
|
||||
|
||||
--2 Clauses missing object noun phrases
|
||||
|
||||
SlashVP np vps = mkClause (np.s ! NCase Nom) vps np.a ** {
|
||||
c2 = vps.c2
|
||||
} ;
|
||||
|
||||
AdvSlash cls adv = {
|
||||
s =\\ten,ant,pol,ord => cls.s ! ten ! ant ! pol ! ord ++ adv.s ;
|
||||
c2 = cls.c2
|
||||
} ;
|
||||
|
||||
SlashPrep cl prep = cl ** {
|
||||
c2 = prep
|
||||
} ;
|
||||
|
||||
SlashVS np vs ssl = {
|
||||
s = \\ten,ant,pol,ord => let cl = mkClause (np.s ! NCase Nom) (predV vs) np.a
|
||||
in cl.s ! ten ! ant ! pol ! ord ++ ssl.s ! ord ;
|
||||
c2 = ssl.c2
|
||||
} ;
|
||||
|
||||
--2 Imperatives
|
||||
|
||||
-- VP -> Imp
|
||||
ImpVP vp = {s =\\pol,num =>
|
||||
let
|
||||
agr = gennumperToAgr Masc num P2 ;
|
||||
ind = vp.indObj ! agr ;
|
||||
dir = vp.dirObj ! agr ;
|
||||
adv = vp.a2 ;
|
||||
verb = vp.s ! VPImp ! pol ! agr
|
||||
in case <vp.indShift,vp.dirShift> of {
|
||||
<False,False> => verb.fin ++ verb.a1.p2 ++ ind ++ dir ++ adv ;
|
||||
<True,False> => verb.fin ++ ind ++ verb.a1.p2 ++ dir ++ adv ;
|
||||
<_,True> => verb.fin ++ ind ++ dir ++ verb.a1.p2 ++ adv
|
||||
} ;
|
||||
} ;
|
||||
|
||||
--2 Embedded sentences
|
||||
|
||||
EmbedS ss = {s = "að" ++ ss.s} ;
|
||||
|
||||
EmbedQS qs = {s = qs.s ! QDir} ;
|
||||
|
||||
EmbedVP vp = {s = "að" ++ infVP vp} ;
|
||||
|
||||
--2 Sentences
|
||||
|
||||
UseCl t p cl = {
|
||||
s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! ODir
|
||||
} ;
|
||||
|
||||
UseRCl t p rcl = {
|
||||
s = \\agr => t.s ++ p.s ++ rcl.s ! t.t ! t.a ! p.p ! agr ;
|
||||
c = NCase Nom
|
||||
} ;
|
||||
|
||||
UseQCl t p qcl = {
|
||||
s = \\qf => t.s ++ p.s ++ qcl.s ! t.t ! t.a ! p.p ! qf
|
||||
} ;
|
||||
|
||||
UseSlash t p cls = {
|
||||
s = \\o => cls.s ! t.t ! t.a ! p.p ! o ;
|
||||
c2 = cls.c2
|
||||
} ;
|
||||
|
||||
|
||||
AdvS adv s = {s = adv.s ++ s.s} ;
|
||||
|
||||
ExtAdvS adv s = {s = adv.s ++ "," ++ s.s} ;
|
||||
|
||||
SSubjS sx subj sy = {s = sx.s ++ subj.s ++ sy.s} ;
|
||||
|
||||
-- S -> RS -> S
|
||||
-- TODO : Add Agr to S and Cl, otherwise RS will always
|
||||
-- have the same gender, person and number.
|
||||
-- This is possible only a problem when numbers differ..
|
||||
-- just add another function in ExtraIce?
|
||||
RelS s rs = { s = s.s ++ rs.s ! gennumperToAgr Neutr Sg P3 } ;
|
||||
}
|
||||
292
lib/src/icelandic/StructuralIce.gf
Normal file
292
lib/src/icelandic/StructuralIce.gf
Normal file
@@ -0,0 +1,292 @@
|
||||
concrete StructuralIce of Structural = CatIce **
|
||||
open MorphoIce, ResIce, ParadigmsIce, MakeStructuralIce, IrregIce,
|
||||
(C = ConstructX), Prelude in {
|
||||
|
||||
lin
|
||||
possess_Prep = mkPrep "af" dative ;
|
||||
always_AdV = mkAdV "alltaf" ;
|
||||
above_Prep = mkPrep "ofan" genitive ;
|
||||
after_Prep = mkPrep "eftir" dative ;
|
||||
almost_AdA = mkAdA "næstum" ;
|
||||
before_Prep = mkPrep "fyrir" dative ;
|
||||
behind_Prep = mkPrep "fyrir aftan" dative ;
|
||||
between_Prep = mkPrep "á milli" genitive ;
|
||||
almost_AdN = mkAdN (lin CAdv ({s = "næstum" ; p = "því" })) ;
|
||||
although_Subj = ss "þó" ;
|
||||
by8agent_Prep = mkPrep "hjá" dative ;
|
||||
by8means_Prep = mkPrep "hjá" dative ;
|
||||
during_Prep = mkPrep "á meðan" nominative ;
|
||||
every_Det = {
|
||||
s = table {
|
||||
Masc => caseList "sérhver" "sérhvern" "sérhverjum" "sérhvers" ;
|
||||
Fem => caseList "sérhver" "sérhverja" "sérhverri" "sérhverrar" ;
|
||||
Neutr => caseList "sérhvert" "sérhvert" "sérhverju" "sérhvers"
|
||||
} ;
|
||||
pron = \\_,_ => [] ;
|
||||
n = Sg ;
|
||||
b = Free ;
|
||||
d = Strong
|
||||
} ;
|
||||
everywhere_Adv = mkAdv "alls staðar" ;
|
||||
few_Det = {
|
||||
s = table {
|
||||
Masc => caseList "fáeinir" "fáeina" "fáeinum" "fáeinna" ;
|
||||
Fem => caseList "fáeinar" "fáeinar" "fáeinum" "fáeinna" ;
|
||||
Neutr => caseList "fáein" "fáein" "fáeinum" "fáeinna"
|
||||
} ;
|
||||
pron = \\_,_ => [] ;
|
||||
n = Pl ;
|
||||
b = Free ;
|
||||
d = Strong
|
||||
} ;
|
||||
for_Prep = mkPrep "fyrir" dative ;
|
||||
from_Prep = mkPrep "frá" dative ;
|
||||
here_Adv = mkAdv "hérna" ;
|
||||
here7to_Adv = mkAdv ["hingað"] ;
|
||||
here7from_Adv = mkAdv ["héðan"] ;
|
||||
in8front_Prep = mkPrep ["fyrir framan"] accusative ;
|
||||
in_Prep = mkPrep "í" dative ;
|
||||
no_Utt = ss "nei" ;
|
||||
part_Prep = mkPrep "af" dative ;
|
||||
quite_Adv = mkAdv "alveg" ;
|
||||
someSg_Det = {
|
||||
s = table {
|
||||
Masc => caseList "nokkur" "nokkurn" "nokkrum" "nokkurs" ;
|
||||
Fem => caseList "nokkur" "nokkra" "nokkurri" "nokkurrar" ;
|
||||
Neutr => caseList "nokkurt" "nokkurt" "nokkru" "nokkurs"
|
||||
} ;
|
||||
pron = \\_,_ => [] ;
|
||||
n = Sg ;
|
||||
b = Free ;
|
||||
d = Strong
|
||||
} ;
|
||||
somePl_Det = {
|
||||
s = table {
|
||||
Masc => caseList "nokkrir" "nokkra" "nokkrum" "nokkurra" ;
|
||||
Fem => caseList "nokkrar" "nokkrar" "nokkrum" "nokkurra" ;
|
||||
Neutr => caseList "nokkur" "nokkur" "nokkrum" "nokkurra"
|
||||
} ;
|
||||
pron = \\_,_ => [] ;
|
||||
n = Pl ;
|
||||
b = Free ;
|
||||
d = Strong
|
||||
} ;
|
||||
through_Prep = mkPrep "gegnum" accusative ;
|
||||
too_AdA = mkAdA "líka" ;
|
||||
to_Prep = mkPrep "til" genitive ;
|
||||
very_AdA = mkAdA "mjög" ;
|
||||
without_Prep = mkPrep "án" genitive ;
|
||||
yes_Utt = ss "já" ;
|
||||
at_least_AdN = mkAdN (lin CAdv ({s = "að minnsta" ; p = "kosti"})) ;
|
||||
at_most_AdN = mkAdN (lin CAdv ({s = "í mesta" ; p = "lagi"})) ;
|
||||
except_Prep = mkPrep "nema" nominative;
|
||||
|
||||
so_AdA = mkAdA "svo" ;
|
||||
somewhere_Adv = mkAdv "einhvers staðar" ;
|
||||
there_Adv = mkAdv "þarna" ;
|
||||
therefore_PConj = ss "þar af leiðandi" ;
|
||||
|
||||
-- To my knowledge there is no special difference when reffering to a specific known object (or person)
|
||||
-- that is far away or close (emotionally or physically) in Icelandic - without specifiying the distance further,
|
||||
-- e.g., with an adverb "þessi hlutur hérna" = "this object here" and "þessi hlutur þarna" = "that object there".
|
||||
-- But one could argue that "þessi/sá" =~ "this/that". There is also another demonstrative determiner in
|
||||
-- Icelandic, "hinn" = "the other one". Atm I use the "þessi/sá" = "this/that".
|
||||
-- Later I will change to "þessi hér" == "this" and "þessi þarna" == "that". But that raises further questions on how
|
||||
-- it should then treat some situations e.g. "..þessi guli maður..."/"..this yellow man.."
|
||||
-- to "..þessi hérna guli maður.." ?
|
||||
-- or "..þessi guli maður hérna.." ?
|
||||
-- I think/feel that "..þessi guli maður.." is the most natural/right one to use.
|
||||
this_Quant = {
|
||||
s = table {
|
||||
Sg => table {
|
||||
Masc => caseList "þessi" "þennan" "þessum" "þessa" ;
|
||||
Fem => caseList "þessi" "þessa" "þessari" "þessarar" ;
|
||||
Neutr => caseList "þetta" "þetta" "þessu" "þessa"
|
||||
} ;
|
||||
Pl => table {
|
||||
Masc => caseList "þessir" "þessa" "þessum" "þessara" ;
|
||||
Fem => caseList "þessar" "þessar" "þessum" "þessara" ;
|
||||
Neutr => caseList "þessi" "þessi" "þessum" "þessara"
|
||||
}
|
||||
} ;
|
||||
b = Free ;
|
||||
d = Weak ;
|
||||
isPron = False
|
||||
} ;
|
||||
that_Quant = {
|
||||
s = table {
|
||||
Sg => table {
|
||||
Masc => caseList "sá" "þann" "þeim" "þess" ;
|
||||
Fem => caseList "sú" "þá" "þeirri" "þeirrar" ;
|
||||
Neutr => caseList "það" "það" "því" "þess"
|
||||
} ;
|
||||
Pl => table {
|
||||
Masc => caseList "þeir" "þá" "þeim" "þeirra" ;
|
||||
Fem => caseList "þær" "þær" "þeim" "þeirra" ;
|
||||
Neutr => caseList "þau" "þau" "þeim" "þeirra"
|
||||
}
|
||||
} ;
|
||||
b = Free ;
|
||||
d = Weak ;
|
||||
isPron = False
|
||||
} ;
|
||||
and_Conj = mkConj "og" ;
|
||||
or_Conj = mkConj "eða" singular ;
|
||||
if_then_Conj = mkConj "ef" "þá" singular ;
|
||||
either7or_DConj = mkConj "annaðhvort" "eða" singular ;
|
||||
otherwise_PConj = ss "annars" ;
|
||||
that_Subj = ss "að" ;
|
||||
because_Subj = ss "af því að" ;
|
||||
both7and_DConj = mkConj "bæði" "og";
|
||||
but_PConj = ss "en" ;
|
||||
how_IAdv = ss "hvernig" ;
|
||||
how8much_IAdv = ss "hversu mikið" ;
|
||||
if_Subj = ss "ef" ;
|
||||
please_Voc = ss "vinsamlegast" ;
|
||||
when_Subj = ss "þegar" ;
|
||||
|
||||
where_IAdv = ss "hvar" ;
|
||||
|
||||
why_IAdv = ss "af hverju" ;
|
||||
yes_Phr = ss "já" ;
|
||||
i_Pron = mkPronPers "ég" "mig" "mér" "mín" "minn" "minn" "mínum" "míns" "mín" "mína" "minni" "minnar" "mitt" "mitt" "mínu" "míns" "mínir" "mína" "mínum" "minna" "mínar" "mínar" "mín" "mín" Masc Sg P1 ;
|
||||
youSg_Pron = mkPronPers "þú" "þig" "þér" "þín" "þinn" "þinn" "þínum" "þíns" "þín" "þína" "þinni" "þinnar" "þitt" "þitt" "þínu" "þíns" "þínir" "þína" "þínum" "þinna" "þínar" "þínar" "þín" "þín" Masc Sg P2 ;
|
||||
-- He, she and it are complicated regarding possessions. Sinn is
|
||||
-- used for thrid persons singular, but only if it is the subject
|
||||
-- of the sentence, otherwise the genitive of the personal pronoun
|
||||
-- (hans) is used.
|
||||
-- dont be afraid to be awkward :)
|
||||
|
||||
he_Pron = mkPronPers "hann" "hann" "honum" "hans"
|
||||
"sinn" "sinn" "sínum" "síns"
|
||||
"sín" "sína" "sinni" "sinnar"
|
||||
"sitt" "sitt" "sínu" "síns"
|
||||
"sínir" "sína" "sínum" "sinna"
|
||||
"sínar" "sínar" "sín" "sín" Masc Sg P3 ;
|
||||
|
||||
she_Pron = mkPronPers "hún" "hana" "henni" "hennar"
|
||||
"sinn" "sinn" "sínum" "síns"
|
||||
"sín" "sína" "sinni" "sinnar"
|
||||
"sitt" "sitt" "sínu" "síns"
|
||||
"sínir" "sína" "sínum" "sinna"
|
||||
"sínar" "sínar" "sín" "sín" Fem Sg P3 ;
|
||||
|
||||
it_Pron = mkPronPers "það" "það" "því" "þess"
|
||||
"sinn" "sinn" "sínum" "síns"
|
||||
"sín" "sína" "sinni" "sinnar"
|
||||
"sitt" "sitt" "sínu" "síns"
|
||||
"sínir" "sína" "sínum" "sinna"
|
||||
"sínar" "sínar" "sín" "sín" Neutr Sg P3 ;
|
||||
|
||||
-- "They" depends on gender,i.e. has 3x4 forms for personal pronouns
|
||||
-- the masculine is given here, neuter and feminine are given in Extra
|
||||
they_Pron = mkPronPers "þeir" "þá" "þeim" "þeirra"
|
||||
"sinn" "sinn" "sínum" "síns"
|
||||
"sín" "sína" "sinni" "sinnar"
|
||||
"sitt" "sitt" "sínu" "síns"
|
||||
"sínir" "sína" "sínum" "sinna"
|
||||
"sínar" "sínar" "sín" "sín" Masc Pl P3 ;
|
||||
|
||||
-- the possesive equivalent, vor, is mostly used in elevated style.
|
||||
we_Pron = mkPronPers "við" "okkur" "okkur" "okkar"
|
||||
"vor" "vor" "vorum" "vors"
|
||||
"vor" "vora" "vorri" "vorrar"
|
||||
"vort" "vort" "voru" "vors"
|
||||
"vorir" "vora" "vorum" "vorra"
|
||||
"vorar" "vorar" "vor" "vor" Neutr Pl P1 ;
|
||||
|
||||
-- this is a bit awkward - there is really no possessive term for this
|
||||
-- the genative is always used...
|
||||
youPl_Pron = mkPronPers "þið" "ykkur" "ykkur" "ykkar"
|
||||
"ykkar" "ykkar" "ykkar" "ykkar"
|
||||
"ykkar" "ykkar" "ykkar" "ykkar"
|
||||
"ykkar" "ykkar" "ykkar" "ykkar"
|
||||
"ykkar" "ykkar" "ykkar" "ykkar"
|
||||
"ykkar" "ykkar" "ykkar" "ykkar" Neutr Pl P2 ;
|
||||
|
||||
youPol_Pron = mkPronPers "þú" "þig" "þér" "þín" "þinn" "þinn" "þínum" "þíns" "þín" "þína" "þinni" "þinnar" "þitt" "þitt" "þínu" "þíns" "þínir" "þína" "þínum" "þinna" "þínar" "þínar" "þín" "þín" Masc Sg P2 ;
|
||||
|
||||
-- Strictly speaking all these interrigative pronouns correspond to one interrigative pronoun
|
||||
-- in Icelandic, "hver". But "hver", like other pronouns, exists in 3 genders and two numbers
|
||||
-- hence, hver (masculine) corresponds to who (in a masculine context, also for feminie, but
|
||||
-- only in the nominative), and hvert/hvað corresponds to what.
|
||||
whatSg_IP = {
|
||||
s = \\_ => caseList "hvað" "hvað" "hverju" "hvers" ;
|
||||
n = Pl
|
||||
} ;
|
||||
|
||||
whatPl_IP = {
|
||||
s = \\_ => caseList "hver" "hver" "hverjum" "hverra" ;
|
||||
n = Sg
|
||||
} ;
|
||||
|
||||
-- whoPl_IP = mkIP "who" "whom" "whose" plural ;
|
||||
whoPl_IP = {
|
||||
s = table {
|
||||
Masc => caseList "hverjir" "hverja" "hverjum" "hverra" ;
|
||||
Fem => caseList "hverjar" "hverjar" "hverjum" "hverra" ;
|
||||
Neutr => caseList "hver" "hver" "hverjum" "hverra"
|
||||
} ;
|
||||
n = Pl
|
||||
} ;
|
||||
|
||||
whoSg_IP = {
|
||||
s = table {
|
||||
Masc => caseList "hver" "hvern" "hverjum" "hvers" ;
|
||||
Fem => caseList "hver" "hverja" "hverri" "hverjar" ;
|
||||
Neutr => caseList "hvað" "hvað" "hverju" "hvers"
|
||||
} ;
|
||||
n = Sg
|
||||
} ;
|
||||
|
||||
-- Note this is basically the superlative of the adjective margur (e. many)
|
||||
-- a paradigm or make function will be made for Predet's.
|
||||
most_Predet = {
|
||||
s = table {
|
||||
Sg => table {
|
||||
Masc => caseList "flestur" "flestan" "flestum" "flests" ;
|
||||
Fem => caseList "flest" "flesta" "flestri" "flestrar" ;
|
||||
Nautr => caseList "flest" "flest" "flestu" "flests"
|
||||
} ;
|
||||
Pl => table {
|
||||
Masc => caseList "flestir" "flesta" "flestum" "flestra" ;
|
||||
Fem => caseList "flestar" "flestar" "flestum" "flestra" ;
|
||||
Nautr => caseList "flest" "flest" "flestum" "flestra"
|
||||
}
|
||||
};
|
||||
};
|
||||
all_Predet = {
|
||||
s = table {
|
||||
Sg => table {
|
||||
Masc => caseList "allur" "allan" "öllum" "alls" ;
|
||||
Fem => caseList "öll" "alla" "allri" "allrar" ;
|
||||
Neutr => caseList "allt" "allt" "öllu" "alls"
|
||||
} ;
|
||||
Pl => table {
|
||||
Masc => caseList "allir" "alla" "öllum" "allra" ;
|
||||
Fem => caseList "allar" "allar" "öllum" "allra" ;
|
||||
Neutr => caseList "öll" "öll" "öllum" "allra"
|
||||
}
|
||||
} ;
|
||||
} ;
|
||||
|
||||
|
||||
-- not sure atm how this will translate : aðeins is an adverb that does not inflect and eini is a weak form of the adjective einn (e. one)
|
||||
only_Predet = { s = \\_,_,_ => "aðeins"} ;
|
||||
-- Same here : ekki is a sentence adverb that does not inflect
|
||||
not_Predet = { s = \\_,_,_ => "ekki"} ;
|
||||
|
||||
less_CAdv = {s = "minna" ; p = "en"} ;
|
||||
more_CAdv = {s = "meira" ; p = "en"} ;
|
||||
as_CAdv = {s = "eins" ; p = "og"} ;
|
||||
on_Prep = mkPrep "á" dative ;
|
||||
with_Prep = mkPrep "með" dative ;
|
||||
-- when using in the context of two objects "hvor" is used.
|
||||
when_IAdv = ss "hvenær" ;
|
||||
which_IQuant = {s = \\_,_,_ => "hvaða"} ;
|
||||
under_Prep = mkPrep "undir" dative ;
|
||||
want_VV = mkV2 IrregIce.vilja_V (mkPrep "" accusative) ;
|
||||
must_VV = mkV2 IrregIce.verða_V (mkPrep "að" accusative) ;
|
||||
can_VV, can8know_VV = mkV2 IrregIce.kunna_V (mkPrep "að" accusative) ;
|
||||
have_V2 = mkV2 (mkV "hafa" "hef" "hafði" "hafður" "haft") (mkPrep "" accusative) ;
|
||||
}
|
||||
3
lib/src/icelandic/SymbolIce.gf
Normal file
3
lib/src/icelandic/SymbolIce.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
concrete SymbolIce of Symbol = CatIce ** open Prelude, ResIce in {}
|
||||
14
lib/src/icelandic/TenseX.gf
Normal file
14
lib/src/icelandic/TenseX.gf
Normal file
@@ -0,0 +1,14 @@
|
||||
concrete TenseX of Tense = CommonX ** open (R = ParamX) in {
|
||||
|
||||
lin
|
||||
TTAnt t a = {s = t.s ++ a.s ; t = t.t ; a = a.a} ;
|
||||
|
||||
PPos = {s = []} ** {p = R.Pos} ;
|
||||
PNeg = {s = []} ** {p = R.Neg} ;
|
||||
TPres = {s = []} ** {t = R.Pres} ;
|
||||
TPast = {s = []} ** {t = R.Past} ; --# notpresent
|
||||
TFut = {s = []} ** {t = R.Fut} ; --# notpresent
|
||||
TCond = {s = []} ** {t = R.Cond} ; --# notpresent
|
||||
ASimul = {s = []} ** {a = R.Simul} ;
|
||||
AAnter = {s = []} ** {a = R.Anter} ; --# notpresent
|
||||
}
|
||||
7
lib/src/icelandic/Test.gf
Normal file
7
lib/src/icelandic/Test.gf
Normal file
@@ -0,0 +1,7 @@
|
||||
abstract Test = Grammar ** {
|
||||
fun
|
||||
man_N, woman_N, house_N, tree_N : N ;
|
||||
big_A, small_A, green_A : A ;
|
||||
walk_V, arrive_V : V ;
|
||||
love_V2, please_V2 : V2 ;
|
||||
}
|
||||
21
lib/src/icelandic/TestIce.gf
Normal file
21
lib/src/icelandic/TestIce.gf
Normal file
@@ -0,0 +1,21 @@
|
||||
concrete TestIce of Test = GrammarIce ** open ParadigmsIce,Prelude in {
|
||||
lin
|
||||
--Some prefabricated nouns:
|
||||
man_N = mkN "maður" "mann" "manni" "manns" "menn" "menn" "mönnum" "manna" masculine;
|
||||
woman_N = mkN "kona" "konu" "konu" "konu" "konur" "konur" "konum" "kvenna" feminine;
|
||||
house_N = mkN "hús" "hús" "húsi" "húss" "hús" "hús" "húsum" "húsa" neuter;
|
||||
tree_N = mkN "tré" "tré" "tré" "trés" "tré" "tré" "trjáum" "trjáa" neuter;
|
||||
|
||||
--Some prefabricated adjectives:
|
||||
big_A = mkA "stór" "stóran" "stórum" "stórs" "stór" "stóra" "stórri" "stórrar" "stórt" "stórt" "stóru" "stórs" "stórir" "stóra" "stórum" "stórra" "stórar" "stórar" "stórum" "stórra" "stór" "stór" "stórum" "stórra" "stóri" "stóra" "stóra" "stóru" "stóra" "stóru" True;
|
||||
small_A = mkA "lítill" "lítinn" "litlum" "lítils" "lítil" "litla" "lítilli" "lítillar" "lítið" "lítið" "litlu" "lítils" "litlir" "litla" "litlum" "lítilla" "litlar" "litlar" "litlum" "lítilla" "lítil" "lítil" "litlum" "lítilla" "litli" "litla" "litla" "litlu" "litla" "litlu" True;
|
||||
green_A = mkA "grænn" "grænan" "grænum" "grænans" "græn" "græna" "grænni" "grænnar" "grænt" "grænt" "grænu" "græns" "grænir" "græna" "grænum" "grænna" "grænar" "grænar" "grænum" "grænna" "græn" "græn" "grænum" "grænna" "græni" "græna" "græna" "grænu" "græna" "grænu" True;
|
||||
|
||||
--Some prefabricated verbs:
|
||||
walk_V = mkV "ganga" "geng" "gengur" "gengur" "göngum" "gangið" "ganga" "gekk" "gekkst" "gekk" "gengum" "genguð" "gengu" "gengið";
|
||||
arrive_V = mkV "koma" "kem" "kemur" "kemur" "komum" "komið" "koma" "kom" "komst" "kom" "komum" "komuð" "komu" "komið";
|
||||
|
||||
--Some prefabricated two-place verbs (the acc is taken, as far as I know that is the "unmarked" case that verbs inlfect? on the subject):
|
||||
love_V2 = mkV2 "elska" "elska" "elskar" "elskar" "elskum" "elskið" "elska" "elskaði" "elskaðir" "elskaði" "elskuðum" "elskuðuð" "elskuðu" "elskað" accusative;
|
||||
please_V2 = mkV2 "gleðja" "gleð" "gleður" "gleður" "gleðjum" "gleðjið" "gleðja" "gladdi" "gladdir" "gladdi" "glöddum" "glödduð" "glöddu" "glatt" accusative;
|
||||
}
|
||||
108
lib/src/icelandic/VerbIce.gf
Normal file
108
lib/src/icelandic/VerbIce.gf
Normal file
@@ -0,0 +1,108 @@
|
||||
concrete VerbIce of Verb = CatIce ** open ResIce, Prelude in {
|
||||
|
||||
-- flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
UseV v = predV v;
|
||||
|
||||
ComplVV vv vp = insertDir (predV vv) (\\_ => vv.c2.s ++ infVP vp) ;
|
||||
|
||||
ComplVS vs s = insertDir (predV vs) (\\_ => s.s) ;
|
||||
|
||||
ComplVQ vq qs = insertDir (predV vq) (\\_ => qs.s ! QDir) ;
|
||||
|
||||
ComplVA va ap = insertDir (predV va) (\\a => ap.s ! a.n ! a.g ! Strong ! Nom) ;
|
||||
|
||||
SlashV2a v = predV v ** {c2 = v.c2} ;
|
||||
|
||||
Slash2V3 v3 np = (insertDir (predV v3) (\\a => v3.c3.s ++ np.s ! NCase v3.c3.c)) ** {dirShift = np.isPron; c2 = v3.c2} ;
|
||||
|
||||
Slash3V3 v3 np = (insertInd (predV v3) (\\a => v3.c2.s ++ np.s ! NCase v3.c2.c)) ** {indShift = np.isPron; c2 = v3.c3} ;
|
||||
|
||||
SlashV2V v2v vp = (insertDir (predV v2v) (\\_ => v2v.c3.s ++ infVP vp)) ** {c2 = v2v.c2} ;
|
||||
|
||||
SlashV2S v2s s = (insertDir (predV v2s) (\\a => s.s)) ** {c2 = v2s.c2} ;
|
||||
|
||||
SlashV2Q v2q qs = (insertDir (predV v2q) (\\a => qs.s ! QDir)) ** {c2 = v2q.c2} ;
|
||||
|
||||
SlashV2A v2a ap = (insertDir (predV v2a) (\\a => ap.s ! a.n ! a.g ! Strong ! v2a.c2.c)) ** {c2 = v2a.c2} ;
|
||||
|
||||
ComplSlash vps np = insertDir vps (\\a => vps.c2.s ++ np.s ! NCase vps.c2.c ++ vps.dirObj ! np.a );
|
||||
|
||||
SlashVV vv vps = (insertDir (predV vv) (\\_ => vv.c2.s ++ infVP vps)) ** {c2 = vps.c2} ;
|
||||
|
||||
SlashV2VNP v2v np vps = (insertDir
|
||||
(predV v2v)
|
||||
(\\_ => v2v.c2.s ++ np.s ! NCase v2v.c2.c ++ v2v.c3.s ++ infVP vps)
|
||||
) ** {c2 = vps.c2} ;
|
||||
|
||||
ReflVP vps = (insertInd
|
||||
vps
|
||||
(\\a => vps.indObj ! a ++ reflPron a.p a.n a.g vps.c2.c ++ vps.c2.s)
|
||||
) ** {indShift = True} ;
|
||||
|
||||
UseComp comp = insertDir (predV verbBe) (\\a => comp.s ! a) ;
|
||||
|
||||
PassV2 v2 =
|
||||
let
|
||||
vp = predV verbBe
|
||||
in
|
||||
{
|
||||
s = \\vpform,pol,agr => vf (vp.s ! vpform ! pol ! agr).fin (v2.p ! PStrong agr.n agr.g Nom) (negation pol) True;
|
||||
p = \\pform => v2.p ! pform ;
|
||||
indObj = \\_ => [] ;
|
||||
dirObj = \\a => vp.dirObj ! a ;
|
||||
a2 = [] ;
|
||||
indShift,dirShift = False
|
||||
} ;
|
||||
|
||||
AdvVP vp adv = vp ** {a2 = vp.a2 ++ adv.s} ;
|
||||
|
||||
ExtAdvVP vp adv = vp ** {n2 = \\a => adv.s ++ vp.n2 ! a} ;
|
||||
|
||||
AdVVP adv vp = insertAdV adv.s vp ;
|
||||
|
||||
AdvVPSlash vps adv = vps ** {a2 = vps.a2 ++ adv.s} ;
|
||||
|
||||
AdVVPSlash adv vps = (insertAdV adv.s vps) ** {c2 = vps.c2} ;
|
||||
|
||||
VPSlashPrep vp prep = vp ** {c2 = prep} ;
|
||||
|
||||
CompAP ap = {
|
||||
s = \\a => ap.s ! a.n ! a.g ! Strong ! Nom ;
|
||||
} ;
|
||||
|
||||
CompNP np = {s = \\_ => np.s ! NCase Nom} ;
|
||||
|
||||
CompAdv adv = {s = \\_ => adv.s} ;
|
||||
|
||||
CompCN cn = {
|
||||
s = \\a => cn.s ! a.n ! Free ! Strong ! Nom ++ cn.comp ! a.n ! Nom;
|
||||
} ;
|
||||
|
||||
UseCopula = predV verbBe ;
|
||||
|
||||
oper
|
||||
insertDir : ResIce.VP -> (Agr => Str) -> ResIce.VP =\vp,obj -> vp ** {
|
||||
dirObj = obj
|
||||
} ;
|
||||
|
||||
insertInd : ResIce.VP -> (Agr => Str) -> ResIce.VP =\vp,obj -> vp ** {
|
||||
indObj = obj
|
||||
} ;
|
||||
|
||||
insertAdV : Str -> ResIce.VP -> ResIce.VP = \adv,vp -> vp ** {
|
||||
s = \\vpform,pol,agr =>
|
||||
let
|
||||
vps = vp.s ! vpform ! pol ! agr
|
||||
in {
|
||||
fin = vps.fin ;
|
||||
inf = vps.inf ;
|
||||
a1 = case vpform of {
|
||||
VPImp | VPMood Pres Simul | VPMood Past Simul
|
||||
=> <vps.a1.p1, vps.a1.p2 ++ adv> ;
|
||||
_ => <vps.a1.p1 ++ adv, vps.a1.p2>
|
||||
};
|
||||
} ;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user