Skip to content

Commit

Permalink
修改: bot/adapters/storage/memorystorage.go
Browse files Browse the repository at this point in the history
  • Loading branch information
TsaoLun committed Aug 15, 2023
1 parent c661bae commit 0b73560
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bot/adapters/storage/memorystorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"math"
"os"
"path"
"sort"

"github.com/wangbin/jiebago"
Expand All @@ -14,7 +15,7 @@ import (
"github.com/zeromicro/go-zero/core/mr"
)

const (
var (
chunkSize = 10000
topKeywords = 5
thresholdForKeywords = 5
Expand Down Expand Up @@ -44,6 +45,12 @@ type (

func RestoreMemoryStorage(decoder *gob.Decoder) (*memoryStorage, error) {
var segmenter jiebago.Segmenter
// 获取当前文件的绝对路径
dir, _ := os.Getwd()
dictFile = path.Join(dir, dictFile)
idfFile = path.Join(dir, idfFile)
stopWordsFile = path.Join(dir, stopWordsFile)
generatedStopWordsFile = path.Join(dir, generatedStopWordsFile)
logx.Must(segmenter.LoadDictionary(dictFile))
var extracter analyse.TagExtracter
logx.Must(extracter.LoadDictionary(dictFile))
Expand Down

0 comments on commit 0b73560

Please sign in to comment.