paragraphreadability

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ARI

func ARI(text string) float64

ARI computes the Automated Readability Index. Formula: 4.71*(characters/words) + 0.5*(words/sentences) - 21.43 Characters = letters and digits only.

Types

type GradeFunc

type GradeFunc func(text string) float64

GradeFunc computes a readability grade level from plain text. Higher values mean harder to read.

type Rule

type Rule struct {
	MaxGrade float64
	MinWords int
	Grade    GradeFunc
}

Rule checks that paragraph readability grade does not exceed a configured maximum. Uses the Automated Readability Index by default.

func (*Rule) ApplySettings

func (r *Rule) ApplySettings(settings 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) ID

func (r *Rule) ID() string

ID implements rule.Rule.

func (*Rule) Name

func (r *Rule) Name() string

Name implements rule.Rule.

Jump to

Keyboard shortcuts

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