未验证 提交 7f186895 编写于 作者: P Phodal Huang

refactor: extract it words

上级 e0d65683
......@@ -45,7 +45,6 @@ func findRelatedMethodParameter(list []models.JMethod) {
items := res.GetSupportRecord().GetItems()
if len(items) >= 4 {
fmt.Println(items)
fmt.Println(res.GetSupportRecord().GetSupport())
}
}
}
......@@ -105,7 +104,7 @@ func (s Service) buildLifecycle(methodNameArray [][]string) map[string][]string
}
firstWord := nameArray[0]
if !(s.isTechStopWords(firstWord)) {
if !(support.IsTechStopWords(firstWord)) {
nameMap[firstWord] = append(nameMap[firstWord], strings.Join(nameArray, ""))
}
if len(nameMap[firstWord]) > 1 {
......@@ -116,16 +115,6 @@ func (s Service) buildLifecycle(methodNameArray [][]string) map[string][]string
return hadLifecycle
}
func (s Service) isTechStopWords(firstWord string) bool {
for _, word := range support.TechStopWords {
if word == firstWord {
return true;
}
}
return false;
}
func (s Service) enableLifecycle() bool {
return true
}
......
......@@ -79,3 +79,13 @@ var TechStopWords = []string{
"return",
}
func IsTechStopWords(firstWord string) bool {
for _, word := range TechStopWords {
if word == firstWord {
return true;
}
}
return false;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册