<commit_before>package main

import "strings"

func messageCheck(msg string) string {
	var result = ""
	if isTrainingCommand(msg) {
		// train
		messsageDeploy(msg)
		result = "ข้าจำได้แล้ว ลองทักใหม่ซิ อิอิ"

	} else if msg == "#help" {
		result = "ควย เอ้ย! คอย"
	} else if isBotCommand(msg) {
		botCommandProcessing(msg)
	} else {
		result = getReplyMessageFromUser(msg)
		//result = msg
	}

	return result
}
func isTrainingCommand(msg string) bool {
	if len(msg) > 6 && msg[0:4] == "#ask" {
		return true
	} else {
		return false
	}
}
func messsageDeploy(msg string) {
	msg = strings.Trim(msg, "#ask ")
	msg = strings.Replace(msg, " #ans ", ":", 1)
	var msgArray = strings.Split(msg, ":")
	if checkNewMessage(msgArray[0]) == true {
		addNewMessageFromUser(msgArray[0], msgArray[1])
	} else {
		addReplyMessageFromUser(msgArray[0], msgArray[1])
	}
}
func isBotCommand(msg string) bool {
	if len(msg) > 6 && msg[0:4] == "#bot" {
		return true
	} else {
		return false
	}
}
func botCommandProcessing(msg string) {
	var result = ""
	msg = strings.Trim(msg, "#bot ")
	var msgArray = strings.Split(msg, " ")
	if msgArray[0] == "nof" {
		logNof = msgArray[1]
		if msgArray[1] == "close" {
			result = "close log notification"
		} else {
			result = "open log notification"
		}
	} else if msgArray[0] == "help" {
		// show help command list
		result = "#bot nof close -> ปิดแจ้งเตือน\n#bot nof open -> เปิดแจ้งเตือน\n#bot send <userId> <msg> -> ส่งข้อความให้คนอื่น\n#bot broadcast <msg> -> ประกาศ\n"
	} else if msgArray[0] == "send" {
		// send content to user
	} else if msgArray[0] == "broadcast" {
		// broadcast msg to all user
	} else if msgArray[0] == "get" {
		// send content to user
	} else {

	}
	bot.SendText([]string{eggyoID}, result)

}<commit_msg>v.5.1.1<commit_after>package main

/*
func messageCheck(msg string) string {
	var result = ""
	if isTrainingCommand(msg) {
		// train
		messsageDeploy(msg)
		result = "ข้าจำได้แล้ว ลองทักใหม่ซิ อิอิ"

	} else if msg == "#help" {
		result = "ควย เอ้ย! คอย"
	} else if isBotCommand(msg) {
		botCommandProcessing(msg)
	} else {
		result = getReplyMessageFromUser(msg)
		//result = msg
	}

	return result
}
func isTrainingCommand(msg string) bool {
	if len(msg) > 6 && msg[0:4] == "#ask" {
		return true
	} else {
		return false
	}
}
func messsageDeploy(msg string) {
	msg = strings.Trim(msg, "#ask ")
	msg = strings.Replace(msg, " #ans ", ":", 1)
	var msgArray = strings.Split(msg, ":")
	if checkNewMessage(msgArray[0]) == true {
		addNewMessageFromUser(msgArray[0], msgArray[1])
	} else {
		addReplyMessageFromUser(msgArray[0], msgArray[1])
	}
}
func isBotCommand(msg string) bool {
	if len(msg) > 6 && msg[0:4] == "#bot" {
		return true
	} else {
		return false
	}
}
func botCommandProcessing(msg string) {
	var result = ""
	msg = strings.Trim(msg, "#bot ")
	var msgArray = strings.Split(msg, " ")
	if msgArray[0] == "nof" {
		logNof = msgArray[1]
		if msgArray[1] == "close" {
			result = "close log notification"
		} else {
			result = "open log notification"
		}
	} else if msgArray[0] == "help" {
		// show help command list
		result = "#bot nof close -> ปิดแจ้งเตือน\n#bot nof open -> เปิดแจ้งเตือน\n#bot send <userId> <msg> -> ส่งข้อความให้คนอื่น\n#bot broadcast <msg> -> ประกาศ\n"
	} else if msgArray[0] == "send" {
		// send content to user
	} else if msgArray[0] == "broadcast" {
		// broadcast msg to all user
	} else if msgArray[0] == "get" {
		// send content to user
	} else {

	}
	bot.SendText([]string{eggyoID}, result)

}

*/
{'fraction_non_alphanumeric': 0.16785816414069202, 'fraction_numerical': 0.011724335144409494, 'mean_word_length': 3.689008042895442, 'pattern_counts': {'":': 4, '<': 9, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1246077', 'n_tokens_mistral': 1506, 'n_tokens_neox': 1454, 'n_words': 328}