1
0
mirror of https://github.com/fumiama/jieba.git synced 2026-06-12 13:10:25 +08:00

make some public variable/function to private

This commit is contained in:
Wang Bin
2015-02-28 18:23:59 +08:00
parent 1c8d4fbf23
commit 8bf9888a1c
2 changed files with 5 additions and 0 deletions

View File

@@ -113,6 +113,8 @@ func (u *undirectWeightedGraph) rank() wordWeights {
return result
}
// Extract keywords from sentence using TextRank algorithm. the allowed POS list
// could be manually speificed.
func TextRankWithPOS(sentence string, topK int, allowPOS []string) wordWeights {
posFilt := make(map[string]int)
for _, pos := range allowPOS {
@@ -152,6 +154,8 @@ func TextRankWithPOS(sentence string, topK int, allowPOS []string) wordWeights {
return tags
}
// Extract keywords from sentence using TextRank algorithm.
// topK specify how many top keywords to be returned at most.
func TextRank(sentence string, topK int) wordWeights {
return TextRankWithPOS(sentence, topK, defaultAllowPOS)
}