diff options
| author | aarne <aarne@chalmers.se> | 2010-04-09 14:37:25 +0000 |
|---|---|---|
| committer | aarne <aarne@chalmers.se> | 2010-04-09 14:37:25 +0000 |
| commit | d505fa5b6737b6b78fb65161cea3c2ac175494ab (patch) | |
| tree | 316a778a7869c6d264e2cb4850f032a39cdbe16b /examples/phrasebook/WordsSwe.gf | |
| parent | 1903fe8bf99cf6f567669a803f4b725478309ad3 (diff) | |
generalized the Person category in Phrasebook to plurals, added some new Words
Diffstat (limited to 'examples/phrasebook/WordsSwe.gf')
| -rw-r--r-- | examples/phrasebook/WordsSwe.gf | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/examples/phrasebook/WordsSwe.gf b/examples/phrasebook/WordsSwe.gf index 2171faf86..b48bb3e18 100644 --- a/examples/phrasebook/WordsSwe.gf +++ b/examples/phrasebook/WordsSwe.gf @@ -124,10 +124,21 @@ concrete WordsSwe of Words = SentencesSwe ** open_A = mkA "öppen" "öppet" ; closed_A = mkA "stängd" "stängt" ; - nameOf : {name : NP ; isPron : Bool ; poss : Det} -> NP = \p -> - case p.isPron of { - True => mkNP p.poss (mkN "namn" "namn") ; - _ => mkNP (mkNP the_Det (mkN "namn" "namn")) + NPPerson : Type = {name : NP ; isPron : Bool ; poss : Quant} ; + + xOf : Bool -> N -> NPPerson -> NPPerson = \n,x,p -> + let num = if_then_else Num n plNum sgNum in { + name = case p.isPron of { + True => mkNP p.poss num x ; + _ => mkNP (mkNP the_Quant num x) (SyntaxSwe.mkAdv possess_Prep p.name) } ; + isPron = False ; + poss = SyntaxSwe.mkQuant he_Pron -- not used because not pron + } ; + + nameOf : NPPerson -> NP = \p -> (xOf sing L.name_N p).name ; + + sing = False ; plur = True ; + } |
