From b9192ccccf324f5223b3663fd5ed674aa0a562ea Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Tue, 3 Sep 2013 08:00:59 +0000 Subject: [PATCH] RelNP and ApposNP should put a final comma after the inserted phrase. --- lib/src/english/NounEng.gf | 2 +- lib/src/english/ParseEng.gf | 2 +- lib/src/english/ResEng.gf | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/src/english/NounEng.gf b/lib/src/english/NounEng.gf index 28b9dfe8b..9f58f5a93 100644 --- a/lib/src/english/NounEng.gf +++ b/lib/src/english/NounEng.gf @@ -22,7 +22,7 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in { } ; RelNP np rs = { - s = \\c => np.s ! c ++ "," ++ rs.s ! np.a ; + s = \\c => np.s ! c ++ "," ++ rs.s ! np.a ++ finalComma ; a = np.a } ; diff --git a/lib/src/english/ParseEng.gf b/lib/src/english/ParseEng.gf index cada5b118..329944ba2 100644 --- a/lib/src/english/ParseEng.gf +++ b/lib/src/english/ParseEng.gf @@ -133,7 +133,7 @@ lin } ; ApposNP np1 np2 = { - s = \\c => np1.s ! c ++ "," ++ np2.s ! npNom ; + s = \\c => np1.s ! c ++ "," ++ np2.s ! npNom ++ finalComma ; a = np1.a } ; diff --git a/lib/src/english/ResEng.gf b/lib/src/english/ResEng.gf index fa6d2031e..fd2845f13 100644 --- a/lib/src/english/ResEng.gf +++ b/lib/src/english/ResEng.gf @@ -523,5 +523,6 @@ resource ResEng = ParamX ** open Prelude in { } } ; + finalComma : Str = pre {"," | "." => []; "" => ","; _ => []} ; }