ArchEdit moved; spanish/Structural now works

This commit is contained in:
aarne
2005-03-30 11:41:12 +00:00
parent d465324279
commit 6cb79f531c
8 changed files with 1169 additions and 1154 deletions

View File

@@ -2,11 +2,6 @@ concrete NumeralsIta of Numerals = open Prelude, TypesIta, MorphoIta, SyntaxIta
lincat
--Digit = {s : DForm => Str} ;
--lincat Sub10 = {s : DForm => Str ; n : Number} ;
--lincat Sub100 = {s : Str ; n : Number} ;
--lincat Sub1000 = {s : Str ; n : Number} ;
--lincat Sub1000000 = {s : Str} ;
Numeral = {s : Gender => Str ; n : Number} ;
Digit = {s : DForm => Str} ;
Sub10 = {s : DForm => Gender => Str ; n : Number} ;

File diff suppressed because it is too large Load Diff

View File

@@ -176,4 +176,11 @@ haber_10 : Str -> Verbum = haber_3 ;
param DForm = unit | teen | ten | hundred ;
param Modif = mod | unmod | conj ;
oper spl : Str -> {s : Gender => Str ; n : Number} = \s -> {s = \\_ =>
s ; n = Pl} ;
uno : Gender => Str = table {Masc => "uno" ; Fem => "una"} ;
yuno : Gender => Str = \\g => "y" ++ uno ! g ;
}

View File

@@ -1,18 +1,20 @@
concrete NumeralsSpa of Numerals = open MorphoSpa in {
--# -path=.:../romance:../abstract:../../prelude
concrete NumeralsSpa of Numerals = open TypesSpa, MorphoSpa in {
-- by Carlos Gonzalia, Chalmers, 1999
-- original source automatically translated to new GF by AR
-- modified by addition of gender and number 30/3/2005
lincat Numeral = {s : Str} ;
lincat Numeral = {s : Gender => Str ; n : Number} ;
lincat Digit = {inh : Modif ; s : {p1 : DForm ; p2 : Modif} => Str} ;
lincat Sub10 = {s : {p1 : DForm ; p2 : Modif} => Str} ;
lincat Sub100 = {s : Str} ;
lincat Sub1000 = {s : Str} ;
lincat Sub1000000 = {s : Str} ;
lincat Sub10 = {s : {p1 : DForm ; p2 : Modif} => Gender => Str ; n : Number} ;
lincat Sub100 = {s : Gender => Str ; n : Number} ;
lincat Sub1000 = {s : Gender => Str ; n : Number} ;
lincat Sub1000000 = {s : Gender => Str ; n : Number} ;
lin num x0 = x0 ;
lin num x0 =
{s = x0.s} ;
lin n2 =
{inh = mod ; s = table {{p1 = unit ; p2 = mod} => "dos" ; {p1 = unit ; p2 = unmod} => "dos" ; {p1 = unit ; p2 = conj} => "y" ++ "dos" ; {p1 = teen ; p2 = mod} => "doce" ; {p1 = teen ; p2 = unmod} => "doce" ; {p1 = teen ; p2 = conj} => "doce" ; {p1 = ten ; p2 = mod} => "veinti" ; {p1 = ten ; p2 = unmod} => "veinte" ; {p1 = ten ; p2 = conj} => "veinte" ; {p1 = hundred ; p2 = mod} => "doscientos" ; {p1 = hundred ; p2 = unmod} => "doscientos" ; {p1 = hundred ; p2 = conj} => "doscientos"}} ;
lin n3 =
@@ -30,31 +32,35 @@ lin n8 =
lin n9 =
{inh = conj ; s = table {{p1 = unit ; p2 = mod} => "nueve" ; {p1 = unit ; p2 = unmod} => "nueve" ; {p1 = unit ; p2 = conj} => "y" ++ "nueve" ; {p1 = teen ; p2 = mod} => "diecinueve" ; {p1 = teen ; p2 = unmod} => "diecinueve" ; {p1 = teen ; p2 = conj} => "diecinueve" ; {p1 = ten ; p2 = mod} => "noventa" ; {p1 = ten ; p2 = unmod} => "noventa" ; {p1 = ten ; p2 = conj} => "noventa" ; {p1 = hundred ; p2 = mod} => "novecientos" ; {p1 = hundred ; p2 = unmod} => "novecientos" ; {p1 = hundred ; p2 = conj} => "novecientos"}} ;
lin pot01 =
{s = table {{p1 = unit ; p2 = mod} => "uno" ; {p1 = unit ; p2 = unmod} => "uno" ; {p1 = unit ; p2 = conj} => "y" ++ "uno" ; {p1 = teen ; p2 = mod} => "uno" ; {p1 = teen ; p2 = unmod} => "uno" ; {p1 = teen ; p2 = conj} => "y" ++ "uno" ; {p1 = ten ; p2 = mod} => "uno" ; {p1 = ten ; p2 = unmod} => "uno" ; {p1 = ten ; p2 = conj} => "y" ++ "uno" ; {p1 = hundred ; p2 = mod} => "ciento" ; {p1 = hundred ; p2 = unmod} => "cien" ; {p1 = hundred ; p2 = conj} => "y" ++ "uno"}} ;
{s = table {{p1 = unit ; p2 = mod} => uno ; {p1 = unit ; p2 = unmod}
=> uno ; {p1 = unit ; p2 = conj} => yuno ; {p1 = teen ; p2 = mod} =>
uno ; {p1 = teen ; p2 = unmod} => uno ; {p1 = teen ; p2 = conj} =>
yuno ; {p1 = ten ; p2 = mod} => uno ; {p1 = ten ; p2 = unmod} => uno
; {p1 = ten ; p2 = conj} => yuno ; {p1 = hundred ; p2 = mod} =>
\\_ => "ciento" ; {p1 = hundred ; p2 = unmod} => \\_ => "cien" ; {p1 = hundred ; p2 = conj} => yuno} ; n = Sg} ;
lin pot0 d =
{s = table {{p1 = unit ; p2 = mod} => d.s ! {p1 = unit ; p2 = mod} ; {p1 = unit ; p2 = unmod} => d.s ! {p1 = unit ; p2 = unmod} ; {p1 = unit ; p2 = conj} => d.s ! {p1 = unit ; p2 = conj} ; {p1 = teen ; p2 = mod} => d.s ! {p1 = teen ; p2 = mod} ; {p1 = teen ; p2 = unmod} => d.s ! {p1 = teen ; p2 = unmod} ; {p1 = teen ; p2 = conj} => d.s ! {p1 = teen ; p2 = conj} ; {p1 = ten ; p2 = mod} => d.s ! {p1 = ten ; p2 = mod} ; {p1 = ten ; p2 = unmod} => d.s ! {p1 = ten ; p2 = unmod} ; {p1 = ten ; p2 = conj} => d.s ! {p1 = ten ; p2 = conj} ; {p1 = hundred ; p2 = mod} => d.s ! {p1 = hundred ; p2 = mod} ; {p1 = hundred ; p2 = unmod} => d.s ! {p1 = hundred ; p2 = unmod} ; {p1 = hundred ; p2 = conj} => d.s ! {p1 = hundred ; p2 = conj}}} ;
{s = \\f,g => d.s ! f ; n = Pl} ;
lin pot110 =
{s = "diez"} ;
spl "diez" ;
lin pot111 =
{s = "once"} ;
spl "once" ;
lin pot1to19 d =
{s = d.s ! {p1 = teen ; p2 = unmod}} ;
spl (d.s ! {p1 = teen ; p2 = unmod}) ;
lin pot0as1 n =
{s = n.s ! {p1 = unit ; p2 = unmod}} ;
{s = n.s ! {p1 = unit ; p2 = unmod} ; n = n.n} ;
lin pot1 d =
{s = d.s ! {p1 = ten ; p2 = unmod}} ;
spl (d.s ! {p1 = ten ; p2 = unmod}) ;
lin pot1plus d e =
{s = (d.s ! {p1 = ten ; p2 = mod}) ++ e.s ! {p1 = unit ; p2 = d.inh}} ;
lin pot1as2 n =
{s = n.s} ;
{s = \\g => (d.s ! {p1 = ten ; p2 = mod}) ++ e.s ! {p1 = unit ; p2 =
d.inh} ! g ; n = Pl} ;
lin pot1as2 n = n ;
lin pot2 d =
{s = d.s ! {p1 = hundred ; p2 = unmod}} ;
spl (d.s ! {p1 = hundred ; p2 = unmod} ! Masc) ;
lin pot2plus d e =
{s = (d.s ! {p1 = hundred ; p2 = mod}) ++ e.s} ;
lin pot2as3 n =
{s = n.s} ;
{s = \\g => (d.s ! {p1 = hundred ; p2 = mod}) ! Masc ++ e.s ! g ; n = Pl} ;
lin pot2as3 n = n ;
lin pot3 n =
{s = n.s ++ "mil"} ;
spl (n.s ! Masc ++ "mil") ;
lin pot3plus n m =
{s = n.s ++ "mil" ++ m.s} ;
{s = \\g => n.s ! Masc ++ "mil" ++ m.s ! g ; n = Pl} ;
}

View File

@@ -1,116 +1,95 @@
--# -path=.:../romance:../abstract:../../prelude
concrete StructuralSpa of Structural = CategoriesSpa, NumeralsSpa **
open SyntaxSpa, MorphoSpa, Prelude in {
concrete StructuralSpa of Structural = CategoriesSpa, NumeralsSpa **
open SyntaxSpa, MorphoSpa, BeschSpa, Prelude in {
lin
INP = pronNounPhrase pronJe ;
ThouNP = pronNounPhrase pronTu ;
HeNP = pronNounPhrase pronIl ;
SheNP = pronNounPhrase pronElle ;
WeNumNP n = pronNounPhrase (pronWithNum pronNous n) ;
YeNumNP n = pronNounPhrase (pronWithNum pronVous n) ;
YouNP = pronNounPhrase pronVous ;
TheyNP = pronNounPhrase pronIls ;
TheyFemNP = pronNounPhrase pronElles ;
-- Here is a point where the API is really inadequate for French,
-- which distinguishes between masculine and feminine "they".
-- The following solution is not attractive.
UseNumeral n = {s = \\g => n.s !g ; n = n.n} ;
--- TheyNP = pronNounPhrase (variants {pronIls ; pronElles}) ;
ThisNP = mkNameNounPhrase ["esto"] Masc ;
ThatNP = mkNameNounPhrase ["eso"] Masc ;
TheseNumNP n = mkNameNounPhrase ("éstos" ++ n.s ! Masc) Masc ;
ThoseNumNP n = mkNameNounPhrase ("ésos" ++ n.s ! Masc) Masc ;
ItNP = pronNounPhrase pronIl ;
EveryDet = chaqueDet ;
AllMassDet = mkDeterminer singular "todo" "toda" ;
AllNumDet = mkDeterminerNum plural ["todos los"] ["todas las"] ;
WhichDet = quelDet ;
WhichNumDet = mkDeterminerNum plural "cuales" "cuales" ;
HowManyDet = mkDeterminer plural "cuántos" "cuántas" ;
MostsDet = plupartDet ;
MostDet = mkDeterminer1 singular (["la mayor parte"] ++ elisDe) ; --- de
SomeDet = mkDeterminer singular "alguno" "alguna" ;
SomeNumDet = mkDeterminerNum plural "algunos" "algunas" ;
NoDet = mkDeterminer singular "ninguno" "ninguna" ; --- non
NoNumDet = mkDeterminerNum plural "ningunos" "ningunas" ; ---- ??
AnyDet = mkDeterminer singular "alguno" "alguna" ; ---
AnyNumDet = mkDeterminerNum plural "algunos" "algunas" ; ---
ManyDet = mkDeterminer plural "muchos" "muchas" ;
MuchDet = mkDeterminer1 singular "mucho" ;
ThisDet = mkDeterminer singular "esto" "esta" ;
ThatDet = mkDeterminer singular "eso" "esa" ;
TheseNumDet = mkDeterminerNum plural "estos" "estas" ;
ThoseNumDet = mkDeterminerNum plural "esos" "esas" ;
UseNumeral n = {s = \\_ => n.s} ; ---- gender
HowIAdv = commentAdv ;
WhenIAdv = quandAdv ;
WhereIAdv = ouAdv ;
WhyIAdv = pourquoiAdv ;
AndConj = etConj ;
OrConj = ouConj ;
BothAnd = etetConj ;
EitherOr = ououConj ;
NeitherNor = niniConj ;
IfSubj = siSubj ;
WhenSubj = quandSubj ;
PhrYes = ouiPhr ;
PhrNo = nonPhr ; --- and also Si!
VeryAdv = ss "muy" ;
TooAdv = ss "demasiado" ;
OtherwiseAdv = ss "otramente" ;
ThereforeAdv = ss ["por eso"] ;
EverybodyNP = normalNounPhrase (\\c => prepCase c ++ "todos") Masc Pl ;
SomebodyNP = mkNameNounPhrase ["algún"] Masc ;
NobodyNP = mkNameNounPhrase ["nadién"] Masc ; --- ne
EverythingNP = mkNameNounPhrase ["todo"] Masc ;
SomethingNP = mkNameNounPhrase ["algo"] Masc ;
NothingNP = mkNameNounPhrase ["nada"] Masc ; --- ne
---- provisory, for completeness
CanVV = mkVerbVerbDir (verbPres (vender_4 "poder") AHabere) ; ----
CanKnowVV = mkVerbVerbDir (verbPres (vender_4 "saber") AHabere) ; ----
MustVV = mkVerbVerbDir (verbPres (vender_4 "deber") AHabere) ; ----
WantVV = mkVerbVerbDir (verbPres (vender_4 "quierer") AHabere) ; ----
EverywhereNP = ss ["en todas partes"] ;
SomewhereNP = ss ["en ninguna parte"] ;
NowhereNP = ss ["en alguna parte"] ; ----
AlthoughSubj = ss "benché" ** {m = Con} ;
AlmostAdv = ss "casi" ;
QuiteAdv = ss "bastante" ;
InPrep = justPrep "en" ;
OnPrep = justPrep "sobre" ; ----
ToPrep = justCase dative ; ---
ThroughPrep = justPrep "por" ;
AbovePrep = justPrep "sobre" ;
UnderPrep = justPrep "bajo" ;
InFrontPrep = {s = "delante" ; c = genitive} ;
BehindPrep = {s = "detrás" ; c = genitive} ;
BetweenPrep = justPrep "entre" ;
FromPrep = justCase (CPrep P_de) ;
BeforePrep = {s = "antes" ; c = genitive} ;
DuringPrep = justPrep "durante" ; ----
AfterPrep = {s = "después" ; c = genitive} ;
WithPrep = justPrep "con" ;
WithoutPrep = justPrep "sin" ;
ByMeansPrep = justPrep "por" ;
PossessPrep = justCase genitive ;
PartPrep = justCase genitive ; ---
AgentPrep = justPrep "por" ;
above_Prep = justPrep "sobre" ;
after_Prep = {s = "después" ; c = genitive} ;
all8mass_Det = mkDeterminer singular "todo" "toda" ;
all_NDet = mkDeterminerNum ["todos los"] ["todas las"] ;
almost_Adv = ss "casi" ;
although_Subj = ss "benché" ** {m = Con} ;
and_Conj = etConj ;
because_Subj = ss "porque" ** {m = Ind} ;
before_Prep = {s = "antes" ; c = genitive} ;
behind_Prep = {s = "detrás" ; c = genitive} ;
between_Prep = justPrep "entre" ;
both_AndConjD = etetConj ;
by8agent_Prep = justPrep "por" ;
by8means_Prep = justPrep "por" ;
can8know_VV = mkVerbVerbDir (verbPres (saber_71 "saber") AHabere) ;
can_VV = mkVerbVerbDir (verbPres (poder_58 "poder") AHabere) ; ----
during_Prep = justPrep "durante" ; ----
either8or_ConjD = ououConj ;
everybody_NP = normalNounPhrase (\\c => prepCase c ++ "todos") Masc Pl ;
every_Det = chaqueDet ;
everything_NP = mkNameNounPhrase ["todo"] Masc ;
everywhere_Adv = ss ["en todas partes"] ;
from_Prep = justCase (CPrep P_de) ;
he_NP = pronNounPhrase pronIl ;
how8many_IDet = mkDeterminer plural "cuántos" "cuántas" ;
how_IAdv = commentAdv ;
if_Subj = siSubj ;
in8front_Prep = {s = "delante" ; c = genitive} ;
i_NP = pronNounPhrase pronJe ;
in_Prep = justPrep "en" ;
it_NP = pronNounPhrase pronIl ;
many_Det = mkDeterminer plural "muchos" "muchas" ;
most8many_Det = plupartDet ;
most_Det = mkDeterminer1 singular (["la mayor parte"] ++ elisDe) ; --- de
much_Det = mkDeterminer1 singular "mucho" ;
must_VV = mkVerbVerbDir (verbPres (deber_6 "deber") AHabere) ; ----
no_Phr = nonPhr ;
on_Prep = justPrep "sobre" ; ----
or_Conj = ouConj ;
otherwise_Adv = ss "otramente" ;
part_Prep = justCase genitive ; ---
possess_Prep = justCase genitive ;
quite_Adv = ss "bastante" ;
she_NP = pronNounPhrase pronElle ;
so_Adv = ss "tanto" ; ----
somebody_NP = mkNameNounPhrase ["algún"] Masc ;
some_Det = mkDeterminer singular "alguno" "alguna" ;
some_NDet = mkDeterminerNum "algunos" "algunas" ;
something_NP = mkNameNounPhrase ["algo"] Masc ;
somewhere_Adv = ss ["en ninguna parte"] ;
that_Det = mkDeterminer singular "eso" "esa" ;
that_NP = mkNameNounPhrase ["eso"] Masc ;
therefore_Adv = ss ["por eso"] ;
these_NDet = mkDeterminerNum "estos" "estas" ;
they8fem_NP = pronNounPhrase pronElles ;
they_NP = pronNounPhrase pronIls ;
this_Det = mkDeterminer singular "esto" "esta" ;
this_NP = mkNameNounPhrase ["esto"] Masc ;
those_NDet = mkDeterminerNum "esos" "esas" ;
thou_NP = pronNounPhrase pronTu ;
through_Prep = justPrep "por" ;
too_Adv = ss "demasiado" ;
to_Prep = justCase dative ; ---
under_Prep = justPrep "bajo" ;
very_Adv = ss "muy" ;
want_VV = mkVerbVerbDir (verbPres (querer_64 "querer") AHabere) ; ----
we_NP = pronNounPhrase pronNous ;
what8one_IP = intPronWhat singular ;
what8many_IP = intPronWhat plural ;
when_IAdv = quandAdv ;
when_Subj = quandSubj ;
where_IAdv = ouAdv ;
which8many_IDet = mkDeterminerNum "cuales" "cuales" ** {n = Pl} ;
which8one_IDet = quelDet ;
who8one_IP = intPronWho singular ;
who8many_IP = intPronWho plural ;
why_IAdv = pourquoiAdv ;
without_Prep = justPrep "sin" ;
with_Prep = justPrep "con" ;
ye_NP = pronNounPhrase pronVous ;
yes_Phr = ouiPhr ;
you_NP = pronNounPhrase pronVous ;
}

View File

@@ -35,6 +35,7 @@ oper
npGenPossNum = \nu,ton,mec ->
\\c => artDef mec.g Pl c ++ ton.s ! Poss Pl mec.g ++ nu.s ! mec.g ++ mec.s ! Pl ;
{- ----
existNounPhrase = \delvino -> {
s = \\m =>
case m of {
@@ -42,6 +43,7 @@ oper
Con => "haya"
} ++ delvino.s ! stressed accusative
} ;
-}
mkAdjSolo : Str -> Bool -> Adjective = \adj,p ->
mkAdjective (adjSolo adj) p ;
@@ -83,8 +85,7 @@ oper
negVerb = \va -> "no" ++ va ;
copula = \b,w -> let etre = (predVerb verbSer).s in
etre ! b ! Masc ! w ; ---- Masc
copula = verbSer ;
isClitCase = \c -> case c of {
Acc => True ;
@@ -148,7 +149,7 @@ oper
} ;
-- Questions
{- ----
questVerbPhrase = \jean,dort ->
{s = table {
DirQ => (predVerbPhrase jean dort).s ! Ind ;
@@ -162,14 +163,6 @@ oper
s = \\m => case m of {DirQ => [] ; _ => "si"} ++ cedelvino
} ;
intVerbPhrase = \qui, dormir ->
let dort = dormir.s ! qui.g ! VPF Simul (VFin presInd qui.n P3)
in
{s = table {
_ => qui.s ! Nom ++ dort
}
} ;
intSlash = \Qui, Tuvois ->
let {qui = Tuvois.s2 ++ Qui.s ! Tuvois.c ; tuvois = Tuvois.s ! Ind} in
{s = table {
@@ -177,13 +170,18 @@ oper
IndirQ => qui ++ tuvois
}
} ;
-}
questAdverbial = \quand, jean, dort ->
let {jeandort = (predVerbPhrase jean dort).s ! Ind} in
{s = table {
DirQ => quand.s ++ jeandort ; --- inversion?
IndirQ => quand.s ++ jeandort
}
intSlash = \Qui, Tuvois ->
{s = \\b,cl =>
let
qui = Tuvois.s2 ++ Qui.s ! Tuvois.c ;
tuvois = Tuvois.s ! b ! cl
in
table {
DirQ => qui ++ tuvois ;
IndirQ => qui ++ tuvois
}
} ;
---- moved from MorphoIta

View File

@@ -111,8 +111,8 @@ oper
VInfin => amare.s ! VI Infn ;
VFin (VPres Ind) n p => amare.s ! VP (Pres Ind n p) ;
VFin (VPres Sub) n p => amare.s ! VP (Pres Sub n p) ;
VFin (VImperf Ind) n p => amare.s ! VP (Past Ind n p) ;
VFin (VImperf Sub) n p => amare.s ! VP (Past Sub n p) ;
VFin (VImperf Ind) n p => amare.s ! VP (Impf Ind n p) ;
VFin (VImperf Sub) n p => amare.s ! VP (Impf Sub n p) ;
VFin VPasse n p => amare.s ! VP (Pret n p) ;
VFin VFut n p => amare.s ! VP (Fut Ind n p) ;
VFin VCondit n p => amare.s ! VP (Cond n p) ;
@@ -134,7 +134,7 @@ param
VPers =
Pres Mode Number Person
| Past Mode Number Person
| Impf Mode Number Person
| Pret Number Person
| Fut Mode Number Person
| Cond Number Person

30
src/GF/System/ArchEdit.hs Normal file
View File

@@ -0,0 +1,30 @@
----------------------------------------------------------------------
-- |
-- Module : ArchEdit
-- Maintainer : AR
-- Stability : (stable)
-- Portability : (portable)
--
-- > CVS $Date: 2005/03/30 12:41:12 $
-- > CVS $Author: aarne $
-- > CVS $Revision: 1.1 $
--
-- (Description of the module)
-----------------------------------------------------------------------------
module ArchEdit (
fudlogueEdit, fudlogueWrite, fudlogueWriteUni
) where
fudlogueEdit :: a -> b -> IO ()
fudlogueEdit _ _ = do
putStrLn "sorry no fudgets available in Hugs"
return ()
fudlogueWrite :: a -> b -> IO ()
fudlogueWrite _ _ = do
putStrLn "sorry no fudgets available in Hugs"
fudlogueWriteUni :: a -> b -> IO ()
fudlogueWriteUni _ _ = do
putStrLn "sorry no fudgets available in Hugs"