1999-11-20 00:40:50 +00:00
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// Copyright (C) 1999, International Business Machines
|
|
|
|
// Corporation and others. All Rights Reserved.
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// Date Name Description
|
|
|
|
// 11/17/99 aliu Creation.
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
|
|
|
|
// StraightQuotes-CurlyQuotes
|
|
|
|
|
|
|
|
quotes {
|
|
|
|
Rule {
|
|
|
|
// Rewritten using character codes [LIU]
|
2000-01-13 07:30:26 +00:00
|
|
|
"white=[[:Zs:][:Zl:][:Zp:]];"
|
|
|
|
"black=[^{white}];"
|
|
|
|
"open=[:Ps:];"
|
|
|
|
"dquote=\";"
|
1999-11-20 00:40:50 +00:00
|
|
|
|
2000-01-13 07:30:26 +00:00
|
|
|
"lAng=\u3008;"
|
|
|
|
"ldAng=\u300A;"
|
|
|
|
"lBrk='[';"
|
|
|
|
"lBrc='{';"
|
1999-11-20 00:40:50 +00:00
|
|
|
|
2000-01-13 07:30:26 +00:00
|
|
|
"lquote=\u2018;"
|
|
|
|
"rquote=\u2019;"
|
|
|
|
"ldquote=\u201C;"
|
|
|
|
"rdquote=\u201D;"
|
1999-11-20 00:40:50 +00:00
|
|
|
|
2000-01-13 07:30:26 +00:00
|
|
|
"ldguill=\u00AB;"
|
|
|
|
"rdguill=\u00BB;"
|
|
|
|
"lguill=\u2039;"
|
|
|
|
"rguill=\u203A;"
|
1999-11-20 00:40:50 +00:00
|
|
|
|
2000-01-13 07:30:26 +00:00
|
|
|
"mdash=\u2014;"
|
1999-11-20 00:40:50 +00:00
|
|
|
|
|
|
|
//#######################################
|
|
|
|
// Conversions from input
|
|
|
|
//#######################################
|
|
|
|
|
|
|
|
// join single quotes
|
2000-01-13 07:30:26 +00:00
|
|
|
"{lquote}''>{ldquote};"
|
|
|
|
"{lquote}{lquote}>{ldquote};"
|
|
|
|
"{rquote}''>{rdquote};"
|
|
|
|
"{rquote}{rquote}>{rdquote};"
|
1999-11-20 00:40:50 +00:00
|
|
|
|
|
|
|
//smart single quotes
|
2000-01-13 07:30:26 +00:00
|
|
|
"{white})''>{lquote};"
|
|
|
|
"{open})''>{lquote};"
|
|
|
|
"{black})''>{rquote};"
|
|
|
|
"''>{lquote};"
|
1999-11-20 00:40:50 +00:00
|
|
|
|
|
|
|
//smart doubles
|
2000-01-13 07:30:26 +00:00
|
|
|
"{white}){dquote}>{ldquote};"
|
|
|
|
"{open}){dquote}>{ldquote};"
|
|
|
|
"{black}){dquote}>{rdquote};"
|
|
|
|
"{dquote}>{ldquote};"
|
1999-11-20 00:40:50 +00:00
|
|
|
|
|
|
|
// join single guillemets
|
2000-01-13 07:30:26 +00:00
|
|
|
"{rguill}{rguill}>{rdguill};"
|
|
|
|
"'>>'>{rdguill};"
|
|
|
|
"{lguill}{lguill}>{ldguill};"
|
|
|
|
"'<<'>{ldguill};"
|
1999-11-20 00:40:50 +00:00
|
|
|
|
|
|
|
// prevent double spaces
|
2000-01-13 07:30:26 +00:00
|
|
|
"\\ )\\ >;"
|
1999-11-20 00:40:50 +00:00
|
|
|
|
|
|
|
// join hyphens into dash
|
2000-01-13 07:30:26 +00:00
|
|
|
"-->{mdash};"
|
1999-11-20 00:40:50 +00:00
|
|
|
|
|
|
|
//#######################################
|
|
|
|
// Conversions back to input
|
|
|
|
//#######################################
|
|
|
|
|
|
|
|
//smart quotes
|
2000-01-13 07:30:26 +00:00
|
|
|
"''<{lquote};"
|
|
|
|
"''<{rquote};"
|
|
|
|
"{dquote}<{ldquote};"
|
|
|
|
"{dquote}<{rdquote};"
|
|
|
|
|
1999-11-20 00:40:50 +00:00
|
|
|
//hyphens
|
2000-01-13 07:30:26 +00:00
|
|
|
"--<{mdash};"
|
1999-11-20 00:40:50 +00:00
|
|
|
}
|
|
|
|
}
|