Documentation ¶
Overview ¶
Package textrank 包含提取关键词
Index ¶
- Constants
- type Keywords
- func (k *Keywords) AddStopwords(keywords []string)
- func (k *Keywords) DelStopwords(keywords []string)
- func (k *Keywords) Extract(txt string, n int) []string
- func (k *Keywords) LoadStopwords(r io.Reader) error
- func (k *Keywords) LoadStopwrdsFile(filename string) error
- func (k *Keywords) SetMaxIter(maxIter int)
- func (k *Keywords) SetTol(tol float64)
- func (k *Keywords) SetWindow(window int)
- type Score
- type ScoreSlice
- type Summarize
- func (s *Summarize) AddStopwords(keywords []string)
- func (s *Summarize) DelStopwords(keywords []string)
- func (s *Summarize) LoadStopwords(r io.Reader) error
- func (s *Summarize) LoadStopwordsFile(filename string) error
- func (s *Summarize) SetMaxIter(maxIter int)
- func (s *Summarize) SetTol(tol float64)
- func (s *Summarize) Summary(txt string, n int) []string
Constants ¶
View Source
const ( // DEFAULT_MAX_ITER 默认maxIter DEFAULT_MAX_ITER int = 100 // DEFAULT_TOL 默认tol DEFAULT_TOL float64 = 0.0001 // DEFALUT_WINDOW 默认window DEFAULT_WINDOW int = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Keywords ¶
type Keywords struct {
// contains filtered or unexported fields
}
Keywords 提取关键词类
func NewKeywords ¶
New 初始化
func (*Keywords) AddStopwords ¶
AddStopwords 添加stopword
func (*Keywords) DelStopwords ¶
DelStopwords 删除stopword
func (*Keywords) LoadStopwords ¶
LoadStopwords 加载stopwords
func (*Keywords) LoadStopwrdsFile ¶
LoadStopwordsFile 加载stopwords文件
type ScoreSlice ¶
type ScoreSlice []Score
func NewScoreSlice ¶
func NewScoreSlice(scores []float64) ScoreSlice
func (ScoreSlice) Len ¶
func (s ScoreSlice) Len() int
func (ScoreSlice) Less ¶
func (s ScoreSlice) Less(i, j int) bool
func (ScoreSlice) Swap ¶
func (s ScoreSlice) Swap(i, j int)
type Summarize ¶
type Summarize struct {
// contains filtered or unexported fields
}
func NewSummarize ¶
New 初始化
func (*Summarize) AddStopwords ¶
AddStopwords 添加stopword
func (*Summarize) DelStopwords ¶
DelStopwords 删除stopword
func (*Summarize) LoadStopwords ¶
LoadStopwords 加载stopwords
func (*Summarize) LoadStopwordsFile ¶
LoadStopwordsFile 加载stopwords文件
Click to show internal directories.
Click to hide internal directories.