mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-22 09:32:53 -06:00
Query/small packaged
This commit is contained in:
10
examples/query/small/Makefile
Normal file
10
examples/query/small/Makefile
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
all: pgf treebank
|
||||||
|
|
||||||
|
pgf:
|
||||||
|
gf -make -optimize-pgf Query???.gf
|
||||||
|
|
||||||
|
treebank:
|
||||||
|
gf --run Query.pgf <tests.gfs >treebank.txt
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -5,7 +5,7 @@ concrete QueryEng of Query = open
|
|||||||
IrregEng,
|
IrregEng,
|
||||||
SyntaxEng,
|
SyntaxEng,
|
||||||
ExtraEng,
|
ExtraEng,
|
||||||
(L = LangEng),
|
(L = GrammarEng),
|
||||||
Prelude
|
Prelude
|
||||||
in {
|
in {
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ lin
|
|||||||
QSet s =
|
QSet s =
|
||||||
let
|
let
|
||||||
ss : NP = s
|
ss : NP = s
|
||||||
| mkNP (mkNP thePl_Det L.name_N) (mkAdv possess_Prep s)
|
| mkNP (mkNP thePl_Det name_N) (mkAdv possess_Prep s)
|
||||||
---- s's names
|
---- s's names
|
||||||
in
|
in
|
||||||
mkUtt (mkImp (mkVP give_V3 (mkNP i_Pron) ss))
|
mkUtt (mkImp (mkVP give_V3 (mkNP i_Pron) ss))
|
||||||
@@ -101,6 +101,7 @@ oper
|
|||||||
give_V3 = mkV3 give_V ;
|
give_V3 = mkV3 give_V ;
|
||||||
information_N = mkN "information" ;
|
information_N = mkN "information" ;
|
||||||
other_A = mkA "other" ;
|
other_A = mkA "other" ;
|
||||||
|
name_N = mkN "name" ;
|
||||||
|
|
||||||
-- lexical constructors
|
-- lexical constructors
|
||||||
mkName : Str -> NP =
|
mkName : Str -> NP =
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ concrete QuerySwe of Query = open
|
|||||||
SyntaxSwe,
|
SyntaxSwe,
|
||||||
ExtraSwe,
|
ExtraSwe,
|
||||||
(M = MakeStructuralSwe),
|
(M = MakeStructuralSwe),
|
||||||
(L = LangSwe),
|
(L = GrammarSwe),
|
||||||
Prelude
|
Prelude
|
||||||
in {
|
in {
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ lin
|
|||||||
QSet s =
|
QSet s =
|
||||||
let
|
let
|
||||||
ss : NP = s
|
ss : NP = s
|
||||||
| mkNP (mkNP thePl_Det L.name_N) (mkAdv on_Prep s)
|
| mkNP (mkNP thePl_Det name_N) (mkAdv on_Prep s)
|
||||||
---- s's names
|
---- s's names
|
||||||
in
|
in
|
||||||
mkUtt (mkImp (mkVP give_V3 (mkNP i_Pron) ss))
|
mkUtt (mkImp (mkVP give_V3 (mkNP i_Pron) ss))
|
||||||
@@ -51,7 +51,7 @@ lin
|
|||||||
mkUtt (mkImp (mkVP give_V3 (mkNP i_Pron) info))
|
mkUtt (mkImp (mkVP give_V3 (mkNP i_Pron) info))
|
||||||
| mkUtt info ;
|
| mkUtt info ;
|
||||||
|
|
||||||
QCalled i = mkUtt (mkQS (mkQCl how_IAdv (mkCl i (mkVP also_AdV (mkVP called_A))))) ;
|
QCalled i = mkUtt (mkQS (mkQCl (mkIP whichSg_IDet (mkCN other_A name_N)) i have_V2)) ;
|
||||||
|
|
||||||
AKind s k = mkUtt (mkCl s (mkNP aPl_Det k)) ; ---- a, fun of s
|
AKind s k = mkUtt (mkCl s (mkNP aPl_Det k)) ; ---- a, fun of s
|
||||||
AProp s p = mkUtt (mkCl s p) ;
|
AProp s p = mkUtt (mkCl s p) ;
|
||||||
@@ -105,8 +105,7 @@ oper
|
|||||||
information_N = mkN "information" "informationer" ;
|
information_N = mkN "information" "informationer" ;
|
||||||
other_A = compoundA (mkA "annan" "annat" "andra" "andra" "andra") ;
|
other_A = compoundA (mkA "annan" "annat" "andra" "andra" "andra") ;
|
||||||
that_RP = which_RP ;
|
that_RP = which_RP ;
|
||||||
|
name_N = mkN "namn" "namn" ;
|
||||||
sina : CN -> NP = \cn -> mkNP (M.mkPredet "sin" "sitt" "sina") (mkNP a_Quant plNum cn) ; ---- should be in ExtraSwe
|
|
||||||
|
|
||||||
-- lexical constructors
|
-- lexical constructors
|
||||||
mkName : Str -> NP =
|
mkName : Str -> NP =
|
||||||
|
|||||||
11
examples/query/small/README
Normal file
11
examples/query/small/README
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
Query language for MOLTO KRI.
|
||||||
|
(c) Aarne Ranta 2011 for the gf files
|
||||||
|
|
||||||
|
To compile and test: make
|
||||||
|
|
||||||
|
To build a new language, use QueryGer or QueryIta as starting point:
|
||||||
|
they are the simplest and cleanest implementations. As baseline, just change
|
||||||
|
the lexical oper's in the beginning of the file.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
299
examples/query/small/treebank.txt
Normal file
299
examples/query/small/treebank.txt
Normal file
@@ -0,0 +1,299 @@
|
|||||||
|
Query: MQuery (QSet (SAll Person))
|
||||||
|
QueryEng: give me all people
|
||||||
|
QueryFin: näytä kaikki henkilöt
|
||||||
|
QueryFre: montrer toutes les personnes
|
||||||
|
QueryGer: zeigen Sie alle Personen
|
||||||
|
QueryIta: mostrare tutte le persone
|
||||||
|
QuerySwe: ge mig alla personer
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QSet (SAll (KRel Location)))
|
||||||
|
QueryEng: give me all locations
|
||||||
|
QueryFin: näytä kaikki sijainnit
|
||||||
|
QueryFre: montrer toutes les positions
|
||||||
|
QueryGer: zeigen Sie alle Lagen
|
||||||
|
QueryIta: mostrare tutte le posizioni
|
||||||
|
QuerySwe: ge mig alla lägen
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QSet (SAll Organization))
|
||||||
|
QueryEng: give me all organizations
|
||||||
|
QueryFin: näytä kaikki organisaatiot
|
||||||
|
QueryFre: montrer toutes les organisations
|
||||||
|
QueryGer: zeigen Sie alle Organisationen
|
||||||
|
QueryIta: mostrare tutte le organizzazioni
|
||||||
|
QuerySwe: ge mig alla organisationer
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QInfo (SInd (IName (NOrg Organization1))))
|
||||||
|
QueryEng: give me all information about 'Organization1
|
||||||
|
QueryFin: anna kaikki tiedot organisaatiosta 'Organization1
|
||||||
|
QueryFre: montrer toutes les informations sur 'Organization1
|
||||||
|
QueryGer: zeigen Sie alle Informationen über 'Organization1
|
||||||
|
QueryIta: mostrare tutte le informazioni su 'Organization1
|
||||||
|
QuerySwe: ge mig all information om 'Organization1
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QInfo (SInd (IName (NPers Person1))))
|
||||||
|
QueryEng: give me all information about 'Person1
|
||||||
|
QueryFin: anna kaikki tiedot henkilöstä 'Person1
|
||||||
|
QueryFre: montrer toutes les informations sur 'Person1
|
||||||
|
QueryGer: zeigen Sie alle Informationen über 'Person1
|
||||||
|
QueryIta: mostrare tutte le informazioni su 'Person1
|
||||||
|
QuerySwe: ge mig all information om 'Person1
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QInfo (SInd (IName (NLoc Location1))))
|
||||||
|
QueryEng: give me all information about 'Location1
|
||||||
|
QueryFin: anna kaikki tiedot paikasta 'Location1
|
||||||
|
QueryFre: montrer toutes les informations sur 'Location1
|
||||||
|
QueryGer: zeigen Sie alle Informationen über 'Location1
|
||||||
|
QueryIta: mostrare tutte le informazioni su 'Location1
|
||||||
|
QuerySwe: ge mig all information om 'Location1
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QSet (SInd (IName (NOrg Organization1))))
|
||||||
|
QueryEng: give me 'Organization1
|
||||||
|
QueryFin: näytä organisaatio 'Organization1
|
||||||
|
QueryFre: montrer 'Organization1
|
||||||
|
QueryGer: zeigen Sie 'Organization1
|
||||||
|
QueryIta: mostrare 'Organization1
|
||||||
|
QuerySwe: ge mig 'Organization1
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QSet (SInd (IName (NPers Person1))))
|
||||||
|
QueryEng: give me 'Person1
|
||||||
|
QueryFin: näytä henkilö 'Person1
|
||||||
|
QueryFre: montrer 'Person1
|
||||||
|
QueryGer: zeigen Sie 'Person1
|
||||||
|
QueryIta: mostrare 'Person1
|
||||||
|
QuerySwe: ge mig 'Person1
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QSet (SInd (IName (NLoc Location1))))
|
||||||
|
QueryEng: give me 'Location1
|
||||||
|
QueryFin: näytä paikka 'Location1
|
||||||
|
QueryFre: montrer 'Location1
|
||||||
|
QueryGer: zeigen Sie 'Location1
|
||||||
|
QueryIta: mostrare 'Location1
|
||||||
|
QuerySwe: ge mig 'Location1
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QInfo (SAll Person))
|
||||||
|
QueryEng: give me all information about all people
|
||||||
|
QueryFin: anna kaikki tiedot kaikista henkilöistä
|
||||||
|
QueryFre: montrer toutes les informations sur toutes les personnes
|
||||||
|
QueryGer: zeigen Sie alle Informationen über alle Personen
|
||||||
|
QueryIta: mostrare tutte le informazioni su tutte le persone
|
||||||
|
QuerySwe: ge mig all information om alla personer
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QInfo (SAll (KRel Location)))
|
||||||
|
QueryEng: give me all information about all locations
|
||||||
|
QueryFin: anna kaikki tiedot kaikista sijainneista
|
||||||
|
QueryFre: montrer toutes les informations sur toutes les positions
|
||||||
|
QueryGer: zeigen Sie alle Informationen über alle Lagen
|
||||||
|
QueryIta: mostrare tutte le informazioni su tutte le posizioni
|
||||||
|
QuerySwe: ge mig all information om alla lägen
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QInfo (SAll Organization))
|
||||||
|
QueryEng: give me all information about all organizations
|
||||||
|
QueryFin: anna kaikki tiedot kaikista organisaatioista
|
||||||
|
QueryFre: montrer toutes les informations sur toutes les organisations
|
||||||
|
QueryGer: zeigen Sie alle Informationen über alle Organisationen
|
||||||
|
QueryIta: mostrare tutte le informazioni su tutte le organizzazioni
|
||||||
|
QuerySwe: ge mig all information om alla organisationer
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QSet (SAll (KRelSet Subregion (SAll (KRel Location)))))
|
||||||
|
QueryEng: give me all subregions of all locations
|
||||||
|
QueryFin: näytä kaikki kaikkien sijaintien osat
|
||||||
|
QueryFre: montrer toutes les sous-régions de toutes les positions
|
||||||
|
QueryGer: zeigen Sie alle Teilbereiche von allen Lagen
|
||||||
|
QueryIta: mostrare tutte le sottoregioni di tutte le posizioni
|
||||||
|
QuerySwe: ge mig alla delregioner i alla lägen
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QSet (SAll (KRelKind (KRel Location) Subregion (SOther (KRel Location)))))
|
||||||
|
QueryEng: give me all locations that are subregions of other locations
|
||||||
|
QueryFin: näytä kaikki sijainnit jotka ovat muiden sijaintien osia
|
||||||
|
QueryFre: montrer toutes les positions qui sont des sous-régions d' autres positions
|
||||||
|
QueryGer: zeigen Sie alle Lagen die Teilbereiche von anderen Lagen sind
|
||||||
|
QueryIta: mostrare tutte le posizioni che sono sottoregioni di altre posizioni
|
||||||
|
QuerySwe: ge mig alla lägen som är delregioner i andra lägen
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QSet (SAll (KRelSet Subregion (SInd (IName (NLoc Location1))))))
|
||||||
|
QueryEng: give me all subregions of 'Location1
|
||||||
|
QueryFin: näytä kaikki paikan 'Location1 osat
|
||||||
|
QueryFre: montrer toutes les sous-régions de 'Location1
|
||||||
|
QueryGer: zeigen Sie alle Teilbereiche von 'Location1
|
||||||
|
QueryIta: mostrare tutte le sottoregioni di 'Location1
|
||||||
|
QuerySwe: ge mig alla delregioner i 'Location1
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QSet (SPlural (KProp (Located Location1) Organization)))
|
||||||
|
QueryEng: give me organizations located in 'Location1
|
||||||
|
QueryFin: näytä paikassa 'Location1 sijaitsevia organisaatioita
|
||||||
|
QueryFre: montrer des organisations situées dans 'Location1
|
||||||
|
QueryGer: zeigen Sie in 'Location1 situierte Organisationen
|
||||||
|
QueryIta: mostrare organizzazioni situate in 'Location1
|
||||||
|
QuerySwe: ge mig organisationer belägna i 'Location1
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QSet (SPlural (KProp (Located Location1) Person)))
|
||||||
|
QueryEng: give me people located in 'Location1
|
||||||
|
QueryFin: näytä paikassa 'Location1 sijaitsevia henkilöitä
|
||||||
|
QueryFre: montrer des personnes situées dans 'Location1
|
||||||
|
QueryGer: zeigen Sie in 'Location1 situierte Personen
|
||||||
|
QueryIta: mostrare persone situate in 'Location1
|
||||||
|
QuerySwe: ge mig personer belägna i 'Location1
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QSet (SPlural (KProp (Located Location1) (KRel Location))))
|
||||||
|
QueryEng: give me locations located in 'Location1
|
||||||
|
QueryFin: näytä paikassa 'Location1 sijaitsevia sijainteja
|
||||||
|
QueryFre: montrer des positions situées dans 'Location1
|
||||||
|
QueryGer: zeigen Sie in 'Location1 situierte Lagen
|
||||||
|
QueryIta: mostrare posizioni situate in 'Location1
|
||||||
|
QuerySwe: ge mig lägen belägna i 'Location1
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QWhere (SInd (IName (NLoc Location1))))
|
||||||
|
QueryEng: where is 'Location1
|
||||||
|
QueryFin: missä on paikka 'Location1
|
||||||
|
QueryFre: où est 'Location1
|
||||||
|
QueryGer: wo ist 'Location1
|
||||||
|
QueryIta: dove è 'Location1
|
||||||
|
QuerySwe: var är 'Location1
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QWhere (SInd (IName (NOrg Organization1))))
|
||||||
|
QueryEng: where is 'Organization1
|
||||||
|
QueryFin: missä on organisaatio 'Organization1
|
||||||
|
QueryFre: où est 'Organization1
|
||||||
|
QueryGer: wo ist 'Organization1
|
||||||
|
QueryIta: dove è 'Organization1
|
||||||
|
QuerySwe: var är 'Organization1
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QWhere (SInd (IName (NPers Person1))))
|
||||||
|
QueryEng: where is 'Person1
|
||||||
|
QueryFin: missä on henkilö 'Person1
|
||||||
|
QueryFre: où est 'Person1
|
||||||
|
QueryGer: wo ist 'Person1
|
||||||
|
QueryIta: dove è 'Person1
|
||||||
|
QuerySwe: var är 'Person1
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QSet (SAll (KRelPair Organization Location)))
|
||||||
|
QueryEng: give me all organizations with their locations
|
||||||
|
QueryFin: näytä kaikki organisaatiot ja näiden sijainnit
|
||||||
|
QueryFre: montrer toutes les organisations avec leurs positions
|
||||||
|
QueryGer: zeigen Sie alle Organisationen mit ihren Lagen
|
||||||
|
QueryIta: mostrare tutte le organizzazioni colle loro posizioni
|
||||||
|
QuerySwe: ge mig alla organisationer med deras lägen
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QWhere (SAll Organization))
|
||||||
|
QueryEng: where are all organizations
|
||||||
|
QueryFin: missä ovat kaikki organisaatiot
|
||||||
|
QueryFre: où sont toutes les organisations
|
||||||
|
QueryGer: wo sind alle Organisationen
|
||||||
|
QueryIta: dove sono tutte le organizzazioni
|
||||||
|
QuerySwe: var är alla organisationer
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QWhere (SAll Person))
|
||||||
|
QueryEng: where are all people
|
||||||
|
QueryFin: missä ovat kaikki henkilöt
|
||||||
|
QueryFre: où sont toutes les personnes
|
||||||
|
QueryGer: wo sind alle Personen
|
||||||
|
QueryIta: dove sono tutte le persone
|
||||||
|
QuerySwe: var är alla personer
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QWhere (SAll (KRel Location)))
|
||||||
|
QueryEng: where are all locations
|
||||||
|
QueryFin: missä ovat kaikki sijainnit
|
||||||
|
QueryFre: où sont toutes les positions
|
||||||
|
QueryGer: wo sind alle Lagen
|
||||||
|
QueryIta: dove sono tutte le posizioni
|
||||||
|
QuerySwe: var är alla lägen
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QSet (SPlural (KRelPair (KRel Region) Subregion)))
|
||||||
|
QueryEng: give me regions with their subregions
|
||||||
|
QueryFin: näytä alueita ja näiden osia
|
||||||
|
QueryFre: montrer des régions avec leurs sous-régions
|
||||||
|
QueryGer: zeigen Sie Regionen mit ihren Teilbereichen
|
||||||
|
QueryIta: mostrare regioni colle loro sottoregioni
|
||||||
|
QuerySwe: ge mig regioner med deras delregioner
|
||||||
|
|
||||||
|
|
||||||
|
command not parsed
|
||||||
|
Query: MQuery (QSet (SAll (KAct (Work Organization1) Person)))
|
||||||
|
QueryEng: give me all people that work at 'Organization1
|
||||||
|
QueryFin: näytä kaikki henkilöt jotka työskentelevät organisaatiossa 'Organization1
|
||||||
|
QueryFre: montrer toutes les personnes qui travaillent chez 'Organization1
|
||||||
|
QueryGer: zeigen Sie alle Personen die bei 'Organization1 arbeiten
|
||||||
|
QueryIta: mostrare tutte le persone che lavorano presso 'Organization1
|
||||||
|
QuerySwe: ge mig alla personer som jobbar på 'Organization1
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QSet (SAll (KRelSet RNickname (SInd (IName (NPers Person1))))))
|
||||||
|
QueryEng: give me all nicknames of 'Person1
|
||||||
|
QueryFin: näytä kaikki henkilön 'Person1 lisänimet
|
||||||
|
QueryFre: montrer tous les surnoms de 'Person1
|
||||||
|
QueryGer: zeigen Sie alle Spitznamen von 'Person1
|
||||||
|
QueryIta: mostrare tutti i soprannomi di 'Person1
|
||||||
|
QuerySwe: ge mig alla tilläggsnamn på 'Person1
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QSet (SAll (KRelSet RNickname (SInd (IName (NLoc Location1))))))
|
||||||
|
QueryEng: give me all nicknames of 'Location1
|
||||||
|
QueryFin: näytä kaikki paikan 'Location1 lisänimet
|
||||||
|
QueryFre: montrer tous les surnoms de 'Location1
|
||||||
|
QueryGer: zeigen Sie alle Spitznamen von 'Location1
|
||||||
|
QueryIta: mostrare tutti i soprannomi di 'Location1
|
||||||
|
QuerySwe: ge mig alla tilläggsnamn på 'Location1
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QSet (SAll (KRelSet RNickname (SInd (IName (NOrg Organization1))))))
|
||||||
|
QueryEng: give me all nicknames of 'Organization1
|
||||||
|
QueryFin: näytä kaikki organisaation 'Organization1 lisänimet
|
||||||
|
QueryFre: montrer tous les surnoms de 'Organization1
|
||||||
|
QueryGer: zeigen Sie alle Spitznamen von 'Organization1
|
||||||
|
QueryIta: mostrare tutti i soprannomi di 'Organization1
|
||||||
|
QuerySwe: ge mig alla tilläggsnamn på 'Organization1
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QCalled (IName (NPers Person1)))
|
||||||
|
QueryEng: how is 'Person1 also called
|
||||||
|
QueryFin: mikä on henkilön 'Person1 toinen nimi
|
||||||
|
QueryFre: quel autre nom a 'Person1
|
||||||
|
QueryGer: welchen anderen Namen hat 'Person1
|
||||||
|
QueryIta: quale altro nome ha 'Person1
|
||||||
|
QuerySwe: vilket annat namn har 'Person1
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QCalled (IName (NLoc Location1)))
|
||||||
|
QueryEng: how is 'Location1 also called
|
||||||
|
QueryFin: mikä on paikan 'Location1 toinen nimi
|
||||||
|
QueryFre: quel autre nom a 'Location1
|
||||||
|
QueryGer: welchen anderen Namen hat 'Location1
|
||||||
|
QueryIta: quale altro nome ha 'Location1
|
||||||
|
QuerySwe: vilket annat namn har 'Location1
|
||||||
|
|
||||||
|
|
||||||
|
Query: MQuery (QCalled (IName (NOrg Organization1)))
|
||||||
|
QueryEng: how is 'Organization1 also called
|
||||||
|
QueryFin: mikä on organisaation 'Organization1 toinen nimi
|
||||||
|
QueryFre: quel autre nom a 'Organization1
|
||||||
|
QueryGer: welchen anderen Namen hat 'Organization1
|
||||||
|
QueryIta: quale altro nome ha 'Organization1
|
||||||
|
QuerySwe: vilket annat namn har 'Organization1
|
||||||
|
|
||||||
|
|
||||||
|
command not parsed
|
||||||
Reference in New Issue
Block a user