Skip to content

Commit

Permalink
Check Logic Update
Browse files Browse the repository at this point in the history
  • Loading branch information
fluffy-melli committed Jan 11, 2025
1 parent 2639981 commit 688e3a2
Showing 1 changed file with 99 additions and 78 deletions.
177 changes: 99 additions & 78 deletions korcen.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ const (
DBelittle
DRace
DParent
DSpecial
DPolitics
DEnglish
DJapanese
DChinese
DSpecial
)

func ChangeUnicode(unicode string) string {
Expand Down Expand Up @@ -1250,6 +1253,79 @@ func Parent(input string) bool {

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

func Politics(input string) bool {
input = strings.ToLower(input)
newtext := strings.ReplaceAll(input, " ", "")

mh := []string{"노시개", "노알라", "뇌사모", "뇌물현", "응디시티"}
for _, item := range mh {
if strings.Contains(newtext, item) {
return true
}
}

ji := []string{"귀걸이아빠", "달창", "대깨문", "문재앙", "문죄앙", "문죄인", "문크예거", "훠훠훠", "문빠"}
for _, item := range ji {
if strings.Contains(newtext, item) {
return true
}
}

gh := []string{"근혜어", "길라임", "나대블츠", "닭근혜", "댓통령", "레이디가카",
"바쁜벌꿀", "수첩공주", "유신공주", "유체이탈화법", "칠푼이", "쿼터갓"}
for _, item := range gh {
if strings.Contains(newtext, item) {
return true
}
}

jh := []string{"반인반신", "데미갓", "박정희"}
for _, item := range jh {
if strings.Contains(newtext, item) {
return true
}
}

cs := []string{"간철수"}
for _, item := range cs {
if strings.Contains(newtext, item) {
return true
}
}

input = regexp.MustCompile(`[^ㄱ-힣]`).ReplaceAllString(newtext, "")
input = strings.ReplaceAll(input, "카카오톡", "")
input = strings.ReplaceAll(input, "카톡", "")
input = strings.ReplaceAll(input, "카페", "")
input = strings.ReplaceAll(input, "하다가", "")
input = strings.ReplaceAll(input, "먹다가", "")
input = strings.ReplaceAll(input, "카와이", "")
input = strings.ReplaceAll(input, "카츠", "")
input = strings.ReplaceAll(input, "카레", "")
input = strings.ReplaceAll(input, "니가", "")
input = strings.ReplaceAll(input, "내가", "")
input = strings.ReplaceAll(input, "너가", "")
input = strings.ReplaceAll(input, "우리가", "")
input = strings.ReplaceAll(input, "너희가", "")
input = strings.ReplaceAll(input, "카카오", "")
input = strings.ReplaceAll(input, "너희가", "")
input = strings.ReplaceAll(input, "카세트", "")
input = strings.ReplaceAll(input, "카플레이어", "")
input = strings.ReplaceAll(input, "카운터", "")
input = strings.ReplaceAll(input, "카정", "")
input = strings.ReplaceAll(input, "카드", "")
mb := []string{"가카", "이명박근혜", "다스는누구겁니까"}
for _, item := range mb {
if strings.Contains(input, item) {
return true
}
}

return false
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

// 현재 미지원
func English(input string) bool {
return false
Expand Down Expand Up @@ -1384,79 +1460,6 @@ func Special(input string) bool {

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

func Politics(input string) bool {
input = strings.ToLower(input)
newtext := strings.ReplaceAll(input, " ", "")

mh := []string{"노시개", "노알라", "뇌사모", "뇌물현", "응디시티"}
for _, item := range mh {
if strings.Contains(newtext, item) {
return true
}
}

ji := []string{"귀걸이아빠", "달창", "대깨문", "문재앙", "문죄앙", "문죄인", "문크예거", "훠훠훠", "문빠"}
for _, item := range ji {
if strings.Contains(newtext, item) {
return true
}
}

gh := []string{"근혜어", "길라임", "나대블츠", "닭근혜", "댓통령", "레이디가카",
"바쁜벌꿀", "수첩공주", "유신공주", "유체이탈화법", "칠푼이", "쿼터갓"}
for _, item := range gh {
if strings.Contains(newtext, item) {
return true
}
}

jh := []string{"반인반신", "데미갓", "박정희"}
for _, item := range jh {
if strings.Contains(newtext, item) {
return true
}
}

cs := []string{"간철수"}
for _, item := range cs {
if strings.Contains(newtext, item) {
return true
}
}

input = regexp.MustCompile(`[^ㄱ-힣]`).ReplaceAllString(newtext, "")
input = strings.ReplaceAll(input, "카카오톡", "")
input = strings.ReplaceAll(input, "카톡", "")
input = strings.ReplaceAll(input, "카페", "")
input = strings.ReplaceAll(input, "하다가", "")
input = strings.ReplaceAll(input, "먹다가", "")
input = strings.ReplaceAll(input, "카와이", "")
input = strings.ReplaceAll(input, "카츠", "")
input = strings.ReplaceAll(input, "카레", "")
input = strings.ReplaceAll(input, "니가", "")
input = strings.ReplaceAll(input, "내가", "")
input = strings.ReplaceAll(input, "너가", "")
input = strings.ReplaceAll(input, "우리가", "")
input = strings.ReplaceAll(input, "너희가", "")
input = strings.ReplaceAll(input, "카카오", "")
input = strings.ReplaceAll(input, "너희가", "")
input = strings.ReplaceAll(input, "카세트", "")
input = strings.ReplaceAll(input, "카플레이어", "")
input = strings.ReplaceAll(input, "카운터", "")
input = strings.ReplaceAll(input, "카정", "")
input = strings.ReplaceAll(input, "카드", "")
mb := []string{"가카", "이명박근혜", "다스는누구겁니까"}
for _, item := range mb {
if strings.Contains(input, item) {
return true
}
}

return false
}

// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

func Check(input string) CheckInfo {
if General(input) {
return CheckInfo{
Expand Down Expand Up @@ -1494,16 +1497,34 @@ func Check(input string) CheckInfo {
Type: DParent,
}
}
if Special(input) {
if Politics(input) {
return CheckInfo{
Detect: true,
Type: DSpecial,
Type: DPolitics,
}
}
if Politics(input) {
if English(input) {
return CheckInfo{
Detect: true,
Type: DPolitics,
Type: DEnglish,
}
}
if Japanese(input) {
return CheckInfo{
Detect: true,
Type: DJapanese,
}
}
if Chinese(input) {
return CheckInfo{
Detect: true,
Type: DChinese,
}
}
if Special(input) {
return CheckInfo{
Detect: true,
Type: DSpecial,
}
}

Expand Down

0 comments on commit 688e3a2

Please sign in to comment.