glost-presets 0.5.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/LICENSE +21 -0
- package/README.md +210 -0
- package/dist/grammar-analyzer.d.ts +40 -0
- package/dist/grammar-analyzer.d.ts.map +1 -0
- package/dist/grammar-analyzer.js +61 -0
- package/dist/grammar-analyzer.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/language-learning.d.ts +58 -0
- package/dist/language-learning.d.ts.map +1 -0
- package/dist/language-learning.js +83 -0
- package/dist/language-learning.js.map +1 -0
- package/dist/minimal.d.ts +40 -0
- package/dist/minimal.d.ts.map +1 -0
- package/dist/minimal.js +55 -0
- package/dist/minimal.js.map +1 -0
- package/dist/reading-app.d.ts +43 -0
- package/dist/reading-app.d.ts.map +1 -0
- package/dist/reading-app.js +62 -0
- package/dist/reading-app.js.map +1 -0
- package/dist/vocabulary-builder.d.ts +41 -0
- package/dist/vocabulary-builder.d.ts.map +1 -0
- package/dist/vocabulary-builder.js +61 -0
- package/dist/vocabulary-builder.js.map +1 -0
- package/package.json +40 -0
- package/src/grammar-analyzer.ts +71 -0
- package/src/index.ts +43 -0
- package/src/language-learning.ts +103 -0
- package/src/minimal.ts +65 -0
- package/src/reading-app.ts +76 -0
- package/src/vocabulary-builder.ts +73 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 GLOST Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# glost-presets
|
|
2
|
+
|
|
3
|
+
Preset configurations for common GLOST use cases.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
`glost-presets` provides pre-configured plugin combinations for common language learning and text processing scenarios.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install glost-presets
|
|
13
|
+
# or
|
|
14
|
+
pnpm add glost-presets
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Available Presets
|
|
18
|
+
|
|
19
|
+
### Language Learning Preset
|
|
20
|
+
|
|
21
|
+
Complete language learning stack with all features.
|
|
22
|
+
|
|
23
|
+
**Includes:** Transcription, Translation, Frequency, Difficulty, POS
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import { glost } from "glost-processor";
|
|
27
|
+
import { languageLearningPreset } from "glost-presets";
|
|
28
|
+
|
|
29
|
+
const processor = glost()
|
|
30
|
+
.use(languageLearningPreset);
|
|
31
|
+
|
|
32
|
+
const result = await processor.process(document);
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**Customized:**
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { createLanguageLearningPreset } from "glost-presets";
|
|
39
|
+
|
|
40
|
+
const preset = createLanguageLearningPreset({
|
|
41
|
+
transcriptionScheme: "ipa",
|
|
42
|
+
translationTarget: "es",
|
|
43
|
+
includePos: false
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const processor = glost().use(preset);
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Reading App Preset
|
|
50
|
+
|
|
51
|
+
Optimized for interactive reading applications.
|
|
52
|
+
|
|
53
|
+
**Includes:** Transcription, Translation, Clause Segmentation
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import { readingAppPreset } from "glost-presets";
|
|
57
|
+
|
|
58
|
+
const processor = glost()
|
|
59
|
+
.use(readingAppPreset);
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Vocabulary Builder Preset
|
|
63
|
+
|
|
64
|
+
Focus on word frequency and difficulty for vocabulary learning.
|
|
65
|
+
|
|
66
|
+
**Includes:** Frequency, Difficulty, Translation
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
import { vocabularyBuilderPreset } from "glost-presets";
|
|
70
|
+
|
|
71
|
+
const processor = glost()
|
|
72
|
+
.use(vocabularyBuilderPreset);
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Grammar Analyzer Preset
|
|
76
|
+
|
|
77
|
+
Focus on grammatical analysis.
|
|
78
|
+
|
|
79
|
+
**Includes:** POS Tagging, Clause Segmentation, Gender
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
import { grammarAnalyzerPreset } from "glost-presets";
|
|
83
|
+
|
|
84
|
+
const processor = glost()
|
|
85
|
+
.use(grammarAnalyzerPreset);
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Minimal Preset
|
|
89
|
+
|
|
90
|
+
Just the essentials.
|
|
91
|
+
|
|
92
|
+
**Includes:** Transcription, Translation
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
import { minimalPreset } from "glost-presets";
|
|
96
|
+
|
|
97
|
+
const processor = glost()
|
|
98
|
+
.use(minimalPreset);
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Creating Custom Presets
|
|
102
|
+
|
|
103
|
+
You can create your own presets:
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
import type { Preset } from "glost-processor";
|
|
107
|
+
|
|
108
|
+
const myCustomPreset: Preset = {
|
|
109
|
+
id: "my-custom",
|
|
110
|
+
name: "My Custom Preset",
|
|
111
|
+
description: "My custom plugin combination",
|
|
112
|
+
plugins: [
|
|
113
|
+
["transcription", { scheme: "ipa" }],
|
|
114
|
+
"frequency",
|
|
115
|
+
["my-plugin", { option: "value" }]
|
|
116
|
+
]
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const processor = glost()
|
|
120
|
+
.use(myCustomPreset);
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Combining Presets
|
|
124
|
+
|
|
125
|
+
You can use multiple presets or extend them:
|
|
126
|
+
|
|
127
|
+
```typescript
|
|
128
|
+
import { glost } from "glost-processor";
|
|
129
|
+
import { minimalPreset } from "glost-presets";
|
|
130
|
+
|
|
131
|
+
const processor = glost()
|
|
132
|
+
.use(minimalPreset)
|
|
133
|
+
.use("frequency") // Add frequency on top
|
|
134
|
+
.use("difficulty"); // And difficulty
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Customization Functions
|
|
138
|
+
|
|
139
|
+
Each preset has a customization function:
|
|
140
|
+
|
|
141
|
+
- `createLanguageLearningPreset(options)`
|
|
142
|
+
- `createReadingAppPreset(options)`
|
|
143
|
+
- `createVocabularyBuilderPreset(options)`
|
|
144
|
+
- `createGrammarAnalyzerPreset(options)`
|
|
145
|
+
- `createMinimalPreset(options)`
|
|
146
|
+
|
|
147
|
+
These let you customize the preset while keeping the overall structure.
|
|
148
|
+
|
|
149
|
+
## Use Cases
|
|
150
|
+
|
|
151
|
+
### Language Learning App
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
import { languageLearningPreset } from "glost-presets";
|
|
155
|
+
|
|
156
|
+
const processor = glost()
|
|
157
|
+
.use(languageLearningPreset)
|
|
158
|
+
.before("translation", async (doc) => {
|
|
159
|
+
// Cache original text before translation
|
|
160
|
+
})
|
|
161
|
+
.after("difficulty", (doc) => {
|
|
162
|
+
// Send analytics after difficulty calculation
|
|
163
|
+
});
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Reading Tool
|
|
167
|
+
|
|
168
|
+
```typescript
|
|
169
|
+
import { readingAppPreset } from "glost-presets";
|
|
170
|
+
|
|
171
|
+
const processor = glost()
|
|
172
|
+
.use(readingAppPreset)
|
|
173
|
+
.onProgress((stats) => {
|
|
174
|
+
updateProgressBar(stats.completed / stats.total);
|
|
175
|
+
});
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Vocabulary Flashcards
|
|
179
|
+
|
|
180
|
+
```typescript
|
|
181
|
+
import { vocabularyBuilderPreset } from "glost-presets";
|
|
182
|
+
|
|
183
|
+
const processor = glost({ lenient: true })
|
|
184
|
+
.use(vocabularyBuilderPreset);
|
|
185
|
+
|
|
186
|
+
const result = await processor.processWithMeta(document);
|
|
187
|
+
const words = getAllWords(result.document);
|
|
188
|
+
|
|
189
|
+
// Create flashcards from words with frequency/difficulty
|
|
190
|
+
const flashcards = words
|
|
191
|
+
.filter(w => w.extras?.frequency?.level === "common")
|
|
192
|
+
.map(createFlashcard);
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## API
|
|
196
|
+
|
|
197
|
+
Each preset is a `Preset` object with:
|
|
198
|
+
|
|
199
|
+
```typescript
|
|
200
|
+
interface Preset {
|
|
201
|
+
id: string;
|
|
202
|
+
name: string;
|
|
203
|
+
description: string;
|
|
204
|
+
plugins: Array<PluginSpec | [PluginSpec, any]>;
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## License
|
|
209
|
+
|
|
210
|
+
MIT
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grammar Analyzer Preset
|
|
3
|
+
*
|
|
4
|
+
* Focus on grammatical analysis with POS tagging and clause segmentation.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
import type { Preset } from "glost-processor";
|
|
9
|
+
/**
|
|
10
|
+
* Grammar Analyzer Preset
|
|
11
|
+
*
|
|
12
|
+
* Optimized for grammatical analysis and teaching.
|
|
13
|
+
*
|
|
14
|
+
* Includes:
|
|
15
|
+
* - Part-of-speech tagging
|
|
16
|
+
* - Clause segmentation
|
|
17
|
+
* - Gender (for applicable languages)
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import { glost } from "glost-processor";
|
|
22
|
+
* import { grammarAnalyzerPreset } from "glost-presets";
|
|
23
|
+
*
|
|
24
|
+
* const processor = glost()
|
|
25
|
+
* .use(grammarAnalyzerPreset);
|
|
26
|
+
*
|
|
27
|
+
* const result = await processor.process(document);
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare const grammarAnalyzerPreset: Preset;
|
|
31
|
+
/**
|
|
32
|
+
* Create a customized grammar analyzer preset
|
|
33
|
+
*
|
|
34
|
+
* @param options - Customization options
|
|
35
|
+
* @returns Customized preset
|
|
36
|
+
*/
|
|
37
|
+
export declare function createGrammarAnalyzerPreset(options?: {
|
|
38
|
+
includeGender?: boolean;
|
|
39
|
+
}): Preset;
|
|
40
|
+
//# sourceMappingURL=grammar-analyzer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grammar-analyzer.d.ts","sourceRoot":"","sources":["../src/grammar-analyzer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,qBAAqB,EAAE,MASnC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,CAAC,EAAE;IACpD,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GAAG,MAAM,CAoBT"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grammar Analyzer Preset
|
|
3
|
+
*
|
|
4
|
+
* Focus on grammatical analysis with POS tagging and clause segmentation.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Grammar Analyzer Preset
|
|
10
|
+
*
|
|
11
|
+
* Optimized for grammatical analysis and teaching.
|
|
12
|
+
*
|
|
13
|
+
* Includes:
|
|
14
|
+
* - Part-of-speech tagging
|
|
15
|
+
* - Clause segmentation
|
|
16
|
+
* - Gender (for applicable languages)
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* import { glost } from "glost-processor";
|
|
21
|
+
* import { grammarAnalyzerPreset } from "glost-presets";
|
|
22
|
+
*
|
|
23
|
+
* const processor = glost()
|
|
24
|
+
* .use(grammarAnalyzerPreset);
|
|
25
|
+
*
|
|
26
|
+
* const result = await processor.process(document);
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export const grammarAnalyzerPreset = {
|
|
30
|
+
id: "grammar-analyzer",
|
|
31
|
+
name: "Grammar Analyzer",
|
|
32
|
+
description: "POS tagging and clause segmentation for grammar analysis",
|
|
33
|
+
plugins: [
|
|
34
|
+
"pos",
|
|
35
|
+
"clause-segmenter",
|
|
36
|
+
"gender",
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Create a customized grammar analyzer preset
|
|
41
|
+
*
|
|
42
|
+
* @param options - Customization options
|
|
43
|
+
* @returns Customized preset
|
|
44
|
+
*/
|
|
45
|
+
export function createGrammarAnalyzerPreset(options) {
|
|
46
|
+
const { includeGender = true, } = options || {};
|
|
47
|
+
const plugins = [
|
|
48
|
+
"pos",
|
|
49
|
+
"clause-segmenter",
|
|
50
|
+
];
|
|
51
|
+
if (includeGender) {
|
|
52
|
+
plugins.push("gender");
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
id: "grammar-analyzer-custom",
|
|
56
|
+
name: "Grammar Analyzer (Custom)",
|
|
57
|
+
description: "Customized grammar analyzer preset",
|
|
58
|
+
plugins,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=grammar-analyzer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grammar-analyzer.js","sourceRoot":"","sources":["../src/grammar-analyzer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAW;IAC3C,EAAE,EAAE,kBAAkB;IACtB,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,0DAA0D;IACvE,OAAO,EAAE;QACP,KAAK;QACL,kBAAkB;QAClB,QAAQ;KACT;CACF,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CAAC,OAE3C;IACC,MAAM,EACJ,aAAa,GAAG,IAAI,GACrB,GAAG,OAAO,IAAI,EAAE,CAAC;IAElB,MAAM,OAAO,GAAsB;QACjC,KAAK;QACL,kBAAkB;KACnB,CAAC;IAEF,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC;IAED,OAAO;QACL,EAAE,EAAE,yBAAyB;QAC7B,IAAI,EAAE,2BAA2B;QACjC,WAAW,EAAE,oCAAoC;QACjD,OAAO;KACR,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GLOST Presets
|
|
3
|
+
*
|
|
4
|
+
* Preset configurations for common GLOST use cases.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import { glost } from "glost-processor";
|
|
11
|
+
* import { languageLearningPreset } from "glost-presets";
|
|
12
|
+
*
|
|
13
|
+
* const processor = glost()
|
|
14
|
+
* .use(languageLearningPreset);
|
|
15
|
+
*
|
|
16
|
+
* const result = await processor.process(document);
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export { languageLearningPreset, createLanguageLearningPreset, } from "./language-learning.js";
|
|
20
|
+
export { readingAppPreset, createReadingAppPreset, } from "./reading-app.js";
|
|
21
|
+
export { vocabularyBuilderPreset, createVocabularyBuilderPreset, } from "./vocabulary-builder.js";
|
|
22
|
+
export { grammarAnalyzerPreset, createGrammarAnalyzerPreset, } from "./grammar-analyzer.js";
|
|
23
|
+
export { minimalPreset, createMinimalPreset, } from "./minimal.js";
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EACL,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,aAAa,EACb,mBAAmB,GACpB,MAAM,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GLOST Presets
|
|
3
|
+
*
|
|
4
|
+
* Preset configurations for common GLOST use cases.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import { glost } from "glost-processor";
|
|
11
|
+
* import { languageLearningPreset } from "glost-presets";
|
|
12
|
+
*
|
|
13
|
+
* const processor = glost()
|
|
14
|
+
* .use(languageLearningPreset);
|
|
15
|
+
*
|
|
16
|
+
* const result = await processor.process(document);
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export { languageLearningPreset, createLanguageLearningPreset, } from "./language-learning.js";
|
|
20
|
+
export { readingAppPreset, createReadingAppPreset, } from "./reading-app.js";
|
|
21
|
+
export { vocabularyBuilderPreset, createVocabularyBuilderPreset, } from "./vocabulary-builder.js";
|
|
22
|
+
export { grammarAnalyzerPreset, createGrammarAnalyzerPreset, } from "./grammar-analyzer.js";
|
|
23
|
+
export { minimalPreset, createMinimalPreset, } from "./minimal.js";
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EACL,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,aAAa,EACb,mBAAmB,GACpB,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Language Learning Preset
|
|
3
|
+
*
|
|
4
|
+
* Complete language learning stack with transcription, translation,
|
|
5
|
+
* frequency, difficulty, and POS tagging.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
import type { Preset } from "glost-processor";
|
|
10
|
+
/**
|
|
11
|
+
* Language Learning Preset
|
|
12
|
+
*
|
|
13
|
+
* Full-featured preset for language learning applications.
|
|
14
|
+
*
|
|
15
|
+
* Includes:
|
|
16
|
+
* - Transcription (with configurable scheme)
|
|
17
|
+
* - Translation (with configurable target)
|
|
18
|
+
* - Frequency data
|
|
19
|
+
* - Difficulty levels
|
|
20
|
+
* - Part-of-speech tagging
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* import { glost } from "glost-processor";
|
|
25
|
+
* import { languageLearningPreset } from "glost-presets";
|
|
26
|
+
*
|
|
27
|
+
* const processor = glost()
|
|
28
|
+
* .use(languageLearningPreset);
|
|
29
|
+
*
|
|
30
|
+
* const result = await processor.process(document);
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare const languageLearningPreset: Preset;
|
|
34
|
+
/**
|
|
35
|
+
* Create a customized language learning preset
|
|
36
|
+
*
|
|
37
|
+
* @param options - Customization options
|
|
38
|
+
* @returns Customized preset
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* import { createLanguageLearningPreset } from "glost-presets";
|
|
43
|
+
*
|
|
44
|
+
* const preset = createLanguageLearningPreset({
|
|
45
|
+
* transcriptionScheme: "ipa",
|
|
46
|
+
* translationTarget: "es",
|
|
47
|
+
* includePos: false
|
|
48
|
+
* });
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export declare function createLanguageLearningPreset(options?: {
|
|
52
|
+
transcriptionScheme?: string;
|
|
53
|
+
translationTarget?: string;
|
|
54
|
+
includeFrequency?: boolean;
|
|
55
|
+
includeDifficulty?: boolean;
|
|
56
|
+
includePos?: boolean;
|
|
57
|
+
}): Preset;
|
|
58
|
+
//# sourceMappingURL=language-learning.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language-learning.d.ts","sourceRoot":"","sources":["../src/language-learning.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAWpC,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,CAAC,EAAE;IACrD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,MAAM,CAgCT"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Language Learning Preset
|
|
3
|
+
*
|
|
4
|
+
* Complete language learning stack with transcription, translation,
|
|
5
|
+
* frequency, difficulty, and POS tagging.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Language Learning Preset
|
|
11
|
+
*
|
|
12
|
+
* Full-featured preset for language learning applications.
|
|
13
|
+
*
|
|
14
|
+
* Includes:
|
|
15
|
+
* - Transcription (with configurable scheme)
|
|
16
|
+
* - Translation (with configurable target)
|
|
17
|
+
* - Frequency data
|
|
18
|
+
* - Difficulty levels
|
|
19
|
+
* - Part-of-speech tagging
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* import { glost } from "glost-processor";
|
|
24
|
+
* import { languageLearningPreset } from "glost-presets";
|
|
25
|
+
*
|
|
26
|
+
* const processor = glost()
|
|
27
|
+
* .use(languageLearningPreset);
|
|
28
|
+
*
|
|
29
|
+
* const result = await processor.process(document);
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export const languageLearningPreset = {
|
|
33
|
+
id: "language-learning",
|
|
34
|
+
name: "Language Learning",
|
|
35
|
+
description: "Complete language learning stack with transcription, translation, frequency, difficulty, and POS",
|
|
36
|
+
plugins: [
|
|
37
|
+
["transcription", { scheme: "auto" }],
|
|
38
|
+
["translation", { target: "en" }],
|
|
39
|
+
"frequency",
|
|
40
|
+
"difficulty",
|
|
41
|
+
"pos",
|
|
42
|
+
],
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Create a customized language learning preset
|
|
46
|
+
*
|
|
47
|
+
* @param options - Customization options
|
|
48
|
+
* @returns Customized preset
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* import { createLanguageLearningPreset } from "glost-presets";
|
|
53
|
+
*
|
|
54
|
+
* const preset = createLanguageLearningPreset({
|
|
55
|
+
* transcriptionScheme: "ipa",
|
|
56
|
+
* translationTarget: "es",
|
|
57
|
+
* includePos: false
|
|
58
|
+
* });
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export function createLanguageLearningPreset(options) {
|
|
62
|
+
const { transcriptionScheme = "auto", translationTarget = "en", includeFrequency = true, includeDifficulty = true, includePos = true, } = options || {};
|
|
63
|
+
const plugins = [
|
|
64
|
+
["transcription", { scheme: transcriptionScheme }],
|
|
65
|
+
["translation", { target: translationTarget }],
|
|
66
|
+
];
|
|
67
|
+
if (includeFrequency) {
|
|
68
|
+
plugins.push("frequency");
|
|
69
|
+
}
|
|
70
|
+
if (includeDifficulty) {
|
|
71
|
+
plugins.push("difficulty");
|
|
72
|
+
}
|
|
73
|
+
if (includePos) {
|
|
74
|
+
plugins.push("pos");
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
id: "language-learning-custom",
|
|
78
|
+
name: "Language Learning (Custom)",
|
|
79
|
+
description: "Customized language learning preset",
|
|
80
|
+
plugins,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=language-learning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language-learning.js","sourceRoot":"","sources":["../src/language-learning.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAW;IAC5C,EAAE,EAAE,mBAAmB;IACvB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,kGAAkG;IAC/G,OAAO,EAAE;QACP,CAAC,eAAe,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QACrC,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QACjC,WAAW;QACX,YAAY;QACZ,KAAK;KACN;CACF,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,4BAA4B,CAAC,OAM5C;IACC,MAAM,EACJ,mBAAmB,GAAG,MAAM,EAC5B,iBAAiB,GAAG,IAAI,EACxB,gBAAgB,GAAG,IAAI,EACvB,iBAAiB,GAAG,IAAI,EACxB,UAAU,GAAG,IAAI,GAClB,GAAG,OAAO,IAAI,EAAE,CAAC;IAElB,MAAM,OAAO,GAAsB;QACjC,CAAC,eAAe,EAAE,EAAE,MAAM,EAAE,mBAAmB,EAAE,CAAC;QAClD,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC;KAC/C,CAAC;IAEF,IAAI,gBAAgB,EAAE,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC5B,CAAC;IAED,IAAI,iBAAiB,EAAE,CAAC;QACtB,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC7B,CAAC;IAED,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IAED,OAAO;QACL,EAAE,EAAE,0BAA0B;QAC9B,IAAI,EAAE,4BAA4B;QAClC,WAAW,EAAE,qCAAqC;QAClD,OAAO;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal Preset
|
|
3
|
+
*
|
|
4
|
+
* Just the essentials: transcription and translation.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
import type { Preset } from "glost-processor";
|
|
9
|
+
/**
|
|
10
|
+
* Minimal Preset
|
|
11
|
+
*
|
|
12
|
+
* Lightweight preset with just transcription and translation.
|
|
13
|
+
*
|
|
14
|
+
* Includes:
|
|
15
|
+
* - Transcription
|
|
16
|
+
* - Translation
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* import { glost } from "glost-processor";
|
|
21
|
+
* import { minimalPreset } from "glost-presets";
|
|
22
|
+
*
|
|
23
|
+
* const processor = glost()
|
|
24
|
+
* .use(minimalPreset);
|
|
25
|
+
*
|
|
26
|
+
* const result = await processor.process(document);
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare const minimalPreset: Preset;
|
|
30
|
+
/**
|
|
31
|
+
* Create a customized minimal preset
|
|
32
|
+
*
|
|
33
|
+
* @param options - Customization options
|
|
34
|
+
* @returns Customized preset
|
|
35
|
+
*/
|
|
36
|
+
export declare function createMinimalPreset(options?: {
|
|
37
|
+
transcriptionScheme?: string;
|
|
38
|
+
translationTarget?: string;
|
|
39
|
+
}): Preset;
|
|
40
|
+
//# sourceMappingURL=minimal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minimal.d.ts","sourceRoot":"","sources":["../src/minimal.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,aAAa,EAAE,MAQ3B,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE;IAC5C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,GAAG,MAAM,CAeT"}
|
package/dist/minimal.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal Preset
|
|
3
|
+
*
|
|
4
|
+
* Just the essentials: transcription and translation.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Minimal Preset
|
|
10
|
+
*
|
|
11
|
+
* Lightweight preset with just transcription and translation.
|
|
12
|
+
*
|
|
13
|
+
* Includes:
|
|
14
|
+
* - Transcription
|
|
15
|
+
* - Translation
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import { glost } from "glost-processor";
|
|
20
|
+
* import { minimalPreset } from "glost-presets";
|
|
21
|
+
*
|
|
22
|
+
* const processor = glost()
|
|
23
|
+
* .use(minimalPreset);
|
|
24
|
+
*
|
|
25
|
+
* const result = await processor.process(document);
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export const minimalPreset = {
|
|
29
|
+
id: "minimal",
|
|
30
|
+
name: "Minimal",
|
|
31
|
+
description: "Just transcription and translation - the essentials",
|
|
32
|
+
plugins: [
|
|
33
|
+
["transcription", { scheme: "auto" }],
|
|
34
|
+
["translation", { target: "en" }],
|
|
35
|
+
],
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Create a customized minimal preset
|
|
39
|
+
*
|
|
40
|
+
* @param options - Customization options
|
|
41
|
+
* @returns Customized preset
|
|
42
|
+
*/
|
|
43
|
+
export function createMinimalPreset(options) {
|
|
44
|
+
const { transcriptionScheme = "auto", translationTarget = "en", } = options || {};
|
|
45
|
+
return {
|
|
46
|
+
id: "minimal-custom",
|
|
47
|
+
name: "Minimal (Custom)",
|
|
48
|
+
description: "Customized minimal preset",
|
|
49
|
+
plugins: [
|
|
50
|
+
["transcription", { scheme: transcriptionScheme }],
|
|
51
|
+
["translation", { target: translationTarget }],
|
|
52
|
+
],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=minimal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minimal.js","sourceRoot":"","sources":["../src/minimal.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAW;IACnC,EAAE,EAAE,SAAS;IACb,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,qDAAqD;IAClE,OAAO,EAAE;QACP,CAAC,eAAe,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QACrC,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;KAClC;CACF,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAGnC;IACC,MAAM,EACJ,mBAAmB,GAAG,MAAM,EAC5B,iBAAiB,GAAG,IAAI,GACzB,GAAG,OAAO,IAAI,EAAE,CAAC;IAElB,OAAO;QACL,EAAE,EAAE,gBAAgB;QACpB,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE,2BAA2B;QACxC,OAAO,EAAE;YACP,CAAC,eAAe,EAAE,EAAE,MAAM,EAAE,mBAAmB,EAAE,CAAC;YAClD,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC;SAC/C;KACF,CAAC;AACJ,CAAC"}
|