@jjlmoya/utils-language 1.10.1 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/category/index.ts +2 -1
- package/src/entries.ts +2 -1
- package/src/tests/locale_completeness.test.ts +1 -1
- package/src/tests/registry_contract.test.ts +67 -0
- package/src/tests/tool_validation.test.ts +1 -1
- package/src/tool/lexical-coverage-vocabulary-calculator/bibliography.astro +6 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/bibliography.ts +6 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/component.astro +77 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/controller.ts +157 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/dom-views.ts +158 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/entry.ts +34 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/evaluator.ts +13 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/i18n/de.ts +13 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/i18n/en.ts +59 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/i18n/es.ts +13 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/i18n/fr.ts +53 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/i18n/id.ts +13 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/i18n/it.ts +13 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/i18n/ja.ts +13 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/i18n/ko.ts +13 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/i18n/nl.ts +13 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/i18n/pl.ts +13 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/i18n/pt.ts +13 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/i18n/ru.ts +13 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/i18n/sv.ts +13 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/i18n/tr.ts +59 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/i18n/zh.ts +13 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/index.ts +14 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/lexical-coverage-vocabulary-calculator.css +497 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/logic.test.ts +35 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/logic.ts +76 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/seo.astro +11 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/storage.ts +24 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/types.ts +33 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/ui.ts +50 -0
- package/src/tool/lexical-coverage-vocabulary-calculator/validation.ts +18 -0
- package/src/tools.ts +2 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type CoverageTarget = 80 | 90 | 95 | 98;
|
|
2
|
+
export type ContentType = 'conversation' | 'travel' | 'media' | 'generalReading' | 'novels' | 'business' | 'academic';
|
|
3
|
+
export type CoverageStatus = 'below-target' | 'at-target' | 'buffer';
|
|
4
|
+
|
|
5
|
+
export interface VocabularyPreset {
|
|
6
|
+
id: ContentType;
|
|
7
|
+
wordsByCoverage: Record<CoverageTarget, number>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface LexicalCoverageInputs {
|
|
11
|
+
contentType: ContentType;
|
|
12
|
+
knownWords: number;
|
|
13
|
+
targetCoverage: CoverageTarget;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface CoverageCheckpoint {
|
|
17
|
+
coverage: CoverageTarget;
|
|
18
|
+
words: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface LexicalCoveragePlan {
|
|
22
|
+
inputs: LexicalCoverageInputs;
|
|
23
|
+
recommendedWords: number;
|
|
24
|
+
knownWords: number;
|
|
25
|
+
estimatedCoverage: number;
|
|
26
|
+
unknownPerHundred: number;
|
|
27
|
+
gapWords: number;
|
|
28
|
+
status: CoverageStatus;
|
|
29
|
+
checkpoints: CoverageCheckpoint[];
|
|
30
|
+
nextCheckpoint: CoverageCheckpoint | null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type LexicalCoverageResult = { ok: true; plan: LexicalCoveragePlan } | { ok: false; error: string };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export interface LexicalCoverageUI extends Record<string, string> {
|
|
2
|
+
contentType: string;
|
|
3
|
+
conversation: string;
|
|
4
|
+
travel: string;
|
|
5
|
+
media: string;
|
|
6
|
+
generalReading: string;
|
|
7
|
+
novels: string;
|
|
8
|
+
business: string;
|
|
9
|
+
academic: string;
|
|
10
|
+
knownWords: string;
|
|
11
|
+
knownWordsHint: string;
|
|
12
|
+
targetCoverage: string;
|
|
13
|
+
coverage80: string;
|
|
14
|
+
coverage90: string;
|
|
15
|
+
coverage95: string;
|
|
16
|
+
coverage98: string;
|
|
17
|
+
resetButton: string;
|
|
18
|
+
quickStart: string;
|
|
19
|
+
conversationPreset: string;
|
|
20
|
+
readingPreset: string;
|
|
21
|
+
workPreset: string;
|
|
22
|
+
resultTitle: string;
|
|
23
|
+
emptyResult: string;
|
|
24
|
+
checkInputs: string;
|
|
25
|
+
invalidWords: string;
|
|
26
|
+
invalidContentType: string;
|
|
27
|
+
invalidCoverage: string;
|
|
28
|
+
belowTarget: string;
|
|
29
|
+
atTarget: string;
|
|
30
|
+
buffer: string;
|
|
31
|
+
recommendedWords: string;
|
|
32
|
+
vocabularyKnown: string;
|
|
33
|
+
estimatedCoverage: string;
|
|
34
|
+
gapWords: string;
|
|
35
|
+
unknownPerHundred: string;
|
|
36
|
+
coverageRoute: string;
|
|
37
|
+
nextCheckpoint: string;
|
|
38
|
+
noMoreCheckpoints: string;
|
|
39
|
+
words: string;
|
|
40
|
+
wordUnit: string;
|
|
41
|
+
unknownWords: string;
|
|
42
|
+
targetMarker: string;
|
|
43
|
+
coverageNote: string;
|
|
44
|
+
wordFamilyNote: string;
|
|
45
|
+
contentTypeHelp: string;
|
|
46
|
+
interpretationTitle: string;
|
|
47
|
+
actionBelow: string;
|
|
48
|
+
actionAt: string;
|
|
49
|
+
actionBuffer: string;
|
|
50
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const validation = {
|
|
2
|
+
reviewedAt: '2026-09-02',
|
|
3
|
+
methodology: 'The calculator maps a content profile to four planning checkpoints for receptive vocabulary size and estimates an intermediate coverage by linear interpolation. It is a transparent heuristic based on frequency-band research, not a test of language ability.',
|
|
4
|
+
sources: [
|
|
5
|
+
'https://www.scienceguide.nl/wp-content/uploads/2017/11/nation-2006-vocabulary.pdf',
|
|
6
|
+
'https://asele.org/media/2025/03/8izquierdogilm-adelcarmenlaselecciondellexicoenlaensananza.pdf',
|
|
7
|
+
],
|
|
8
|
+
referenceCases: [
|
|
9
|
+
{ contentType: 'conversation', targetCoverage: '80%', expectedWords: 2000 },
|
|
10
|
+
{ contentType: 'novels', targetCoverage: '95%', expectedWords: 8000 },
|
|
11
|
+
{ contentType: 'business', targetCoverage: '95%', expectedWords: 8000 },
|
|
12
|
+
],
|
|
13
|
+
limitations: [
|
|
14
|
+
'The checkpoints describe word families or frequency bands in source research and may not match an app count of lemmas or surface forms.',
|
|
15
|
+
'Coverage varies by language, corpus, genre, topic, proper nouns, morphology, background knowledge, and the learner\'s ability to infer meaning.',
|
|
16
|
+
'The result does not certify comprehension, speaking ability, fluency, or a CEFR level.',
|
|
17
|
+
],
|
|
18
|
+
};
|
package/src/tools.ts
CHANGED
|
@@ -2,7 +2,8 @@ import type { ToolDefinition } from './types';
|
|
|
2
2
|
import { CEFR_LANGUAGE_SKILL_PROFILE_PLANNER_TOOL } from './tool/cefr-language-skill-profile-planner';
|
|
3
3
|
import { LANGUAGE_SHADOWING_SESSION_PLANNER_TOOL } from './tool/language-shadowing-session-planner';
|
|
4
4
|
import { LANGUAGE_LEARNING_STUDY_PLAN_PLANNER_TOOL } from './tool/language-learning-study-plan-planner';
|
|
5
|
+
import { LEXICAL_COVERAGE_VOCABULARY_CALCULATOR_TOOL } from './tool/lexical-coverage-vocabulary-calculator/entry';
|
|
5
6
|
|
|
6
|
-
export const ALL_TOOLS: ToolDefinition[] = [LANGUAGE_LEARNING_STUDY_PLAN_PLANNER_TOOL, CEFR_LANGUAGE_SKILL_PROFILE_PLANNER_TOOL, LANGUAGE_SHADOWING_SESSION_PLANNER_TOOL];
|
|
7
|
+
export const ALL_TOOLS: ToolDefinition[] = [LANGUAGE_LEARNING_STUDY_PLAN_PLANNER_TOOL, CEFR_LANGUAGE_SKILL_PROFILE_PLANNER_TOOL, LANGUAGE_SHADOWING_SESSION_PLANNER_TOOL, LEXICAL_COVERAGE_VOCABULARY_CALCULATOR_TOOL];
|
|
7
8
|
|
|
8
9
|
export { ALL_ENTRIES } from './entries';
|