From 6e7bbf3aa82a90f1b0ca38e3915972d02c5c8239 Mon Sep 17 00:00:00 2001 From: aarne Date: Wed, 28 Apr 2010 16:53:20 +0000 Subject: [PATCH] some moving around of new phrasebook entries --- examples/phrasebook/Sentences.gf | 38 ++++---------------------- examples/phrasebook/SentencesI.gf | 11 ++++++++ examples/phrasebook/Words.gf | 44 +++++++++++++++++++++++-------- examples/phrasebook/WordsFin.gf | 12 +++++++++ 4 files changed, 61 insertions(+), 44 deletions(-) diff --git a/examples/phrasebook/Sentences.gf b/examples/phrasebook/Sentences.gf index 349f0098d..a9f0a7684 100644 --- a/examples/phrasebook/Sentences.gf +++ b/examples/phrasebook/Sentences.gf @@ -38,9 +38,9 @@ abstract Sentences = Numeral ** { Date ; -- definite date e.g. "on Friday" Name ; -- name of person e.g. "NN" Number ; -- number expression 1 .. 999,999 e.g. "twenty" - Transp ; -- transportation device e.g. "car" - ByTransp ; -- mean of transportation e.g. "by tram" - SuperlModif ; -- superlative modifiers of places e.g. "the best restaurant" + Transport ; -- transportation device e.g. "car" + ByTransport ; -- mean of transportation e.g. "by tram" + Superlative ; -- superlative modifiers of places e.g. "the best restaurant" -- Many of the categories are accessible as Phrases, i.e. as translation units. @@ -77,20 +77,6 @@ abstract Sentences = Numeral ** { WherePlace : Place -> Question ; -- where is the bar WherePerson : Person -> Question ; -- where are you ---** added - HowFar : Place -> Question ; -- how far is the zoo ? - HowFarFrom : Place -> Place -> Question ; -- how far is the center from the hotel ? - HowFarFromBy : Place -> Place -> ByTransp -> Question ; -- how far is the airport from the hotel by taxi ? - HowFarBy : Place -> Transp -> Question ; -- how far is the museum by bus ? - - - By : Transp -> ByTransp ; -- by bus - - WhichTranspPlace : Transp -> Place -> Question ; -- which bus goes to the best amusement park ? - IsTranspPlace : Transp -> Place -> Question ; -- is there a metro to the airport ? - --- ** - -- This is the way to build propositions about persons. PropAction : Action -> Proposition ; -- (you (are|aren't) | are you) Swedish @@ -115,23 +101,9 @@ abstract Sentences = Numeral ** { AmountCurrency : Number -> Currency -> Price ; -- five euros - ThePlace : PlaceKind -> Place ; -- the bar --- ** added : - APlace : PlaceKind -> Place ; + ThePlace : PlaceKind -> Place ; -- the bar + APlace : PlaceKind -> Place ; -- a bar - - SuperlPlace : SuperlModif -> PlaceKind -> Place ; -- the best bar - - - TheBest : SuperlModif ; - TheClosest : SuperlModif ; - TheCheapest : SuperlModif ; - TheWorst : SuperlModif ; - MostExpensive : SuperlModif ; - MostPopular : SuperlModif ; - --- ** - IMale, IFemale, -- I, said by man/woman (affects agreement) YouFamMale, YouFamFemale, -- familiar you, said to man/woman (affects agreement) YouPolMale, YouPolFemale : Person ; -- polite you, said to man/woman (affects agreement) diff --git a/examples/phrasebook/SentencesI.gf b/examples/phrasebook/SentencesI.gf index 0d56bc3d5..6d689d099 100644 --- a/examples/phrasebook/SentencesI.gf +++ b/examples/phrasebook/SentencesI.gf @@ -34,6 +34,9 @@ incomplete concrete SentencesI of Sentences = Numeral ** Date = Adv ; Name = NP ; Number = Card ; + ByTransport = Adv ; + Transport = {name : NP ; by : Adv} ; + Superlative = Det ; lin PSentence s = mkText s | lin Text (mkUtt s) ; -- optional '.' PQuestion s = mkText s | lin Text (mkUtt s) ; -- optional '?' @@ -84,12 +87,19 @@ incomplete concrete SentencesI of Sentences = Numeral ** Very property = mkAP very_AdA (mkAP property) ; Too property = mkAP too_AdA (mkAP property) ; PropQuality property = mkAP property ; + ThePlace kind = let name : NP = mkNP the_Quant kind.name in { name = name ; at = mkAdv kind.at name ; to = mkAdv kind.to name } ; + APlace kind = + let name : NP = mkNP a_Quant kind.name in { + name = name ; + at = mkAdv kind.at name ; + to = mkAdv kind.to name + } ; IMale, IFemale = mkPerson i_Pron ; YouFamMale, YouFamFemale = mkPerson youSg_Pron ; @@ -114,6 +124,7 @@ incomplete concrete SentencesI of Sentences = Numeral ** ACitizen p n = mkCl p.name n ; ABePlace p place = mkCl p.name place.at ; + oper -- These operations are used internally in Sentences. diff --git a/examples/phrasebook/Words.gf b/examples/phrasebook/Words.gf index 6c9412b10..086a19004 100644 --- a/examples/phrasebook/Words.gf +++ b/examples/phrasebook/Words.gf @@ -56,7 +56,7 @@ abstract Words = Sentences ** { University : PlaceKind ; - NationalRestaurant : Nationality -> PlaceKind ; + CitRestaurant : Citizenship -> PlaceKind ; Parking : PlaceKind ; Supermarket : PlaceKind ; Pharmacy : PlaceKind ; @@ -107,17 +107,17 @@ abstract Words = Sentences ** { -- means of transportation - Train : Transp ; - Bus : Transp ; - Plane : Transp ; - Ferry : Transp ; - Subway : Transp ; - Tram : Transp ; - Taxi : Transp ; - Car : Transp ; - Bike : Transp ; + Train : Transport ; + Bus : Transport ; + Plane : Transport ; + Ferry : Transport ; + Subway : Transport ; + Tram : Transport ; + Taxi : Transport ; + Car : Transport ; + Bike : Transport ; - ByFoot : ByTransp ; + ByFoot : ByTransport ; -- Actions (which can be expressed by different structures in different languages). @@ -174,4 +174,26 @@ abstract Words = Sentences ** { Tomorrow : Date ; +-- transports + + HowFar : Place -> Question ; -- how far is the zoo ? + HowFarFrom : Place -> Place -> Question ; -- how far is the center from the hotel ? + HowFarFromBy : Place -> Place -> ByTransport -> Question ; -- how far is the airport from the hotel by taxi ? + HowFarBy : Place -> Transport -> Question ; -- how far is the museum by bus ? + + + + WhichTranspPlace : Transport -> Place -> Question ; -- which bus goes to the hotel + IsTranspPlace : Transport -> Place -> Question ; -- is there a metro to the airport ? + ByTransp : Transport -> ByTransport ; -- by bus + + TheBest : Superlative ; + TheClosest : Superlative ; + TheCheapest : Superlative ; + TheWorst : Superlative ; + MostExpensive : Superlative ; + MostPopular : Superlative ; + + SuperlPlace : Superlative -> PlaceKind -> Place ; -- the best bar + } diff --git a/examples/phrasebook/WordsFin.gf b/examples/phrasebook/WordsFin.gf index 6be95ba29..27e96e0ea 100644 --- a/examples/phrasebook/WordsFin.gf +++ b/examples/phrasebook/WordsFin.gf @@ -55,6 +55,18 @@ concrete WordsFin of Words = SentencesFin ** University = mkPlace (mkN "yliopisto") lla ; School = mkPlace (mkN "koulu") lla ; + CitRestaurant cit = { + name = mkCN cit (mkN "ravintola") ; at = casePrep inessive ; to = casePrep illative + } ; + Parking = mkPlace (mkN "pysäköinti" (mkN "alue")) lla ; + Supermarket = mkPlace (mkN "supermarket") ssa ; + Pharmacy = mkPlace (mkN "apteekki") ssa ; + Center = mkPlace (mkN "keskusta") ssa ; + Cafeteria = mkPlace (mkN "kahvila") ssa ; + Disco = mkPlace (mkN "disko") ssa ; + Pub = mkPlace (mkN "pub") ssa ; + AmusementPark = mkPlace (mkN "huvi" (mkN "puisto")) ssa ; + -- currencies DanishCrown = mkCN (mkN "Tanskan kruunu") | mkCN (mkN "kruunu") ;