From a49ce31f8df6817d0f548c6d7ee0f8b28c411eae Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 30 Jun 2017 15:28:27 +0200 Subject: [PATCH] Fix punctuation to use SOFT_BIND and BIND in the whole RGL --- lib/src/afrikaans/SymbolAfr.gf | 2 +- lib/src/bulgarian/TextBul.gf | 8 ++++---- lib/src/catalan/CompatibilityCat.gf | 2 +- lib/src/chunk/ChunkCat.gf | 11 ----------- lib/src/chunk/ChunkFre.gf | 18 ++++++------------ lib/src/chunk/ChunkFunctor.gf | 21 +++++++++++---------- lib/src/chunk/ChunkIta.gf | 11 ----------- lib/src/chunk/ChunkSpa.gf | 11 ----------- lib/src/common/TextX.gf | 8 ++++---- lib/src/dutch/SymbolDut.gf | 2 +- lib/src/estonian/SymbolEst.gf | 2 +- lib/src/finnish/CompatibilityFin.gf | 2 +- lib/src/finnish/SymbolFin.gf | 2 +- lib/src/french/CompatibilityFre.gf | 2 +- lib/src/german/SymbolGer.gf | 2 +- lib/src/greek/SymbolGre.gf | 2 +- lib/src/greek/TextGre.gf | 8 ++++---- lib/src/italian/CompatibilityIta.gf | 2 +- lib/src/latvian/CompatibilityLav.gf | 2 +- lib/src/latvian/SymbolLav.gf | 2 +- lib/src/mongolian/TextMon.gf | 8 ++++---- lib/src/portuguese/CompatibilityPor.gf | 2 +- lib/src/portuguese/TextPor.gf | 10 +++++----- lib/src/romance/SymbolRomance.gf | 2 +- lib/src/spanish/CompatibilitySpa.gf | 2 +- lib/src/spanish/TextSpa.gf | 8 ++++---- 26 files changed, 57 insertions(+), 95 deletions(-) diff --git a/lib/src/afrikaans/SymbolAfr.gf b/lib/src/afrikaans/SymbolAfr.gf index 0a6ee555e..4d85510cb 100644 --- a/lib/src/afrikaans/SymbolAfr.gf +++ b/lib/src/afrikaans/SymbolAfr.gf @@ -29,7 +29,7 @@ lin SymbS sy = {s = \\_ => sy.s} ; SymbNum n = {s = \\_,_ => n.s ; n = Pl ; isNum = True} ; - SymbOrd n = {s = \\_ => n.s ++ "."} ; + SymbOrd n = {s = \\_ => glue n.s "."} ; lincat diff --git a/lib/src/bulgarian/TextBul.gf b/lib/src/bulgarian/TextBul.gf index 1f1805c37..de26fdfb3 100644 --- a/lib/src/bulgarian/TextBul.gf +++ b/lib/src/bulgarian/TextBul.gf @@ -1,5 +1,5 @@ --# -coding=cp1251 -concrete TextBul of Text = CatBul ** { +concrete TextBul of Text = CatBul ** open Prelude in { flags coding=cp1251 ; @@ -7,8 +7,8 @@ concrete TextBul of Text = CatBul ** { lin TEmpty = {s = []} ; - TFullStop x xs = {s = x.s ++ "." ++ xs.s} ; - TQuestMark x xs = {s = x.s ++ "?" ++ xs.s} ; - TExclMark x xs = {s = x.s ++ "!" ++ xs.s} ; + TFullStop x xs = {s = x.s ++ SOFT_BIND ++ "." ++ xs.s} ; + TQuestMark x xs = {s = x.s ++ SOFT_BIND ++ "?" ++ xs.s} ; + TExclMark x xs = {s = x.s ++ SOFT_BIND ++ "!" ++ xs.s} ; } diff --git a/lib/src/catalan/CompatibilityCat.gf b/lib/src/catalan/CompatibilityCat.gf index 858874797..bfadae52d 100644 --- a/lib/src/catalan/CompatibilityCat.gf +++ b/lib/src/catalan/CompatibilityCat.gf @@ -6,6 +6,6 @@ concrete CompatibilityCat of Compatibility = CatCat ** open Prelude, CommonRoman lin NumInt n = {s = \\_ => n.s ; isNum = True ; n = Pl} ; - OrdInt n = {s = \\_ => n.s ++ "."} ; --- + OrdInt n = {s = \\_ => n.s ++ SOFT_BIND ++ "."} ; --- } diff --git a/lib/src/chunk/ChunkCat.gf b/lib/src/chunk/ChunkCat.gf index 527011a90..7d9551227 100644 --- a/lib/src/chunk/ChunkCat.gf +++ b/lib/src/chunk/ChunkCat.gf @@ -41,16 +41,5 @@ lin perfect_neg_Chunk = ss "no ha" ; past_perfect_Chunk = ss "havia" ; past_perfect_neg_Chunk = ss "no havia" ; - - fullstop_Chunk = ss "." ; - exclmark_Chunk = ss "!" ; - questmark_Chunk = ss "?" ; - comma_Chunk = ss "," ; - colon_Chunk = ss ":" ; - semicolon_Chunk = ss ";" ; - quote_Chunk = ss "\"" ; - lpar_Chunk = ss "(" ; - rpar_Chunk = ss ")" ; - dash_Chunk = ss "-" ; } diff --git a/lib/src/chunk/ChunkFre.gf b/lib/src/chunk/ChunkFre.gf index 6ace1243c..904fc9382 100644 --- a/lib/src/chunk/ChunkFre.gf +++ b/lib/src/chunk/ChunkFre.gf @@ -1,5 +1,5 @@ concrete ChunkFre of Chunk = CatFre, ExtensionsFre [VPS,VPI] ** - ChunkFunctor - [AP_Chunk, SSlash_Chunk] + ChunkFunctor - [AP_Chunk, SSlash_Chunk, quote_Chunk] with (Syntax = SyntaxFre), (Extensions = ExtensionsFre) ** open SyntaxFre, (E = ExtensionsFre), Prelude, @@ -10,6 +10,11 @@ lin SSlash_Chunk s = mkUtt ; + quote_Chunk = variants { ss (SOFT_BIND ++ "\"") ; + ss ("\"" ++ SOFT_BIND) ; + ss ("«" ++ SOFT_BIND) ; + ss (SOFT_BIND ++ "»") } ; + lin NP_Acc_Chunk np = ss (np.s ! Acc).ton ; NP_Gen_Chunk np = ss (np.s ! genitive).comp ; @@ -42,15 +47,4 @@ lin past_perfect_Chunk = ss "avait" ; past_perfect_neg_Chunk = ss "n'avait pas" ; - fullstop_Chunk = ss "." ; - exclmark_Chunk = ss "!" ; - questmark_Chunk = ss "?" ; - comma_Chunk = ss "," ; - colon_Chunk = ss ":" ; - semicolon_Chunk = ss ";" ; - quote_Chunk = ss "\"" ; - lpar_Chunk = ss "(" ; - rpar_Chunk = ss ")" ; - dash_Chunk = ss "-" ; - } \ No newline at end of file diff --git a/lib/src/chunk/ChunkFunctor.gf b/lib/src/chunk/ChunkFunctor.gf index 33c47ef10..61f5d5fe6 100644 --- a/lib/src/chunk/ChunkFunctor.gf +++ b/lib/src/chunk/ChunkFunctor.gf @@ -67,18 +67,19 @@ lin Symb_Chunk s = lin Utt s ; - fullstop_Chunk = ss "." ; - exclmark_Chunk = ss "!" ; - questmark_Chunk = ss "?" ; - comma_Chunk = ss "," ; - colon_Chunk = ss ":" ; - semicolon_Chunk = ss ";" ; - quote_Chunk = ss "\"" ; - lpar_Chunk = ss "(" ; - rpar_Chunk = ss ")" ; - dash_Chunk = ss "-" ; + fullstop_Chunk = sbSS "." ; + exclmark_Chunk = sbSS "!" ; + questmark_Chunk = sbSS "?" ; + comma_Chunk = sbSS "," ; + colon_Chunk = sbSS ":" ; + semicolon_Chunk = sbSS ";" ; + quote_Chunk = variants {sbSS "\"" ; ss ("\"" ++ SOFT_BIND) } ; + lpar_Chunk = ss ("(" ++ SOFT_BIND) ; + rpar_Chunk = sbSS ")" ; + dash_Chunk = sbSS "-" ; oper emptyNP : NP = Syntax.mkNP (P.mkPN []) ; + sbSS : Str -> SS = \s -> ss (SOFT_BIND ++ s) ; } \ No newline at end of file diff --git a/lib/src/chunk/ChunkIta.gf b/lib/src/chunk/ChunkIta.gf index 66814868a..57a2a22d1 100644 --- a/lib/src/chunk/ChunkIta.gf +++ b/lib/src/chunk/ChunkIta.gf @@ -42,15 +42,4 @@ oper past_perfect_Chunk = ss "aveva" ; past_perfect_neg_Chunk = ss "non aveva" ; - fullstop_Chunk = ss "." ; - exclmark_Chunk = ss "!" ; - questmark_Chunk = ss "?" ; - comma_Chunk = ss "," ; - colon_Chunk = ss ":" ; - semicolon_Chunk = ss ";" ; - quote_Chunk = ss "\"" ; - lpar_Chunk = ss "(" ; - rpar_Chunk = ss ")" ; - dash_Chunk = ss "-" ; - } \ No newline at end of file diff --git a/lib/src/chunk/ChunkSpa.gf b/lib/src/chunk/ChunkSpa.gf index 80805c026..1100da877 100644 --- a/lib/src/chunk/ChunkSpa.gf +++ b/lib/src/chunk/ChunkSpa.gf @@ -40,16 +40,5 @@ lin perfect_neg_Chunk = ss "no ha" ; past_perfect_Chunk = ss "había" ; past_perfect_neg_Chunk = ss "no había" ; - - fullstop_Chunk = ss "." ; - exclmark_Chunk = ss "!" ; - questmark_Chunk = ss "?" ; - comma_Chunk = ss "," ; - colon_Chunk = ss ":" ; - semicolon_Chunk = ss ";" ; - quote_Chunk = ss "\"" ; - lpar_Chunk = ss "(" ; - rpar_Chunk = ss ")" ; - dash_Chunk = ss "-" ; } \ No newline at end of file diff --git a/lib/src/common/TextX.gf b/lib/src/common/TextX.gf index a5ddebc54..f52f56662 100644 --- a/lib/src/common/TextX.gf +++ b/lib/src/common/TextX.gf @@ -1,11 +1,11 @@ -concrete TextX of Text = CommonX ** { +concrete TextX of Text = CommonX ** open Prelude in { -- This will work for almost all languages except Spanish. lin TEmpty = {s = []} ; - TFullStop x xs = {s = x.s ++ "." ++ xs.s} ; - TQuestMark x xs = {s = x.s ++ "?" ++ xs.s} ; - TExclMark x xs = {s = x.s ++ "!" ++ xs.s} ; + TFullStop x xs = {s = x.s ++ SOFT_BIND ++ "." ++ xs.s} ; + TQuestMark x xs = {s = x.s ++ SOFT_BIND ++ "?" ++ xs.s} ; + TExclMark x xs = {s = x.s ++ SOFT_BIND ++ "!" ++ xs.s} ; } diff --git a/lib/src/dutch/SymbolDut.gf b/lib/src/dutch/SymbolDut.gf index d0b96b0dc..9c9519fac 100644 --- a/lib/src/dutch/SymbolDut.gf +++ b/lib/src/dutch/SymbolDut.gf @@ -29,7 +29,7 @@ lin SymbS sy = {s = \\_ => sy.s} ; SymbNum n = {s = \\_,_ => n.s ; n = Pl ; isNum = True} ; - SymbOrd n = {s = \\_ => n.s ++ "."} ; + SymbOrd n = {s = \\_ => glue n.s "."} ; lincat diff --git a/lib/src/estonian/SymbolEst.gf b/lib/src/estonian/SymbolEst.gf index 6f59cdd74..3517d5114 100644 --- a/lib/src/estonian/SymbolEst.gf +++ b/lib/src/estonian/SymbolEst.gf @@ -27,7 +27,7 @@ lin SymbS sy = sy ; SymbNum n = {s = \\_,_ => n.s ; isNum = True ; n = Pl} ; - SymbOrd n = {s = \\_ => n.s ++ "."} ; + SymbOrd n = {s = \\_ => glue n.s "."} ; lincat diff --git a/lib/src/finnish/CompatibilityFin.gf b/lib/src/finnish/CompatibilityFin.gf index fc2375f5c..ba6cb28f9 100644 --- a/lib/src/finnish/CompatibilityFin.gf +++ b/lib/src/finnish/CompatibilityFin.gf @@ -6,6 +6,6 @@ concrete CompatibilityFin of Compatibility = CatFin ** open Prelude, ResFin in { lin NumInt n = {s = \\_,_ => n.s ; isNum = True ; n = Pl} ; - OrdInt n = {s = \\_ => n.s ++ "."} ; + OrdInt n = {s = \\_ => n.s ++ SOFT_BIND ++ "."} ; } diff --git a/lib/src/finnish/SymbolFin.gf b/lib/src/finnish/SymbolFin.gf index 1e08e7fe5..26763536b 100644 --- a/lib/src/finnish/SymbolFin.gf +++ b/lib/src/finnish/SymbolFin.gf @@ -27,7 +27,7 @@ lin SymbS sy = sy ; SymbNum n = {s = \\_,_ => n.s ; isNum = True ; n = Pl} ; - SymbOrd n = {s = \\_ => n.s ++ "."} ; + SymbOrd n = {s = \\_ => glue n.s "."} ; lincat diff --git a/lib/src/french/CompatibilityFre.gf b/lib/src/french/CompatibilityFre.gf index a3046816b..9d3dff908 100644 --- a/lib/src/french/CompatibilityFre.gf +++ b/lib/src/french/CompatibilityFre.gf @@ -6,6 +6,6 @@ concrete CompatibilityFre of Compatibility = CatFre ** open Prelude, CommonRoman lin NumInt n = {s = \\_ => n.s ; isNum = True ; n = Pl} ; - OrdInt n = {s = \\_ => n.s ++ "."} ; --- + OrdInt n = {s = \\_ => n.s ++ SOFT_BIND ++ "."} ; --- } diff --git a/lib/src/german/SymbolGer.gf b/lib/src/german/SymbolGer.gf index 4782d14f0..888ff3937 100644 --- a/lib/src/german/SymbolGer.gf +++ b/lib/src/german/SymbolGer.gf @@ -31,7 +31,7 @@ lin SymbS sy = {s = \\_ => sy.s} ; SymbNum n = {s = \\_,_ => n.s ; n = Pl ; isNum = True} ; - SymbOrd n = {s = \\_ => n.s ++ "."} ; + SymbOrd n = {s = \\_ => glue n.s "."} ; lincat diff --git a/lib/src/greek/SymbolGre.gf b/lib/src/greek/SymbolGre.gf index 6979b2fb8..08f32436e 100644 --- a/lib/src/greek/SymbolGre.gf +++ b/lib/src/greek/SymbolGre.gf @@ -32,7 +32,7 @@ lin SymbS sy = {s = \\_ => sy.s} ; SymbNum n = {s = \\_,_ => n.s ; isNum = True ; n = Pl} ; - SymbOrd n = {s = \\_,_,_,_ => n.s ++ "." ; adv= table { Posit => " " ; Compar => " " ; Superl => " "}} ; + SymbOrd n = {s = \\_,_,_,_ => glue n.s "." ; adv= table { Posit => " " ; Compar => " " ; Superl => " "}} ; lincat diff --git a/lib/src/greek/TextGre.gf b/lib/src/greek/TextGre.gf index 4fa860955..6da432415 100644 --- a/lib/src/greek/TextGre.gf +++ b/lib/src/greek/TextGre.gf @@ -1,11 +1,11 @@ -concrete TextGre of Text = CatGre ** { +concrete TextGre of Text = CatGre ** open Prelude in { flags coding=utf8 ; lin TEmpty = {s = []} ; - TFullStop x xs = {s = x.s ++ "." ++ xs.s} ; - TQuestMark x xs = {s = x.s ++ ";" ++ xs.s} ; - TExclMark x xs = {s = x.s ++ "!" ++ xs.s} ; + TFullStop x xs = {s = x.s ++ SOFT_BIND ++ "." ++ xs.s} ; + TQuestMark x xs = {s = x.s ++ SOFT_BIND ++ ";" ++ xs.s} ; + TExclMark x xs = {s = x.s ++ SOFT_BIND ++ "!" ++ xs.s} ; } \ No newline at end of file diff --git a/lib/src/italian/CompatibilityIta.gf b/lib/src/italian/CompatibilityIta.gf index 2d80eaa8a..99714e3e8 100644 --- a/lib/src/italian/CompatibilityIta.gf +++ b/lib/src/italian/CompatibilityIta.gf @@ -6,6 +6,6 @@ concrete CompatibilityIta of Compatibility = CatIta ** open Prelude, CommonRoman lin NumInt n = {s = \\_ => n.s ; isNum = True ; n = Pl} ; - OrdInt n = {s = \\_ => n.s ++ "."} ; --- + OrdInt n = {s = \\_ => n.s ++ SOFT_BIND ++ "."} ; --- } diff --git a/lib/src/latvian/CompatibilityLav.gf b/lib/src/latvian/CompatibilityLav.gf index 074c71e63..7bd8b6954 100644 --- a/lib/src/latvian/CompatibilityLav.gf +++ b/lib/src/latvian/CompatibilityLav.gf @@ -11,6 +11,6 @@ flags lin -- TODO: kāpēc citās valodās (piem., Eng, Bul) kategorijai Num (NumInt) ir lauks isNum (= True)? NumInt n = { s = \\_,_ => n.s ; num = Pl ; hasCard = False } ; - OrdInt n = { s = \\_,_ => n.s ++ "." } ; + OrdInt n = { s = \\_,_ => n.s ++ SOFT_BIND ++ "." } ; } diff --git a/lib/src/latvian/SymbolLav.gf b/lib/src/latvian/SymbolLav.gf index c521c8ce5..a6a9a88cb 100644 --- a/lib/src/latvian/SymbolLav.gf +++ b/lib/src/latvian/SymbolLav.gf @@ -48,7 +48,7 @@ lin SymbS sy = sy ; SymbNum sy = { s = \\_,_ => sy.s ; num = Pl } ; - SymbOrd sy = { s = \\_,_ => sy.s ++ "."} ; + SymbOrd sy = { s = \\_,_ => glue sy.s "."} ; lincat diff --git a/lib/src/mongolian/TextMon.gf b/lib/src/mongolian/TextMon.gf index 125ffd0ab..4cb76fbff 100644 --- a/lib/src/mongolian/TextMon.gf +++ b/lib/src/mongolian/TextMon.gf @@ -1,10 +1,10 @@ -concrete TextMon of Text = CatMon ** { +concrete TextMon of Text = CatMon ** open Prelude in { flags coding=utf8 ; lin TEmpty = {s = []} ; - TFullStop p t = {s = p.s ++ "." ++ t.s} ; - TQuestMark p t = {s = p.s ++ "?" ++ t.s} ; - TExclMark p t = {s = p.s ++ "!" ++ t.s} ; + TFullStop p t = {s = p.s ++ SOFT_BIND ++ "." ++ t.s} ; + TQuestMark p t = {s = p.s ++ SOFT_BIND ++ "?" ++ t.s} ; + TExclMark p t = {s = p.s ++ SOFT_BIND ++ "!" ++ t.s} ; } diff --git a/lib/src/portuguese/CompatibilityPor.gf b/lib/src/portuguese/CompatibilityPor.gf index 52f20268e..a300fbef6 100644 --- a/lib/src/portuguese/CompatibilityPor.gf +++ b/lib/src/portuguese/CompatibilityPor.gf @@ -6,6 +6,6 @@ concrete CompatibilityPor of Compatibility = CatPor ** open Prelude, CommonRoman lin NumInt n = {s = \\_ => n.s ; isNum = True ; n = Pl} ; - OrdInt n = {s = \\_ => n.s ++ "."} ; --- + OrdInt n = {s = \\_ => n.s ++ SOFT_BIND ++ "."} ; --- } diff --git a/lib/src/portuguese/TextPor.gf b/lib/src/portuguese/TextPor.gf index 1b5fe2324..61b8c8598 100644 --- a/lib/src/portuguese/TextPor.gf +++ b/lib/src/portuguese/TextPor.gf @@ -1,12 +1,12 @@ -concrete TextPor of Text = CommonX - [Temp,TTAnt,Tense,TPres,TPast,TFut,TCond] ** { +concrete TextPor of Text = CommonX - [Temp,TTAnt,Tense,TPres,TPast,TFut,TCond] ** open Prelude in { flags coding=utf8 ; --- This works for the special punctuation marks of Pornish. +-- This works for the special punctuation marks of Portuguese. lin TEmpty = {s = []} ; - TFullStop x xs = {s = x.s ++ "." ++ xs.s} ; - TQuestMark x xs = {s = "¿" ++ x.s ++ "?" ++ xs.s} ; - TExclMark x xs = {s = "¡" ++ x.s ++ "!" ++ xs.s} ; + TFullStop x xs = {s = x.s ++ SOFT_BIND ++ "." ++ xs.s} ; + TQuestMark x xs = {s = "¿" ++ SOFT_BIND ++ x.s ++ SOFT_BIND ++ "?" ++ xs.s} ; + TExclMark x xs = {s = "¡" ++ SOFT_BIND ++ x.s ++ SOFT_BIND ++ "!" ++ xs.s} ; } diff --git a/lib/src/romance/SymbolRomance.gf b/lib/src/romance/SymbolRomance.gf index 8f63a29cf..8c56c624e 100644 --- a/lib/src/romance/SymbolRomance.gf +++ b/lib/src/romance/SymbolRomance.gf @@ -25,7 +25,7 @@ lin SymbS sy = {s = \\_ => sy.s} ; SymbNum n = {s = \\_ => n.s ; isNum = True ; n = Pl} ; - SymbOrd n = {s = \\_ => n.s ++ "."} ; --- + SymbOrd n = {s = \\_ => n.s ++ BIND ++ "º"} ; -- feminine variant ª, also variants 1.º and 1.ª lincat diff --git a/lib/src/spanish/CompatibilitySpa.gf b/lib/src/spanish/CompatibilitySpa.gf index 6d1402b51..d736c363e 100644 --- a/lib/src/spanish/CompatibilitySpa.gf +++ b/lib/src/spanish/CompatibilitySpa.gf @@ -6,6 +6,6 @@ concrete CompatibilitySpa of Compatibility = CatSpa ** open Prelude, CommonRoman lin NumInt n = {s = \\_ => n.s ; isNum = True ; n = Pl} ; - OrdInt n = {s = \\_ => n.s ++ "."} ; --- + OrdInt n = {s = \\_ => n.s ++ SOFT_BIND ++ "."} ; --- } diff --git a/lib/src/spanish/TextSpa.gf b/lib/src/spanish/TextSpa.gf index 8c18e6bd9..8baf3b46a 100644 --- a/lib/src/spanish/TextSpa.gf +++ b/lib/src/spanish/TextSpa.gf @@ -1,12 +1,12 @@ -concrete TextSpa of Text = CommonX - [Temp,TTAnt,Tense,TPres,TPast,TFut,TCond] ** { +concrete TextSpa of Text = CommonX - [Temp,TTAnt,Tense,TPres,TPast,TFut,TCond] ** open Prelude in { flags coding=utf8 ; -- This works for the special punctuation marks of Spanish. lin TEmpty = {s = []} ; - TFullStop x xs = {s = x.s ++ "." ++ xs.s} ; - TQuestMark x xs = {s = "¿" ++ x.s ++ "?" ++ xs.s} ; - TExclMark x xs = {s = "¡" ++ x.s ++ "!" ++ xs.s} ; + TFullStop x xs = {s = x.s ++ SOFT_BIND ++ "." ++ xs.s} ; + TQuestMark x xs = {s = "¿" ++ SOFT_BIND ++ x.s ++ SOFT_BIND ++ "?" ++ xs.s} ; + TExclMark x xs = {s = "¡" ++ SOFT_BIND ++ x.s ++ SOFT_BIND ++ "!" ++ xs.s} ; }