kana_kit 2.0.0 copy "kana_kit: ^2.0.0" to clipboard
kana_kit: ^2.0.0 copied to clipboard

outdated

A Dart library for for detecting and transliterating Hiragana, Katakana, and Romaji.

example/example.md

Example #

To use KanaKit, construct a KanaKit class instance. It contains all available methods for detecting and converting Japanese text.

// Create a KanaKit instance.
//
// You can optionally provide a config of type KanaKitConfig.
// If no config is provided, KanaKitConfig.defaultConfig is used.
const kanaKit = KanaKit();

// Checks
kanaKit.isJapanese('泣き虫。!~2¥zenkaku') // true

kanaKit.isKana('あーア') // true

kanaKit.isHiragana('すげー') // true

kanaKit.isKatakana('ゲーム') // true

kanaKit.isKanji('切腹') // true
kanaKit.isKanji('勢い') // false

kanaKit.isRomaji('Tōkyō and Ōsaka') // true

// Converters
kanaKit.toKana('ONAJI buttsuuji') // 'オナジ ぶっつうじ'
kanaKit.toKana('座禅‘zazen’スタイル') // '座禅「ざぜん」スタイル'
kanaKit.toKana('batsuge-mu') // 'ばつげーむ'

kanaKit.toHiragana('toukyou, オオサカ') // 'とうきょう、 おおさか'
kanaKit.toKatakana('toukyou, おおさか') // 'トウキョウ、 オオサカ'

kanaKit.toRomaji('ひらがな カタカナ') // 'hiragana katakana'

// Use upcaseKatakana to capitalize characters that were converted from Katakana.s
kanaKit
  .copyWithConfig(upcaseKatakana: true)
  .toRomaji('ひらがな カタカナ') // 'hiragana KATAKANA'
37
likes
0
pub points
90%
popularity

Publisher

verified publisherjfk.dev

A Dart library for for detecting and transliterating Hiragana, Katakana, and Romaji.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

equatable

More

Packages that depend on kana_kit