forked from GitHub/gf-core
English noncontracted forms implemented
This commit is contained in:
@@ -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
|
and 'resource' will probably be made into a symbolic link to the
|
||||||
current version.
|
current version.
|
||||||
|
|
||||||
To test:
|
To compile:
|
||||||
|
|
||||||
make
|
make
|
||||||
|
|
||||||
For translation from Eng to all others, try e.g.
|
For translation from Eng to all others, try e.g.
|
||||||
|
|
||||||
gf langs.gfcm
|
gf -nocf langs.gfcm
|
||||||
> p -cat=Phr -mcfg -parser=topdown "I haven't seen her" | l -multi
|
> p -cat=Phr -fcfg "I haven't seen her" | l -multi
|
||||||
|
|
||||||
To link to the library, use the precompiled packages
|
To link to the library, use the precompiled packages
|
||||||
|
|
||||||
@@ -72,6 +72,9 @@ Notice that GF v.
|
|||||||
|
|
||||||
---------- later history and status:
|
---------- 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.
|
25/2 Added directories for precompiled libraries directly under lib.
|
||||||
See doc/index.html for more information.
|
See doc/index.html for more information.
|
||||||
|
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ Ita: infinitive contractions
|
|||||||
|
|
||||||
%Ger: constituents of infinitive VP
|
%Ger: constituents of infinitive VP
|
||||||
|
|
||||||
Spa: ordinal numbers
|
%Spa: ordinal numbers
|
||||||
|
|
||||||
Nor: Ext: possessives
|
%Nor: Ext: possessives
|
||||||
|
|
||||||
%Spa: zero subjects
|
%Spa: zero subjects
|
||||||
|
|
||||||
@@ -38,10 +38,10 @@ 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
|
%API: mathematical/: symbolic formulas as Cl
|
||||||
|
|
||||||
%API: text construction
|
%API: text construction
|
||||||
|
|
||||||
%All: punctuation
|
%All: punctuation
|
||||||
|
|
||||||
API: apposition, e.g. Det -> CN -> [PN] -> NP
|
%API: apposition, e.g. Det -> CN -> [PN] -> NP
|
||||||
|
|||||||
@@ -181,37 +181,35 @@ resource ResEng = ParamX ** open Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
--- The order gets wrong with AdV, but works around a parser
|
predV : Verb -> VP = predGenV False ;
|
||||||
--- generation bug.
|
|
||||||
|
|
||||||
predV : Verb -> VP = \verb -> {
|
predGenV : Bool -> Verb -> VP = \contr, verb -> {
|
||||||
s = \\t,ant,b,ord,agr =>
|
s = \\t,ant,b,ord,agr =>
|
||||||
let
|
let
|
||||||
inf = verb.s ! VInf ;
|
inf = verb.s ! VInf ;
|
||||||
fin = presVerb verb agr ;
|
fin = presVerb verb agr ;
|
||||||
part = verb.s ! VPPart ;
|
part = verb.s ! VPPart ;
|
||||||
vf : Str -> Str -> {fin, inf : Str} = \x,y ->
|
vn = vfn contr ;
|
||||||
{fin = x ; inf = y} ;
|
|
||||||
in
|
in
|
||||||
case <t,ant,b,ord> of {
|
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,Simul,Pos,OQuest> => vf (does agr) inf ;
|
||||||
<Pres,Anter,Pos,_> => vf (have agr) part ; --# notpresent
|
<Pres,Anter,Pos,_> => vf (have agr) part ; --# notpresent
|
||||||
<Pres,Anter,Neg,_> => vf (havent agr) part ; --# notpresent
|
<Pres,Anter,Neg,_> => vn (have agr) (havent agr) part ; --# notpresent
|
||||||
<Past,Simul,Pos,ODir> => vf (verb.s ! VPast) [] ; --# notpresent --- should be opp
|
<Past,Simul,Pos,ODir> => vf (verb.s ! VPast) [] ; --# notpresent
|
||||||
<Past,Simul,Pos,OQuest> => vf "did" inf ; --# 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,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,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,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,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,Pos,_> => vf "would" ("have" ++ part) ; --# notpresent
|
||||||
<Cond,Anter,Neg,_> => vf "wouldn't" ("have" ++ part) ; --# notpresent
|
<Cond,Anter,Neg,_> => vn "would" "wouldn't" ("have" ++ part) ; --# notpresent
|
||||||
<Pres,Simul,Neg,_> => vf (doesnt agr) inf
|
<Pres,Simul,Neg,_> => vn (does agr) (doesnt agr) inf
|
||||||
} ;
|
} ;
|
||||||
prp = verb.s ! VPresPart ;
|
prp = verb.s ! VPresPart ;
|
||||||
inf = verb.s ! VInf ;
|
inf = verb.s ! VInf ;
|
||||||
@@ -219,36 +217,48 @@ resource ResEng = ParamX ** open Prelude in {
|
|||||||
s2 = \\a => if_then_Str verb.isRefl (reflPron ! a) []
|
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 =>
|
s = \\t,ant,b,ord,agr =>
|
||||||
let
|
let
|
||||||
inf = verb.inf ;
|
inf = verb.inf ;
|
||||||
fin = verb.pres ! b ! agr ;
|
fin = verb.pres ! b ! agr ;
|
||||||
|
finp = verb.pres ! Pos ! agr ;
|
||||||
part = verb.ppart ;
|
part = verb.ppart ;
|
||||||
vf : Str -> Str -> {fin, inf : Str} = \x,y ->
|
vn = vfn contr ;
|
||||||
{fin = x ; inf = y} ;
|
|
||||||
in
|
in
|
||||||
case <t,ant,b,ord> of {
|
case <t,ant,b,ord> of {
|
||||||
<Pres,Anter,Pos,_> => vf (have agr) part ; --# notpresent
|
<Pres,Anter,Pos,_> => vf (have agr) part ; --# notpresent
|
||||||
<Pres,Anter,Neg,_> => vf (havent agr) part ; --# notpresent
|
<Pres,Anter,Neg,_> => vn (have agr) (havent agr) part ; --# notpresent
|
||||||
<Past,Simul,_, _> => vf (verb.past ! b ! agr) [] ; --# 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,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,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,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,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,Pos,_> => vf "would" ("have" ++ part) ; --# notpresent
|
||||||
<Cond,Anter,Neg,_> => vf "wouldn't" ("have" ++ part) ; --# notpresent
|
<Cond,Anter,Neg,_> => vn "would" "wouldn't" ("have" ++ part) ; --# notpresent
|
||||||
<Pres,Simul,_, _> => vf fin []
|
<Pres,Simul,Pos, _> => vf fin [] ;
|
||||||
|
<Pres,Simul,_, _> => vn finp fin []
|
||||||
} ;
|
} ;
|
||||||
prp = verb.prpart ;
|
prp = verb.prpart ;
|
||||||
inf = verb.inf ;
|
inf = verb.inf ;
|
||||||
ad = [] ;
|
ad = [] ;
|
||||||
s2 = \\_ => []
|
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 -> {
|
insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> {
|
||||||
s = vp.s ;
|
s = vp.s ;
|
||||||
|
|||||||
Reference in New Issue
Block a user