diff options
| author | aarne <aarne@chalmers.se> | 2010-03-30 18:48:59 +0000 |
|---|---|---|
| committer | aarne <aarne@chalmers.se> | 2010-03-30 18:48:59 +0000 |
| commit | 5cb147fa19fdd348a24bc9d90fc8b5a6041530d8 (patch) | |
| tree | 73a42a9aa38df413443e2a8a730e8e669f70604d /examples/phrasebook/SentencesI.gf | |
| parent | de909a4e44419562ca4ba071e15cf9b8e00288be (diff) | |
simplified the treatment of politeness in Phrasebook
Diffstat (limited to 'examples/phrasebook/SentencesI.gf')
| -rw-r--r-- | examples/phrasebook/SentencesI.gf | 52 |
1 files changed, 18 insertions, 34 deletions
diff --git a/examples/phrasebook/SentencesI.gf b/examples/phrasebook/SentencesI.gf index 47029360f..e7b7e0832 100644 --- a/examples/phrasebook/SentencesI.gf +++ b/examples/phrasebook/SentencesI.gf @@ -2,14 +2,12 @@ incomplete concrete SentencesI of Sentences = Numeral ** open DiffPhrasebook, Syntax, - (R = Roles), Prelude in { lincat Phrase = Text ; - Politeness = {s : Str ; p : R.Politeness} ; - Sentence = {s : R.Politeness => S} ; - Question = {s : R.Politeness => QS} ; + Sentence = S ; + Question = QS ; Item = NP ; Kind = CN ; Quality = AP ; @@ -18,15 +16,12 @@ incomplete concrete SentencesI of Sentences = Numeral ** PlaceKind = CN ; Currency = CN ; Price = NP ; - Action = {s : R.Politeness => Cl} ; - Person = {s : R.Politeness => NP} ; + Action = Cl ; + Person = NP ; Language = NP ; lin ---- todo: add speaker and hearer genders - PSentence p g = let s = g.s ! p.p in - mkText (mkText s | lin Text (mkUtt s)) (lin Text (ss p.s)) ; -- optional '.' - PQuestion p g = let s = g.s ! p.p in - mkText (mkText s | lin Text (mkUtt s)) (lin Text (ss p.s)) ; -- optional '?' + PSentence s = mkText s | lin Text (mkUtt s) ; -- optional '.' + PQuestion s = mkText s | lin Text (mkUtt s) ; -- optional '?' PObject x = mkPhrase (mkUtt x) ; PKind x = mkPhrase (mkUtt x) ; @@ -38,17 +33,17 @@ incomplete concrete SentencesI of Sentences = Numeral ** PPrice x = mkPhrase (mkUtt x) ; PLanguage x = mkPhrase (mkUtt x) ; - Is item quality = neutralS (mkS (mkCl item quality)) ; - IsNot item quality = neutralS (mkS negativePol (mkCl item quality)) ; - WhetherIs item quality = neutralQS (mkQS (mkQCl (mkCl item quality))) ; - WhereIs place = neutralQS (mkQS (mkQCl where_IAdv place)) ; + Is item quality = mkS (mkCl item quality) ; + IsNot item quality = mkS negativePol (mkCl item quality) ; + WhetherIs item quality = mkQS (mkQCl (mkCl item quality)) ; + WhereIs place = mkQS (mkQCl where_IAdv place) ; - SAction a = {s = \\p => mkS (a.s ! p)} ; - SNotAction a = {s = \\p => mkS negativePol (a.s ! p)} ; - QAction a = {s = \\p => mkQS (mkQCl (a.s ! p))} ; + SAction = mkS ; + SNotAction = mkS negativePol ; + QAction a = mkQS (mkQCl a) ; - HowMuchCost item = neutralQS (mkQS (mkQCl how8much_IAdv (mkCl item cost_V))) ; - ItCost item price = neutralS (mkS (mkCl item cost_V2 price)) ; + HowMuchCost item = mkQS (mkQCl how8much_IAdv (mkCl item cost_V)) ; + ItCost item price = mkS (mkCl item cost_V2 price) ; AmountCurrency num curr = mkNP <lin Numeral num : Numeral> curr ; @@ -67,23 +62,12 @@ incomplete concrete SentencesI of Sentences = Numeral ** Too quality = mkAP too_AdA quality ; ThePlace kind = mkNP the_Quant kind ; - I = {s = \\_ => mkNP i_Pron} ; - You = {s = table {R.PPolite => mkNP youPol_Pron ; R.PFamiliar => mkNP youSg_Pron}} ; - - Polite = {s = [] ; p = R.PPolite} ; - Familiar = {s = [] ; p = R.PFamiliar} ; --- Male = {s = [] ; g = R.Male} ; --- Female = {s = [] ; g = R.Female} ; + I = mkNP i_Pron ; + YouFam = mkNP youSg_Pron ; + YouPol = mkNP youPol_Pron ; oper mkPhrase : Utt -> Text = \u -> lin Text u ; -- no punctuation - politeS : S -> S -> {s : R.Politeness => S} = \pol,fam -> - {s = table {R.PPolite => pol ; R.PFamiliar => fam}} ; - neutralS : S -> {s : R.Politeness => S} = \pol -> politeS pol pol ; - politeQS : QS -> QS -> {s : R.Politeness => QS} = \pol,fam -> - {s = table {R.PPolite => pol ; R.PFamiliar => fam}} ; - neutralQS : QS -> {s : R.Politeness => QS} = \pol -> politeQS pol pol ; ----- it would be greate to use overloading here } |
