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 dac2de9 commit 6527c07
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bot/adapters/storage/memorystorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package storage

import (
"encoding/gob"
"flag"
"fmt"
"log"
"math"
Expand All @@ -26,12 +27,13 @@ var (
idfFile = "./etc/idf.txt"
stopWordsFile = "./etc/stop_words.txt"
generatedStopWordsFile = "./etc/stopwords.txt"
EtcDir = flag.String("etc", "cli", "the etc directory to look for corpora files")
)

func init() {
// 获取当前文件的绝对路径
dir, _ := os.Getwd()
dictFile = path.Join(dir, dictFile)
dictFile = path.Join(dir, *EtcDir, dictFile)
idfFile = path.Join(dir, idfFile)
stopWordsFile = path.Join(dir, stopWordsFile)
generatedStopWordsFile = path.Join(dir, generatedStopWordsFile)
Expand Down

0 comments on commit 6527c07

Please sign in to comment.