completed Documentation modules for English, Swedish, Bulgarian, German, Finnish, French. The examples for Finnish, German and French could still be improved. The old parsing grammars are now restored. The new Translation grammar still don't have statistical model.

This commit is contained in:
kr.angelov
2014-02-21 16:31:50 +00:00
parent 014f4e1e11
commit dc19edc05d
15 changed files with 1037 additions and 477 deletions

View File

@@ -1,7 +1,184 @@
--# -path=.:../abstract:../common
concrete DocumentationEng of Documentation = CatEng ** open
ResEng,
HTML in {
-- documentation of English in English: the default introduced in LangEng
lincat
Inflection = {t : Str; s1,s2 : Str} ;
Document = {s : Str} ;
Tag = {s : Str} ;
concrete DocumentationEng of Documentation = CatEng **
DocumentationEngFunctor with (Terminology = TerminologyEng) ;
lin
InflectionN, InflectionN2, InflectionN3 = \noun -> {
t = "n" ;
s1 = heading1 ("Noun" ++ case noun.g of {
Neutr => "";
Masc => "(masc)";
Fem => "(fem)"
}) ;
s2 = frameTable (
tr (th "" ++ th "nom" ++ th "gen") ++
tr (th "sg" ++ td (noun.s ! Sg ! Nom) ++ td (noun.s ! Sg ! Gen)) ++
tr (th "pl" ++ td (noun.s ! Pl ! Nom) ++ td (noun.s ! Pl ! Gen))
)
} ;
InflectionA, InflectionA2 = \adj -> {
t = "a" ;
s1 = heading1 "Adjective" ;
s2 = frameTable (
tr (th "" ++ th "nom" ++ th "gen") ++
tr (th "posit" ++ td (adj.s ! AAdj Posit Nom) ++ td (adj.s ! AAdj Posit Gen)) ++
tr (th "compar" ++ td (adj.s ! AAdj Compar Nom) ++ td (adj.s ! AAdj Compar Gen)) ++
tr (th "superl" ++ td (adj.s ! AAdj Superl Nom) ++ td (adj.s ! AAdj Superl Gen))
) ++
heading1 "Adverb" ++
paragraph (adj.s ! AAdv)
} ;
InflectionAdv = \adv -> {
t = "adv" ;
s1= heading1 "Adverb" ;
s2= paragraph (adv.s) ;
s3= ""
} ;
InflectionPrep = \prep -> {
t = "prep" ;
s1= heading1 "Preposition" ;
s2= paragraph (prep.s) ;
s3= ""
} ;
InflectionV v = {
t = "v" ;
s1= heading1 "Verb" ++
paragraph (pp "subject" ++ v.s ! VInf ++ v.p) ;
s2= inflVerb v
} ;
InflectionV2 v = {
t = "v" ;
s1= heading1 "Verb" ++
paragraph (pp "subject" ++
v.s ! VInf ++ v.p ++ v.c2 ++
pp "object") ;
s2= inflVerb v
} ;
InflectionV3 v = {
t = "v" ;
s1= heading1 "Verb" ++
paragraph (pp "subject" ++
v.s ! VInf ++ v.p ++
v.c2 ++ pp "arg1" ++
v.c3 ++ pp "arg2") ;
s2= inflVerb v
} ;
InflectionV2V v = {
t = "v" ;
s1= heading1 "Verb" ++
paragraph (pp "subject" ++
v.s ! VInf ++ v.p ++
v.c2 ++ pp "object" ++
v.c3 ++ case v.typ of {
VVAux => pp "verb" ;
VVInf => "to" ++ pp "verb" ;
VVPresPart => pp "verb+ing"
}) ;
s2= inflVerb v
} ;
InflectionV2S v = {
t = "v" ;
s1= heading1 "Verb" ++
paragraph (pp "subject" ++
v.s ! VInf ++ v.p ++
v.c2 ++ pp "object" ++
"that" ++ pp "sentence") ;
s2= inflVerb v
} ;
InflectionV2Q v = {
t = "v" ;
s1= heading1 "Verb" ++
paragraph (pp "subject" ++
v.s ! VInf ++ v.p ++
pp "question") ;
s2= inflVerb v
} ;
InflectionV2A v = {
t = "v" ;
s1= heading1 "Verb" ++
paragraph (pp "subject" ++
v.s ! VInf ++ v.p ++
v.c2 ++ pp "object" ++
pp "adjective") ;
s2= inflVerb v
} ;
InflectionVV v = {
t = "v" ;
s1= heading1 "Verb" ++
paragraph (pp "subject" ++
v.s ! VVF VInf ++ v.p ++
case v.typ of {
VVAux => pp "verb" ;
VVInf => "to" ++ pp "verb" ;
VVPresPart => pp "verb+ing"
}) ;
s2= frameTable (
tr (th "infitive" ++ td (v.s ! VVF VInf)) ++
tr (th "present" ++ td (v.s ! VVF VPres ++ " " ++ v.s ! VVPresNeg)) ++
tr (th "past" ++ td (v.s ! VVF VPast ++ " " ++ v.s ! VVPastNeg)) ++ --# notpresent
tr (th "past part." ++ td (v.s ! VVF VPPart)) ++
tr (th "present part." ++ td (v.s ! VVF VPresPart))
)
} ;
InflectionVS v = {
t = "v" ;
s1= heading1 "Verb" ++
paragraph (pp "subject" ++
v.s ! VInf ++ v.p ++
"that" ++ pp "sentence") ;
s2= inflVerb v
} ;
InflectionVQ v = {
t = "v" ;
s1= heading1 "Verb" ++
paragraph (pp "subject" ++
v.s ! VInf ++ v.p ++
pp "question") ;
s2= inflVerb v
} ;
InflectionVA v = {
t = "v" ;
s1= heading1 "Verb" ++
paragraph (pp "subject" ++
v.s ! VInf ++ v.p ++
pp "adjective") ;
s2= inflVerb v
} ;
oper
inflVerb : Verb -> Str = \verb ->
frameTable (
tr (th "infitive" ++ td (verb.s ! VInf)) ++
tr (th "present" ++ td (verb.s ! VPres)) ++
tr (th "past" ++ td (verb.s ! VPast)) ++ --# notpresent
tr (th "past part." ++ td (verb.s ! VPPart)) ++
tr (th "present part." ++ td (verb.s ! VPresPart))
) ;
pp : Str -> Str = \s -> "<"+s+">";
lin
MkDocument b i e = {s = i.s1 ++ paragraph b.s ++ i.s2 ++ paragraph e.s} ;
MkTag i = {s = i.t} ;
}

View File

@@ -1,4 +1,4 @@
--# -path=.:../abstract
--# -path=.:../abstract:../translator
concrete ParseEng of ParseEngAbs =
TenseX - [Pol, PNeg, PPos],
@@ -23,7 +23,7 @@ concrete ParseEng of ParseEngAbs =
ComplSlashPartLast,
ClSlash, RCl, EmptyRelSlash, VS, V2S, ComplBareVS, SlashBareV2S],
DictEng **
DictionaryEng **
open MorphoEng, ResEng, ParadigmsEng, (S = SentenceEng), (E = ExtraEng), Prelude in {
flags
@@ -156,68 +156,4 @@ lin
PPos = {s = [] ; p = CPos} ;
PNeg = {s = [] ; p = CNeg True} | {s = [] ; p = CNeg False} ;
lincat
Feat = Str;
lin FeatN, FeatN2 = \n ->
case n.g of {
Neutr => "";
Masc => "(masc)";
Fem => "(fem)"
};
FeatV = \v ->
"<subject>" ++
v.s ! VInf ++ v.p ;
FeatV2 = \v ->
"<subject>" ++
v.s ! VInf ++ v.p ++ v.c2 ++
"<object>";
FeatV3 = \v ->
"<subject>" ++
v.s ! VInf ++ v.p ++
v.c2 ++ "<arg1>" ++
v.c3 ++ "<arg2>";
FeatV2V = \v ->
"<subject>" ++
v.s ! VInf ++ v.p ++
v.c2 ++ "<object>" ++
v.c3 ++ case v.typ of {
VVAux => "<verb>" ;
VVInf => "to" ++ "<verb>" ;
VVPresPart => "<verb+ing>"
};
FeatV2S = \v ->
"<subject>" ++
v.s ! VInf ++ v.p ++
v.c2 ++ "<object>" ++
"that" ++ "<sentence>";
FeatV2Q = \v ->
"<subject>" ++
v.s ! VInf ++ v.p ++
v.c2 ++ "<object>" ++
"that" ++ "<question>";
FeatV2A = \v ->
"<subject>" ++
v.s ! VInf ++ v.p ++
v.c2 ++ "<object>" ++
"<adjective>";
FeatVV = \v ->
"<subject>" ++
v.s ! VVF VInf ++ v.p ++
case v.typ of {
VVAux => "<verb>" ;
VVInf => "to" ++ "<verb>" ;
VVPresPart => "<verb+ing>"
};
FeatVS = \v ->
"<subject>" ++
v.s ! VInf ++ v.p ++
"that" ++ "<sentence>";
FeatVQ = \v ->
"<subject>" ++
v.s ! VInf ++ v.p ++
"<question>";
FeatVA = \v ->
"<subject>" ++
v.s ! VInf ++ v.p ++
"<adjective>";
}

View File

@@ -19,7 +19,7 @@ abstract ParseEngAbs =
Temp, Tense, Pol, Conj, VPS, ListVPS, S, Num, CN, RP, MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS, GenRP,
VPI, ListVPI, VV, MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV, ComplSlashPartLast,
ClSlash, RCl, EmptyRelSlash, VS, V2S, ComplBareVS, SlashBareV2S],
DictEngAbs ** {
Dictionary ** {
flags
startcat=Phr;