-
Notifications
You must be signed in to change notification settings - Fork 0
/
utils.go
40 lines (32 loc) · 832 Bytes
/
utils.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package kuroshiro
import (
"github.com/chanyeinthaw/kuroshiro.go/checker"
"github.com/chanyeinthaw/kuroshiro.go/converter"
)
var (
ToHiragana = converter.ToRawHiragana
ToKatakana = converter.ToRawKatakana
ToRomaji = converter.ToRawRomaji
)
var (
IsHiragana = checker.IsHiragana
IsKatakana = checker.IsKatakana
IsKana = checker.IsKana
IsKanji = checker.IsKanji
IsJapanese = checker.IsJapanese
)
func HasHiragana(str string) bool {
return checker.HasKana(str, checker.HIRAGANA)
}
func HasKatakana(str string) bool {
return checker.HasKana(str, checker.KATAKANA)
}
func HasKana(str string) bool {
return checker.HasKana(str, checker.KANA)
}
func HasKanji(str string) bool {
return checker.HasKana(str, checker.KANJI)
}
func HasJapanese(str string) bool {
return checker.HasKana(str, checker.JAPANESE)
}