1 line
No EOL
2.7 KiB
JSON
1 line
No EOL
2.7 KiB
JSON
{"name":"Jtransliterate","tagline":"Transliterate [Hirag/Katak]ana to Latin/English and back with Python. Convert half/full-width Japanese text.","body":"jTransliterate - [Hirag/Katak]ana to Latin/English & Back\r\n===========================================================================\r\nSometimes you may want to convert from Hiragana to Katakana, or back again, or...\r\nI dunno, maybe you wanna get the English pronunciation of these words. I'll\r\nbe honest and say it's of no concern or interest to me, but I needed this in\r\nPython and so I ported it, figured I'd release it.\r\n\r\nIt's MIT licensed. Credit for much of this also belongs to Kim Ahlström and\r\nhis linguistics/etc work on **[Ve](https://github.com/Kimtaro/ve/blob/master/lib/providers/japanese_transliterators.rb)**.\r\n\r\n\r\nInstallation\r\n---------------------------------------------------------------------------\r\n pip install jTransliterate\r\n\r\n\r\nExamples && Documentation\r\n---------------------------------------------------------------------------\r\n``` python\r\n# -*- coding: utf-8 -*-\r\n\r\nfrom jTransliterate import JapaneseTransliterator\r\n\r\n# Transliterate from Latin/English to [Hirag/Katak]ana\r\nx = JapaneseTransliterator(u'kanazawa')\r\nprint x.transliterate_from_latn_to_hrkt()\r\n# Should print \"かなざわ\"\r\n\r\n# Transliterate from Hiragana to Latin/English\r\nb = JapaneseTransliterator(u'かなざわ')\r\nprint b.transliterate_from_hira_to_latn()\r\n# Should print \"kanazawa\"\r\n\r\n# Transliterate from either Hiragana or Katakana to Latin/English\r\nprint b.transliterate_from_hrkt_to_latn(text = u'カナザワ')\r\n# Should print \"kanazawa\"\r\n\r\n# Transliterate from Katakan to Hiragana (You... probably never need to do this)\r\nprint b.transliterate_from_kana_to_hira(text = u'キットカート')\r\n# Should print \"きっとかーと\"\r\n\r\n# Transliterate from Hiragana to Katakana\r\nprint b.transliterate_from_hira_to_kana(text = u'かなざわ')\r\n# Should print \"カナザワ\" \r\n\r\n# If you want to convert between half/full width kana, you can use the following\r\n# functions. I didn't care enough to do demos here. ;|\r\nb.transliterate_from_halfwidth_to_fullwidth()\r\nb.transliterate_from_fullwidth_to_halfwidth()\r\n```\r\n\r\nQuestions, Comments, Complaints and/or etc\r\n---------------------------------------------------------------------------\r\nHit me up on them Twitters or find me on them internets at the links below.\r\n\r\nTwitter: **[@ryanmcgrath](http://twitter.com/ryanmcgrath/)** \r\nWeb: **[Veno Designs](http://venodesigns.net/)** \r\n","google":"UA-40660943-4","note":"Don't delete this file! It's used internally to help with page regeneration."} |