mirror of
https://github.com/simon-ding/polaris.git
synced 2026-04-21 11:17:30 +08:00
feat: japan anime support
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func isASCII(s string) bool {
|
||||
func IsASCII(s string) bool {
|
||||
for _, c := range s {
|
||||
if c > unicode.MaxASCII {
|
||||
return false
|
||||
@@ -36,7 +36,7 @@ func VerifyPassword(password, hash string) bool {
|
||||
return err == nil
|
||||
}
|
||||
|
||||
func IsChineseChar(str string) bool {
|
||||
func ContainsChineseChar(str string) bool {
|
||||
|
||||
for _, r := range str {
|
||||
if unicode.Is(unicode.Han, r) || (regexp.MustCompile("[\u3002\uff1b\uff0c\uff1a\u201c\u201d\uff08\uff09\u3001\uff1f\u300a\u300b]").MatchString(string(r))) {
|
||||
@@ -61,7 +61,7 @@ func IsNameAcceptable(name1, name2 string) bool {
|
||||
re := regexp.MustCompile(`[^\p{L}\w\s]`)
|
||||
name1 = re.ReplaceAllString(strings.ToLower(name1), "")
|
||||
name2 = re.ReplaceAllString(strings.ToLower(name2), "")
|
||||
return strutil.Similarity(name1, name2, metrics.NewHamming()) > 0.1
|
||||
return strutil.Similarity(name1, name2, metrics.NewHamming()) > 0.4
|
||||
}
|
||||
|
||||
func FindSeasonEpisodeNum(name string) (se int, ep int, err error) {
|
||||
|
||||
Reference in New Issue
Block a user