Detect if a romanized japanese string is a palindrome.
This project is built on top of and requires:
- mac and unix-like systems are welcome (sorry, hasn't been tested on windows)
- ruby 2.0.0-p247
$ git clone [email protected]:hendrauzia/japanese-palindrome.git
$ bundle install
The following examples will return "<text>" is a palindrome!
, otherwise it will return "<text>" is not a palindrome!
.
$ cd japanese-palindrome
$ bin/japanese-palindrome "Shikishi"
"Shikishi" is a palindrome!
$ bin/japanese-palindrome "Dansu ga sunda"
"Dansu ga sunda" is a palindrome!
$ bin/japanese-palindrome "Karui kibin na koneko nanbiki iruka"
"Karui kibin na koneko nanbiki iruka" is a palindrome!
$ bin/japanese-palindrome "Watashi no ongaku"
"Watashi no ongaku" is not a palindrome!
Japanese Hiragana syllables taken from:
- http://en.wikipedia.org/wiki/Hiragana#Table_of_hiragana
- http://www.japanese-lesson.com/resources/pdf/hiragana_chart.pdf
List of japanese palindrome can be seen at:
It still has some limitations to detect palindrome on sentences like these:
Ika ni mo nigai
Nagasaki ya no yaki sakana
Hei no aru ano ie
The above sentences, even if it's a palindrome, it will return "<text>" is not a palindrome!
.