Add lexical richness indices (Brunet's W, Honoré's R) to competence timeline - #52
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds total-sample lexical-richness indices to the linguistic-competence
timeline: Brunet's W and Honoré's R, plus the hapax-legomena count.
Why
MATTR-30 (the headline lexical-diversity measure) depends on a moving window
and behaves awkwardly on the small, highly variable samples typical of AAC
output. Brunet's W (
N·V^-0.165, lower = richer) and Honoré's R(
100·ln N / (1 − V₁/V), higher = richer) are total-sample type-tokenmeasures that complement it without window-size sensitivity. Both are used in
DEPAC's lexical-complexity feature set (Tasnim et al., DEPAC 2022) and the
wider clinical-linguistics literature.
What
lexicalRichness(words)— pure function of the token-frequencydistribution; language-agnostic, no word lists or resources needed (fits
the data-free competence core). Returns
{ brunetsW, honoresR, hapax, types, tokens }with null guards (empty stream; R undefined when everytype is a hapax or N ≤ 1).
MonthBin.lexicalRichness— computed per calendar month inanalyzeTimeline(nulled on suppressed months alongside the other measures).Testing
monotonicity (W decreases as vocabulary diversifies at fixed N), and
MonthBin wiring in
analyzeTimeline.Consumers
Grid-Metrics-Exporter dashboard already renders
lexicalRichnesscharts fromthe timeline (omitted gracefully on ≤ 0.3.3 reports); it will pick this up on
the next versioned release.