New_Coder New_Coder - 1 year ago 79
Python Question

How to print Hindi words in NLTK's Indian corpus?


from nltk.corpus import indian



[u'\u092a\u0942\u0930\u094d\u0923', u'\u092a\u094d\u0930\u0924\u093f\u092c\u0902\u0927', ...]

But, I need output to be:
['पूर्ण', 'प्रतिबंध', 'हटाओ', ':', 'इराक', 'संयुक्त', ...]

Like shown in:

Could you please tell how can I print the actual words instead of unicode.
Any help is appreciated.

cat cat
Answer Source

Python 2 doesn't have VM-wide Unicode support. The prettyprinter isn't the same as printing one of the strings in the array -- but printing just one will work as expected.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download