Le 01/04/2011 22:55, candide a écrit :
How to retrieve the list of all characters defined as alphabetic for the
current locale ?
Thanks for the responses. Alas, neither solution works.
Under Ubuntu :
# ----------------------
import string
import locale
print locale.getdefaultlocale()
print locale.getpreferredencoding()
locale.setlocale(locale.LC_ALL, "")
print string.letters
letter_class = u"[" + u"".join(unichr(c) for c in range(0x10000) if
unichr(c).isalpha()) + u"]"
#print letter_class
# ----------------------
prints the following :
('fr_FR', 'UTF8')
UTF-8
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
I commented out the letter_class printing for outputing a flood of
characters not belonging to the usual french character set.
More or less the same problem under Windows, for instance,
string.letters gives the "latin capital letter eth" as an analphabetic
character (this is not the case, we never use this letter in true french
words).
--
http://mail.python.org/mailman/listinfo/python-list