Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
suggest-task
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
田川
suggest-task
Commits
e8fe507a
Commit
e8fe507a
authored
Jul 14, 2020
by
zhaoyanchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
英文符号转中文,加屏蔽词
parent
388a7fe5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
3 deletions
+24
-3
suggest-task-dependency.go
main/suggest-task-dependency.go
+23
-2
suggest-task.go
main/suggest-task.go
+1
-1
No files found.
main/suggest-task-dependency.go
View file @
e8fe507a
...
...
@@ -5,7 +5,7 @@ import (
"github.com/mozillazg/go-pinyin"
"fmt"
"strconv"
)
)
type
ENV
struct
{
DataWareDB
string
...
...
@@ -16,6 +16,7 @@ type ENV struct {
ManualFolder
string
SensitiveFolder
string
}
var
test_env
=
&
ENV
{
DataWareDB
:
"DataWarehouse_test:FihdZW7o1XKtDETZexOG@tcp(test01-secooDataWarehouse.master.com:3306)/secooDataWarehouse"
,
ErpDB
:
"3306_test:iS6CXpYqgZ8Mhjui@tcp(10.4.3.223:3306)/secooErpDB"
,
...
...
@@ -43,6 +44,22 @@ var RUN_ENV = prod_env
/************************* 下面是 util 方法 *****************************/
var
CH_EN_PUNC
=
map
[
string
]
string
{
","
:
","
,
"。"
:
"."
,
"!"
:
"!"
,
"?"
:
"?"
,
"【"
:
"["
,
"】"
:
"]"
,
"("
:
"("
,
")"
:
")"
,
"‘"
:
"'"
,
"’"
:
"'"
,
"“"
:
"
\"
"
,
"”"
:
"
\"
"
,
}
func
convertToPinyin
(
str
string
)
string
{
var
ret
string
for
_
,
v
:=
range
str
{
...
...
@@ -78,12 +95,16 @@ func DBC2SBC(s string) string {
var
strLst
[]
string
for
_
,
i
:=
range
s
{
insideCode
:=
i
if
insideCode
==
12288
{
insideCode
=
32
}
else
{
insideCode
-=
65248
}
if
insideCode
<
32
||
insideCode
>
126
{
if
key
,
exist
:=
CH_EN_PUNC
[
string
(
i
)];
exist
{
strLst
=
append
(
strLst
,
key
)
}
else
if
insideCode
<
32
||
insideCode
>
126
{
strLst
=
append
(
strLst
,
string
(
i
))
}
else
{
strLst
=
append
(
strLst
,
string
(
insideCode
))
...
...
main/suggest-task.go
View file @
e8fe507a
...
...
@@ -66,7 +66,7 @@ var dateStr = fmt.Sprintf("%d-%02d-%02d",now.Year(),now.Month(),now.Day())
var
t2s
,
_
=
gocc
.
New
(
"t2s"
)
var
prefixFilterArr
=
[]
string
{
"https://"
,
"http://"
,
"dg"
,
"d & g"
,
"dolce&gabbana"
,
"dolce & gabbana"
,
"杜嘉班纳"
,
"避孕"
,
"情趣"
,
"cucci"
,
"乒乓球"
,
"cuccl"
,
"gucii"
}
"dolce & gabbana"
,
"杜嘉班纳"
,
"避孕"
,
"情趣"
,
"cucci"
,
"乒乓球"
,
"cuccl"
,
"gucii"
,
"tod's"
,
"iwc7"
}
const
TABLE_SPLIT_STEP_SIZE
=
10000
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment