data

package
v0.0.0-...-788cabf Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package data holds embedded word frequency and linguistic reference data used by the cefr package for vocabulary lookup and analysis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AWLLevel

func AWLLevel(word string) (int, bool)

AWLLevel returns the AWL level for a single word, if present.

func InitError

func InitError() error

InitError returns the first dataset initialization error encountered, or nil when all embedded datasets were loaded successfully.

func IrregularLemma

func IrregularLemma(word string) (string, bool)

IrregularLemma returns the lemma for an irregular form, if present.

func LoadAWL

func LoadAWL() map[string]int

LoadAWL returns a map of word → level (4–5, mapped by sublist):

sublist 1–5 → 4, sublist 6–10 → 5

The returned map must not be modified by the caller.

func LoadAbbreviations

func LoadAbbreviations() map[string]bool

LoadAbbreviations returns a set of common English abbreviations (e.g., "mr.", "dr."). The returned map must not be modified by the caller.

func LoadIrregularPastParticiples

func LoadIrregularPastParticiples() map[string]bool

LoadIrregularPastParticiples returns a set of irregular past participle forms (type=pp entries from the irregulars data). Used for passive voice detection. The returned map must not be modified by the caller.

func LoadIrregulars

func LoadIrregulars() map[string]string

LoadIrregulars returns a map of variant → lemma for irregular word forms. The returned map must not be modified by the caller.

func LoadNGSL

func LoadNGSL() map[string]int

LoadNGSL returns a map of word → level (1–4, mapped by frequency rank):

1–500 → 1, 501–1200 → 2, 1201–2000 → 3, 2001–2800 → 4

The returned map must not be modified by the caller.

func LoadOxford

func LoadOxford() map[string]int

LoadOxford returns a map of word → CEFR level (1–5, where a1=1, a2=2, b1=3, b2=4, c1=5). The returned map must not be modified by the caller.

func LoadStopwords

func LoadStopwords() map[string]bool

LoadStopwords returns a set of common English stopwords. The returned map must not be modified by the caller.

func NGSLLevel

func NGSLLevel(word string) (int, bool)

NGSLLevel returns the NGSL level for a single word, if present.

func OxfordLevel

func OxfordLevel(word string) (int, bool)

OxfordLevel returns the Oxford CEFR level for a single word, if present.

Types

This section is empty.

Jump to

Keyboard shortcuts

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