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

feat: add basic keywords

上级 2d4d3cd1
......@@ -7,14 +7,13 @@ import (
)
type ConceptAnalyser struct {
}
func NewConceptAnalyser() ConceptAnalyser {
return *&ConceptAnalyser{}
}
func (c ConceptAnalyser) run() {
func (c ConceptAnalyser) run() {
}
......@@ -33,8 +32,51 @@ func buildMethodsFromDeps(clzs []models.JClassNode) {
}
}
camelcase := support.SegmentConceptCamelcase(methodsName)
words := support.SegmentConceptCamelcase(methodsName)
words = removeNormalWords(words)
wordCounts := support.RankByWordCount(words)
for _, word := range wordCounts[0:20] {
fmt.Println(word.Key, word.Value)
}
}
var normalWords = []string{
"get",
"create",
"update",
"delete",
"save",
"exist",
"find",
"new",
"parse",
"set",
"get",
"type",
"all",
"by",
"id",
"is",
"of",
"not",
"with",
"main",
}
func removeNormalWords(words map[string]int) map[string]int {
var newWords = words
for _, normalWord := range normalWords {
if newWords[normalWord] > 0 {
delete(newWords, normalWord)
}
}
count := support.RankByWordCount(camelcase)
fmt.Println(count)
fmt.Println(newWords)
return newWords
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册