New_Coder New_Coder - 1 month ago 10
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

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.