In perl
, there's the perluniprops
index of Unicode 7, http://perldoc.perl.org/perluniprops.html where I can do the following to pad opening and closing punctuations:
s/(\p{Open_Punctuation})/ $1 /g;
s/(\p{Close_Punctuation})/ $1 /g;
What is the full list of opening/closing punctuations that gets padded when using the perl? And what is the equivalence in python
?
Related question: Padding multiple character with space - python Padding multiple character with space - python; this question was asked separatedly by answerer's vote that it should be separate.
Are you asking how to determine what's the corresponding closing punctuation for a given open punctuation? Unicode does not define this. In fact, there's not even a 1:1 relationship.
However, It should be relatively easy for you to build your own mapping.
After installing
unichars
withcpan Unicode::Tussle
, in python: