Javascript library that provides utilities for detecting and transliterating Hiragana <--> Katakana <--> Romaji.
See demo site to see WanaKana in action.
- Clone repository.
- Install all dependencies from
package.json
usingnpm install
. - Run grunt.
- General development
grunt default
or justgrunt
- Open test suite (Mac only)
grunt test
- Deploy
grunt deploy
- Demo
grunt demo
- runs adeploy
then copies html and opens a browser window - Full list of tasks
grunt --help
- General development
// HTML
<textarea id="ime"></textarea>
// Javascript
var input = document.getElementById('ime');
wanakana.bind(input);
// Bind IME functionality to form textarea or input.
// Pass in option { useObsoleteKana: true } to use obsolete characters, such as ゐ and ゑ.
wanakana.bind(element, options)
// Unbind IME from element.
wanakana.unbind(element)
// Returns false if string contains mixed characters, otherwise true if Hiragana.
wanakana.isHiragana(string)
// Returns false if string contains characters outside of the kana family, otherwise true if Hiragana and/or Katakana.
wanakana.isKana(string)
//Returns false if string contains mixed characters, otherwise true if Katakana.
wanakana.isKatakana(string)
// Convert Katakana or Romaji to Hiragana.
wanakana.toHiragana(string)
// Convert Romaji to Kana. Lowcase entries output Hiragana, while upcase entries output Katakana.
wanakana.toKana(string)
// Convert Hiragana or Romaji to Katakana.
wanakana.toKatakana(string)
// Convert Kana to Romaji.
wanakana.toRomaji(string)
- Mims H. Wright Author
- James McNamee Contributor
The following are ports created by the community:
- Java (MasterKale/WanaKanaJava)