mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-28 09:28:54 -06:00
Documentation for Nynorsk
This commit is contained in:
@@ -1,3 +1,16 @@
|
|||||||
--# -path=.:../nynorsk:../scandinavian:../common:../abstract:../prelude
|
--# -path=.:../nynorsk:../scandinavian:../common:../abstract:../prelude
|
||||||
|
|
||||||
resource TryNno = SyntaxNno, LexiconNno, ParadigmsNno - [mkAdv] ;
|
resource TryNno = SyntaxNno-[mkAdN], LexiconNno, ParadigmsNno - [mkAdv,mkAdN] **
|
||||||
|
open (P = ParadigmsNno) in {
|
||||||
|
|
||||||
|
oper
|
||||||
|
mkAdv = overload SyntaxNno {
|
||||||
|
mkAdv : Str -> Adv = P.mkAdv ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
mkAdN = overload {
|
||||||
|
mkAdN : CAdv -> AdN = SyntaxNno.mkAdN ;
|
||||||
|
mkAdN : Str -> AdN = P.mkAdN ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
283
src/nynorsk/DocumentationNno.gf
Normal file
283
src/nynorsk/DocumentationNno.gf
Normal file
@@ -0,0 +1,283 @@
|
|||||||
|
concrete DocumentationNno of Documentation = CatNno ** open
|
||||||
|
ResNno,
|
||||||
|
CommonScand,
|
||||||
|
HTML
|
||||||
|
in {
|
||||||
|
flags coding=utf8 ;
|
||||||
|
lincat
|
||||||
|
Inflection = {t : Str; s1,s2 : Str} ;
|
||||||
|
Definition = {s : Str} ;
|
||||||
|
Document = {s : Str} ;
|
||||||
|
Tag = {s : Str} ;
|
||||||
|
|
||||||
|
{-
|
||||||
|
-} --# notpresent
|
||||||
|
|
||||||
|
|
||||||
|
lin
|
||||||
|
InflectionN, InflectionN2, InflectionN3 = \noun -> {
|
||||||
|
t = "s" ;
|
||||||
|
s1 = heading1 ("Substantiv" ++ case noun.g of {
|
||||||
|
NUtr Male => "(maskulinum)" ;
|
||||||
|
NUtr Female => "(femininum)" ;
|
||||||
|
NNeutr => "(neutr)"
|
||||||
|
}) ;
|
||||||
|
s2 = frameTable (
|
||||||
|
tr (intagAttr "th" "colspan=2" "" ++ th "obest" ++ th "best") ++
|
||||||
|
tr (intagAttr "th" "rowspan=2" "nom" ++
|
||||||
|
th "sg" ++ td (noun.s ! Sg ! Indef ! Nom) ++ td (noun.s ! Sg ! Def ! Nom)) ++
|
||||||
|
tr (th "pl" ++ td (noun.s ! Pl ! Indef ! Nom) ++ td (noun.s ! Pl ! Def ! Nom)) ++
|
||||||
|
tr (intagAttr "th" "rowspan=2" "gen" ++
|
||||||
|
th "sg" ++ td (noun.s ! Sg ! Indef ! Gen) ++ td (noun.s ! Sg ! Def ! Gen)) ++
|
||||||
|
tr (th "pl" ++ td (noun.s ! Pl ! Indef ! Gen) ++ td (noun.s ! Pl ! Def ! Gen))
|
||||||
|
)
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionLN = \n -> {
|
||||||
|
t = "nm" ;
|
||||||
|
s1 = heading1 ("Platsnamn" ++ case n.g of {
|
||||||
|
Utr => "(utr)" ;
|
||||||
|
Neutr => "(neutr)"
|
||||||
|
}) ;
|
||||||
|
s2 = frameTable (
|
||||||
|
tr (th "nom" ++ td (n.s ! Nom)) ++
|
||||||
|
tr (th "gen" ++ td (n.s ! Gen))
|
||||||
|
) ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionGN = \pn -> {
|
||||||
|
t = "fnm" ;
|
||||||
|
s1 = heading1 ("Förnamn" ++ case pn.g of {
|
||||||
|
Male => "(man)" ;
|
||||||
|
Female => "(kvinna)"
|
||||||
|
}) ;
|
||||||
|
s2 = frameTable (
|
||||||
|
tr (th "nom" ++ td (pn.s ! Nom)) ++
|
||||||
|
tr (th "gen" ++ td (pn.s ! Gen))
|
||||||
|
)
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionSN = \pn -> {
|
||||||
|
t = "enm" ;
|
||||||
|
s1 = heading1 "Efternamn" ;
|
||||||
|
s2 = frameTable (
|
||||||
|
tr (th "nom" ++ td (pn.s ! Male ! Nom)) ++
|
||||||
|
tr (th "gen" ++ td (pn.s ! Male ! Gen))
|
||||||
|
)
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionA, InflectionA2 = \adj -> {
|
||||||
|
t = "a" ;
|
||||||
|
s1 = heading1 "Adjektiv" ;
|
||||||
|
s2 = frameTable (
|
||||||
|
tr (intagAttr "th" "colspan=5" "nominativ") ++
|
||||||
|
tr (intagAttr "th" "colspan=2" "posit" ++
|
||||||
|
th "posit" ++
|
||||||
|
th "kompar" ++
|
||||||
|
th "superl") ++
|
||||||
|
caseInfl Nom ++
|
||||||
|
tr (intagAttr "th" "colspan=5" "genitiv") ++
|
||||||
|
caseInfl Nom
|
||||||
|
) ++
|
||||||
|
heading1 ("Adverb") ++
|
||||||
|
paragraph (adj.s ! AAdv) ;
|
||||||
|
} where {
|
||||||
|
caseInfl : Case -> Str = \c ->
|
||||||
|
tr (intagAttr "th" "rowspan=3" "obest" ++
|
||||||
|
th "utr" ++
|
||||||
|
td (adj.s ! (AF (APosit (Strong (GSg Utr))) c)) ++
|
||||||
|
intagAttr "td" "rowspan=5" (adj.s ! (AF ACompar c)) ++
|
||||||
|
intagAttr "td" "rowspan=3" (adj.s ! (AF (ASuperl SupStrong) c))) ++
|
||||||
|
tr (th "neut" ++
|
||||||
|
td (adj.s ! (AF (APosit (Strong (GSg Neutr))) c))) ++
|
||||||
|
tr (th "pl" ++
|
||||||
|
td (adj.s ! (AF (APosit (Strong GPl)) c))) ++
|
||||||
|
tr (intagAttr "th" "rowspan=2" "best" ++
|
||||||
|
th "sg" ++
|
||||||
|
td (adj.s ! (AF (APosit (Weak Sg)) c)) ++
|
||||||
|
intagAttr "td" "rowspan=2" (adj.s ! (AF (ASuperl SupWeak) c))) ++
|
||||||
|
tr (th "pl" ++
|
||||||
|
td (adj.s ! (AF (APosit (Weak Pl)) c))) ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionAdv, InflectionAdV, InflectionAdA, InflectionAdN = \adv -> {
|
||||||
|
t = "adv" ;
|
||||||
|
s1 = heading1 "Adverb" ;
|
||||||
|
s2 = paragraph adv.s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionPrep p = {
|
||||||
|
t = "prep" ;
|
||||||
|
s1 = heading1 "Preposition" ;
|
||||||
|
s2 = paragraph p.s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionV v = {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 "Verb" ++
|
||||||
|
paragraph (pp "subjekt" ++
|
||||||
|
v.s ! VI (VInfin Act) ++ v.part);
|
||||||
|
s2 = inflVerb v
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionV2 v = {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 "Verb" ++
|
||||||
|
paragraph (pp "subjekt" ++
|
||||||
|
v.s ! VI (VInfin Act) ++ v.part ++ v.c2.s ++
|
||||||
|
pp "objekt") ;
|
||||||
|
s2 = inflVerb v
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionV3 v = {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 "Verb" ++
|
||||||
|
paragraph (pp "subjekt" ++
|
||||||
|
v.s ! VI (VInfin Act) ++ v.part ++
|
||||||
|
v.c2.s ++ pp "arg1" ++
|
||||||
|
v.c3.s ++ pp "arg2") ;
|
||||||
|
s2 = inflVerb v
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionV2V v = {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 "Verb" ++
|
||||||
|
paragraph (pp "subjekt" ++
|
||||||
|
v.s ! VI (VInfin Act) ++ v.part ++
|
||||||
|
v.c2.s ++ pp "objekt" ++
|
||||||
|
v.c3.s ++ pp "verb") ;
|
||||||
|
s2 = inflVerb v
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionV2S v = {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 "Verb" ++
|
||||||
|
paragraph (pp "subjekt" ++
|
||||||
|
v.s ! VI (VInfin Act) ++ v.part ++
|
||||||
|
v.c2.s ++ pp "objekt" ++
|
||||||
|
conjThat ++ pp "mening") ;
|
||||||
|
s2 = inflVerb v
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionV2Q v = {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 "Verb" ++
|
||||||
|
paragraph (pp "subjekt" ++
|
||||||
|
v.s ! VI (VInfin Act) ++ v.part ++
|
||||||
|
v.c2.s ++ pp "objekt" ++
|
||||||
|
pp "fråga") ;
|
||||||
|
s2 = inflVerb v
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionV2A v = {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 "Verb" ++
|
||||||
|
paragraph (pp "subjekt" ++
|
||||||
|
v.s ! VI (VInfin Act) ++ v.part ++
|
||||||
|
v.c2.s ++ pp "objekt" ++
|
||||||
|
pp "adjektiv") ;
|
||||||
|
s2 = inflVerb v
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionVV v = {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 "Verb" ++
|
||||||
|
paragraph (pp "subjekt" ++
|
||||||
|
v.s ! VI (VInfin Act) ++ v.part ++
|
||||||
|
pp "verb") ;
|
||||||
|
s2 = inflVerb v
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionVS v = {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 "Verb" ++
|
||||||
|
paragraph (pp "subjekt" ++
|
||||||
|
v.s ! VI (VInfin Act) ++ v.part ++
|
||||||
|
conjThat ++ pp "mening") ;
|
||||||
|
s2 = inflVerb v
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionVQ v = {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 "Verb" ++
|
||||||
|
paragraph (pp "subjekt" ++
|
||||||
|
v.s ! VI (VInfin Act) ++ v.part ++
|
||||||
|
pp "fråga") ;
|
||||||
|
s2 = inflVerb v
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InflectionVA v = {
|
||||||
|
t = "v" ;
|
||||||
|
s1 = heading1 "Verb" ++
|
||||||
|
paragraph (pp "subjekt" ++
|
||||||
|
v.s ! VI (VInfin Act) ++ v.part ++
|
||||||
|
pp "adjektiv") ;
|
||||||
|
s2 = inflVerb v
|
||||||
|
} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
NoDefinition t = {s=t.s};
|
||||||
|
MkDefinition t d = {s="<p><b>Definition:</b>"++t.s++d.s++"</p>"};
|
||||||
|
MkDefinitionEx t d e = {s="<p><b>Definition:</b>"++t.s++d.s++"</p><p><b>Exempel:</b>"++e.s++"</p>"};
|
||||||
|
|
||||||
|
MkDocument d i e = {s = i.s1 ++ d.s ++ i.s2 ++ paragraph e.s} ; -- explanation appended in a new paragraph
|
||||||
|
MkTag i = {s = i.t} ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
inflVerb : Verb -> Str = \verb ->
|
||||||
|
frameTable (
|
||||||
|
tr (th "" ++ th "active" ++ th "passive") ++
|
||||||
|
tr (th "infitiv" ++ td (verb.s ! VI (VInfin Act)) ++ td (verb.s ! VI (VInfin Pass))) ++
|
||||||
|
tr (th "presens" ++ td (verb.s ! VF (VPres Act)) ++ td (verb.s ! VF (VPres Pass))) ++
|
||||||
|
tr (th "preteritum" ++ td (verb.s ! VF (VPret Act)) ++ td (verb.s ! VF (VPret Pass))) ++
|
||||||
|
tr (th "supinum" ++ td (verb.s ! VI (VSupin Act)) ++ td (verb.s ! VI (VSupin Pass))) ++
|
||||||
|
tr (th "imperativ" ++ td (verb.s ! VF (VImper Act)) ++ td (verb.s ! VF (VImper Pass)))
|
||||||
|
) ++
|
||||||
|
heading2 "Particip Presens" ++
|
||||||
|
frameTable (
|
||||||
|
tr (intagAttr "th" "colspan=2" "" ++ th "obest" ++ th "best") ++
|
||||||
|
tr (intagAttr "th" "rowspan=2" "nom" ++
|
||||||
|
th "sg" ++
|
||||||
|
td (verb.s ! VI (VPtPres Sg Indef Nom)) ++
|
||||||
|
td (verb.s ! VI (VPtPres Sg Def Nom))) ++
|
||||||
|
tr (th "pl" ++
|
||||||
|
td (verb.s ! VI (VPtPres Pl Indef Nom)) ++
|
||||||
|
td (verb.s ! VI (VPtPres Pl Def Nom))) ++
|
||||||
|
tr (intagAttr "th" "rowspan=2" "gen" ++
|
||||||
|
th "sg" ++
|
||||||
|
td (verb.s ! VI (VPtPres Sg Indef Gen)) ++
|
||||||
|
td (verb.s ! VI (VPtPres Sg Def Gen))) ++
|
||||||
|
tr (th "pl" ++
|
||||||
|
td (verb.s ! VI (VPtPres Pl Indef Gen)) ++
|
||||||
|
td (verb.s ! VI (VPtPres Pl Def Gen)))
|
||||||
|
) ++
|
||||||
|
heading2 "Particip Perfekt" ++
|
||||||
|
frameTable (
|
||||||
|
tr (intagAttr "th" "colspan=2" "" ++
|
||||||
|
th "nom" ++
|
||||||
|
th "gen") ++
|
||||||
|
tr (intagAttr "th" "rowspan=3" "obest" ++
|
||||||
|
th "utr" ++
|
||||||
|
td (verb.s ! VI (VPtPret (Strong (GSg Utr)) Nom)) ++
|
||||||
|
td (verb.s ! VI (VPtPret (Strong (GSg Utr)) Gen))) ++
|
||||||
|
tr (th "neut" ++
|
||||||
|
td (verb.s ! VI (VPtPret (Strong (GSg Neutr)) Nom)) ++
|
||||||
|
td (verb.s ! VI (VPtPret (Strong (GSg Neutr)) Gen))) ++
|
||||||
|
tr (th "pl" ++
|
||||||
|
td (verb.s ! VI (VPtPret (Strong GPl) Nom)) ++
|
||||||
|
td (verb.s ! VI (VPtPret (Strong GPl) Gen))) ++
|
||||||
|
tr (intagAttr "th" "rowspan=2" "best" ++
|
||||||
|
th "sg" ++
|
||||||
|
td (verb.s ! VI (VPtPret (Weak Sg) Nom)) ++
|
||||||
|
td (verb.s ! VI (VPtPret (Weak Sg) Gen))) ++
|
||||||
|
tr (th "pl" ++
|
||||||
|
td (verb.s ! VI (VPtPret (Weak Pl) Nom)) ++
|
||||||
|
td (verb.s ! VI (VPtPret (Weak Pl) Gen)))
|
||||||
|
) ;
|
||||||
|
|
||||||
|
pp : Str -> Str = \s -> "<"+s+">";
|
||||||
|
|
||||||
|
{- --# notpresent
|
||||||
|
-}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -14,7 +14,8 @@ concrete GrammarNno of Grammar =
|
|||||||
TextX - [Tense,Temp] ,
|
TextX - [Tense,Temp] ,
|
||||||
IdiomNno,
|
IdiomNno,
|
||||||
StructuralNno,
|
StructuralNno,
|
||||||
TenseNno
|
TenseNno,
|
||||||
|
NamesNno
|
||||||
** {
|
** {
|
||||||
|
|
||||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||||
|
|||||||
10
src/nynorsk/NamesNno.gf
Normal file
10
src/nynorsk/NamesNno.gf
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
concrete NamesNno of Noun = CatNno ** NamesScand - [AdjLN] with
|
||||||
|
(ResScand = ResNno) ** {
|
||||||
|
|
||||||
|
lin AdjLN ap ln = ln ** {
|
||||||
|
s = \\c => preOrPost ap.isPre
|
||||||
|
(ap.s ! agrAdj (gennum ln.g ln.n) (DDef Def))
|
||||||
|
(ln.s ! c) ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
}
|
||||||
43
src/scandinavian/NamesScand.gf
Normal file
43
src/scandinavian/NamesScand.gf
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
incomplete concrete NamesScand of Names = CatScand ** open CommonScand, ResScand, Prelude in {
|
||||||
|
|
||||||
|
lin GivenName = \pn -> {
|
||||||
|
s = \\c => pn.s ! caseNP c ;
|
||||||
|
a = agrP3 Utr Sg ;
|
||||||
|
isPron = False
|
||||||
|
} ;
|
||||||
|
lin MaleSurname = \pn -> {
|
||||||
|
s = \\c => pn.s ! Male ! caseNP c ;
|
||||||
|
a = agrP3 Utr Sg ;
|
||||||
|
isPron = False
|
||||||
|
} ;
|
||||||
|
lin FemaleSurname = \pn -> {
|
||||||
|
s = \\c => pn.s ! Female ! caseNP c ;
|
||||||
|
a = agrP3 Utr Sg ;
|
||||||
|
isPron = False
|
||||||
|
} ;
|
||||||
|
lin PlSurname = \pn -> {
|
||||||
|
s = \\c => pn.pl ! caseNP c ;
|
||||||
|
a = agrP3 Utr Pl ;
|
||||||
|
isPron = False
|
||||||
|
} ;
|
||||||
|
lin FullName gn sn = {
|
||||||
|
s = \\c => gn.s ! Nom ++ sn.s ! gn.g ! caseNP c ;
|
||||||
|
a = agrP3 Utr Sg ;
|
||||||
|
isPron = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
UseLN, PlainLN = \n -> {
|
||||||
|
s = \\c => n.s ! caseNP c ;
|
||||||
|
a = agrP3 n.g n.n ;
|
||||||
|
isPron = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
AdjLN ap ln = ln ** {
|
||||||
|
s = \\c => preOrPost ap.isPre
|
||||||
|
(ap.s ! agrAdj (gennum (ngen2gen ln.g) ln.n) (DDef Def))
|
||||||
|
(ln.s ! c) ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InLN n = {s = "i" ++ n.s ! caseNP accusative} ;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,43 +1,2 @@
|
|||||||
concrete NamesSwe of Names = CatSwe ** open CommonScand, ResSwe, Prelude in {
|
concrete NamesSwe of Noun = CatSwe ** NamesScand with
|
||||||
|
(ResScand = ResSwe) ;
|
||||||
lin GivenName = \pn -> {
|
|
||||||
s = \\c => pn.s ! caseNP c ;
|
|
||||||
a = agrP3 Utr Sg ;
|
|
||||||
isPron = False
|
|
||||||
} ;
|
|
||||||
lin MaleSurname = \pn -> {
|
|
||||||
s = \\c => pn.s ! Male ! caseNP c ;
|
|
||||||
a = agrP3 Utr Sg ;
|
|
||||||
isPron = False
|
|
||||||
} ;
|
|
||||||
lin FemaleSurname = \pn -> {
|
|
||||||
s = \\c => pn.s ! Female ! caseNP c ;
|
|
||||||
a = agrP3 Utr Sg ;
|
|
||||||
isPron = False
|
|
||||||
} ;
|
|
||||||
lin PlSurname = \pn -> {
|
|
||||||
s = \\c => pn.pl ! caseNP c ;
|
|
||||||
a = agrP3 Utr Pl ;
|
|
||||||
isPron = False
|
|
||||||
} ;
|
|
||||||
lin FullName gn sn = {
|
|
||||||
s = \\c => gn.s ! Nom ++ sn.s ! gn.g ! caseNP c ;
|
|
||||||
a = agrP3 Utr Sg ;
|
|
||||||
isPron = False
|
|
||||||
} ;
|
|
||||||
|
|
||||||
UseLN, PlainLN = \n -> {
|
|
||||||
s = \\c => n.s ! caseNP c ;
|
|
||||||
a = agrP3 n.g n.n ;
|
|
||||||
isPron = False
|
|
||||||
} ;
|
|
||||||
|
|
||||||
AdjLN ap ln = ln ** {
|
|
||||||
s = \\c => preOrPost ap.isPre
|
|
||||||
(ap.s ! agrAdj (gennum (ngen2gen ln.g) ln.n) (DDef Def))
|
|
||||||
(ln.s ! c) ;
|
|
||||||
} ;
|
|
||||||
|
|
||||||
InLN n = {s = "i" ++ n.s ! caseNP accusative} ;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user