diff options
Diffstat (limited to 'examples/query')
| -rw-r--r-- | examples/query/Query.gf | 86 | ||||
| -rw-r--r-- | examples/query/QueryEng.gf | 44 | ||||
| -rw-r--r-- | examples/query/QueryI.gf | 6 | ||||
| -rw-r--r-- | examples/query/QuerySwe.gf | 46 | ||||
| -rw-r--r-- | examples/query/TestQuery.gf | 26 | ||||
| -rw-r--r-- | examples/query/TestQueryEng.gf | 38 | ||||
| -rw-r--r-- | examples/query/TestQuerySwe.gf | 38 |
7 files changed, 219 insertions, 65 deletions
diff --git a/examples/query/Query.gf b/examples/query/Query.gf index 4687f6c06..6f6dab6bc 100644 --- a/examples/query/Query.gf +++ b/examples/query/Query.gf @@ -9,14 +9,18 @@ cat Move ; -- top-level utterance, e.g. "give me all Bulgarian persons that work at Google"
Query ;
Answer ;
- Set ; -- the set requested, e.g. "all persons"
- Interrogative ; -- interrog. pron. e.g. "who"
- Function ; -- something of something, e.g. "subregion of Bulgaria"
- Kind ; -- type of things, e.g. "person"
- Relation ; -- relation between things,e.g. "employed at"
- Property ; -- property of things, e.g. "employed at Google"
- Individual ; -- one entity, e.g. "Google"
- Name ; -- person, company... e.g. "Eric Schmidt"
+ Set ; -- the set requested, e.g. "all persons"
+ Interrogative ; -- interrog. pron. e.g. "who"
+ Function ; -- something of something, e.g. "subregion of Bulgaria"
+ Kind ; -- type of things, e.g. "person"
+ Relation ; -- relation between things,e.g. "employed at"
+ Property ; -- property of things, e.g. "employed at Google"
+ Individual ; -- one entity, e.g. "Google"
+-- Activity ; -- action property, e.g. "work at Google"
+ Name ; -- person, company... e.g. "Eric Schmidt"
+ Loc ;
+ Org ;
+ Pers ;
[Individual] {2} ; -- list of entities, e.g. "Larry Page, Sergey Brin"
fun
@@ -39,6 +43,7 @@ fun AInd : Set -> Individual -> Answer ; -- S is I
AName : Set -> Name -> Answer ; -- N is the name of S
AProp : Set -> Property -> Answer ; -- S is P
+-- AAct : Set -> Activity -> Answer ; -- S As --+
SAll : Kind -> Set ; -- all Ks | the Ks
SFun : Set -> Function -> Set ; -- S's Rs
@@ -59,10 +64,15 @@ fun KFunKind : Kind -> Function -> Set -> Kind ; -- K that is R of S
KFunPair : Kind -> Function -> Kind ; -- S's with their R's
KProp : Property -> Kind -> Kind ; -- P K | K that is P
+-- KAct : Activity -> Kind -> Kind ; -- K that Ps
KFun : Function -> Kind ; -- R ---??
IName : Name -> Individual ;
+ NLoc : Loc -> Name ;
+ NOrg : Org -> Name ;
+ NPers : Pers -> Name ;
+
PCalled : Individual -> Property ; -- also called I
PCalleds : [Individual] -> Property ; -- also called I or J
@@ -100,10 +110,10 @@ fun Region : Function ;
Subregion : Function ;
- USA : Country ;
- California : Country ;
- Bulgaria : Country ;
- OblastSofiya : Name ;
+-- USA : Country ;
+-- California : Country ;
+-- Bulgaria : Country ;
+-- OblastSofiya : Name ;
FName : Function ;
FNickname : Function ;
@@ -111,20 +121,46 @@ fun SJobTitle : JobTitle -> Set ; -- a programmer
- CEO : JobTitle ;
- ChiefInformationOfficer : JobTitle ;
+-- JobTitles
+ JobTitle1 : JobTitle ;
+ JobTitle2 : JobTitle ;
+ JobTitle3 : JobTitle ;
+ JobTitle4 : JobTitle ;
+
+-- Locations
+ Location1 : Loc ;
+ Location2 : Loc ;
+ Location3 : Loc ;
+ Location4 : Loc ;
+
+-- Organizations
+ Organization1 : Org ;
+ Organization2 : Org ;
+ Organization3 : Org ;
+ Organization4 : Org ;
+
+-- Persons
+ Person1 : Pers ;
+ Person2 : Pers ;
+ Person3 : Pers ;
+ Person4 : Pers ;
+
+-- CEO : JobTitle ;
+-- ChiefInformationOfficer : JobTitle ;
- Microsoft : Name ;
- Google : Name ;
-
- SergeyBrin : Name ;
- LarryPage : Name ;
- EricSchmidt : Name ;
- MarissaMayer : Name ;
- UdiManber : Name ;
- CarlGustavJung : Name ;
- Jung : Name ;
- BenFried : Name ;
+-- Microsoft : Name ;
+-- Google : Name ;
+
+-- SergeyBrin : Name ;
+-- LarryPage : Name ;
+-- EricSchmidt : Name ;
+-- MarissaMayer : Name ;
+-- UdiManber : Name ;
+-- CarlGustavJung : Name ;
+-- Jung : Name ;
+-- BenFried : Name ;
+
+
}
diff --git a/examples/query/QueryEng.gf b/examples/query/QueryEng.gf index 0cd9c74b7..59a25f55d 100644 --- a/examples/query/QueryEng.gf +++ b/examples/query/QueryEng.gf @@ -73,26 +73,6 @@ lin SJobTitle t = mkNP a_Det t ; - USA = mkCountry "USA" "American" ; - Bulgaria = mkCountry "Bulgaria" "Bulgarian" ; - California = mkCountry "California" "Californian" ; - OblastSofiya = mkName "Oblast Sofiya" ; - - CEO = mkCN (mkN "CEO") ; - ChiefInformationOfficer = mkCN (mkN "Chief Information Officer") ; - - Microsoft = mkName "Microsoft" ; - Google = mkName "Google" ; - - SergeyBrin = mkName "Sergey Brin" ; - LarryPage = mkName "Larry Page" ; - EricSchmidt = mkName "Eric Schmidt" ; - MarissaMayer = mkName "Marissa Mayer" ; - UdiManber = mkName "Udi Manber" ; - CarlGustavJung = mkName "Carl Gustav Jung" ; - Jung = mkName "Jung" ; - BenFried = mkName "Ben Fried" ; - oper mkCountry : Str -> Str -> {np : NP ; a : A} = \n,a -> {np = mkNP (mkPN n) ; a = mkA a} ; @@ -102,5 +82,29 @@ oper mkFunction : Str -> Fun = \s -> {cn = mkCN (mkN s) ; prep = possess_Prep} ; +lin +-- JobTitles + JobTitle1 = mkCN (mkN "'JobTitle1") ; + JobTitle2 = mkCN (mkN "'JobTitle2") ; + JobTitle3 = mkCN (mkN "'JobTitle3") ; + JobTitle4 = mkCN (mkN "'JobTitle4") ; + +-- Locations + Location1 = mkName "'Location1" ; + Location2 = mkName "'Location2" ; + Location3 = mkName "'Location3" ; + Location4 = mkName "'Location4" ; + +-- Organizations + Organization1 = mkName "'Organization1" ; + Organization2 = mkName "'Organization2" ; + Organization3 = mkName "'Organization3" ; + Organization4 = mkName "'Organization4" ; + +-- Persons + Person1 = mkName "'Person1" ; + Person2 = mkName "'Person2" ; + Person3 = mkName "'Person3" ; + Person4 = mkName "'Person4" ; } diff --git a/examples/query/QueryI.gf b/examples/query/QueryI.gf index 16c8ba24c..6c98e0188 100644 --- a/examples/query/QueryI.gf +++ b/examples/query/QueryI.gf @@ -17,6 +17,9 @@ lincat Relation = Rel ; -- = {ap : AP ; vp : VP ; prep : Prep} ; Individual = NP ; Name = NP ; + Loc = NP ; + Org = NP ; + Pers = NP ; [Individual] = [NP] ; lin @@ -176,5 +179,8 @@ lin NCountry c = c.np ; PCountry c = propAP (mkAP c.a) ; + NLoc n = n ; + NOrg n = n ; + NPers n = n; } diff --git a/examples/query/QuerySwe.gf b/examples/query/QuerySwe.gf index 2b7aad0d0..ce9f6c482 100644 --- a/examples/query/QuerySwe.gf +++ b/examples/query/QuerySwe.gf @@ -90,26 +90,6 @@ lin SJobTitle t = mkNP a_Det t ; - USA = mkCountry "USA" "amerikansk" ; - Bulgaria = mkCountry "Bulgarien" "bulgarisk" ; - California = mkCountry "Kalifornien" "Kalifornisk" ; - OblastSofiya = mkName "Oblast Sofiya" ; - - CEO = mkCN (mkN "VD" "VD:ar") ; - ChiefInformationOfficer = mkCN (mkN "chefsinformatör" "chefsinformatörer") ; - - Microsoft = mkName "Microsoft" ; - Google = mkName "Google" ; - - SergeyBrin = mkName "Sergey Brin" ; - LarryPage = mkName "Larry Page" ; - EricSchmidt = mkName "Eric Schmidt" ; - MarissaMayer = mkName "Marissa Mayer" ; - UdiManber = mkName "Udi Manber" ; - CarlGustavJung = mkName "Carl Gustav Jung" ; - Jung = mkName "Jung" ; - BenFried = mkName "Ben Fried" ; - oper mkCountry : Str -> Str -> {np : NP ; a : A} = \n,a -> {np = mkNP (mkPN n) ; a = mkA a} ; @@ -121,4 +101,30 @@ oper mkFunctionP : N -> Prep -> Fun = \n,p -> {cn = mkCN n ; prep = p} ; + +lin +-- JobTitles + JobTitle1 = mkCN (mkN "'JobTitle1") ; + JobTitle2 = mkCN (mkN "'JobTitle2") ; + JobTitle3 = mkCN (mkN "'JobTitle3") ; + JobTitle4 = mkCN (mkN "'JobTitle4") ; + +-- Locations + Location1 = mkName "'Location1" ; + Location2 = mkName "'Location2" ; + Location3 = mkName "'Location3" ; + Location4 = mkName "'Location4" ; + +-- Organizations + Organization1 = mkName "'Organization1" ; + Organization2 = mkName "'Organization2" ; + Organization3 = mkName "'Organization3" ; + Organization4 = mkName "'Organization4" ; + +-- Persons + Person1 = mkName "'Person1" ; + Person2 = mkName "'Person2" ; + Person3 = mkName "'Person3" ; + Person4 = mkName "'Person4" ; + } diff --git a/examples/query/TestQuery.gf b/examples/query/TestQuery.gf new file mode 100644 index 000000000..a91f256b1 --- /dev/null +++ b/examples/query/TestQuery.gf @@ -0,0 +1,26 @@ +abstract TestQuery = Query ** {
+
+fun
+ USA : Country ;
+ California : Country ;
+ Bulgaria : Country ;
+ OblastSofiya : Name ;
+
+ CEO : JobTitle ;
+ ChiefInformationOfficer : JobTitle ;
+
+ Microsoft : Name ;
+ Google : Name ;
+
+ SergeyBrin : Name ;
+ LarryPage : Name ;
+ EricSchmidt : Name ;
+ MarissaMayer : Name ;
+ UdiManber : Name ;
+ CarlGustavJung : Name ;
+ Jung : Name ;
+ BenFried : Name ;
+
+}
+
+
diff --git a/examples/query/TestQueryEng.gf b/examples/query/TestQueryEng.gf new file mode 100644 index 000000000..898a5b03a --- /dev/null +++ b/examples/query/TestQueryEng.gf @@ -0,0 +1,38 @@ +--# -path=.:present + +concrete TestQueryEng of TestQuery = QueryEng ** +open + LexQueryEng, + ParadigmsEng, + IrregEng, + SyntaxEng, + ExtraEng, + (L = LangEng), + (M = MakeStructuralEng), + Prelude +in { + +-- test lexicon + +lin + USA = mkCountry "USA" "American" ; + Bulgaria = mkCountry "Bulgaria" "Bulgarian" ; + California = mkCountry "California" "Californian" ; + OblastSofiya = mkName "Oblast Sofiya" ; + + CEO = mkCN (mkN "CEO") ; + ChiefInformationOfficer = mkCN (mkN "Chief Information Officer") ; + + Microsoft = mkName "Microsoft" ; + Google = mkName "Google" ; + + SergeyBrin = mkName "Sergey Brin" ; + LarryPage = mkName "Larry Page" ; + EricSchmidt = mkName "Eric Schmidt" ; + MarissaMayer = mkName "Marissa Mayer" ; + UdiManber = mkName "Udi Manber" ; + CarlGustavJung = mkName "Carl Gustav Jung" ; + Jung = mkName "Jung" ; + BenFried = mkName "Ben Fried" ; + +} diff --git a/examples/query/TestQuerySwe.gf b/examples/query/TestQuerySwe.gf new file mode 100644 index 000000000..da20230e9 --- /dev/null +++ b/examples/query/TestQuerySwe.gf @@ -0,0 +1,38 @@ +--# -path=.:present + +concrete TestQuerySwe of TestQuery = QuerySwe ** +open + LexQuerySwe, + ParadigmsSwe, + IrregSwe, + SyntaxSwe, + ExtraSwe, + (L = LangSwe), + (M = MakeStructuralSwe), + Prelude +in { + +-- test lexicon + +lin + USA = mkCountry "USA" "amerikansk" ; + Bulgaria = mkCountry "Bulgarien" "bulgarisk" ; + California = mkCountry "Kalifornien" "Kalifornisk" ; + OblastSofiya = mkName "Oblast Sofiya" ; + + CEO = mkCN (mkN "VD" "VD:ar") ; + ChiefInformationOfficer = mkCN (mkN "chefsinformatör" "chefsinformatörer") ; + + Microsoft = mkName "Microsoft" ; + Google = mkName "Google" ; + + SergeyBrin = mkName "Sergey Brin" ; + LarryPage = mkName "Larry Page" ; + EricSchmidt = mkName "Eric Schmidt" ; + MarissaMayer = mkName "Marissa Mayer" ; + UdiManber = mkName "Udi Manber" ; + CarlGustavJung = mkName "Carl Gustav Jung" ; + Jung = mkName "Jung" ; + BenFried = mkName "Ben Fried" ; + +} |
