wangbin / jiebago Goto Github PK
View Code? Open in Web Editor NEWJieba 分词 Go 语言版
Jieba 分词 Go 语言版
請問如何設定 stop-words?
不知能否寫個 sample 參考
需要倒入github.com/blevesearch/bleve/analysis/analyzers/custom_analyzer
在这里记录一下
Build Error: go build -o c:\Users\tieto\Downloads\91porn_spider-master\score__debug_bin3440546766.exe -gcflags all=-N -l .
.\score.go:14:20: undefined: gojieba.Jieba
.\score.go:22:15: undefined: gojieba.NewJieba (exit status 1)
In analyse/textrank.go
TextRankWithPOS function:
the line:
for j := i + 1; j < i+span && j <= len(pairs); j++
will cause an index out of range panic
when i = len(pairs) - 1 (the last element of the pairs)
change j <= len(pairs) to j < len(pairs) should fix it.
For stop words, valid format is : one stop word in each line.
Extra spaces followed stop word may cause error, and will be sent to errCh
(unbuffered channel). Refers to dictionary.go#L38.
But dictionary.go#L68 still waits for tokenCh
, therefore dictionary.go#L70 can not receive from errCh
, finally DeadLock occurs.
There is the same problem, if error(dictionary.go#L49 ) occurs.
package main
import (
"log"
"github.com/wangbin/jiebago"
)
var seg jiebago.Segmenter
func main() {
log.Println(seg.CutAll("我来到北京清华大学"))
}
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x1 addr=0x28 pc=0x4bcf13]
goroutine 4 [running]:
sync.(*RWMutex).RLock(...)
C:/Go/src/sync/rwmutex.go:48
github.com/wangbin/jiebago.(*Dictionary).Frequency(0x0, 0xc0001c5dd8, 0x3, 0x20, 0xc0001c5dd8)
C:/Users/amz/Desktop/gotest/src/github.com/wangbin/jiebago/dictionary.go:54 +0x33
github.com/wangbin/jiebago.(*Segmenter).dag(0x625688, 0xc0001c5ea0, 0x9, 0x20, 0x9)
C:/Users/amz/Desktop/gotest/src/github.com/wangbin/jiebago/jieba.go:118 +0xbe
github.com/wangbin/jiebago.(*Segmenter).cutAll.func1(0x4fe190, 0x1b, 0x625688, 0xc000010060)
C:/Users/amz/Desktop/gotest/src/github.com/wangbin/jiebago/jieba.go:303 +0x9d
created by github.com/wangbin/jiebago.(*Segmenter).cutAll
C:/Users/amz/Desktop/gotest/src/github.com/wangbin/jiebago/jieba.go:301 +0x86
exit status
As title
jie.go:6:2: found packages jiebago (dictionary.go) and main (jie.go) in /home/yu/go/src/github.com/wangbin/jiebago
我把教程中的内容保存在jie.go文件中后,使用go build jie.go时出现错误,不能编译
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.