Extending resource.

This commit is contained in:
aarne
2003-11-19 17:33:06 +00:00
parent 18dfde370e
commit 1ca5e5398a
20 changed files with 2673 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
abstract Database = {
flags startcat=Query ;
cat
Query ;
Category ; Subject ; Value ; Property ; Relation ; Comparison ; Name ;
Feature ;
fun
WhichAre : Category -> Property -> Query ;
IsThere : Category -> Query ;
AreThere : Category -> Query ;
IsIt : Subject -> Property -> Query ;
WhatIs : Value -> Query ;
MoreThan : Comparison -> Subject -> Property ;
TheMost : Comparison -> Category -> Value ;
Relatively : Comparison -> Category -> Property ;
RelatedTo : Relation -> Subject -> Property ;
Individual : Name -> Subject ;
AllN : Category -> Subject ;
Any : Category -> Subject ;
MostN : Category -> Subject ;
EveryN : Category -> Subject ;
FeatureOf : Feature -> Subject -> Subject ;
ValueOf : Feature -> Name -> Value ;
WithProperty : Category -> Property -> Category ;
} ;

View File

@@ -0,0 +1,43 @@
--# -path=.:../resource/nabstract:../resource/nenglish:../prelude
concrete DatabaseEng of Database = open Prelude, ResEng in {
flags lexer=text ; unlexer=text ;
lincat
Query = Phr ;
Subject = NP ;
Category = CN ;
Property = AP ;
Comparison = AdjDeg ;
Relation = Adj2 ;
Feature = Fun ;
Value = NP ;
Name = PN ;
lin
WhichAre A B = QuestPhrase (IntVP (NounIPMany A) (PosA B)) ;
IsThere A = QuestPhrase (IsThereCN A) ;
AreThere A = QuestPhrase (AreThereCN A) ;
WhatIs val = QuestPhrase (IntVP WhatOne (PosNP val)) ;
IsIt Q A = QuestPhrase (QuestVP Q (PosA A)) ;
MoreThan = ComparAdjP ;
TheMost = SuperlNP ;
Relatively C _ = PositAdjP C ;
RelatedTo = ComplAdj ;
FeatureOf f x = DefOneNP (AppFun f x) ;
ValueOf f x = DefOneNP (AppFun f (UsePN x)) ;
WithProperty A B = ModAdj B A ;
Individual = UsePN ;
AllN = DetNP AllDet ;
MostN = DetNP MostDet ;
EveryN = DetNP EveryDet ;
Any = DetNP AnysDet ;
} ;

View File

@@ -0,0 +1,11 @@
resource DatabaseEngRes = open Prelude in {
oper
mkSent : SS -> SS -> SS1 Bool = \long, short ->
{s = table {b => if_then_else Str b long.s short.s}} ;
mkSentPrel : Str -> SS -> SS1 Bool = \prel, matter ->
mkSent (ss (prel ++ matter.s)) matter ;
mkSentSame : SS -> SS1 Bool = \s ->
mkSent s s ;
} ;

View File

@@ -0,0 +1,16 @@
abstract Restaurant = Database ** {
fun
Restaurant, Bar : Category ;
French, Italian, Indian, Japanese : Property ;
address, phone, priceLevel : Feature ;
Cheap, Expensive : Comparison ;
WhoRecommend : Name -> Query ;
WhoHellRecommend : Name -> Query ;
-- examples of restaurant names
LucasCarton : Name ;
LaCoupole : Name ;
BurgerKing : Name ;
} ;

View File

@@ -0,0 +1,30 @@
--# -path=.:../resource/nabstract:../resource/nenglish:../prelude
concrete RestaurantEng of Restaurant =
DatabaseEng ** open Prelude,ParadigmsEng in {
lin
Restaurant = cnNonhuman "restaurant" ;
Bar = cnNonhuman "bar" ;
French = apReg "French" ;
Italian = apReg "Italian" ;
Indian = apReg "Indian" ;
Japanese = apReg "Japanese" ;
address = funNonhuman "address" ;
phone = funNonhuman ["number"] ; --- phone
priceLevel = funNonhuman ["level"] ; --- price
Cheap = aReg "cheap" ;
Expensive = aRidiculous "expensive" ;
WhoRecommend rest =
ss (["who recommended"] ++ rest.s ! nominative) ** {lock_Phr = <>} ;
WhoHellRecommend rest =
ss (["who the hell recommended"] ++ rest.s ! nominative) ** {lock_Phr = <>} ;
LucasCarton = pnReg ["Lucas Carton"] ;
LaCoupole = pnReg ["La Coupole"] ;
BurgerKing = pnReg ["Burger King"] ;
} ;