Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Rule ¶
Rule checks paragraph conciseness using the embedded classifier.
func (*Rule) ApplySettings ¶
ApplySettings implements rule.Configurable.
func (*Rule) Check ¶
func (r *Rule) Check(f *lint.File) []lint.Diagnostic
Check implements rule.Rule.
func (*Rule) DefaultSettings ¶
DefaultSettings implements rule.Configurable.
func (*Rule) EnabledByDefault ¶
EnabledByDefault implements rule.Defaultable.
type ScoreResult ¶ added in v0.5.0
type ScoreResult struct {
// Conciseness is a float64 in [0, 1] where 1.0 means maximally concise.
Conciseness float64
// WordCount is the number of words in the paragraph.
WordCount int
// Cues lists the triggered verbose cues for diagnostic messages.
Cues []string
}
ScoreResult holds the conciseness score for a paragraph.
type Scorer ¶ added in v0.5.0
type Scorer struct {
// contains filtered or unexported fields
}
Scorer wraps the classifier model to produce conciseness scores.
func (*Scorer) Score ¶ added in v0.5.0
func (s *Scorer) Score(text string) ScoreResult
Score computes the conciseness score for a paragraph. The classifier produces a RiskScore where high = verbose. Conciseness is 1 - RiskScore, so high = concise.
Click to show internal directories.
Click to hide internal directories.