From 510a4044675fdc6540e4a74aee656f25bdde9319 Mon Sep 17 00:00:00 2001 From: aarne Date: Sat, 29 May 2010 09:18:20 +0000 Subject: more accurate treatment of negative "have" clauses in Phrasebook --- examples/phrasebook/Sentences.gf | 8 ++++++-- examples/phrasebook/SentencesDut.gf | 13 +++++++++++-- examples/phrasebook/SentencesFre.gf | 10 +++++++++- examples/phrasebook/SentencesGer.gf | 10 +++++++--- examples/phrasebook/SentencesI.gf | 6 +++++- examples/phrasebook/www/support.js | 3 ++- 6 files changed, 40 insertions(+), 10 deletions(-) (limited to 'examples') diff --git a/examples/phrasebook/Sentences.gf b/examples/phrasebook/Sentences.gf index 2d2fc8aab..45b82f030 100644 --- a/examples/phrasebook/Sentences.gf +++ b/examples/phrasebook/Sentences.gf @@ -134,12 +134,16 @@ abstract Sentences = Numeral ** { -- Actions are typically language-dependent, not only lexically but also -- structurally. However, these ones are mostly functorial. - AHave : Person -> Object -> Action ; -- you have pizzas + SHave : Person -> Object -> Sentence ; -- you have beer + SHaveNo : Person -> Kind -> Sentence ; -- you have no apples + SHaveNoMass : Person -> MassKind -> Sentence ; -- you have no beer + QDoHave : Person -> Object -> Question ; -- do you have beer + AHaveCurr : Person -> Currency -> Action ; -- you have dollars ACitizen : Person -> Citizenship -> Action ; -- you are Swedish ABePlace : Person -> Place -> Action ; -- you are in the bar - ByTransp : Transport -> ByTransport ; -- by bus + ByTransp : Transport -> ByTransport ; -- by bus } diff --git a/examples/phrasebook/SentencesDut.gf b/examples/phrasebook/SentencesDut.gf index 1b029378a..d97bf2e35 100644 --- a/examples/phrasebook/SentencesDut.gf +++ b/examples/phrasebook/SentencesDut.gf @@ -1,4 +1,13 @@ -concrete SentencesDut of Sentences = NumeralDut ** SentencesI with +concrete SentencesDut of Sentences = NumeralDut ** SentencesI - + [SHaveNo,SHaveNoMass] + with (Syntax = SyntaxDut), (Symbolic = SymbolicDut), - (Lexicon = LexiconDut) ; + (Lexicon = LexiconDut) ** open Prelude, SyntaxDut in { + + lin + SHaveNo p k = mkS (mkCl p.name have_V2 (mkNP no_Quant plNum k)) ; + SHaveNoMass p k = mkS (mkCl p.name have_V2 (mkNP no_Quant k)) ; + +} + diff --git a/examples/phrasebook/SentencesFre.gf b/examples/phrasebook/SentencesFre.gf index 84d7b8cf0..5c9cbb94e 100644 --- a/examples/phrasebook/SentencesFre.gf +++ b/examples/phrasebook/SentencesFre.gf @@ -2,13 +2,14 @@ concrete SentencesFre of Sentences = NumeralFre ** SentencesI - [ QProp, IFemale, YouFamFemale, YouPolFemale, PYesToNo, + SHaveNo,SHaveNoMass, Superlative ] with (Syntax = SyntaxFre), (Symbolic = SymbolicFre), (Lexicon = LexiconFre) ** - open SyntaxFre, ExtraFre, Prelude in { + open SyntaxFre, ExtraFre, (P = ParadigmsFre), Prelude in { lincat Superlative = {s : Ord ; isPre : Bool} ; @@ -23,4 +24,11 @@ concrete SentencesFre of Sentences = NumeralFre ** SentencesI - [ {name = mkNP youPol8fem_Pron ; isPron = True ; poss = mkQuant youPol_Pron}; PYesToNo = mkPhrase (lin Utt (ss "si")) ; + + SHaveNo p k = mkS negativePol (mkCl p.name have_de (mkNP aPl_Det k)) ; + SHaveNoMass p k = mkS negativePol (mkCl p.name (ComplCN have_de k)) ; + + oper + have_de : V2 = P.mkV2 (P.mkV have_V2) P.genitive ; + } diff --git a/examples/phrasebook/SentencesGer.gf b/examples/phrasebook/SentencesGer.gf index 22facc45c..e33f0f0c6 100644 --- a/examples/phrasebook/SentencesGer.gf +++ b/examples/phrasebook/SentencesGer.gf @@ -1,8 +1,12 @@ -concrete SentencesGer of Sentences = NumeralGer ** SentencesI - [PYesToNo] with +concrete SentencesGer of Sentences = NumeralGer ** SentencesI - + [PYesToNo,SHaveNo,SHaveNoMass] with (Syntax = SyntaxGer), (Symbolic = SymbolicGer), - (Lexicon = LexiconGer) ** open Prelude in { + (Lexicon = LexiconGer) ** open Prelude, SyntaxGer in { - lin PYesToNo = mkPhrase (lin Utt (ss "doch")) ; + lin + PYesToNo = mkPhrase (lin Utt (ss "doch")) ; + SHaveNo p k = mkS (mkCl p.name have_V2 (mkNP no_Quant plNum k)) ; + SHaveNoMass p k = mkS (mkCl p.name have_V2 (mkNP no_Quant k)) ; } diff --git a/examples/phrasebook/SentencesI.gf b/examples/phrasebook/SentencesI.gf index f2b76653a..f871c7d06 100644 --- a/examples/phrasebook/SentencesI.gf +++ b/examples/phrasebook/SentencesI.gf @@ -123,7 +123,11 @@ incomplete concrete SentencesI of Sentences = Numeral ** NNumeral n = mkCard ; - AHave p obj = mkCl p.name have_V2 obj ; + SHave p obj = mkS (mkCl p.name have_V2 obj) ; + SHaveNo p k = mkS negativePol (mkCl p.name have_V2 (mkNP aPl_Det k)) ; + SHaveNoMass p m = mkS negativePol (mkCl p.name have_V2 (mkNP m)) ; + QDoHave p obj = mkQS (mkQCl (mkCl p.name have_V2 obj)) ; + AHaveCurr p curr = mkCl p.name have_V2 (mkNP aPl_Det curr) ; ACitizen p n = mkCl p.name n ; ABePlace p place = mkCl p.name place.at ; diff --git a/examples/phrasebook/www/support.js b/examples/phrasebook/www/support.js index e2240624c..b322aae86 100644 --- a/examples/phrasebook/www/support.js +++ b/examples/phrasebook/www/support.js @@ -38,6 +38,7 @@ function empty_id(tag,id) { return empty(tag,"id",id); } function empty_class(tag,cls) { return empty(tag,"class",cls); } function div_id(id) { return empty_id("div",id); } +function span_id(id) { return empty_id("span",id); } function wrap(tag,contents) { var el=empty(tag); @@ -119,7 +120,7 @@ function swap(a,i,j) { // Note: this doesn't work on strings. function sort(a) { // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/sort - return a.sort; + return a.sort(); /* // Note: this doesn't work on strings. for(var i=0;i