glost 0.3.0 → 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/README.md +253 -114
- package/dist/index.d.ts +29 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +38 -23
- package/dist/index.js.map +1 -1
- package/dist/presets.d.ts +7 -0
- package/dist/presets.d.ts.map +1 -0
- package/dist/presets.js +7 -0
- package/dist/presets.js.map +1 -0
- package/dist/processor.d.ts +8 -0
- package/dist/processor.d.ts.map +1 -0
- package/dist/processor.js +7 -0
- package/dist/processor.js.map +1 -0
- package/dist/registry.d.ts +8 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +7 -0
- package/dist/registry.js.map +1 -0
- package/package.json +27 -37
- package/src/index.ts +126 -68
- package/src/presets.ts +18 -0
- package/src/processor.ts +24 -0
- package/src/registry.ts +23 -0
- package/tsconfig.json +6 -3
- package/CHANGELOG.md +0 -151
- package/dist/example.d.ts +0 -10
- package/dist/example.d.ts.map +0 -1
- package/dist/example.js +0 -138
- package/dist/example.js.map +0 -1
- package/dist/guards.d.ts +0 -103
- package/dist/guards.d.ts.map +0 -1
- package/dist/guards.js +0 -264
- package/dist/guards.js.map +0 -1
- package/dist/nodes.d.ts +0 -163
- package/dist/nodes.d.ts.map +0 -1
- package/dist/nodes.js +0 -186
- package/dist/nodes.js.map +0 -1
- package/dist/types.d.ts +0 -379
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -6
- package/dist/types.js.map +0 -1
- package/dist/utils.d.ts +0 -203
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -497
- package/dist/utils.js.map +0 -1
- package/dist/validators.d.ts +0 -1876
- package/dist/validators.d.ts.map +0 -1
- package/dist/validators.js +0 -302
- package/dist/validators.js.map +0 -1
- package/src/__tests__/README.md +0 -20
- package/src/__tests__/example.test.ts +0 -43
- package/src/__tests__/example.ts +0 -186
- package/src/__tests__/mock-data.ts +0 -624
- package/src/guards.ts +0 -341
- package/src/nodes.ts +0 -327
- package/src/types.ts +0 -565
- package/src/utils.ts +0 -652
- package/src/validators.ts +0 -336
package/README.md
CHANGED
|
@@ -1,176 +1,315 @@
|
|
|
1
|
-
#
|
|
1
|
+
# GLOST - Glossed Syntax Tree
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/glost)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
**GLOST** (Glossed Syntax Tree) is a powerful framework for processing multilingual text with language learning annotations using a unified/remark-style plugin system.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- **Translations and glosses** in multiple languages
|
|
10
|
-
- **Difficulty levels** and word frequency data
|
|
11
|
-
- **Pronunciation guides** (IPA, romanization, transcription systems)
|
|
12
|
-
- **Cultural context** and usage notes
|
|
13
|
-
- **Part-of-speech** tagging
|
|
14
|
-
- **Grammar metadata** for language learners
|
|
15
|
-
|
|
16
|
-
## Installation
|
|
8
|
+
## Quick Start
|
|
17
9
|
|
|
18
10
|
```bash
|
|
19
|
-
|
|
11
|
+
npm install glost
|
|
20
12
|
```
|
|
21
13
|
|
|
22
|
-
## Usage
|
|
23
|
-
|
|
24
14
|
```typescript
|
|
25
|
-
import {
|
|
26
|
-
import
|
|
27
|
-
|
|
28
|
-
// Create a
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
metadata: {
|
|
37
|
-
partOfSpeech: "interjection",
|
|
38
|
-
usage: "greeting"
|
|
39
|
-
},
|
|
40
|
-
lang: "th", // Can also use "tha" (ISO-639-3) or "th-TH" (BCP-47)
|
|
41
|
-
script: "thai"
|
|
15
|
+
import { glost, createSimpleDocument, getAllWords } from "glost";
|
|
16
|
+
import { languageLearningPreset } from "glost/presets";
|
|
17
|
+
|
|
18
|
+
// Create a document
|
|
19
|
+
const words = [
|
|
20
|
+
{ type: "WordNode", value: "สวัสดี" },
|
|
21
|
+
{ type: "WordNode", value: "ครับ" }
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
const document = createSimpleDocument(words, "th", "thai", {
|
|
25
|
+
sentenceText: "สวัสดีครับ"
|
|
42
26
|
});
|
|
27
|
+
|
|
28
|
+
// Process with plugins
|
|
29
|
+
const result = await glost()
|
|
30
|
+
.use(languageLearningPreset)
|
|
31
|
+
.process(document);
|
|
32
|
+
|
|
33
|
+
// Access processed data
|
|
34
|
+
const allWords = getAllWords(result);
|
|
43
35
|
```
|
|
44
36
|
|
|
45
|
-
##
|
|
37
|
+
## What's Included
|
|
46
38
|
|
|
47
|
-
|
|
39
|
+
The `glost` package is a convenient meta-package that includes:
|
|
48
40
|
|
|
49
|
-
|
|
41
|
+
- **glost-core** - Core types, nodes, and utilities
|
|
42
|
+
- **glost-processor** - Unified-style processor with fluent API
|
|
43
|
+
- **glost-registry** - Plugin discovery and validation
|
|
44
|
+
- **glost-presets** - Pre-configured plugin combinations
|
|
45
|
+
|
|
46
|
+
## Features
|
|
50
47
|
|
|
51
|
-
|
|
48
|
+
### 🚀 Unified-Style Processor
|
|
52
49
|
|
|
53
|
-
|
|
50
|
+
Fluent API for plugin composition:
|
|
54
51
|
|
|
55
52
|
```typescript
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
});
|
|
53
|
+
const processor = glost()
|
|
54
|
+
.use(transcription, { scheme: "ipa" })
|
|
55
|
+
.use(translation, { target: "en" })
|
|
56
|
+
.use(frequency)
|
|
57
|
+
.freeze();
|
|
58
|
+
|
|
59
|
+
const result = await processor.process(document);
|
|
64
60
|
```
|
|
65
61
|
|
|
66
|
-
|
|
62
|
+
### 🔍 Plugin Discovery
|
|
67
63
|
|
|
68
|
-
|
|
64
|
+
Find and validate plugins:
|
|
69
65
|
|
|
70
66
|
```typescript
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
children: [wordNode1, wordNode2], // optional
|
|
76
|
-
transcription: {}, // optional
|
|
77
|
-
extras: {} // optional
|
|
78
|
-
});
|
|
67
|
+
import { pluginRegistry } from "glost";
|
|
68
|
+
|
|
69
|
+
const plugins = pluginRegistry.search({ language: "th" });
|
|
70
|
+
const report = pluginRegistry.checkConflicts(["plugin1", "plugin2"]);
|
|
79
71
|
```
|
|
80
72
|
|
|
81
|
-
|
|
73
|
+
### 📦 Presets
|
|
82
74
|
|
|
83
|
-
|
|
75
|
+
Quick setup with common configurations:
|
|
84
76
|
|
|
85
77
|
```typescript
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
metadata: { title: "My Document" }, // optional
|
|
91
|
-
extras: {} // optional
|
|
92
|
-
});
|
|
78
|
+
import { languageLearningPreset } from "glost/presets";
|
|
79
|
+
|
|
80
|
+
const processor = glost()
|
|
81
|
+
.use(languageLearningPreset);
|
|
93
82
|
```
|
|
94
83
|
|
|
95
|
-
|
|
84
|
+
Available presets:
|
|
85
|
+
- `languageLearningPreset` - Full language learning stack
|
|
86
|
+
- `readingAppPreset` - Interactive reading features
|
|
87
|
+
- `vocabularyBuilderPreset` - Word frequency and difficulty
|
|
88
|
+
- `grammarAnalyzerPreset` - POS and clause analysis
|
|
89
|
+
- `minimalPreset` - Just the essentials
|
|
90
|
+
|
|
91
|
+
### 🎯 Multi-Language Support
|
|
96
92
|
|
|
97
|
-
|
|
93
|
+
Built-in support for:
|
|
94
|
+
- Thai (`glost-th`)
|
|
95
|
+
- Japanese (`glost-ja`)
|
|
96
|
+
- Korean (`glost-ko`)
|
|
97
|
+
- English (`glost-en`)
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
### 🔧 Extensible
|
|
100
|
+
|
|
101
|
+
Create custom plugins or use community plugins:
|
|
100
102
|
|
|
101
103
|
```typescript
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
const myPlugin = {
|
|
105
|
+
id: "my-plugin",
|
|
106
|
+
name: "My Custom Plugin",
|
|
107
|
+
transform: (tree) => {
|
|
108
|
+
// Your custom logic
|
|
109
|
+
return tree;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
processor.use(myPlugin);
|
|
108
114
|
```
|
|
109
115
|
|
|
110
|
-
|
|
116
|
+
## Package Structure
|
|
111
117
|
|
|
112
|
-
|
|
118
|
+
GLOST is organized as a monorepo:
|
|
113
119
|
|
|
114
|
-
|
|
120
|
+
```
|
|
121
|
+
glost/
|
|
122
|
+
├── glost # Main package (this one)
|
|
123
|
+
├── glost-core # Core types and nodes
|
|
124
|
+
├── glost-processor # Processor API
|
|
125
|
+
├── glost-registry # Plugin registry
|
|
126
|
+
├── glost-presets # Preset configurations
|
|
127
|
+
├── glost-common # Language utilities
|
|
128
|
+
├── glost-extensions # Extension system
|
|
129
|
+
├── glost-th # Thai language support
|
|
130
|
+
├── glost-ja # Japanese language support
|
|
131
|
+
└── glost-cli # CLI tools
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Installation Options
|
|
135
|
+
|
|
136
|
+
### All-in-One (Recommended)
|
|
115
137
|
|
|
116
138
|
```bash
|
|
117
|
-
npm install glost
|
|
139
|
+
npm install glost
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Granular Installation
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# Just the core
|
|
146
|
+
npm install glost-core
|
|
147
|
+
|
|
148
|
+
# Core + processor
|
|
149
|
+
npm install glost-core glost-processor
|
|
150
|
+
|
|
151
|
+
# Core + specific language
|
|
152
|
+
npm install glost-core glost-th
|
|
118
153
|
```
|
|
119
154
|
|
|
155
|
+
## Usage Examples
|
|
156
|
+
|
|
157
|
+
### Basic Document Creation
|
|
158
|
+
|
|
120
159
|
```typescript
|
|
121
|
-
import {
|
|
122
|
-
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
rtgs: "sawatdi",
|
|
126
|
-
partOfSpeech: "interjection",
|
|
127
|
-
tone: 2,
|
|
128
|
-
syllables: ["sa", "wat", "di"]
|
|
129
|
-
});
|
|
160
|
+
import { createSimpleDocument, getAllWords } from "glost";
|
|
161
|
+
|
|
162
|
+
const document = createSimpleDocument(words, "th", "thai");
|
|
163
|
+
const allWords = getAllWords(document);
|
|
130
164
|
```
|
|
131
165
|
|
|
132
|
-
|
|
166
|
+
### With Processor
|
|
133
167
|
|
|
134
|
-
|
|
168
|
+
```typescript
|
|
169
|
+
import { glost } from "glost";
|
|
135
170
|
|
|
136
|
-
|
|
137
|
-
|
|
171
|
+
const processor = glost()
|
|
172
|
+
.use("transcription")
|
|
173
|
+
.use("translation")
|
|
174
|
+
.use("frequency");
|
|
175
|
+
|
|
176
|
+
const result = await processor.process(document);
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### With Hooks
|
|
180
|
+
|
|
181
|
+
```typescript
|
|
182
|
+
import { glost } from "glost";
|
|
183
|
+
|
|
184
|
+
const processor = glost()
|
|
185
|
+
.use("transcription")
|
|
186
|
+
.before("transcription", (doc) => {
|
|
187
|
+
console.log("Starting transcription");
|
|
188
|
+
})
|
|
189
|
+
.after("transcription", (doc) => {
|
|
190
|
+
console.log("Transcription complete");
|
|
191
|
+
})
|
|
192
|
+
.onProgress((stats) => {
|
|
193
|
+
console.log(`Progress: ${stats.completed}/${stats.total}`);
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
await processor.process(document);
|
|
138
197
|
```
|
|
139
198
|
|
|
199
|
+
### With Registry
|
|
200
|
+
|
|
140
201
|
```typescript
|
|
141
|
-
import {
|
|
202
|
+
import { pluginRegistry } from "glost";
|
|
142
203
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
furigana: "こんにちは"
|
|
204
|
+
// Search for plugins
|
|
205
|
+
const thaiPlugins = pluginRegistry.search({
|
|
206
|
+
language: "th",
|
|
207
|
+
category: "enhancer"
|
|
148
208
|
});
|
|
209
|
+
|
|
210
|
+
// Validate combinations
|
|
211
|
+
const report = pluginRegistry.checkConflicts([
|
|
212
|
+
"transcription",
|
|
213
|
+
"translation",
|
|
214
|
+
"frequency"
|
|
215
|
+
]);
|
|
216
|
+
|
|
217
|
+
if (!report.hasConflicts) {
|
|
218
|
+
// Safe to use together
|
|
219
|
+
processor.use("transcription").use("translation").use("frequency");
|
|
220
|
+
}
|
|
149
221
|
```
|
|
150
222
|
|
|
151
|
-
|
|
223
|
+
## CLI Tools
|
|
152
224
|
|
|
153
|
-
|
|
225
|
+
Install CLI tools globally:
|
|
154
226
|
|
|
155
|
-
|
|
227
|
+
```bash
|
|
228
|
+
npm install -g glost-cli
|
|
229
|
+
```
|
|
156
230
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
- Framework-agnostic
|
|
161
|
-
- Includes Zod validation schemas
|
|
231
|
+
```bash
|
|
232
|
+
# List plugins
|
|
233
|
+
glost plugins list
|
|
162
234
|
|
|
163
|
-
|
|
235
|
+
# Search
|
|
236
|
+
glost plugins search transcription
|
|
164
237
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
- `glost-extensions` - Extension system for transforming GLOST trees
|
|
168
|
-
- `glost-utils` - Utilities for working with GLOST documents
|
|
238
|
+
# Show info
|
|
239
|
+
glost plugins info transcription
|
|
169
240
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
241
|
+
# Validate
|
|
242
|
+
glost plugins validate transcription translation frequency
|
|
243
|
+
```
|
|
173
244
|
|
|
174
245
|
## Documentation
|
|
175
246
|
|
|
176
|
-
|
|
247
|
+
- **[Getting Started](./docs/getting-started.md)** - Installation and first steps
|
|
248
|
+
- **[Processor API](./docs/guides/processor-api.md)** - Complete processor guide
|
|
249
|
+
- **[Registry](./docs/guides/registry.md)** - Plugin discovery and validation
|
|
250
|
+
- **[Migration Guide](./MIGRATION_v0.4_to_v1.0.md)** - Upgrading from v0.4
|
|
251
|
+
- **[API Reference](./docs/api.md)** - Complete API documentation
|
|
252
|
+
|
|
253
|
+
## Examples
|
|
254
|
+
|
|
255
|
+
See the [examples](./examples/) directory for complete examples:
|
|
256
|
+
|
|
257
|
+
- Language learning app
|
|
258
|
+
- Large document processing
|
|
259
|
+
- Custom plugin development
|
|
260
|
+
- Multi-language support
|
|
261
|
+
|
|
262
|
+
## Use Cases
|
|
263
|
+
|
|
264
|
+
GLOST is used for:
|
|
265
|
+
|
|
266
|
+
- **Language Learning Apps** - Interactive reading with annotations
|
|
267
|
+
- **Dictionary Systems** - Multiple transcription schemes
|
|
268
|
+
- **Graded Readers** - Content adapted to learner level
|
|
269
|
+
- **Educational Tools** - Vocabulary and grammar practice
|
|
270
|
+
- **Text Analysis** - Linguistic annotation and processing
|
|
271
|
+
|
|
272
|
+
## Comparison with v0.4
|
|
273
|
+
|
|
274
|
+
### Before (v0.4)
|
|
275
|
+
|
|
276
|
+
```typescript
|
|
277
|
+
import { processGLOSTWithExtensions } from "glost-extensions";
|
|
278
|
+
|
|
279
|
+
const result = processGLOSTWithExtensions(doc, [ext1, ext2, ext3]);
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### After (v1.0)
|
|
283
|
+
|
|
284
|
+
```typescript
|
|
285
|
+
import { glost } from "glost";
|
|
286
|
+
|
|
287
|
+
const result = await glost()
|
|
288
|
+
.use(ext1)
|
|
289
|
+
.use(ext2)
|
|
290
|
+
.use(ext3)
|
|
291
|
+
.process(doc);
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
See the [Migration Guide](./MIGRATION_v0.4_to_v1.0.md) for details.
|
|
295
|
+
|
|
296
|
+
## Contributing
|
|
297
|
+
|
|
298
|
+
Contributions are welcome! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
|
|
299
|
+
|
|
300
|
+
## License
|
|
301
|
+
|
|
302
|
+
MIT © fustilio
|
|
303
|
+
|
|
304
|
+
## Related Projects
|
|
305
|
+
|
|
306
|
+
- [nlcst](https://github.com/syntax-tree/nlcst) - Natural Language Concrete Syntax Tree
|
|
307
|
+
- [unist](https://github.com/syntax-tree/unist) - Universal Syntax Tree
|
|
308
|
+
- [unified](https://unifiedjs.com/) - Interface for parsing, inspecting, transforming, and serializing content
|
|
309
|
+
|
|
310
|
+
## Links
|
|
311
|
+
|
|
312
|
+
- [GitHub Repository](https://github.com/fustilio/glost)
|
|
313
|
+
- [Documentation](https://github.com/fustilio/glost/tree/main/docs)
|
|
314
|
+
- [npm Package](https://www.npmjs.com/package/glost)
|
|
315
|
+
- [Changelog](./CHANGELOG.md)
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
/**
|
|
2
|
+
* GLOST - Glossed Syntax Tree
|
|
3
|
+
*
|
|
4
|
+
* Main package that re-exports all GLOST functionality.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* // Import everything from one place
|
|
11
|
+
* import { glost, createSimpleDocument, getAllWords } from "glost";
|
|
12
|
+
* import { languageLearningPreset } from "glost/presets";
|
|
13
|
+
*
|
|
14
|
+
* // Create a document
|
|
15
|
+
* const document = createSimpleDocument(words, "th", "thai");
|
|
16
|
+
*
|
|
17
|
+
* // Process with plugins
|
|
18
|
+
* const result = await glost()
|
|
19
|
+
* .use(languageLearningPreset)
|
|
20
|
+
* .process(document);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export type { GLOSTNode, GLOSTRoot, GLOSTParagraph, GLOSTSentence, GLOSTWord, GLOSTText, GLOSTWhiteSpace, GLOSTPunctuation, GLOSTSymbol, GLOSTSource, GLOSTClause, GLOSTPhrase, GLOSTSyllable, GLOSTCharacter, GLOSTExtras, TransliterationData, LinguisticMetadata, LanguageCode, ScriptSystem, } from "glost-core";
|
|
24
|
+
export { createGLOSTRootNode, createGLOSTParagraphNode, createGLOSTSentenceNode, createGLOSTWordNode, createGLOSTTextNode, createGLOSTWhiteSpaceNode, createGLOSTPunctuationNode, createGLOSTSymbolNode, createSimpleDocument, createDocumentFromSentences, createDocumentFromParagraphs, createSentenceFromWords, createParagraphFromSentences, createSimpleWord, NODE_TYPES, } from "glost-core";
|
|
25
|
+
export { getAllWords, getAllSentences, getAllParagraphs, getAllClauses, getFirstSentence, getWordsFromSentence, getWordsFromParagraph, findWordsByLanguage, isGLOSTWord, isGLOSTSentence, isGLOSTParagraph, isGLOSTRoot, getWordText, getWordTranscription, getWordTranslation, getSentenceTranslation, getGLOSTWordCount, } from "glost-core";
|
|
26
|
+
export { glost, GLOSTProcessor } from "glost-processor";
|
|
27
|
+
export type { FrozenProcessor, Plugin, PluginSpec, Preset, ProcessorOptions, ProcessingResult, ProcessingError, ProcessingWarning, ProcessingStats, BeforeHook, AfterHook, ErrorHook, SkipHook, ProgressHook, ProgressStats, } from "glost-processor";
|
|
28
|
+
export { pluginRegistry, PluginRegistry } from "glost-registry";
|
|
29
|
+
export type { PluginMetadata, PluginCategory, PluginCapabilities, PluginQuery, ConflictReport, ValidationResult, } from "glost-registry";
|
|
8
30
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,YAAY,EACV,SAAS,EACT,SAAS,EACT,cAAc,EACd,aAAa,EACb,SAAS,EACT,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,WAAW,EACX,WAAW,EACX,aAAa,EACb,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,YAAY,GACb,MAAM,YAAY,CAAC;AAKpB,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,0BAA0B,EAC1B,qBAAqB,EACrB,oBAAoB,EACpB,2BAA2B,EAC3B,4BAA4B,EAC5B,uBAAuB,EACvB,4BAA4B,EAC5B,gBAAgB,EAChB,UAAU,GACX,MAAM,YAAY,CAAC;AAKpB,OAAO,EACL,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAKpB,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACxD,YAAY,EACV,eAAe,EACf,MAAM,EACN,UAAU,EACV,MAAM,EACN,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,SAAS,EACT,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,aAAa,GACd,MAAM,iBAAiB,CAAC;AAKzB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChE,YAAY,EACV,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,gBAAgB,GACjB,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,24 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
/**
|
|
2
|
+
* GLOST - Glossed Syntax Tree
|
|
3
|
+
*
|
|
4
|
+
* Main package that re-exports all GLOST functionality.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* // Import everything from one place
|
|
11
|
+
* import { glost, createSimpleDocument, getAllWords } from "glost";
|
|
12
|
+
* import { languageLearningPreset } from "glost/presets";
|
|
13
|
+
*
|
|
14
|
+
* // Create a document
|
|
15
|
+
* const document = createSimpleDocument(words, "th", "thai");
|
|
16
|
+
*
|
|
17
|
+
* // Process with plugins
|
|
18
|
+
* const result = await glost()
|
|
19
|
+
* .use(languageLearningPreset)
|
|
20
|
+
* .process(document);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
// ============================================================================
|
|
24
|
+
// Node Factories
|
|
25
|
+
// ============================================================================
|
|
26
|
+
export { createGLOSTRootNode, createGLOSTParagraphNode, createGLOSTSentenceNode, createGLOSTWordNode, createGLOSTTextNode, createGLOSTWhiteSpaceNode, createGLOSTPunctuationNode, createGLOSTSymbolNode, createSimpleDocument, createDocumentFromSentences, createDocumentFromParagraphs, createSentenceFromWords, createParagraphFromSentences, createSimpleWord, NODE_TYPES, } from "glost-core";
|
|
27
|
+
// ============================================================================
|
|
28
|
+
// Tree Utilities
|
|
29
|
+
// ============================================================================
|
|
30
|
+
export { getAllWords, getAllSentences, getAllParagraphs, getAllClauses, getFirstSentence, getWordsFromSentence, getWordsFromParagraph, findWordsByLanguage, isGLOSTWord, isGLOSTSentence, isGLOSTParagraph, isGLOSTRoot, getWordText, getWordTranscription, getWordTranslation, getSentenceTranslation, getGLOSTWordCount, } from "glost-core";
|
|
31
|
+
// ============================================================================
|
|
32
|
+
// Processor API
|
|
33
|
+
// ============================================================================
|
|
34
|
+
export { glost, GLOSTProcessor } from "glost-processor";
|
|
35
|
+
// ============================================================================
|
|
36
|
+
// Plugin Registry
|
|
37
|
+
// ============================================================================
|
|
38
|
+
export { pluginRegistry, PluginRegistry } from "glost-registry";
|
|
24
39
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AA2BH,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAC/E,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,0BAA0B,EAC1B,qBAAqB,EACrB,oBAAoB,EACpB,2BAA2B,EAC3B,4BAA4B,EAC5B,uBAAuB,EACvB,4BAA4B,EAC5B,gBAAgB,EAChB,UAAU,GACX,MAAM,YAAY,CAAC;AAEpB,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAC/E,OAAO,EACL,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAEpB,+EAA+E;AAC/E,gBAAgB;AAChB,+EAA+E;AAC/E,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAmBxD,+EAA+E;AAC/E,kBAAkB;AAClB,+EAA+E;AAC/E,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Presets exports
|
|
3
|
+
*
|
|
4
|
+
* Re-exports preset configurations for convenient access via glost/presets.
|
|
5
|
+
*/
|
|
6
|
+
export { languageLearningPreset, createLanguageLearningPreset, readingAppPreset, createReadingAppPreset, vocabularyBuilderPreset, createVocabularyBuilderPreset, grammarAnalyzerPreset, createGrammarAnalyzerPreset, minimalPreset, createMinimalPreset, } from "glost-presets";
|
|
7
|
+
//# sourceMappingURL=presets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../src/presets.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,6BAA6B,EAC7B,qBAAqB,EACrB,2BAA2B,EAC3B,aAAa,EACb,mBAAmB,GACpB,MAAM,eAAe,CAAC"}
|
package/dist/presets.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Presets exports
|
|
3
|
+
*
|
|
4
|
+
* Re-exports preset configurations for convenient access via glost/presets.
|
|
5
|
+
*/
|
|
6
|
+
export { languageLearningPreset, createLanguageLearningPreset, readingAppPreset, createReadingAppPreset, vocabularyBuilderPreset, createVocabularyBuilderPreset, grammarAnalyzerPreset, createGrammarAnalyzerPreset, minimalPreset, createMinimalPreset, } from "glost-presets";
|
|
7
|
+
//# sourceMappingURL=presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.js","sourceRoot":"","sources":["../src/presets.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,6BAA6B,EAC7B,qBAAqB,EACrB,2BAA2B,EAC3B,aAAa,EACb,mBAAmB,GACpB,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Processor exports
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the processor API for convenient access via glost/processor.
|
|
5
|
+
*/
|
|
6
|
+
export { glost, GLOSTProcessor } from "glost-processor";
|
|
7
|
+
export type { FrozenProcessor, Plugin, PluginSpec, Preset, ProcessorOptions, ProcessingResult, ProcessingError, ProcessingWarning, ProcessingStats, BeforeHook, AfterHook, ErrorHook, SkipHook, ProgressHook, ProgressStats, } from "glost-processor";
|
|
8
|
+
//# sourceMappingURL=processor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processor.d.ts","sourceRoot":"","sources":["../src/processor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACxD,YAAY,EACV,eAAe,EACf,MAAM,EACN,UAAU,EACV,MAAM,EACN,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,SAAS,EACT,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,aAAa,GACd,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processor.js","sourceRoot":"","sources":["../src/processor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registry exports
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the registry API for convenient access via glost/registry.
|
|
5
|
+
*/
|
|
6
|
+
export { pluginRegistry, PluginRegistry, PluginFilter, PluginSorter, PluginDiscovery, PluginValidator } from "glost-registry";
|
|
7
|
+
export type { PluginMetadata, PluginCategory, PluginCapabilities, PluginRequirements, PluginOptionsSchema, PropertySchema, PluginExample, PluginQuery, ConflictReport, PluginConflict, ValidationResult, ValidationError, ValidationWarning, RegistryStatistics, } from "glost-registry";
|
|
8
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC9H,YAAY,EACV,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,WAAW,EACX,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC"}
|
package/dist/registry.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registry exports
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the registry API for convenient access via glost/registry.
|
|
5
|
+
*/
|
|
6
|
+
export { pluginRegistry, PluginRegistry, PluginFilter, PluginSorter, PluginDiscovery, PluginValidator } from "glost-registry";
|
|
7
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
|