@jjlmoya/utils-language 1.2.0 → 1.3.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/tests/category_quality.test.ts +94 -0
- package/src/tests/qa-test-helpers.ts +31 -0
- package/src/tests/qa_bibliography_links.test.ts +50 -0
- package/src/tests/qa_claim_evidence.test.ts +68 -0
- package/src/tests/qa_logic_reference_coverage.test.ts +45 -0
- package/src/tests/qa_runtime_i18n.test.ts +99 -0
- package/src/tool/language-learning-study-plan-planner/validation.ts +15 -0
package/package.json
CHANGED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { languageCategory } from '../data';
|
|
5
|
+
|
|
6
|
+
const EXPECTED_LOCALES = ['de', 'en', 'es', 'fr', 'id', 'it', 'ja', 'ko', 'nl', 'pl', 'pt', 'ru', 'sv', 'tr', 'zh'] as const;
|
|
7
|
+
const EXPECTED_SLUGS = {
|
|
8
|
+
de: 'sprachen', en: 'language', es: 'idiomas', fr: 'langues', id: 'bahasa',
|
|
9
|
+
it: 'lingue', ja: 'gengo', ko: 'eoneo', nl: 'talen', pl: 'jezyki', pt: 'idiomas',
|
|
10
|
+
ru: 'yazyki', sv: 'sprak', tr: 'diller', zh: 'yuyan',
|
|
11
|
+
} as const;
|
|
12
|
+
const CATEGORY_DIR = join(process.cwd(), 'src', 'category', 'i18n');
|
|
13
|
+
const SEO_TYPES = new Set(['title', 'paragraph', 'list', 'stats']);
|
|
14
|
+
|
|
15
|
+
type CategoryContent = {
|
|
16
|
+
slug: string;
|
|
17
|
+
title: string;
|
|
18
|
+
description: string;
|
|
19
|
+
seo: Array<Record<string, unknown>>;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
function sectionText(section: Record<string, unknown>): string {
|
|
23
|
+
const value = section.text ?? section.html ?? '';
|
|
24
|
+
return typeof value === 'string' ? value.replace(/<[^>]*>/g, '').trim() : '';
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
describe('Language category quality', () => {
|
|
28
|
+
it('has one registered category with a usable icon and unique tools', () => {
|
|
29
|
+
expect(languageCategory.icon.trim()).not.toBe('');
|
|
30
|
+
expect(languageCategory.tools.length).toBeGreaterThan(0);
|
|
31
|
+
const ids = languageCategory.tools.map((tool) => tool.id);
|
|
32
|
+
expect(new Set(ids).size).toBe(ids.length);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('declares every locale in the category registry', () => {
|
|
36
|
+
expect(Object.keys(languageCategory.i18n).sort()).toEqual([...EXPECTED_LOCALES].sort());
|
|
37
|
+
for (const locale of EXPECTED_LOCALES) {
|
|
38
|
+
expect(typeof languageCategory.i18n[locale]).toBe('function');
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('keeps each locale source independent and explicit about its slug', () => {
|
|
43
|
+
expect(existsSync(join(CATEGORY_DIR, 'shared.ts'))).toBe(false);
|
|
44
|
+
for (const locale of EXPECTED_LOCALES) {
|
|
45
|
+
const source = readFileSync(join(CATEGORY_DIR, `${locale}.ts`), 'utf8');
|
|
46
|
+
expect(source, `${locale}.ts must declare its own slug`).toMatch(/(?:const\s+slug\s*=|\bslug\s*:)/);
|
|
47
|
+
expect(source, `${locale}.ts must not import a shared category translation`).not.toContain("from './shared'");
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('uses valid localized slugs and complete metadata in every locale', async () => {
|
|
52
|
+
for (const locale of EXPECTED_LOCALES) {
|
|
53
|
+
const content = await languageCategory.i18n[locale]!() as CategoryContent;
|
|
54
|
+
expect(content.slug).toBe(EXPECTED_SLUGS[locale]);
|
|
55
|
+
expect(content.slug).toMatch(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);
|
|
56
|
+
expect(content.title.length).toBeGreaterThanOrEqual(5);
|
|
57
|
+
expect(content.title.length).toBeLessThanOrEqual(70);
|
|
58
|
+
expect(content.description.length).toBeGreaterThanOrEqual(20);
|
|
59
|
+
expect(content.description.length).toBeLessThanOrEqual(220);
|
|
60
|
+
expect(content.title).not.toMatch(/[|]/);
|
|
61
|
+
expect(content.description).not.toContain('\uFFFD');
|
|
62
|
+
expect(content.seo.length).toBeGreaterThan(0);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('keeps SEO structure and useful text in parity with English', async () => {
|
|
67
|
+
const english = await languageCategory.i18n.en!() as CategoryContent;
|
|
68
|
+
const englishTypes = english.seo.map((section) => section.type);
|
|
69
|
+
|
|
70
|
+
for (const locale of EXPECTED_LOCALES) {
|
|
71
|
+
const content = await languageCategory.i18n[locale]!() as CategoryContent;
|
|
72
|
+
expect(content.seo.map((section) => section.type), locale).toEqual(englishTypes);
|
|
73
|
+
if (locale !== 'en') {
|
|
74
|
+
expect(content.title).not.toBe(english.title);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
for (const section of content.seo) {
|
|
78
|
+
expect(SEO_TYPES.has(String(section.type)), `${locale} has an unsupported SEO section type`).toBe(true);
|
|
79
|
+
const text = sectionText(section);
|
|
80
|
+
if (section.type === 'title') {
|
|
81
|
+
expect(text.length, `${locale} SEO title is empty`).toBeGreaterThanOrEqual(8);
|
|
82
|
+
}
|
|
83
|
+
if (section.type === 'paragraph') {
|
|
84
|
+
expect(text.length, `${locale} SEO paragraph is too short`).toBeGreaterThanOrEqual(20);
|
|
85
|
+
}
|
|
86
|
+
if (section.type === 'stats') {
|
|
87
|
+
expect(Array.isArray(section.items), `${locale} SEO stats need items`).toBe(true);
|
|
88
|
+
expect((section.items as unknown[]).length).toBeGreaterThan(0);
|
|
89
|
+
}
|
|
90
|
+
expect(JSON.stringify(section)).not.toContain('\uFFFD');
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { readdirSync, readFileSync, statSync } from 'node:fs';
|
|
2
|
+
import { join, relative } from 'node:path';
|
|
3
|
+
|
|
4
|
+
export const repositoryRoot = process.cwd();
|
|
5
|
+
export const toolRoot = join(repositoryRoot, 'src', 'tool');
|
|
6
|
+
|
|
7
|
+
export function listToolDirectories(): string[] {
|
|
8
|
+
return readdirSync(toolRoot)
|
|
9
|
+
.map((name) => join(toolRoot, name))
|
|
10
|
+
.filter((path) => statSync(path).isDirectory());
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function findFiles(directory: string, extensions: string[]): string[] {
|
|
14
|
+
const files: string[] = [];
|
|
15
|
+
|
|
16
|
+
for (const entry of readdirSync(directory, { withFileTypes: true })) {
|
|
17
|
+
const path = join(directory, entry.name);
|
|
18
|
+
if (entry.isDirectory()) files.push(...findFiles(path, extensions));
|
|
19
|
+
else if (extensions.some((extension) => entry.name.endsWith(extension))) files.push(path);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return files;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function read(path: string): string {
|
|
26
|
+
return readFileSync(path, 'utf8');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function displayPath(path: string): string {
|
|
30
|
+
return relative(repositoryRoot, path).replace(/\\/g, '/');
|
|
31
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { ALL_TOOLS } from '../tools';
|
|
3
|
+
import type { ToolLocaleContent } from '../types';
|
|
4
|
+
|
|
5
|
+
interface LinkFailure {
|
|
6
|
+
tool: string;
|
|
7
|
+
message: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function validateLink(tool: string, entry: { url: string }, seen: Set<string>): LinkFailure[] {
|
|
11
|
+
const failures: LinkFailure[] = [];
|
|
12
|
+
let url: URL;
|
|
13
|
+
try {
|
|
14
|
+
url = new URL(entry.url);
|
|
15
|
+
} catch {
|
|
16
|
+
return [{ tool, message: `invalid URL: ${entry.url}` }];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (url.protocol !== 'https:') {
|
|
20
|
+
failures.push({ tool, message: `non-HTTPS URL: ${entry.url}` });
|
|
21
|
+
}
|
|
22
|
+
if (url.pathname === '/' && !url.search && !url.hash) {
|
|
23
|
+
failures.push({ tool, message: `generic homepage, cite the exact document: ${entry.url}` });
|
|
24
|
+
}
|
|
25
|
+
if (seen.has(url.href)) {
|
|
26
|
+
failures.push({ tool, message: `duplicate source URL: ${entry.url}` });
|
|
27
|
+
}
|
|
28
|
+
seen.add(url.href);
|
|
29
|
+
return failures;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async function validateTool(tool: typeof ALL_TOOLS[number]): Promise<LinkFailure[]> {
|
|
33
|
+
const loader = tool.entry.i18n.en;
|
|
34
|
+
if (!loader) {
|
|
35
|
+
return [{ tool: tool.entry.id, message: 'English locale loader is missing' }];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const content = (await loader()) as ToolLocaleContent;
|
|
39
|
+
const seen = new Set<string>();
|
|
40
|
+
return (content.bibliography ?? []).flatMap((entry) => validateLink(tool.entry.id, entry, seen));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
describe('QA: bibliography links are specific and usable', () => {
|
|
44
|
+
it('uses unique HTTPS links to exact source pages instead of generic homepages', async () => {
|
|
45
|
+
const failures = (await Promise.all(ALL_TOOLS.map(validateTool))).flat();
|
|
46
|
+
|
|
47
|
+
const messages = failures.map(({ tool, message }) => `${tool}: ${message}`);
|
|
48
|
+
expect(messages, `Bibliography hygiene failures:\n${messages.join('\n')}`).toEqual([]);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { displayPath, listToolDirectories, read } from './qa-test-helpers';
|
|
5
|
+
|
|
6
|
+
const evidenceClaims = [
|
|
7
|
+
/\bofficial algorithm\b/i,
|
|
8
|
+
/\balgoritmo oficial\b/i,
|
|
9
|
+
/\b(?:records|data|rates|tables) updated(?:\s+(?:to|through)\s+20\d{2})?\b/i,
|
|
10
|
+
/\b(?:registros|datos|tasas|tablas) actualizad[oa]s?(?:\s+(?:a|hasta)\s+20\d{2})?\b/i,
|
|
11
|
+
/\b(?:validated|verified) (?:method|algorithm|calculation)\b/i,
|
|
12
|
+
/\b(?:método|algoritmo|cálculo) (?:validado|verificado)\b/i,
|
|
13
|
+
/\b(?:guarantees|ensures)\b/i,
|
|
14
|
+
/\bgarantiza\b/i,
|
|
15
|
+
/\bofficial (?:data|rate|calculation)\b/i,
|
|
16
|
+
/\b(?:datos|tasa|cálculo) oficial(?:es)?\b/i,
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
const requiredEvidenceFields = [
|
|
20
|
+
'reviewedAt',
|
|
21
|
+
'methodology',
|
|
22
|
+
'sources',
|
|
23
|
+
'referenceCases',
|
|
24
|
+
'limitations',
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
describe('QA: strong factual claims are traceable', () => {
|
|
28
|
+
it('requires machine-readable validation evidence beside tools making strong claims', () => {
|
|
29
|
+
const failures: string[] = [];
|
|
30
|
+
|
|
31
|
+
for (const directory of listToolDirectories()) {
|
|
32
|
+
const localePaths = ['en', 'es']
|
|
33
|
+
.map((locale) => join(directory, 'i18n', `${locale}.ts`))
|
|
34
|
+
.filter(existsSync);
|
|
35
|
+
const claims = localePaths.flatMap((path) => {
|
|
36
|
+
const source = read(path);
|
|
37
|
+
return evidenceClaims
|
|
38
|
+
.filter((pattern) => pattern.test(source))
|
|
39
|
+
.map((pattern) => `${displayPath(path)} matches ${pattern.source}`);
|
|
40
|
+
});
|
|
41
|
+
if (claims.length === 0) continue;
|
|
42
|
+
|
|
43
|
+
const evidencePath = join(directory, 'validation.ts');
|
|
44
|
+
if (!existsSync(evidencePath)) {
|
|
45
|
+
failures.push(`${displayPath(evidencePath)} missing; claims: ${claims.join(' | ')}`);
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const evidence = read(evidencePath);
|
|
50
|
+
const missingFields = requiredEvidenceFields.filter(
|
|
51
|
+
(field) => !new RegExp(`\\b${field}\\s*:`).test(evidence),
|
|
52
|
+
);
|
|
53
|
+
if (missingFields.length > 0) {
|
|
54
|
+
failures.push(`${displayPath(evidencePath)} missing fields: ${missingFields.join(', ')}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
expect(
|
|
59
|
+
failures,
|
|
60
|
+
[
|
|
61
|
+
'Claims such as official, validated, guaranteed or updated need inspectable evidence.',
|
|
62
|
+
'Add validation.ts with reviewedAt, methodology, sources, referenceCases and limitations,',
|
|
63
|
+
'or weaken/remove the unsupported claim.',
|
|
64
|
+
...failures,
|
|
65
|
+
].join('\n'),
|
|
66
|
+
).toEqual([]);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { basename, join } from 'node:path';
|
|
3
|
+
import { existsSync } from 'node:fs';
|
|
4
|
+
import {
|
|
5
|
+
displayPath,
|
|
6
|
+
findFiles,
|
|
7
|
+
listToolDirectories,
|
|
8
|
+
read,
|
|
9
|
+
repositoryRoot,
|
|
10
|
+
} from './qa-test-helpers';
|
|
11
|
+
|
|
12
|
+
function hasDedicatedLogicTest(toolDirectory: string): boolean {
|
|
13
|
+
const localCandidates = [
|
|
14
|
+
join(toolDirectory, 'logic.test.ts'),
|
|
15
|
+
join(toolDirectory, 'logic.spec.ts'),
|
|
16
|
+
join(toolDirectory, '__tests__', 'logic.test.ts'),
|
|
17
|
+
join(toolDirectory, '__tests__', 'logic.spec.ts'),
|
|
18
|
+
];
|
|
19
|
+
if (localCandidates.some(existsSync)) return true;
|
|
20
|
+
|
|
21
|
+
const toolName = basename(toolDirectory);
|
|
22
|
+
const centralTests = findFiles(join(repositoryRoot, 'src', 'tests'), ['.test.ts', '.spec.ts']);
|
|
23
|
+
return centralTests.some((testPath) => {
|
|
24
|
+
const source = read(testPath).replace(/\\/g, '/');
|
|
25
|
+
return source.includes(`/tool/${toolName}/logic`) || source.includes(`../tool/${toolName}/logic`);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
describe('QA: calculation logic has reference tests', () => {
|
|
30
|
+
it('gives every public calculator logic module its own behavioral test suite', () => {
|
|
31
|
+
const failures = listToolDirectories()
|
|
32
|
+
.filter((directory) => existsSync(join(directory, 'logic.ts')))
|
|
33
|
+
.filter((directory) => !hasDedicatedLogicTest(directory))
|
|
34
|
+
.map((directory) => `${displayPath(join(directory, 'logic.ts'))} -> no test imports this module`);
|
|
35
|
+
|
|
36
|
+
expect(
|
|
37
|
+
failures,
|
|
38
|
+
[
|
|
39
|
+
'Add behavioral tests through each logic module public API.',
|
|
40
|
+
'At minimum cover a documented reference case, boundaries, invalid input and invariants.',
|
|
41
|
+
...failures,
|
|
42
|
+
].join('\n'),
|
|
43
|
+
).toEqual([]);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { basename, join } from 'node:path';
|
|
3
|
+
import { existsSync } from 'node:fs';
|
|
4
|
+
import {
|
|
5
|
+
displayPath,
|
|
6
|
+
findFiles,
|
|
7
|
+
listToolDirectories,
|
|
8
|
+
read,
|
|
9
|
+
repositoryRoot,
|
|
10
|
+
} from './qa-test-helpers';
|
|
11
|
+
|
|
12
|
+
interface VisibleLiteral {
|
|
13
|
+
line: number;
|
|
14
|
+
value: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const domTextAssignment = /\.(?:innerText|textContent|innerHTML)\s*=/;
|
|
18
|
+
const quotedLiteral = /(['"`])((?:\\.|(?!\1).)*)\1/g;
|
|
19
|
+
|
|
20
|
+
function visibleWords(value: string): string {
|
|
21
|
+
return value
|
|
22
|
+
.replace(/\$\{[^}]*\}/g, ' ')
|
|
23
|
+
.replace(/<[^>]+>/g, ' ')
|
|
24
|
+
.replace(/&[a-z]+;/gi, ' ')
|
|
25
|
+
.replace(/[\d\p{P}\p{S}_]+/gu, ' ')
|
|
26
|
+
.replace(/\s+/g, ' ')
|
|
27
|
+
.trim();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function isTechnicalLiteral(value: string): boolean {
|
|
31
|
+
return ['.', '#', '['].some((prefix) => value.startsWith(prefix))
|
|
32
|
+
|| /^data-[a-z0-9-]+$/i.test(value);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function hardcodedVisibleLiterals(source: string): VisibleLiteral[] {
|
|
36
|
+
const failures: VisibleLiteral[] = [];
|
|
37
|
+
|
|
38
|
+
source.split(/\r?\n/).forEach((line, index) => {
|
|
39
|
+
if (!domTextAssignment.test(line)) return;
|
|
40
|
+
|
|
41
|
+
const assignment = line.slice(line.search(domTextAssignment));
|
|
42
|
+
for (const match of assignment.matchAll(quotedLiteral)) {
|
|
43
|
+
if (isTechnicalLiteral(match[2])) continue;
|
|
44
|
+
const words = visibleWords(match[2]);
|
|
45
|
+
if (words && /\p{L}/u.test(words)) {
|
|
46
|
+
failures.push({ line: index + 1, value: match[2] });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
return failures;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function runtimeSources(toolDirectory: string): string {
|
|
55
|
+
return findFiles(toolDirectory, ['.astro', '.ts', '.js'])
|
|
56
|
+
.filter((path) => !path.includes(`${join(toolDirectory, 'i18n')}`))
|
|
57
|
+
.filter((path) => basename(path) !== 'ui.ts')
|
|
58
|
+
.map(read)
|
|
59
|
+
.join('\n');
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
describe('QA: runtime copy is localized', () => {
|
|
63
|
+
const componentFiles = findFiles(join(repositoryRoot, 'src', 'tool'), ['.astro']);
|
|
64
|
+
|
|
65
|
+
it('does not write user-facing string literals directly into the DOM', () => {
|
|
66
|
+
const failures = componentFiles.flatMap((path) =>
|
|
67
|
+
hardcodedVisibleLiterals(read(path)).map(
|
|
68
|
+
({ line, value }) => `${displayPath(path)}:${line} -> ${JSON.stringify(value)}`,
|
|
69
|
+
),
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
expect(
|
|
73
|
+
failures,
|
|
74
|
+
`Move visible browser copy to the tool UI locale contract:\n${failures.join('\n')}`,
|
|
75
|
+
).toEqual([]);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('uses every string declared by each UI locale contract', () => {
|
|
79
|
+
const failures: string[] = [];
|
|
80
|
+
|
|
81
|
+
for (const directory of listToolDirectories()) {
|
|
82
|
+
const uiPath = join(directory, 'ui.ts');
|
|
83
|
+
if (!existsSync(uiPath)) continue;
|
|
84
|
+
|
|
85
|
+
const keys = Array.from(read(uiPath).matchAll(/^\s*(\w+)\??:\s*string\s*;/gm), (match) => match[1]);
|
|
86
|
+
const runtime = runtimeSources(directory);
|
|
87
|
+
const unused = keys.filter((key) => !new RegExp(`\\b${key}\\b`).test(runtime));
|
|
88
|
+
|
|
89
|
+
if (unused.length > 0) {
|
|
90
|
+
failures.push(`${displayPath(uiPath)} -> unused: ${unused.join(', ')}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
expect(
|
|
95
|
+
failures,
|
|
96
|
+
`Unused locale keys are dead copy or may mean the browser bypasses translations:\n${failures.join('\n')}`,
|
|
97
|
+
).toEqual([]);
|
|
98
|
+
});
|
|
99
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const validation = {
|
|
2
|
+
reviewedAt: '2026-08-29',
|
|
3
|
+
methodology: 'The planner uses broad guided-learning hour ranges as a planning estimate, subtracts the current level range from the target level range, and compares the result with weeks available at the selected weekly pace.',
|
|
4
|
+
sources: [
|
|
5
|
+
'https://www.coe.int/en/web/common-european-framework-reference-languages',
|
|
6
|
+
'https://www.cambridge.org/elt/blog/2020/08/19/how-long-learn-language/',
|
|
7
|
+
],
|
|
8
|
+
referenceCases: [
|
|
9
|
+
{ currentLevel: 'A1', targetLevel: 'B1', expectedHoursRange: '260-300' },
|
|
10
|
+
],
|
|
11
|
+
limitations: [
|
|
12
|
+
'The ranges are planning estimates, not a placement test or a guarantee of fluency.',
|
|
13
|
+
'Language distance, previous exposure, study quality, and real-world practice can materially change the time required.',
|
|
14
|
+
],
|
|
15
|
+
};
|