kana_kit는 히라가나, 카타카나, 로마자 간의 감지 및 변환을 위해 설계된 Dart 라이브러리입니다. 일본어 텍스트에 대한 정확한 분석 및 변환 유틸리티를 제공하여 일본어 언어 처리를 포함하는 애플리케이션에 이상적입니다. 이 패키지는 모바일, 웹, 데스크톱 등 다양한 플랫폼을 지원하며 광범위한 호환성을 보장합니다. 간단한 API를 통해 개발자는 글자 유형을 식별하고 다양한 문자 체계 간에 텍스트를 원활하게 변환할 수 있습니다.
사용 사례
일본어 텍스트 분석
언어 학습 앱
텍스트 입력 정규화
로컬라이제이션 도구
일본어 텍스트용 입력 검증
주요 기능
스크립트 감지 (히라가나, 카타카나, 로마자)
양방향 전사
크로스 플랫폼 지원
간단하고 직관적인 API
정확한 문자 인식
적합한 대상
일본어 앱을 개발하는 개발자
일본어 배우기 위한 교육 도구
일본어 입력을 지원하는 국제화 애플리케이션
일본어 콘텐츠를 위한 텍스트 처리 파이프라인
고려 사항
일본어 스크립트만 가능
한자 문자를 처리하지 않습니다
혼합 스크립트 텍스트에 대한 수동 처리가 필요합니다
내장된 UI 컴포넌트 없음
컨텍스트 인식 변환을 위해 추가 로직이 필요할 수 있습니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
KanaKit (かな・キット)
A Dart library for for detecting and transliterating Hiragana, Katakana, and Romaji.
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'
LICENSE
MIT License
Copyright (c) 2024 Jeroen Meijer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.