fixed Finnish youPol complement number to Sg ; some encoding things in French

This commit is contained in:
aarne
2010-04-06 12:24:41 +00:00
parent b7a60b5e45
commit f6db1ad200
16 changed files with 114 additions and 81 deletions

View File

@@ -108,7 +108,7 @@ concrete WordsFin of Words = SentencesFin **
mkPlace : N -> Bool -> {name : CN ; at : Prep ; to : Prep} = \p,e -> {
name = mkCN p ;
at = casePrep (if_then_else Case e adessive inessive) ; -- True: external
to = casePrep (if_then_else Case e allative elative) ;
to = casePrep (if_then_else Case e allative illative) ;
} ;
open_Adv = ParadigmsFin.mkAdv "avoinna" ;

View File

@@ -20,6 +20,7 @@ History
<LI>26 March 2010. Version 0.1: Eng, Fin, Fre, Ron; dedicated minibar UI.
<LI>28 March. Version 0.2: Swe, Ita; cat Action; small phrases.
<LI>30 March. Version 0.3: disambiguation grammar for English
<LI>6 April. Version 0.4: weekdays, nationalities
</UL>
<P>
@@ -34,8 +35,9 @@ History
</P>
<H1>Purpose</H1>
<P>
This phrasebook is a programme for translating touristic phrases
between the 15 European languages included in the <A HREF="http://www.molto-project.eu">MOLTO</A> project
This phrasebook is a program for translating touristic phrases
between the 15 European languages included in the
<A HREF="http://www.molto-project.eu">MOLTO</A> project
(Multilingual On-Line Translation):
</P>
<UL>
@@ -67,11 +69,11 @@ The source code resides in
<A HREF="http://code.haskell.org/gf/examples/phrasebook/"><CODE>code.haskell.org/gf/examples/phrasebook/</CODE></A>
</P>
<P>
Current status (28 March 2010):
Current status (6 April 2010):
</P>
<UL>
<LI>available in English, Finnish, French, Italian, Romanian, Swedish
<LI>very small coverage
<LI>small coverage
<LI>works on web browsers calling a server
<LI>web service not yet released, but preliminarily available in
<A HREF="http://tournesol.cs.chalmers.se/~aarne/phrasebook/phrasebook.html"><CODE>http://tournesol.cs.chalmers.se/~aarne/phrasebook/phrasebook.html</CODE></A>
@@ -88,7 +90,7 @@ Compile-time transfer: especially, in Action in Words.
Quasi-incremental translation: many basic types are also used as phrases.
</P>
<P>
Disambiguation, esp. by the parameters in Roles.
Disambiguation, esp. of politeness distinctions.
</P>
<H1>Files</H1>
<P>
@@ -116,16 +118,22 @@ the input language is ambiguous.
</P>
<H1>To Do</H1>
<P>
Text-based translation interface.
Improved translation interface
</P>
<UL>
<LI>a <I>to</I> list of languages: either <I>all</I>, or just one
<LI>combined text field/fridge magnet input; filter magnets by started word prefix
<LI>a nicer way to show disambiguation (smaller font, maybe hidden by default)
</UL>
<P>
The remaining 10 languages
</P>
<P>
Disambiguation grammars for other languages than English.
Disambiguation grammars for other languages than English
</P>
<P>
Extract/construct lexica for
Extend lexica by hand or (semi)automatically for
</P>
<UL>
<LI>food stuff
@@ -134,7 +142,7 @@ Extract/construct lexica for
</UL>
<P>
Connection to Google translate, for fall-back and for comparison
Link to Google translate, for fall-back and for comparison
</P>
<P>
Feedback facility in the UI
@@ -177,11 +185,11 @@ Here are the steps to follow for contributors:
</OL>
</OL>
<OL>
<UL>
<LI>Don't delete anything! But you are free to correct incorrect forms.
<LI>Don't change the module structure! But you are free to add a new language.
<LI>Don't compromise quality to gain coverage: <I>non multa sed multum!</I>
</OL>
</UL>
<!-- html code generated by txt2tags 2.4 (http://txt2tags.sf.net) -->

View File

@@ -16,6 +16,7 @@ History
- 26 March 2010. Version 0.1: Eng, Fin, Fre, Ron; dedicated minibar UI.
- 28 March. Version 0.2: Swe, Ita; cat Action; small phrases.
- 30 March. Version 0.3: disambiguation grammar for English
- 6 April. Version 0.4: weekdays, nationalities
[Missing constructs missing.txt]
@@ -28,8 +29,9 @@ History
=Purpose=
This phrasebook is a programme for translating touristic phrases
between the 15 European languages included in the [MOLTO http://www.molto-project.eu] project
This phrasebook is a program for translating touristic phrases
between the 15 European languages included in the
[MOLTO http://www.molto-project.eu] project
(Multilingual On-Line Translation):
- Bulgarian, Catalan, Danish, Dutch, English,
Finnish, French, German, Italian, Norwegian,
@@ -54,9 +56,11 @@ The source code resides in
[``code.haskell.org/gf/examples/phrasebook/`` http://code.haskell.org/gf/examples/phrasebook/]
Current status (28 March 2010):
%The abstract syntax defines an [ontology of phrases ontology.html].
Current status (6 April 2010):
- available in English, Finnish, French, Italian, Romanian, Swedish
- very small coverage
- small coverage
- works on web browsers calling a server
- web service not yet released, but preliminarily available in
[``http://tournesol.cs.chalmers.se/~aarne/phrasebook/phrasebook.html`` http://tournesol.cs.chalmers.se/~aarne/phrasebook/phrasebook.html]
@@ -71,7 +75,7 @@ Compile-time transfer: especially, in Action in Words.
Quasi-incremental translation: many basic types are also used as phrases.
Disambiguation, esp. by the parameters in Roles.
Disambiguation, esp. of politeness distinctions.
=Files=
@@ -97,19 +101,23 @@ the input language is ambiguous.
=To Do=
Text-based translation interface.
Improved translation interface
- a //to// list of languages: either //all//, or just one
- combined text field/fridge magnet input; filter magnets by started word prefix
- a nicer way to show disambiguation (smaller font, maybe hidden by default)
The remaining 10 languages
Disambiguation grammars for other languages than English.
Disambiguation grammars for other languages than English
Extract/construct lexica for
Extend lexica by hand or (semi)automatically for
- food stuff
- languages
- places
Connection to Google translate, for fall-back and for comparison
Link to Google translate, for fall-back and for comparison
Feedback facility in the UI
@@ -145,9 +153,9 @@ Here are the steps to follow for contributors:
+ How you can open ``gf/examples/phrasebook/www/phrasebook.html`` and use your phrasebook!
+ Don't delete anything! But you are free to correct incorrect forms.
+ Don't change the module structure! But you are free to add a new language.
+ Don't compromise quality to gain coverage: //non multa sed multum!//
- Don't delete anything! But you are free to correct incorrect forms.
- Don't change the module structure! But you are free to add a new language.
- Don't compromise quality to gain coverage: //non multa sed multum!//

View File

@@ -15,7 +15,7 @@ concrete CatFin of Cat = CommonX ** open ResFin, Prelude in {
Cl = {s : ResFin.Tense => Anteriority => Polarity => SType => Str} ;
ClSlash = {s : ResFin.Tense => Anteriority => Polarity => Str ; c2 : Compl} ;
Imp = {s : Polarity => Number => Str} ;
Imp = {s : Polarity => Agr => Str} ;
-- Question

View File

@@ -10,7 +10,7 @@ concrete ConjunctionFin of Conjunction =
ConjAdv = conjunctDistrSS ;
ConjNP conj ss = conjunctDistrTable NPForm conj ss ** {
a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p} ;
a = conjAgr (Ag conj.n P3) ss.a ; -- P3 is the maximum
isPron = False
} ;

View File

@@ -61,10 +61,10 @@ concrete IdiomFin of Idiom = CatFin **
-- The imperative is not available in a $VP$.
ImpPl1 vp =
let vps = vp.s ! VIPass ! Simul ! Pos ! {n = Pl ; p = P1}
let vps = vp.s ! VIPass ! Simul ! Pos ! Ag Pl P1
in
{s = vps.fin ++ vps.inf ++
vp.s2 ! True ! Pos ! {n = Pl ; p = P1} ++ vp.ext
vp.s2 ! True ! Pos ! Ag Pl P1 ++ vp.ext
} ;
oper

View File

@@ -866,7 +866,7 @@ caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
NPCase Abess => minu + ("tt" + a) ;
NPAcc => Predef.tk 1 minun + "t"
} ;
a = {n = n ; p = p}
a = Ag n p
} ;
mkDemPronoun : (_,_,_,_,_ : Str) -> Number ->

View File

@@ -64,13 +64,13 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, Prelude in {
UsePron p = p ** {isPron = True} ;
PredetNP pred np = {
s = \\c => pred.s ! np.a.n ! c ++ np.s ! c ;
s = \\c => pred.s ! complNumAgr np.a ! c ++ np.s ! c ;
a = np.a ;
isPron = np.isPron -- kaikki minun - ni
} ;
PPartNP np v2 = {
s = \\c => np.s ! c ++ v2.s ! PastPartPass (AN (NCase np.a.n Ess)) ;
s = \\c => np.s ! c ++ v2.s ! PastPartPass (AN (NCase (complNumAgr np.a) Ess)) ;
a = np.a ;
isPron = np.isPron -- minun täällä - ni
} ;

View File

@@ -5,9 +5,9 @@ concrete PhraseFin of Phrase = CatFin ** open ResFin, (P = Prelude) in {
UttS s = s ;
UttQS qs = {s = qs.s} ;
UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! Sg} ;
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ;
UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ;
UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! Ag Sg P2} ;
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Ag Pl P2} ;
UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! AgPol} ;
UttIP ip = {s = ip.s ! NPCase Nom} ;
UttIAdv iadv = iadv ;

View File

@@ -18,7 +18,7 @@ concrete RelativeFin of Relative = CatFin ** open Prelude, ResFin, MorphoFin in
RAg a => a
} ;
cl = mkClause
(subjForm {s = rp.s ! agr.n ;
(subjForm {s = rp.s ! (complNumAgr agr) ;
a = agr ; isPron = False} vp.sc) agr vp
in
cl.s ! t ! ant ! b ! SDecl ;
@@ -29,7 +29,7 @@ concrete RelativeFin of Relative = CatFin ** open Prelude, ResFin, MorphoFin in
s = \\t,a,p,ag =>
let
cls = slash.s ! t ! a ! p ;
who = appCompl True p slash.c2 (rp2np ag.n rp)
who = appCompl True p slash.c2 (rp2np (complNumAgr ag) rp)
in
who ++ cls ;
c = slash.c2.c

View File

@@ -26,11 +26,22 @@ resource ResFin = ParamX ** open Prelude in {
| NPossNom Number | NPossGen Number --- number needed for syntax of AdjCN
| NPossTransl Number | NPossIllat Number ;
-- Agreement of $NP$ is a record. We'll add $Gender$ later.
-- Agreement of $NP$ has number*person and the polite second ("te olette valmis").
Agr = Ag Number Person | AgPol ;
oper
Agr = {n : Number ; p : Person} ;
complNumAgr : Agr -> Number = \a -> case a of {
Ag n _ => n ;
AgPol => Sg
} ;
verbAgr : Agr -> {n : Number ; p : Person} = \a -> case a of {
Ag n p => {n = n ; p = p} ;
AgPol => {n = Pl ; p = P2}
} ;
oper
NP = {s : NPForm => Str ; a : Agr ; isPron : Bool} ;
--
@@ -106,7 +117,7 @@ param
--2 For $Relative$
RAgr = RNoAg | RAg {n : Number ; p : Person} ;
RAgr = RNoAg | RAg Agr ;
--2 For $Numeral$
@@ -116,11 +127,13 @@ param
oper
agrP3 : Number -> Agr = \n ->
{n = n ; p = P3} ;
Ag n P3 ;
conjAgr : Agr -> Agr -> Agr = \a,b -> {
n = conjNumber a.n b.n ;
p = conjPerson a.p b.p
conjAgr : Agr -> Agr -> Agr = \a,b -> case <a,b> of {
<Ag n p, Ag m q> => Ag (conjNumber n m) (conjPerson p q) ;
<Ag n p, AgPol> => Ag Pl (conjPerson p P2) ;
<AgPol, Ag n p> => Ag Pl (conjPerson p P2) ;
_ => b
} ;
---
@@ -163,9 +176,10 @@ oper
} ;
predV : (Verb ** {sc : NPForm ; qp : Str}) -> VP = \verb -> {
s = \\vi,ant,b,agr =>
s = \\vi,ant,b,agr0 =>
let
agr = verbAgr agr0 ;
verbs = verb.s ;
part : Str = case vi of {
VIPass => verbs ! PastPartPass (AN (NCase agr.n Nom)) ;
@@ -573,9 +587,9 @@ oper
} ;
possSuffixFront : Agr -> Str = \agr ->
table Agr ["ni" ; "si" ; "nsä" ; "mme" ; "nne" ; "nsä"] ! agr ;
table Agr ["ni" ; "si" ; "nsä" ; "mme" ; "nne" ; "nsä" ; "nne"] ! agr ;
possSuffix : Agr -> Str = \agr ->
table Agr ["ni" ; "si" ; "nsa" ; "mme" ; "nne" ; "nsa"] ! agr ;
table Agr ["ni" ; "si" ; "nsa" ; "mme" ; "nne" ; "nsa" ; "nne"] ! agr ;
oper
rp2np : Number -> {s : Number => NPForm => Str ; a : RAgr} -> NP = \n,rp -> {

View File

@@ -9,9 +9,8 @@ concrete SentenceFin of Sentence = CatFin ** open Prelude, ResFin in {
PredSCVP sc vp = mkClause (\_ -> sc.s) (agrP3 Sg) vp ;
ImpVP vp = {
s = \\pol,n =>
s = \\pol,agr =>
let
agr = {n = n ; p = P2} ;
verb = vp.s ! VIImper ! Simul ! pol ! agr ;
compl = vp.s2 ! False ! pol ! agr ++ vp.ext --- False = like inf (osta auto)
in

View File

@@ -159,8 +159,9 @@ concrete StructuralFin of Structural = CatFin **
yes_Utt = ss "kyllä" ;
youSg_Pron = mkPronoun "sinä" "sinun" "sinua" "sinuna" "sinuun" Sg P2 ;
youPl_Pron = mkPronoun "te" "teidän" "teitä" "teinä" "teihin" Pl P2 ;
youPol_Pron = mkPronoun "te" "teidän" "teitä" "teinä" "teihin" Pl P2 ; --- Sg
youPol_Pron =
let p = mkPronoun "te" "teidän" "teitä" "teinä" "teihin" Pl P2 in
{s = p.s ; a = AgPol} ;
oper
jokuPron : MorphoFin.Number => (MorphoFin.Case) => Str =

View File

@@ -33,7 +33,8 @@ concrete VerbFin of Verb = CatFin ** open Prelude, ResFin in {
ComplVA v ap =
insertObj
(\\_,b,agr =>
ap.s ! False ! (NCase agr.n (npform2case agr.n v.c2.c))) --- v.cs.s ignored
let n = (complNumAgr agr) in
ap.s ! False ! (NCase n (npform2case n v.c2.c))) --- v.cs.s ignored
(predV v) ;
SlashV2S v s =
@@ -90,12 +91,12 @@ concrete VerbFin of Verb = CatFin ** open Prelude, ResFin in {
CompAP ap = {
s = \\agr =>
let
n = agr.n ;
c = case agr.n of {
Sg => Nom ; -- minä olen iso
Pl => Part -- me olemme isoja
n = complNumAgr agr ;
c = case n of {
Sg => Nom ; -- minä olen iso ; te olette iso
Pl => Part -- me olemme isoja ; te olette isoja
} --- definiteness of NP ?
in ap.s ! False ! (NCase agr.n c)
in ap.s ! False ! (NCase n c)
} ;
CompNP np = {s = \\_ => np.s ! NPCase Nom} ;
CompAdv a = {s = \\_ => a.s} ;

View File

@@ -2,7 +2,7 @@
instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in {
flags optimize=noexpand ; coding=utf8 ;
flags optimize=noexpand ; -- coding=utf8 ;
-- flags optimize=all ;
param
@@ -16,7 +16,7 @@ instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in {
prepCase : Case -> Str = \c -> case c of {
Nom => [] ;
Acc => [] ;
CPrep P_a => "à" ;
CPrep P_a => "à" ;
CPrep P_de => elisDe ;
CPrep PNul => []
} ;
@@ -24,7 +24,7 @@ instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in {
artDef : Gender -> Number -> Case -> Str = \g,n,c ->
case <g,n,c> of {
<Masc,Sg, CPrep P_de> => pre {"du" ; ["de l'"] / voyelle} ;
<Masc,Sg, CPrep P_a> => pre {"au" ; ["à l'"] / voyelle} ;
<Masc,Sg, CPrep P_a> => pre {"au" ; ["à l'"] / voyelle} ;
<Masc,Sg, _> => elisLe ;
<Fem, Sg, _> => prepCase c ++ elisLa ;
<_, Pl, CPrep P_de> => "des" ;
@@ -205,18 +205,20 @@ instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in {
auxPassive : Verb = copula ;
copula : Verb = {s = table VF ["être";"être";"suis";"es";"est";"sommes";"êtes";"sont";"sois";"sois";"soit";"soyons";"soyez";"soient";
"étais";"étais";"était";"étions";"étiez";"étaient";--# notpresent
"fusse";"fusses";"fût";"fussions";"fussiez";"fussent";--# notpresent
"fus";"fus";"fut";"fûmes";"fûtes";"furent";--# notpresent
copula : Verb = {s = table VF ["être";"être";"suis";"es";"est";"sommes";"êtes";"sont";"sois";"sois"
;"soit";"soyons";"soyez";"soient";
"étais";"étais";"était";"étions";"étiez";"étaient";--# notpresent
"fusse";"fusses";"fût";"fussions";"fussiez";"fussent";--# notpresent
"fus";"fus";"fut";"fûmes";"fûtes";"furent";--# notpresent
"serai";"seras";"sera";"serons";"serez";"seront";--# notpresent
"serais";"serais";"serait";"serions";"seriez";"seraient";--# notpresent
"sois";"soyons";"soyez";"été";"étés";"étée";"étées";"étant"]; vtyp=VHabere} ;
"sois";"soyons";"soyez";"été";"étés";"étée";"étées";"étant"]; vtyp=VHabere} ;
avoir_V : Verb = {s=table VF ["avoir";"avoir";"ai";"as";"a";"avons";"avez";"ont";"aie";"aies";"ait";"ayons";"ayez";"aient";
avoir_V : Verb = {s=table VF ["avoir";"avoir";"ai";"as";"a";"avons";"avez";"ont";"aie";"aies";"ait"
;"ayons";"ayez";"aient";
"avais";"avais";"avait";"avions";"aviez";"avaient"; --# notpresent
"eusse";"eusses";"eût";"eussions";"eussiez";"eussent";--# notpresent
"eus";"eus";"eut";"eûmes";"eûtes";"eurent";--# notpresent
"eusse";"eusses";"eût";"eussions";"eussiez";"eussent";--# notpresent
"eus";"eus";"eut";"eûmes";"eûtes";"eurent";--# notpresent
"aurai";"auras";"aura";"aurons";"aurez";"auront";--# notpresent
"aurais";"aurais";"aurait";"aurions";"auriez";"auraient";--# notpresent
"aie";"ayons";"ayez";"eu";"eus";"eue";"eues";"ayant"];vtyp=VHabere};

View File

@@ -10,7 +10,7 @@ concrete StructuralFre of Structural = CatFre **
lin
above_Prep = {s = ["au dessus"] ; c = MorphoFre.genitive ; isDir = False} ;
after_Prep = mkPreposition "après" ;
after_Prep = mkPreposition "après" ;
all_Predet = {
s = \\a,c => prepCase c ++ aagrForms "tout" "toute" "tous" "toutes" ! a ;
c = Nom ;
@@ -22,7 +22,7 @@ lin
and_Conj = {s1 = [] ; s2 = "et" ; n = Pl} ;
because_Subj = ss ("parce" ++ elisQue) ** {m = Indic} ;
before_Prep = mkPreposition "avant" ;
behind_Prep = mkPreposition "derrière" ;
behind_Prep = mkPreposition "derrière" ;
between_Prep = mkPreposition "entre" ;
both7and_DConj = {s1,s2 = "et" ; n = Pl} ;
but_PConj = ss "mais" ;
@@ -80,7 +80,7 @@ lin
or_Conj = {s1 = [] ; s2 = "ou" ; n = Sg} ;
otherwise_PConj = ss "autrement" ;
part_Prep = complGen ;
please_Voc = ss ["s'il vous plaît"] ;
please_Voc = ss ["s'il vous plaît"] ;
possess_Prep = complGen ;
quite_Adv = ss "assez" ;
she_Pron =
@@ -102,16 +102,16 @@ lin
Pl => \\_,c => prepCase c ++ "ces"
} ;
sp = table {
Sg => \\g,c => prepCase c ++ genForms "celui-là" "celle-là" ! g ;
Pl => \\g,c => prepCase c ++ genForms "celui-là" "celle-là" ! g
Sg => \\g,c => prepCase c ++ genForms "celui-là" "celle-là" ! g ;
Pl => \\g,c => prepCase c ++ genForms "celui-là" "celle-là" ! g
} ;
s2 = [] ---- "-là"
s2 = [] ---- "-là"
} ;
---b that_NP = makeNP ["cela"] Masc Sg ;
there7from_Adv = ss ["de là"] ;
there7to_Adv = ss "là" ; --- y
there_Adv = ss "là" ;
there7from_Adv = ss ["de là"] ;
there7to_Adv = ss "là" ; --- y
there_Adv = ss "là" ;
therefore_PConj = ss "donc" ;
---b these_NP = makeNP ["ceux-ci"] Masc Pl ;
they_Pron = mkPronoun
@@ -132,12 +132,12 @@ lin
} ;
---b this_NP = pn2np (mkPN ["ceci"] Masc) ;
---b those_NP = makeNP ["ceux-là"] Masc Pl ;
---b those_NP = makeNP ["ceux-là"] Masc Pl ;
through_Prep = mkPreposition "par" ;
too_AdA = ss "trop" ;
to_Prep = complDat ;
under_Prep = mkPreposition "sous" ;
very_AdA = ss "très" ;
very_AdA = ss "très" ;
want_VV = mkVV (vouloir_V2 ** {lock_V = <>}) ;
we_Pron =
mkPronoun "nous" "nous" "nous" "nous" "notre" "notre" "nos"
@@ -150,7 +150,7 @@ lin
where {a = aagr Masc Pl} ;
when_IAdv = ss "quand" ;
when_Subj = ss "quand" ** {m = Indic} ;
where_IAdv = ss "où" ;
where_IAdv = ss "où" ;
which_IQuant = {
s = \\n,g,c =>
prepCase c ++ aagrForms "quel" "quelle" "quels" "quelles" ! aagr g n
@@ -190,14 +190,14 @@ lin
at_least_AdN = ss "au moins" ;
at_most_AdN = ss "au plus" ;
except_Prep = mkPreposition "excepté" ;
except_Prep = mkPreposition "excepté" ;
as_CAdv = X.mkCAdv "aussi" conjThan ;
have_V2 = avoir_V2 ;
that_Subj = ss elisQue ** {m = Conjunct} ;
lin language_title_Utt = ss "français" ;
lin language_title_Utt = ss "français" ;
}