roma-otocomplete
v0.0.2
Published
An autocomplete provider library
Downloads
2
Maintainers
Readme
roma-otocomplete
An autocomplete provider library for javascript.
Installation
$ npm install --save roma-otocomplete
Usage
var romaOtocomplete = require('roma-otocomplete');
Methods
romaOtocomplete.hiraganaToRomaji(kanaText)
Returns the romanized string for the given hiragana text.
RomaOtocomplete.hiraganaToRomaji("ふじさん") === "fujisan"; // true
romaOtocomplete.hiraganaToRomajiText(kanaText)
Returns the RomajiText object for the given hiragana text.
var romajiText = RomaOtocomplete.hiraganaToRomajiText("ぐらーふ・つぇっぺりん");
romajiText.toString() === "gura-futsuepperin"); // true
romaOtocomplete.testQuery(query, kanaText)
Returns RomajiText if all query characters got matches with them, otherwise null.
RomaOtocomplete.testQuery("choukai", "ちょうかい"); // RomajiText
RomaOtocomplete.testQuery("tyokai", "ちょうかい"); // RomajiText
RomaOtocomplete.testQuery("cho-kai", "ちょうかい"); // RomajiText
RomaOtocomplete.testQuery("tyookai", "ちょうかい"); // RomajiText
RomaOtocomplete.testQuery("maya", "ちょうかい"); // null
romaOtocomplete.getSuggestions(query, array, [romajiTextFunctor])
Get suggested texts for the given query.
var list = ["りゅうじょう", "りゅうほう", "しょうほう", "しょうかく", "たいほう"];
RomaOtocomplete.getSuggestions("ryu", list);
License
MIT © Spitice