Message191750
On 24.06.2013 00:52, Alexander Belopolsky wrote:
>
> Alexander Belopolsky added the comment:
>
> There has been a relatively recent discussion of case mappings under #12753 (msg144836).
>
> I personally agree with Martin: str.upper/lower should remain the way it is - a simplistic 1-to-1 mapping using UnicodeData.txt fields. More sophisticated case mapping algorithms belong to a specialized library module not python core.
>
> The behavior of .title() and .capitalize() is harder to defend, so if someone can point out to a python library (PyICU?) that gets it right we can reference it in the documentation.
.title() and .capitalize() are 1-1 mappings as well. Python only supports
"Simple Case Operations" and does not support "Full Case Operations"
which require parsing context (SpecialCasing.txt).
ICU does provide support for both:
http://userguide.icu-project.org/transforms/casemappings
PyICU wraps ICU, but it is not clear to me how you'd access those
mappings (the package doesn't provide dcoumentation on the API, instead
just gives a description of how to map the C++ API to a Python one):
https://pypi.python.org/pypi/PyICU |
|
Date |
User |
Action |
Args |
2013-06-24 08:23:50 | lemburg | set | recipients:
+ lemburg, loewis, rhettinger, belopolsky, senn, ezio.melotti, alexs |
2013-06-24 08:23:50 | lemburg | link | issue4610 messages |
2013-06-24 08:23:49 | lemburg | create | |
|