concisenessscoring

package
v0.13.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rule

type Rule struct {
	MinScore float64
	MinWords int
}

Rule checks paragraph conciseness using the embedded classifier.

func (*Rule) ApplySettings

func (r *Rule) ApplySettings(s map[string]any) error

ApplySettings implements rule.Configurable.

func (*Rule) Category

func (r *Rule) Category() string

Category implements rule.Rule.

func (*Rule) Check

func (r *Rule) Check(f *lint.File) []lint.Diagnostic

Check implements rule.Rule.

func (*Rule) DefaultSettings

func (r *Rule) DefaultSettings() map[string]any

DefaultSettings implements rule.Configurable.

func (*Rule) EnabledByDefault

func (r *Rule) EnabledByDefault() bool

EnabledByDefault implements rule.Defaultable.

func (*Rule) ID

func (r *Rule) ID() string

ID implements rule.Rule.

func (*Rule) Name

func (r *Rule) Name() string

Name implements rule.Rule.

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 NewScorer added in v0.5.0

func NewScorer() (*Scorer, error)

NewScorer loads the embedded classifier and returns a Scorer.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL