mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 08:58:55 -06:00
added documentation and some missing paradigm functions
This commit is contained in:
@@ -107,7 +107,8 @@ lincat
|
||||
N2 = Noun ** {c2 : Complement} ;
|
||||
N3 = Noun ** {c2,c3 : Complement} ;
|
||||
PN = {s : RCase => Str} ;
|
||||
|
||||
LN,GN,SN = {s : Str} ;
|
||||
|
||||
Temp = {s : Str ; t : ClTense ; a : Anteriority} ;
|
||||
Tense = {s : Str ; t : ClTense} ;
|
||||
}
|
||||
|
||||
75
src/mongolian/DocumentationMon.gf
Normal file
75
src/mongolian/DocumentationMon.gf
Normal file
@@ -0,0 +1,75 @@
|
||||
--# -path=.:../abstract:../common
|
||||
concrete DocumentationMon of Documentation = CatMon ** open
|
||||
ResMon,
|
||||
Prelude,
|
||||
HTML in {
|
||||
|
||||
lincat
|
||||
Inflection = {t : Str; s1,s2,s3 : Str} ;
|
||||
Definition = {s : Str} ;
|
||||
Document = {s : Str} ;
|
||||
Tag = {s : Str} ;
|
||||
|
||||
lin InflectionN, InflectionN2, InflectionN3 = \x -> {
|
||||
t="n" ;
|
||||
s1=heading1 "Noun" ;
|
||||
s2=frameTable (
|
||||
tr (th "" ++ th "Sg" ++ th "Pl") ++
|
||||
tr (th "Nom" ++ td (x.s ! SF Sg NNom) ++ td (x.s ! SF Pl NNom)) ++
|
||||
tr (th "Acc Def" ++ td (x.s ! SF Sg (NAcc Definite)) ++ td (x.s ! SF Pl (NAcc Definite))) ++
|
||||
tr (th "Acc Indef" ++ td (x.s ! SF Sg (NAcc Indefinite)) ++ td (x.s ! SF Pl (NAcc Indefinite))) ++
|
||||
tr (th "Dat" ++ td (x.s ! SF Sg NDat) ++ td (x.s ! SF Pl NDat)) ++
|
||||
tr (th "Gen" ++ td (x.s ! SF Sg NGen) ++ td (x.s ! SF Pl NGen)) ++
|
||||
tr (th "Abl" ++ td (x.s ! SF Sg NAbl) ++ td (x.s ! SF Pl NAbl)) ++
|
||||
tr (th "Inst" ++td (x.s ! SF Sg NInst) ++td (x.s ! SF Pl NInst)) ++
|
||||
tr (th "Com" ++ td (x.s ! SF Sg NCom) ++ td (x.s ! SF Pl NCom)) ++
|
||||
tr (th "Dir" ++ td (x.s ! SF Sg NDir) ++ td (x.s ! SF Pl NDir))) ;
|
||||
s3=[]
|
||||
} ;
|
||||
|
||||
lin InflectionPN = \pn -> {
|
||||
t="pn" ;
|
||||
s1=heading1 "Proper Name" ;
|
||||
s2=frameTable (
|
||||
tr (th "Nom" ++ td (pn.s ! Nom)) ++
|
||||
tr (th "Acc" ++ td (pn.s ! Acc)) ++
|
||||
tr (th "Dat" ++ td (pn.s ! Dat)) ++
|
||||
tr (th "Gen" ++ td (pn.s ! Gen)) ++
|
||||
tr (th "Abl" ++ td (pn.s ! Abl)) ++
|
||||
tr (th "Inst" ++td (pn.s ! Inst)) ++
|
||||
tr (th "Com" ++ td (pn.s ! Com)) ++
|
||||
tr (th "Dir" ++ td (pn.s ! Dir))) ;
|
||||
s3=[]
|
||||
} ;
|
||||
|
||||
lin InflectionA, InflectionA2 = \adj -> {
|
||||
t="a" ;
|
||||
s1=heading1 "Adjective" ;
|
||||
s2= paragraph (adj.s) ;
|
||||
s3=[]
|
||||
} ;
|
||||
|
||||
lin InflectionAdv, InflectionAdV, InflectionAdA, InflectionAdN = \adv -> {
|
||||
t = "adv" ;
|
||||
s1= heading1 "Adverb" ;
|
||||
s2= paragraph (adv.s) ;
|
||||
s3= ""
|
||||
} ;
|
||||
|
||||
lin InflectionPrep = \prep -> {
|
||||
t = "prep" ;
|
||||
s1= heading1 "Preposition" ;
|
||||
s2= paragraph (prep.s) ;
|
||||
s3= ""
|
||||
} ;
|
||||
|
||||
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>Example:</b>"++e.s++"</p>"};
|
||||
|
||||
lin
|
||||
MkDocument d i e = {s = i.s1 ++ d.s ++ i.s2 ++ paragraph e.s} ;
|
||||
MkTag i = {s = i.t} ;
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
concrete LangMon of Lang =
|
||||
GrammarMon,
|
||||
LexiconMon -- to compile faster, use TestLexiconMon (see LangExtraMon.gf)
|
||||
,DocumentationMon --# notpresent
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ; coding=utf8 ;
|
||||
|
||||
@@ -19,7 +19,7 @@ lin
|
||||
baby_N = mk2N "нялх" (mkN01f "хүүхэд") ;
|
||||
back_N = mk2N "ар" (mkN "тал" "талууд") ;
|
||||
bad_A = mkA "муу";
|
||||
bank_N = mkLN "банк" ;
|
||||
bank_N = loanN "банк" ;
|
||||
bark_N = mkN "холтос";
|
||||
beautiful_A = mkA "хөөрхөн";
|
||||
become_VA = mkVA (mkV "болох") ;
|
||||
@@ -50,9 +50,9 @@ lin
|
||||
burn_V = mkV "шатах" ;
|
||||
butter_N = mk2N "цөцгийн" (mkN "тос") ;
|
||||
buy_V2 = mkV2 (mkV "худалдан авах") ;
|
||||
camera_N = mk2N "зургийн" (mkLN "аппарат") ;
|
||||
camera_N = mk2N "зургийн" (loanN "аппарат") ;
|
||||
cap_N = mkN "аяга" ;
|
||||
car_N = mkLN "машин" "машинууд" ;
|
||||
car_N = loan2N "машин" "машинууд" ;
|
||||
carpet_N = mkN "хивс" ;
|
||||
cat_N = mkN01h "муур" ;
|
||||
ceiling_N = mkN "тааз" ;
|
||||
@@ -234,7 +234,7 @@ lin
|
||||
reason_N = mkN "шалтгаан" "шалтгаанууд" ;
|
||||
red_A = mkA "улаан" ;
|
||||
religion_N = mkN "шашин" ;
|
||||
restaurant_N = mkLN "ресторан" "ресторанууд" ;
|
||||
restaurant_N = loan2N "ресторан" "ресторанууд" ;
|
||||
right_Ord = mkOrd "баруун" ;
|
||||
river_N = mkN "гол" "голууд" ;
|
||||
road_N = mkN "зам" "замууд" ;
|
||||
|
||||
@@ -28,10 +28,6 @@ oper
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
mkLN = overload { mkLN : Str -> Noun = loanN ;
|
||||
mkLN : (_,_ : Str) -> Noun = loan2N } ;
|
||||
|
||||
regN : Str -> Noun = \nomSg -> mkDeclDrop (chooseDcl nomSg) nomSg ;
|
||||
loanN : Str -> Noun = \nomSg -> mkDeclNoDrop (chooseDcl nomSg) nomSg ;
|
||||
|
||||
@@ -39,6 +35,9 @@ oper
|
||||
s = \\rc => (loanN pn).s ! (SF Sg (toNCase rc Definite))
|
||||
} ;
|
||||
|
||||
mkLN : Str -> LN = \s -> lin LN {s=s} ;
|
||||
mkSN : Str -> SN = \s -> lin SN {s=s} ;
|
||||
mkGN : Str -> GN = \s -> lin GN {s=s} ;
|
||||
|
||||
modDecl : (Dcl -> Dcl) -> Str -> Noun =
|
||||
\mod,nomSg -> mkDeclDrop (mod (chooseDcl nomSg)) nomSg ;
|
||||
|
||||
@@ -350,6 +350,9 @@ oper
|
||||
-- Adverb definitions
|
||||
|
||||
mkAdv : Str -> Adv = \x -> lin Adv (ss x) ;
|
||||
mkAdV : Str -> AdV = \s -> lin AdV {s=s} ;
|
||||
mkAdA : Str -> AdA = \s -> lin AdA {s=s} ;
|
||||
mkAdN : Str -> AdN = \s -> lin AdN {s=s} ;
|
||||
|
||||
-- Verb definitions (without type, these defs cause errors because argtype is unknown)
|
||||
|
||||
@@ -385,4 +388,7 @@ oper
|
||||
mkAS, mkAV : Adjective -> A = \a -> lin A a ;
|
||||
mkA2S, mkA2V : Adjective -> Prep -> A2 = \a,p -> mkA2 a p ;
|
||||
|
||||
|
||||
mkInterj : Str -> Interj = \s -> lin Interj {s=s} ;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user