adjustments and clean-up in resource

This commit is contained in:
aarne
2006-02-26 18:43:13 +00:00
parent f1ffa2f17d
commit 4a21c9b6e2
27 changed files with 84 additions and 70 deletions

View File

@@ -4,7 +4,7 @@ test:
echo "gr -cat=Text -number=11 -prob | tb" | gf -nocf -probs=lang.gfprob langs.gfcm
langs:
echo "s ;; pm | wf langs.gfcm" | gf -nocf -src */Lang??*.gf english/LangEng.gf +RTS -M500M -K100M
echo "s ;; pm | wf langs.gfcm" | gf -nocf -src */Lang??*.gf english/LangEng.gf +RTS -M800M -K100M
cp -p */*.gfc */*.gfr ../alltenses
present:

View File

@@ -14,7 +14,7 @@ Eng: non-contracted negations
Ita: infinitive contractions
Ita: articles in possessives
%Ita: articles in possessives
%Ger: constituents of infinitive VP
@@ -36,7 +36,7 @@ API: mathematical/: math-specific lexicon
API: multimodal/: dialogue-specific lexicon
API: swadesh/: build a swadesh-related API and migrate lexica
%API: swadesh/: build a swadesh-related API and migrate lexica
API: mathematical/: symbolic formulas as Cl

View File

@@ -5,7 +5,7 @@
-- forms of sentences. Together they give 2 x 4 x 4 = 16 sentence forms.
-- These tenses are defined for all languages in the library. More tenses
-- can be defined in the language extensions, e.g. the "passé simple" of
-- can be defined in the language extensions, e.g. the "passé simple" of
-- Romance languages.
abstract Tense = {

View File

@@ -31,8 +31,8 @@ abstract Verb = Cat ** {
-- them. In many languages, the result is a participle that
-- is used as complement to a copula ("is used"), but other
-- auxiliary verbs are possible (Ger. "wird angewendet", It.
-- "viene usato"), as well as special verb forms (Fin. "käytetään",
-- Swe. "används").
-- "viene usato"), as well as special verb forms (Fin. "käytetään",
-- Swe. "används").
--
-- *Note*. the rule can be overgenerating, since the $V2$ need not
-- take a direct object.

View File

@@ -15,9 +15,9 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
} ;
ncase : Case -> NForm = \c ->
case <n,c,det.isNum,det.isPoss, det.isDef> of {
<_, Nom, True,_,_> => NCase Sg Part ; -- kolme kytkintä(ni)
<_, Nom, True,_,_> => NCase Sg Part ; -- kolme kytkintä(ni)
<_, _, True,False,_> => NCase Sg c ; -- kolmeksi kytkimeksi
<Pl,Nom, _,_,False> => NCase Pl Part ; -- kytkimiä
<Pl,Nom, _,_,False> => NCase Pl Part ; -- kytkimiä
<_, Nom,_,True,_> => NPossNom ; -- kytkime+ni on/ovat...
<Sg,Gen,_,True,_> => NPossNom ; -- kytkime+ni vika
<Pl,Gen,_,True,_> => NPossGenPl ; -- kytkimie+ni viat
@@ -59,7 +59,7 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
} ;
DetPl quant num ord = {
s1 = \\c => quant.s1 ! c ++ num.s ! Pl ! c ++ ord.s ! Pl ! c ;
s1 = \\c => quant.s1 ! c ++ num.s ! Sg ! c ++ ord.s ! Pl ! c ;
s2 = quant.s2 ;
n = Pl ;
isNum = num.isNum ;

View File

@@ -45,9 +45,9 @@ concrete QuestionFin of Question = CatFin ** open ResFin, Prelude in {
let
k = npform2case c ;
ncase = case <k,num.isNum> of {
<Nom, True> => NCase Sg Part ; -- mitkä kolme kytkintä
<Nom, True> => NCase Sg Part ; -- mitkä kolme kytkintä
<_, True> => NCase Sg k ; -- miksi kolmeksi kytkimeksi
_ => NCase n k -- mitkä kytkimet
_ => NCase n k -- mitkä kytkimet
}
in
idet.s ! k ++ num.s ! Sg ! k ++ ord.s ! n ! k ++ cn.s ! ncase ;

View File

@@ -28,8 +28,8 @@ concrete SentenceFin of Sentence = CatFin ** open Prelude, ResFin in {
SlashVVV2 np vv v2 =
let
sc = case v2.sc of {
NPCase Nom => vv.sc ; -- joka minun täytyy pestä
c => c -- joka minulla täytyy olla
NPCase Nom => vv.sc ; -- joka minun täytyy pestä
c => c -- joka minulla täytyy olla
}
in
{s = \\t,ag,p =>
@@ -53,7 +53,7 @@ concrete SentenceFin of Sentence = CatFin ** open Prelude, ResFin in {
c2 = prep
} ;
EmbedS s = {s = "että" ++ s.s} ;
EmbedS s = {s = "että" ++ s.s} ;
EmbedQS qs = {s = qs.s} ;
EmbedVP vp = {s = infVP (NPCase Nom) Pos (agrP3 Sg) vp} ; --- case,pol,agr

View File

@@ -6,7 +6,6 @@ instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in {
param
Prep = P_de | P_a ;
NPForm = Ton Case | Aton Case | Poss {g : Gender ; n : Number} ; --- AAgr
VType = VHabere | VEsse | VRefl ;
oper
@@ -39,6 +38,8 @@ instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in {
_ => prepCase c ++ "des"
} ;
possCase = \_,_,c -> prepCase c ;
partitive = \g,c -> case c of {
CPrep P_de => elisDe ;
_ => prepCase c ++ artDef g Sg (CPrep P_de)
@@ -62,18 +63,27 @@ instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in {
vpAgrClit : Agr -> VPAgr = \a ->
VPAgrClit (aagr a.g a.n) ; --- subty
pronArg = \n,p,acc,dat ->
pronArg = pronArgGen Neg ;
-- Positive polarity is used in the imperative: stressed for 1st and
-- 2nd persons.
pronArgGen : Polarity -> Number -> Person -> CAgr -> CAgr -> Str * Str = \b,n,p,acc,dat ->
let
cas : Person -> Case -> Case = \pr,c -> case <pr,b> of {
<P1 | P2, Pos> => CPrep P_de ; --- encoding in argPron
_ => c
} ;
pacc = case acc of {
CRefl => case p of {
P3 => elision "s" ; --- use of reflPron incred. expensive
_ => argPron Fem n p Acc
_ => argPron Fem n p (cas p Acc)
} ;
CPron a => argPron a.g a.n a.p Acc ;
CPron a => argPron a.g a.n a.p (cas a.p Acc) ;
_ => []
} ;
pdat = case dat of {
CPron a => argPron a.g a.n a.p dative ;
CPron a => argPron a.g a.n a.p (cas a.p dative) ;
_ => []
} ;
in
@@ -88,11 +98,11 @@ instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in {
agr = aag ** {p = P2} ;
verb = (vp.s ! VPImperat).fin ! agr ;
neg = vp.neg ! pol ;
clpr = pronArg agr.n agr.p vp.clAcc vp.clDat ;
clpr = pronArgGen pol agr.n agr.p vp.clAcc vp.clDat ;
compl = clpr.p2 ++ vp.comp ! agr ++ vp.ext ! pol
in
case pol of {
Pos => verb ++ clpr.p1 ++ compl ; ---- clitics can be different
Pos => verb ++ clpr.p1 ++ compl ;
Neg => neg.p1 ++ clpr.p1 ++ verb ++ neg.p2 ++ compl
}
} ;

View File

@@ -2,9 +2,9 @@ resource PhonoFre = open Prelude in {
oper
voyelle : Strs = strs {
"a" ; "â" ; "à" ; "e" ; "ê" ; "é" ; "è" ;
"a" ; "à" ; "â " ; "e" ; "é" ; "è" ; "ê¨" ;
"h" ;
"i" ; "î" ; "o" ; "ô" ; "u" ; "û" ; "y"
"i" ; "î" ; "o" ; "ô" ; "u" ; "û" ; "y"
} ;
elision : Str -> Str = \d -> d + pre {"e" ; "'" / voyelle} ;

View File

@@ -80,7 +80,7 @@ lin
someSg_Det = {s = \\_,c => prepCase c ++ elision "quelqu" ; n = Sg} ;
something_NP = pn2np (mkPN ["quelque chose"] Masc) ;
somewhere_Adv = ss ["quelque part"] ; --- ne - pas
that_Quant = {s =
that_Quant = {s = \\_ =>
table {
Sg => \\g,c => prepCase c ++ genForms "ce" "cette" ! g ; ---- cet ; là
Pl => \\_,_ => "ces"
@@ -95,7 +95,7 @@ lin
they_Pron = mkPronoun
"elles" "les" "leur" "eux" "leur" "leur" "leurs"
Fem Pl P3 ;
this_Quant = {s =
this_Quant = {s = \\_ =>
table {
Sg => \\g,c => prepCase c ++ genForms "ce" "cette" ! g ; ---- cet ; ci
Pl => \\_,_ => "ces"

View File

@@ -5,7 +5,7 @@ concrete IdiomGer of Idiom = CatGer **
lin
ExistNP np =
let geben = dirV2 (mkV "geben" "gibt" "gib" "gab" "gäbe" "gegeben")
let geben = dirV2 (mkV "geben" "gibt" "gib" "gab" "gäbe" "gegeben")
in
mkClause "es" (agrP3 Sg)
(insertObj (\\_ => appPrep geben.c2 np.s)

View File

@@ -392,21 +392,21 @@ resource ResGer = ParamX ** open Prelude in {
mkV
"haben" "habe" "hast" "hat" "habt" "hab"
"hatte" "hattest" "hatten" "hattet"
"hätte" "gehabt"
"hätte" "gehabt"
[] VHaben ;
werden_V : Verb =
mkV
"werden" "werde" "wirst" "wird" "werdet" "werd"
"wurde" "wurdest" "wurden" "wurdet"
"würde" "geworden"
"würde" "geworden"
[] VSein ;
werdenPass : Verb =
mkV
"werden" "werde" "wirst" "wird" "werdet" "werd"
"wurde" "wurdest" "wurden" "wurdet"
"würde" "worden"
"würde" "worden"
[] VSein ;
sein_V : Verb =
@@ -414,7 +414,7 @@ resource ResGer = ParamX ** open Prelude in {
sein = mkV
"sein" "bin" "bist" "ist" "seid" "sei"
"war" "warst" "waren" "wart"
"wäre" "gewesen"
"wäre" "gewesen"
[] VSein
in
{s = table {
@@ -544,7 +544,7 @@ resource ResGer = ParamX ** open Prelude in {
{n = Pl ; p = P3} => caselist "sie" "sich" "sich" "ihrer"
} ;
conjThat : Str = "daß" ;
conjThat : Str = "daß" ;
conjThan : Str = "als" ;

View File

@@ -6,7 +6,6 @@ instance DiffIta of DiffRomance = open CommonRomance, PhonoIta, BeschIta, Prelud
param
Prep = P_di | P_a | P_da | P_in | P_su | P_con ;
NPForm = Ton Case | Aton Case | PreClit | Poss {g : Gender ; n : Number} ; --- AAgr
VType = VHabere | VEsse | VRefl ;
oper
@@ -56,6 +55,8 @@ instance DiffIta of DiffRomance = open CommonRomance, PhonoIta, BeschIta, Prelud
_ => prepCase c
} ;
possCase = artDef ;
partitive = \g,c -> case c of {
CPrep P_di => "di" ;
_ => prepCase c ++ artDef g Sg (CPrep P_di)

View File

@@ -131,6 +131,9 @@ oper
-- All the eight personal pronouns can be built by the following macro.
-- The use of "ne" as atonic genitive is debatable.
-- We follow the rule that the atonic nominative is empty.
-- (The form $glie$ is no longer used, and also the other clitics are
-- given in $DiffIta.argPron$ and therefore wouldn't be needed in the
-- pronoun itself.)
mkPronoun : (_,_,_,_,_,_,_,_,_ : Str) ->
Gender -> Number -> Person -> Pronoun =
@@ -143,7 +146,6 @@ oper
Aton (CPrep P_di) => "ne" ; --- hmm
Aton (CPrep P_a) => lui ;
Aton q => prepCase q ++ Lui ; ---- GF bug with c or p!
PreClit => glie ;
Poss {n = Sg ; g = Masc} => son ;
Poss {n = Sg ; g = Fem} => sa ;
Poss {n = Pl ; g = Masc} => ses ;

View File

@@ -80,7 +80,7 @@ lin
something_NP = pn2np (mkPN ["qualche cosa"] Masc) ;
somewhere_Adv = ss ["qualche parte"] ;
that_Quant = {
s = table {
s = \\_ => table {
Sg => \\g,c => prepCase c ++ genForms "quello" "quella" ! g ;
Pl => \\g,c => prepCase c ++ genForms "quelli" "quelle" ! g ---- quegli
}
@@ -95,7 +95,7 @@ lin
"loro" "loro" "li" "glie" "loro" "loro" "loro" "loro" "loro"
Fem Pl P3 ;
this_Quant = {
s = table {
s = \\_ => table {
Sg => \\g,c => prepCase c ++ genForms "questo" "questa" ! g ;
Pl => \\g,c => prepCase c ++ genForms "questi" "queste" ! g
}

View File

@@ -11,7 +11,7 @@ concrete IdiomNor of Idiom = CatNor **
GenericCl vp = mkClause "man" (agrP3 neutrum Sg) vp ;
ProgrVP vp =
insertObj (\\a => ["ved å"] ++ infVP vp a) (predV verbBe) ;
insertObj (\\a => ["ved å"] ++ infVP vp a) (predV verbBe) ;
}

View File

@@ -220,7 +220,7 @@ oper
--3 Deponent verbs.
--
-- Some words are used in passive forms only, e.g. "hoppas", some as
-- reflexive e.g. "ångra sig".
-- reflexive e.g. "ångra sig".
depV : V -> V ;
reflV : V -> V ;
@@ -369,7 +369,7 @@ oper
mkV0 v = v ** {lock_V0 = <>} ;
mkVS v = v ** {lock_VS = <>} ;
mkV2S v p = mkV2 v p ** {lock_V2S = <>} ;
mkVV v = v ** {c2 = "å" ; lock_VV = <>} ;
mkVV v = v ** {c2 = "å" ; lock_VV = <>} ;
mkV2V v p t = mkV2 v p ** {s3 = t ; lock_V2V = <>} ;
mkVA v = v ** {lock_VA = <>} ;
mkV2A v p = mkV2 v p ** {lock_V2A = <>} ;

View File

@@ -49,10 +49,10 @@ incomplete concrete CatRomance of Cat =
NP,Pron = Pronoun ;
Det = {s : Gender => Case => Str ; n : Number} ;
QuantSg = {s : Gender => Case => Str} ;
QuantPl = {s : Gender => Case => Str} ;
Quant = {s : Number => Gender => Case => Str} ;
QuantPl = {s : Bool => Gender => Case => Str} ;
Quant = {s : Bool => Number => Gender => Case => Str} ;
Predet = {s : AAgr => Case => Str ; c : Case} ; -- la plupart de...
Num = {s : Gender => Str} ;
Num = {s : Gender => Str ; isNum : Bool} ;
Ord = {s : AAgr => Str} ;
-- Adverb

View File

@@ -15,11 +15,6 @@ interface DiffRomance = open CommonRomance, Prelude in {
param Prep ;
-- Forms of noun phrases. Spanish and Italian have special forms for
-- fronted clitics.
param NPForm ;
-- Which types of verbs exist, in terms of auxiliaries.
-- (Fre, Ita "avoir", "être", and refl; Spa only "haber" and refl).
@@ -55,8 +50,10 @@ interface DiffRomance = open CommonRomance, Prelude in {
--2 Constants that must derivatively depend on language
dative : Case ;
genitive : Case ;
param NPForm = Ton Case | Aton Case | Poss {g : Gender ; n : Number} ; --- AAgr
oper dative : Case ;
oper genitive : Case ;
vRefl : VType ;
isVRefl : VType -> Bool ;
@@ -71,6 +68,10 @@ interface DiffRomance = open CommonRomance, Prelude in {
artDef : Gender -> Number -> Case -> Str ;
artIndef : Gender -> Number -> Case -> Str ;
-- This is the definite article in Italian, $prepCase c$ in French and Spanish.
possCase : Gender -> Number -> Case -> Str ;
auxVerb : VType -> (VF => Str) ;
negation : Polarity => (Str * Str) ;
copula : Verb ;
@@ -81,7 +82,7 @@ interface DiffRomance = open CommonRomance, Prelude in {
relPron : Bool => AAgr => Case => Str ;
pronSuch : AAgr => Str ;
partQIndir : Str ; -- ce, ciò
partQIndir : Str ; -- ce, ciò
reflPron : Number -> Person -> Case -> Str ;
-- argPron : Gender -> Number -> Person -> Case -> Str ;

View File

@@ -30,36 +30,36 @@ incomplete concrete NounRomance of Noun =
n = Sg
} ;
DetPl quant num ord = {
s = \\g,c => quant.s ! g ! c ++ num.s ! g ++ ord.s ! aagr g Pl ;
s = \\g,c => quant.s ! num.isNum ! g ! c ++ num.s ! g ++ ord.s ! aagr g Pl ;
n = Pl
} ;
SgQuant q = {s = q.s ! Sg} ;
PlQuant q = {s = q.s ! Pl} ;
SgQuant q = {s = q.s ! False ! Sg} ;
PlQuant q = {s = \\b => q.s ! b ! Pl} ;
PossPron p = {
s = \\n,g,c => prepCase c ++ p.s ! Poss (aagr g n) ---- il mio!
s = \\_,n,g,c => possCase g n c ++ p.s ! Poss (aagr g n) ---- il mio!
} ;
NoNum = {s = \\_ => []} ;
NoNum = {s = \\_ => [] ; isNum = False} ;
NoOrd = {s = \\_ => []} ;
NumInt n = {s = \\_ => n.s} ;
OrdInt n = {s = \\_ => n.s ++ "ème"} ; ---
NumInt n = {s = \\_ => n.s ; isNum = True} ;
OrdInt n = {s = \\_ => n.s ++ "."} ; ---
NumNumeral numeral = {s = \\g => numeral.s ! NCard g} ;
NumNumeral numeral = {s = \\g => numeral.s ! NCard g ; isNum = True} ;
OrdNumeral numeral = {s = \\a => numeral.s ! NOrd a.g a.n} ;
AdNum adn num = {s = \\a => adn.s ++ num.s ! a} ;
AdNum adn num = {s = \\a => adn.s ++ num.s ! a ; isNum = num.isNum} ;
OrdSuperl adj = {s = \\a => adj.s ! Superl ! AF a.g a.n} ;
DefArt = {
s = \\n,g,c => artDef g n c
s = \\_,n,g,c => artDef g n c
} ;
IndefArt = {
s = \\n,g,c => artIndef g n c
s = \\b,n,g,c => if_then_Str b [] (artIndef g n c) ;
} ;
MassDet = {

View File

@@ -29,8 +29,7 @@ oper
npform2case : NPForm -> Case = \p -> case p of {
Ton x => x ;
Poss _ => genitive ;
Aton x => x ;
_ => dative ---- Ita PreClit
Aton x => x
} ;
case2npform : Case -> NPForm = \c -> case c of {

View File

@@ -43,7 +43,7 @@ interface DiffScand = open CommonScand, Prelude in {
relPron : GenNum => RCase => Str ;
-- Pronoun "sådan" used in $Relative.RelCl$.
-- Pronoun "sådan" used in $Relative.RelCl$.
pronSuch : GenNum => Str ;

View File

@@ -6,7 +6,6 @@ instance DiffSpa of DiffRomance = open CommonRomance, PhonoSpa, BeschSpa, Prelud
param
Prep = P_de | P_a ;
NPForm = Ton Case | Aton Case | Poss {g : Gender ; n : Number} ; --- AAgr
VType = VHabere | VRefl ;
oper
@@ -37,6 +36,8 @@ instance DiffSpa of DiffRomance = open CommonRomance, PhonoSpa, BeschSpa, Prelud
_ => prepCase c ++ genForms "unos" "unas" ! g
} ;
possCase = \_,_,c -> prepCase c ;
partitive = \g,c -> case c of {
CPrep P_de => "de" ;
_ => prepCase c ++ artDef g Sg (CPrep P_de)

View File

@@ -16,7 +16,7 @@ lincat Sub1000000 = {s : Gender => Str ; n : Number} ;
lin num x = {
s = table {
NCard g => x.s ! g ;
NOrd _ _ => "número" ++ x.s ! Masc ---- TODO
NOrd _ _ => "número" ++ x.s ! Masc ---- TODO
}
} ;
lin n2 =

View File

@@ -85,7 +85,7 @@ lin
something_NP = pn2np (mkPN ["algo"] Masc) ;
somewhere_Adv = ss ["en ninguna parte"] ;
that_Quant = {
s = table {
s = \\_ => table {
Sg => \\g,c => prepCase c ++ genForms "ese" "esa" ! g ;
Pl => \\g,c => prepCase c ++ genForms "esos" "esas" ! g
}
@@ -101,7 +101,7 @@ lin
"su" "su" "sus" "sus"
Fem Pl P3 ;
this_Quant = {
s = table {
s = \\_ => table {
Sg => \\g,c => prepCase c ++ genForms "este" "esta" ! g ;
Pl => \\g,c => prepCase c ++ genForms "estos" "estas" ! g
}