Documentation ¶
Index ¶
- func NewCommentsFactory() entity.MinerFactory
- func NewDeclarationsFactory() entity.MinerFactory
- func NewGlobalFreqTableFactory() entity.MinerFactory
- func NewMinerFactory() entity.MinerAbstractFactory
- func NewScopesFactory() entity.MinerFactory
- func NewWordcountFactory() entity.MinerFactory
- type Comments
- type Decl
- type Declaration
- type GlobalFreqTable
- type Scope
- type ScopedDecl
- type WordCount
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCommentsFactory ¶
func NewCommentsFactory() entity.MinerFactory
NewCommentsFactory creates a new comments miner factory.
func NewDeclarationsFactory ¶
func NewDeclarationsFactory() entity.MinerFactory
NewDeclarationsFactory creates a new declarations miner factory.
func NewGlobalFreqTableFactory ¶
func NewGlobalFreqTableFactory() entity.MinerFactory
NewGlobalFreqTableFactory creates a new declarations miner factory.
func NewMinerFactory ¶
func NewMinerFactory() entity.MinerAbstractFactory
NewMinerFactory creates a new entity.MinerAbstractFactory, including the available miner factories. It supports:
- "comments"
- "declarations"
- "global-frequency-table"
- "scoped-declarations"
- "wordcount"
func NewScopesFactory ¶
func NewScopesFactory() entity.MinerFactory
NewScopesFactory creates a new scopes miner factory.
func NewWordcountFactory ¶
func NewWordcountFactory() entity.MinerFactory
NewWordcountFactory creates a new wordcount miner factory.
Types ¶
type Comments ¶
type Comments struct {
// contains filtered or unexported fields
}
Comments handles the comments mining process.
func (*Comments) Results ¶
func (c *Comments) Results() interface{}
Results returns the list of comments found.
func (*Comments) SetCurrentFile ¶
SetCurrentFile specifies the current file being mined.
type Decl ¶
type Decl struct { ID string DeclType token.Token Words map[string]struct{} Phrases map[string]struct{} }
Decl contains the mined text (words and phrases) related to a declaration.
type Declaration ¶
type Declaration struct { Filename string Dict lists.List PackageName string Comments []*ast.CommentGroup Included []ast.Decl Decls map[string]Decl // contains filtered or unexported fields }
Declaration represents the declarations miner, which extracts information about words and phrases for each function/variable/struct/interface declaration.
func NewDeclaration ¶
func NewDeclaration(dict lists.List) *Declaration
NewDeclaration initializes a new declarations miner.
func (Declaration) Results ¶
func (m Declaration) Results() interface{}
Results returns a map of declaration IDs and the mined text for each declaration.
func (*Declaration) SetCurrentFile ¶
func (m *Declaration) SetCurrentFile(filename string)
SetCurrentFile specifies the current file being mined.
type GlobalFreqTable ¶
type GlobalFreqTable struct {
// contains filtered or unexported fields
}
GlobalFreqTable represents a Global Frequency Table miner.
func NewGlobalFreqTable ¶
func NewGlobalFreqTable(ft *samurai.FrequencyTable) GlobalFreqTable
NewGlobalFreqTable creates a new GlobalFreqTable miner with the provided frequency table.
func (GlobalFreqTable) Name ¶
func (m GlobalFreqTable) Name() string
Name return the name of the miner.
func (GlobalFreqTable) Results ¶
func (g GlobalFreqTable) Results() interface{}
Results returns the global *samurai.FrequencyTable after the mining process.
func (GlobalFreqTable) SetCurrentFile ¶
func (g GlobalFreqTable) SetCurrentFile(filename string)
SetCurrentFile changes the current file on the miner using the provided filename.
type Scope ¶
type Scope struct { Filename string PackageName string PackageComments []string Comments []*ast.CommentGroup Included []ast.Decl Scopes map[string]ScopedDecl // contains filtered or unexported fields }
Scope represents a scopes miner, which extracts information about the scope for each function/variable/struct/interface declaration.
func (Scope) Results ¶
func (m Scope) Results() interface{}
Results returns a map of IDs and the mined scope for each declaration.
func (*Scope) SetCurrentFile ¶
SetCurrentFile specifies the current file being mined.
type ScopedDecl ¶
type ScopedDecl struct { ID string DeclType token.Token Name string VariableDecls []string Statements []string BodyText []string Comments []string PackageComments []string }
ScopedDecl represents the related scope for a declaration.
type WordCount ¶
type WordCount struct {
// contains filtered or unexported fields
}
WordCount handles the word count mining process.
func (WordCount) SetCurrentFile ¶
SetCurrentFile specifies the current file being mined.