|
@@ -1,6 +1,7 @@
|
|
|
package clear
|
|
|
|
|
|
import (
|
|
|
+ "log"
|
|
|
qu "qfw/util"
|
|
|
"regexp"
|
|
|
"strings"
|
|
@@ -53,6 +54,7 @@ func init() {
|
|
|
messycodeStr = "[" + messycodeStr + "]"
|
|
|
}
|
|
|
MesReg = regexp.MustCompile(messycodeStr)
|
|
|
+ log.Println(SpecialSymbols, AsyField, SymField, MesField)
|
|
|
}
|
|
|
|
|
|
//去除首尾空格、换行、回车
|
|
@@ -212,13 +214,13 @@ func RemoveAsymmetric(text string) string {
|
|
|
|
|
|
func OtherClean(field, text string) string {
|
|
|
text = RemoveHeadAndEndSpace(text) //去除首尾空格
|
|
|
- if AsyField[field].(bool) {
|
|
|
+ if AsyField[field] != nil {
|
|
|
text = RemoveAsymmetric(text) //特殊符号
|
|
|
}
|
|
|
- if SymField[field].(bool) { //对称符号
|
|
|
+ if SymField[field] != nil { //对称符号
|
|
|
text = RemoveHeadAndEndSymmetricCode(text)
|
|
|
}
|
|
|
- if MesField[field].(bool) { //乱码
|
|
|
+ if MesField[field] != nil { //乱码
|
|
|
text = RemoveMessycode(text)
|
|
|
}
|
|
|
text = RemoveHeadAndEndSpace(text) //去除首尾空格
|