- Notifications
You must be signed in to change notification settings - Fork8
andree-surya/moji4j
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Moji4J is an open source Java library to converts between Japanese Hiragana, Katakana, and Romaji scripts.
Please add the following Maven dependency to yourpom.xml
:
<dependency> <groupId>com.andree-surya</groupId> <artifactId>moji4j</artifactId> <version>1.0.0</version></dependency>
MojiConverter converter = new MojiConverter();converter.convertRomajiToHiragana("Hiragana"); // ひらがなconverter.convertRomajiToKatakana("Katakana"); // カタカナconverter.convertKanaToRomaji("ひらがな"); // hiraganaconverter.convertKanaToRomaji("カタカナ"); // katakana
MojiDetector detector = new MojiDetector();detector.hasKanji("まっ暗"); // truedetector.hasKanji("まっしろ"); // falsedetector.hasKana("ウソ付き"); // truedetector.hasKana("東京"); // falsedetector.hasRomaji("モデル XYZ"); // truedetector.hasRomaji("フルーツ"); // false
The romanization system adopted by this library is loosely based on themodern Hepburn system, with adjustments for cases that might causes ambiguity during conversion.
Cases | Romaji | Kana |
---|---|---|
Long vowels | sentaa | センター |
ookayama | おおかやま | |
o+u vowels | toukyou | とうきょう |
ousama | おうさま | |
Long consonants | kekka | けっか |
kasetto | カセット | |
kotchi | こっち | |
Syllabicn | gunma | ぐんま |
kan'i | かんい | |
shin'you | しんよう | |
Particles | he | へ |
wo | を | |
Others | dzu | づ |
The romanization tables used in this library are derived fromMojinizer, a Ruby library to converts between Japanese Kana and Romaji. The data is modified to suit differences in algorithm and romanization convention.
© Copyright 2016 Andree SuryaLicensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.
About
A Java library to converts between Japanese Hiragana, Katakana, and Romaji scripts.
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.