mitsuhiko/babel — pull request #65 by blagasz (2013-11-03 14:57:24+00:00)
Title: Adding spelling support.

New code for spelling almost exclusively resides in `babel/spelling.py`. I made a generic helper structure to write speller function for every language. I did not want to interfere with the current structure, but logically it might be better to make it a sub-module of `babel.numbers`. I also modified `babel/numbers.py` to add support for spelling with the function `spell_number`. I made a basic test suit for Hungarian spelling at `tests/test_spelling.py`

The only spelling that is implemented in `babel/seppling.py` currently is Hungarian. As I am native Hungarian I did not dare to implement other languages. If no one else volunteers for English and Chinese I could do those too as well and I could ask a friend for Finnish (although I would prefer natives for all languages).

The spelling framework tries to be as generic as possible, but still structured upon my original non-generic implementation of the Hungarian spelling. The Hungarian language in general and the spelling in particular is very complicated, so I hope that the generic helper structure that is suitable for an easy implementation of the Hungarian spelling would be also suitable for all the other languages. Should any modification need arise I am ready to help.