manimani
v1.1.5
Published
Converts kanji, katakana, and hiragana into romaji.
Downloads
788
Readme
manimani
Converts Japanese to romaji.
Installation
npm i manimani
Usage
var manimani = require("../src/manimani");
manimani.tokenize("path/to/dictionary/dir/", "柿の種", function(moras) {
console.log(JSON.stringify(moras, null, 2))
});
[
{
"from": "か",
"pos": 0,
"node": [
{
"pos": 0,
"val": "k",
"children": [
{
"pos": 1,
"val": "a",
"children": []
}
]
},
{
"pos": 0,
"val": "c",
"children": [
{
"pos": 1,
"val": "a",
"children": []
}
]
}
]
},
{
"from": "き",
"pos": 1,
"node": [
{
"pos": 0,
"val": "k",
"children": [
{
"pos": 1,
"val": "i",
"children": []
}
]
}
]
},
{
"from": "の",
"pos": 2,
"node": [
{
"pos": 0,
"val": "n",
"children": [
{
"pos": 1,
"val": "o",
"children": []
}
]
}
]
},
{
"from": "た",
"pos": 3,
"node": [
{
"pos": 0,
"val": "t",
"children": [
{
"pos": 1,
"val": "a",
"children": []
}
]
}
]
},
{
"from": "ね",
"pos": 4,
"node": [
{
"pos": 0,
"val": "n",
"children": [
{
"pos": 1,
"val": "e",
"children": []
}
]
}
]
}
]