1
0
mirror of https://github.com/fumiama/jieba.git synced 2026-06-10 11:40:26 +08:00

优化 dict, add fs.File 支持

This commit is contained in:
源文雨
2022-11-30 14:14:48 +08:00
parent c8785c7994
commit f3da9e6420
22 changed files with 190 additions and 91 deletions

View File

@@ -6,8 +6,8 @@ import (
func Example_extractTags() {
var t TagExtracter
t.LoadDictionary("../dict.txt")
t.LoadIdf("idf.txt")
t.LoadDictionaryAt("../dict.txt")
t.LoadIdfAt("idf.txt")
sentence := "这是一个伸手不见五指的黑夜。我叫孙悟空我爱北京我爱Python和C++。"
segments := t.ExtractTags(sentence, 5)
@@ -20,7 +20,7 @@ func Example_extractTags() {
}
func Example_textRank() {
t, err := NewTextRanker("../dict.txt")
t, err := NewTextRankerAt("../dict.txt")
if err != nil {
panic(err)
}