Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A Java library to converts between Japanese Hiragana, Katakana, and Romaji scripts.

NotificationsYou must be signed in to change notification settings

andree-surya/moji4j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

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>

Romaji and Kana Conversion

MojiConverter converter = new MojiConverter();converter.convertRomajiToHiragana("Hiragana"); // ひらがなconverter.convertRomajiToKatakana("Katakana"); // カタカナconverter.convertKanaToRomaji("ひらがな"); // hiraganaconverter.convertKanaToRomaji("カタカナ"); // katakana

Romaji, Kana, and Kanji Detection

MojiDetector detector = new MojiDetector();detector.hasKanji("まっ暗"); // truedetector.hasKanji("まっしろ"); // falsedetector.hasKana("ウソ付き"); // truedetector.hasKana("東京"); // falsedetector.hasRomaji("モデル XYZ"); // truedetector.hasRomaji("フルーツ"); // false

Romanization Convention

The romanization system adopted by this library is loosely based on themodern Hepburn system, with adjustments for cases that might causes ambiguity during conversion.

CasesRomajiKana
Long vowelssentaaセンター
ookayamaおおかやま
o+u vowelstoukyouとうきょう
ousamaおうさま
Long consonantskekkaけっか
kasettoカセット
kotchiこっち
Syllabicngunmaぐんま
kan'iかんい
shin'youしんよう
Particleshe
wo
Othersdzu

Acknowledgement

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.

License

© 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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp