Documentation ¶
Index ¶
- func Create(text string, s basically.Summarizer, h basically.Highlighter, ...) (basically.Document, error)
- type Config
- func WithConjunctions() Config
- func WithCustomKWFilter(filter basically.TokenFilter) Config
- func WithCustomSFilter(filter basically.TokenFilter) Config
- func WithCustomSimilarity(similarity basically.Similarity) Config
- func WithCustomThreshold(threshold float64) Config
- func WithoutFocus() Config
- func WithoutMergeQuotations() Config
- type Configs
- type Document
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config func(cfgs *Configs)
A Config represents a setting that changes the summarization process. For example, it may configure a custom token filter:
doc := document.Create(..., document.WithCustomFilter(filter))
func WithConjunctions ¶ added in v0.1.3
func WithConjunctions() Config
WithConjunctions disables removing conjunctions from the start of sentences.
func WithCustomKWFilter ¶ added in v0.2.0
func WithCustomKWFilter(filter basically.TokenFilter) Config
WithCustomKWFilter allows for a custom (black/white) token filter to be set for keyword extraction.
func WithCustomSFilter ¶ added in v0.2.0
func WithCustomSFilter(filter basically.TokenFilter) Config
WithCustomSFilter allows for a custom (black/white) token filter to be set for sentence extraction.
func WithCustomSimilarity ¶ added in v0.1.2
func WithCustomSimilarity(similarity basically.Similarity) Config
WithCustomSimilarity allows for a custom similarity function to be set.
func WithCustomThreshold ¶ added in v0.1.2
WithCustomThreshold sets the similarity threshold as per the specification. Lower threshold values correspond with sparser graphs, and higher threshold values correspond with denser graphs.
func WithoutFocus ¶
func WithoutFocus() Config
WithoutFocus disables the use of a focus for ranking sentence scores.
func WithoutMergeQuotations ¶
func WithoutMergeQuotations() Config
WithoutMergeQuotations disables merging sentences within quotations.
type Configs ¶
type Configs struct {
// contains filtered or unexported fields
}
Configs control the summarization process.
type Document ¶
type Document struct { // Configurations and dependency injection. Configs *Configs Summarizer basically.Summarizer Highlighter basically.Highlighter Parser basically.Parser // Document related information. Sentences []*basically.Sentence Words []*basically.Token CharCount int SummCount int }
Document is an implementation of basically.Document.
func (*Document) Characters ¶ added in v0.2.1
Characters returns the character count of the original text, and the summarized text (if any).