English noncontracted forms implemented

This commit is contained in:
aarne
2006-06-16 16:12:25 +00:00
parent 0e0a3bb935
commit 13446dddf8
3 changed files with 46 additions and 33 deletions

View File

@@ -14,14 +14,14 @@ will be kept available, but 'resource' will be renamed 'resource-0.9',
and 'resource' will probably be made into a symbolic link to the
current version.
To test:
To compile:
make
For translation from Eng to all others, try e.g.
gf langs.gfcm
> p -cat=Phr -mcfg -parser=topdown "I haven't seen her" | l -multi
gf -nocf langs.gfcm
> p -cat=Phr -fcfg "I haven't seen her" | l -multi
To link to the library, use the precompiled packages
@@ -72,6 +72,9 @@ Notice that GF v.
---------- later history and status:
16/6 Close to complete, with 10 languages and a substantial part of
Arabic.
25/2 Added directories for precompiled libraries directly under lib.
See doc/index.html for more information.

View File

@@ -18,9 +18,9 @@ Ita: infinitive contractions
%Ger: constituents of infinitive VP
Spa: ordinal numbers
%Spa: ordinal numbers
Nor: Ext: possessives
%Nor: Ext: possessives
%Spa: zero subjects
@@ -38,10 +38,10 @@ API: multimodal/: dialogue-specific lexicon
%API: swadesh/: build a swadesh-related API and migrate lexica
API: mathematical/: symbolic formulas as Cl
%API: mathematical/: symbolic formulas as Cl
%API: text construction
%All: punctuation
API: apposition, e.g. Det -> CN -> [PN] -> NP
%API: apposition, e.g. Det -> CN -> [PN] -> NP

View File

@@ -181,37 +181,35 @@ resource ResEng = ParamX ** open Prelude in {
} ;
--- The order gets wrong with AdV, but works around a parser
--- generation bug.
predV : Verb -> VP = predGenV False ;
predV : Verb -> VP = \verb -> {
predGenV : Bool -> Verb -> VP = \contr, verb -> {
s = \\t,ant,b,ord,agr =>
let
inf = verb.s ! VInf ;
fin = presVerb verb agr ;
part = verb.s ! VPPart ;
vf : Str -> Str -> {fin, inf : Str} = \x,y ->
{fin = x ; inf = y} ;
vn = vfn contr ;
in
case <t,ant,b,ord> of {
<Pres,Simul,Pos,ODir> => vf fin [] ; --- should be opp
<Pres,Simul,Pos,ODir> => vf fin [] ;
<Pres,Simul,Pos,OQuest> => vf (does agr) inf ;
<Pres,Anter,Pos,_> => vf (have agr) part ; --# notpresent
<Pres,Anter,Neg,_> => vf (havent agr) part ; --# notpresent
<Past,Simul,Pos,ODir> => vf (verb.s ! VPast) [] ; --# notpresent --- should be opp
<Pres,Anter,Neg,_> => vn (have agr) (havent agr) part ; --# notpresent
<Past,Simul,Pos,ODir> => vf (verb.s ! VPast) [] ; --# notpresent
<Past,Simul,Pos,OQuest> => vf "did" inf ; --# notpresent
<Past,Simul,Neg,_> => vf "didn't" inf ; --# notpresent
<Past,Simul,Neg,_> => vn "did" "didn't" inf ; --# notpresent
<Past,Anter,Pos,_> => vf "had" part ; --# notpresent
<Past,Anter,Neg,_> => vf "hadn't" part ; --# notpresent
<Past,Anter,Neg,_> => vn "had" "hadn't" part ; --# notpresent
<Fut, Simul,Pos,_> => vf "will" inf ; --# notpresent
<Fut, Simul,Neg,_> => vf "won't" inf ; --# notpresent
<Fut, Simul,Neg,_> => vn "will" "won't" inf ; --# notpresent
<Fut, Anter,Pos,_> => vf "will" ("have" ++ part) ; --# notpresent
<Fut, Anter,Neg,_> => vf "won't" ("have" ++ part) ; --# notpresent
<Fut, Anter,Neg,_> => vn "will" "won't"("have" ++ part) ; --# notpresent
<Cond,Simul,Pos,_> => vf "would" inf ; --# notpresent
<Cond,Simul,Neg,_> => vf "wouldn't" inf ; --# notpresent
<Cond,Simul,Neg,_> => vn "would" "wouldn't" inf ; --# notpresent
<Cond,Anter,Pos,_> => vf "would" ("have" ++ part) ; --# notpresent
<Cond,Anter,Neg,_> => vf "wouldn't" ("have" ++ part) ; --# notpresent
<Pres,Simul,Neg,_> => vf (doesnt agr) inf
<Cond,Anter,Neg,_> => vn "would" "wouldn't" ("have" ++ part) ; --# notpresent
<Pres,Simul,Neg,_> => vn (does agr) (doesnt agr) inf
} ;
prp = verb.s ! VPresPart ;
inf = verb.s ! VInf ;
@@ -219,36 +217,48 @@ resource ResEng = ParamX ** open Prelude in {
s2 = \\a => if_then_Str verb.isRefl (reflPron ! a) []
} ;
predAux : Aux -> VP = \verb -> {
predAux : Aux -> VP = predGenAux False ;
predGenAux : Bool -> Aux -> VP = \contr, verb -> {
s = \\t,ant,b,ord,agr =>
let
inf = verb.inf ;
fin = verb.pres ! b ! agr ;
finp = verb.pres ! Pos ! agr ;
part = verb.ppart ;
vf : Str -> Str -> {fin, inf : Str} = \x,y ->
{fin = x ; inf = y} ;
vn = vfn contr ;
in
case <t,ant,b,ord> of {
<Pres,Anter,Pos,_> => vf (have agr) part ; --# notpresent
<Pres,Anter,Neg,_> => vf (havent agr) part ; --# notpresent
<Past,Simul,_, _> => vf (verb.past ! b ! agr) [] ; --# notpresent
<Pres,Anter,Neg,_> => vn (have agr) (havent agr) part ; --# notpresent
<Past,Simul,Pos, _> => vf (verb.past ! b ! agr) [] ; --# notpresent
<Past,Simul,_, _> => vn (verb.past!Pos!agr)(verb.past!Neg!agr) [] ; --# notpresent
<Past,Anter,Pos,_> => vf "had" part ; --# notpresent
<Past,Anter,Neg,_> => vf "hadn't" part ; --# notpresent
<Past,Anter,Neg,_> => vn "had" "hadn't" part ; --# notpresent
<Fut, Simul,Pos,_> => vf "will" inf ; --# notpresent
<Fut, Simul,Neg,_> => vf "won't" inf ; --# notpresent
<Fut, Simul,Neg,_> => vn "will" "won't" inf ; --# notpresent
<Fut, Anter,Pos,_> => vf "will" ("have" ++ part) ; --# notpresent
<Fut, Anter,Neg,_> => vf "won't" ("have" ++ part) ; --# notpresent
<Fut, Anter,Neg,_> => vn "will" "won't"("have" ++ part) ; --# notpresent
<Cond,Simul,Pos,_> => vf "would" inf ; --# notpresent
<Cond,Simul,Neg,_> => vf "wouldn't" inf ; --# notpresent
<Cond,Simul,Neg,_> => vn "would" "wouldn't" inf ; --# notpresent
<Cond,Anter,Pos,_> => vf "would" ("have" ++ part) ; --# notpresent
<Cond,Anter,Neg,_> => vf "wouldn't" ("have" ++ part) ; --# notpresent
<Pres,Simul,_, _> => vf fin []
<Cond,Anter,Neg,_> => vn "would" "wouldn't" ("have" ++ part) ; --# notpresent
<Pres,Simul,Pos, _> => vf fin [] ;
<Pres,Simul,_, _> => vn finp fin []
} ;
prp = verb.prpart ;
inf = verb.inf ;
ad = [] ;
s2 = \\_ => []
} ;
vf : Str -> Str -> {fin, inf : Str} = \x,y -> vfn True x x y ;
vfn : Bool -> Str -> Str -> Str -> {fin, inf : Str} = \contr,x,y,z ->
case contr of {
True => {fin = y ; inf = z} ;
False => {fin = x ; inf = "not" ++ z}
} ;
insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> {
s = vp.s ;