Made changes required by lock fields; not yet in Swedish and Finnish.

This commit is contained in:
aarne
2003-11-12 12:22:53 +00:00
parent 54c72f5ab0
commit eb24522848
11 changed files with 93 additions and 74 deletions

View File

@@ -1,4 +1,4 @@
concrete DatabaseEng of Database = open Prelude,Syntax,English,Predication,Paradigms,DatabaseRes in {
concrete DatabaseEng of Database = open Prelude,Syntax,English,Predication,Paradigms,DatabaseEngRes in {
flags lexer=text ; unlexer=text ;
@@ -11,7 +11,7 @@ lincat
Relation = Adj2 ;
Feature = Fun ;
Value = NP ;
Name = ProperName ;
Name = PN ;
lin
LongForm sent = ss (sent.s ! True ++ "?") ;
@@ -41,7 +41,7 @@ lin
-- only these are language-dependent
Any = detNounPhrase anyPlDet ; ---
Any n = detNounPhrase anyPlDet n ** {lock_NP = <>} ; ---
IsThere A = mkSentPrel ["is there"] (defaultNounPhrase (IndefOneNP A)) ;
AreThere A = mkSentPrel ["are there"] (defaultNounPhrase (IndefManyNP A)) ;

View File

@@ -159,9 +159,10 @@ oper
nominative = Nom ;
mkN = \man,men,man's,men's,g -> mkNoun man men man's men's ** {g = g} ;
nReg = addGenN nounReg ;
nKiss = addGenN nounS ;
mkN = \man,men,man's,men's,g ->
mkNoun man men man's men's ** {g = g ; lock_N = <>} ;
nReg a g = addGenN nounReg a g ;
nKiss n g = addGenN nounS n g ;
nFly = \fly -> addGenN nounY (Predef.tk 1 fly) ;
nMan = \man,men -> mkN man men (man + "'s") (men + "'s") ;
nHero = nKiss ;
@@ -180,33 +181,34 @@ oper
eqy "z" nKiss (
nReg))) fly g ;
mkFun = \n,p -> n ** {s2 = p} ;
mkFun = \n,p -> n ** {lock_Fun = <> ; s2 = p} ;
funNonhuman = \s -> mkFun (nNonhuman s) "of" ;
funHuman = \s -> mkFun (nHuman s) "of" ;
pnReg = nameReg ;
pnReg n = nameReg n ** {lock_PN = <>} ;
cnNonhuman = \s -> UseN (nGen s nonhuman) ;
cnHuman = \s -> UseN (nGen s human) ;
npReg = \s -> UsePN (pnReg s) ;
mkFunCN = \n,p -> n ** {s2 = p} ;
mkFunCN = \n,p -> n ** {lock_Fun = <> ; s2 = p} ;
funOfCN = \n -> mkFunCN n "of" ;
addGenN : (Str -> CommonNoun) -> Str -> Gender -> N = \f ->
\s,g -> f s ** {g = g} ;
\s,g -> f s ** {g = g ; lock_N = <>} ;
mkAdj1 = simpleAdj ;
mkAdj2 = \s,p -> simpleAdj s ** {s2 = p} ;
mkAdjDeg = mkAdjDegr ;
aReg = adjDegrReg ;
aHappy = \happy -> adjDegrY (Predef.tk 1 happy) ;
mkAdj1 a = simpleAdj a ** {lock_Adj1 = <>} ;
mkAdj2 = \s,p -> simpleAdj s ** {s2 = p} ** {lock_Adj2 = <>} ;
mkAdjDeg a b c = mkAdjDegr a b c ** {lock_AdjDeg = <>} ;
aReg a = adjDegrReg a ** {lock_AdjDeg = <>} ;
aHappy = \happy -> adjDegrY (Predef.tk 1 happy) ** {lock_AdjDeg = <>} ;
aFat = \fat -> let {fatt = fat + Predef.dp 1 fat} in
mkAdjDeg fat (fatt + "er") (fatt + "est") ;
aRidiculous = adjDegrLong ;
aRidiculous a = adjDegrLong a ** {lock_AdjDeg = <>} ;
apReg = \s -> AdjP1 (mkAdj1 s) ;
mkV = \go,goes,went,gone -> verbNoPart (mkVerbP3 go goes went gone) ;
mkV = \go,goes,went,gone -> verbNoPart (mkVerbP3 go goes went gone) **
{lock_V = <>} ;
vReg = \walk -> mkV walk (walk + "s") (walk + "ed") (walk + "ed") ;
vKiss = \kiss -> mkV kiss (kiss + "es") (kiss + "ed") (kiss + "ed") ;
vFly = \cry -> let {cr = Predef.tk 1 cry} in
@@ -223,14 +225,16 @@ oper
eqy "z" vKiss (
vReg))) fly ;
vPart = \go, goes, went, gone, up -> verbPart (mkVerbP3 go goes went gone) up ;
vPartReg = \get, up -> verbPart (regVerbP3 get) up ;
vPart = \go, goes, went, gone, up ->
verbPart (mkVerbP3 go goes went gone) up ** {lock_V = <>} ;
vPartReg = \get, up ->
verbPart (regVerbP3 get) up ** {lock_V = <>} ;
mkTV = \v,p -> v ** {s3 = p} ;
mkTV = \v,p -> v ** {lock_TV = <> ; s3 = p} ;
tvPartReg = \get, along, to -> mkTV (vPartReg get along) to ;
vBe = verbBe ;
vHave = verbP3Have ;
vBe = verbBe ** {s1 = [] ; lock_V = <>} ;
vHave = verbP3Have ** {s1 = [] ; lock_V = <>} ;
tvGen = \s,p -> mkTV (vGen s) p ;
tvDir = \v -> mkTV v [] ;

View File

@@ -58,10 +58,10 @@ oper
predV1 = \F, x -> PredVP x (PosV F) ;
predV2 = \F, x, y -> PredVP x (PosTV F y) ;
predVColl = \F, x, y -> PredVP (conjNP x y) (PosV F) ;
predA1 = \F, x -> PredVP x (PosA F) ;
predA1 = \F, x -> PredVP x (PosA (AdjP1 F)) ;
predA2 = \F, x, y -> PredVP x (PosA (ComplAdj F y)) ;
predAComp = \F, x, y -> PredVP x (PosA (ComparAdjP F y)) ;
predAColl = \F, x, y -> PredVP (conjNP x y) (PosA F) ;
predAColl = \F, x, y -> PredVP (conjNP x y) (PosA (AdjP1 F)) ;
predN1 = \F, x -> PredVP x (PosCN (UseN F)) ;
predN2 = \F, x, y -> PredVP x (PosCN (AppFun F y)) ;
predNColl = \F, x, y -> PredVP (conjNP x y) (PosCN (UseN F)) ;

View File

@@ -52,7 +52,7 @@ lincat
V3 = TransVerb ** {s4 : Preposition} ;
VS = Verb ;
AdV = {s : Str ; isPost : Bool} ;
AdV = {s : Str ; p : Bool} ;
S = {s : Str} ;
Slash = {s : Bool => Str ; s2 : Preposition} ;

View File

@@ -1,5 +1,7 @@
--# -path=.:../abstract:../../prelude
concrete RestaurantEng of Restaurant =
DatabaseEng ** open Prelude,Paradigms,DatabaseRes in {
DatabaseEng ** open Prelude,Paradigms,DatabaseEngRes in {
lin
Restaurant = cnNonhuman "restaurant" ;

View File

@@ -417,23 +417,23 @@ oper
-- compared adverbials as separate expressions; this could be done another way).
-- We distinguish between post- and pre-verbal adverbs.
Adverb : Type = SS ** {isPost : Bool} ;
Adverb : Type = SS ** {p : Bool} ;
advPre : Str -> Adverb = \seldom -> ss seldom ** {isPost = False} ;
advPost : Str -> Adverb = \well -> ss well ** {isPost = True} ;
advPre : Str -> Adverb = \seldom -> ss seldom ** {p = False} ;
advPost : Str -> Adverb = \well -> ss well ** {p = True} ;
-- N.B. this rule generates the cyclic parsing rule $VP#2 ::= VP#2$
-- and cannot thus be parsed.
adVerbPhrase : VerbPhrase -> Adverb -> VerbPhrase = \sings, well ->
let {postp = orB well.isPost sings.isAux} in
let {postp = orB well.p sings.isAux} in
{
s = \\v => (if_then_else Str postp [] well.s) ++ sings.s ! v ;
s2 = \\n => sings.s2 ! n ++ (if_then_else Str postp well.s []) ;
isAux = sings.isAux
} ;
advAdjPhrase : Adverb -> AdjPhrase -> AdjPhrase = \very, good ->
advAdjPhrase : SS -> AdjPhrase -> AdjPhrase = \very, good ->
{s = very.s ++ good.s ;
p = good.p
} ;
@@ -750,7 +750,7 @@ oper
-- This class covers adverbials such as "otherwise", "therefore", which are prefixed
-- to a sentence to form a phrase.
advSentence : Adverb -> Sentence -> Utterance = \hence,itiseven ->
advSentence : SS -> Sentence -> Utterance = \hence,itiseven ->
ss (hence.s ++ itiseven.s ++ ".") ;