0.0.2 • Published 8 years ago

roma-otocomplete v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

roma-otocomplete NPM version Build Status Dependency Status Coverage percentage

An autocomplete provider library for javascript.

Installation

$ npm install --save roma-otocomplete

Usage

var romaOtocomplete = require('roma-otocomplete');

see test/roma-otocomplete.js

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

0.0.2

8 years ago

0.0.1

8 years ago

0.0.0

8 years ago