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.
Files changed (57) hide show
  1. package/README.md +253 -114
  2. package/dist/index.d.ts +29 -7
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +38 -23
  5. package/dist/index.js.map +1 -1
  6. package/dist/presets.d.ts +7 -0
  7. package/dist/presets.d.ts.map +1 -0
  8. package/dist/presets.js +7 -0
  9. package/dist/presets.js.map +1 -0
  10. package/dist/processor.d.ts +8 -0
  11. package/dist/processor.d.ts.map +1 -0
  12. package/dist/processor.js +7 -0
  13. package/dist/processor.js.map +1 -0
  14. package/dist/registry.d.ts +8 -0
  15. package/dist/registry.d.ts.map +1 -0
  16. package/dist/registry.js +7 -0
  17. package/dist/registry.js.map +1 -0
  18. package/package.json +27 -37
  19. package/src/index.ts +126 -68
  20. package/src/presets.ts +18 -0
  21. package/src/processor.ts +24 -0
  22. package/src/registry.ts +23 -0
  23. package/tsconfig.json +6 -3
  24. package/CHANGELOG.md +0 -151
  25. package/dist/example.d.ts +0 -10
  26. package/dist/example.d.ts.map +0 -1
  27. package/dist/example.js +0 -138
  28. package/dist/example.js.map +0 -1
  29. package/dist/guards.d.ts +0 -103
  30. package/dist/guards.d.ts.map +0 -1
  31. package/dist/guards.js +0 -264
  32. package/dist/guards.js.map +0 -1
  33. package/dist/nodes.d.ts +0 -163
  34. package/dist/nodes.d.ts.map +0 -1
  35. package/dist/nodes.js +0 -186
  36. package/dist/nodes.js.map +0 -1
  37. package/dist/types.d.ts +0 -379
  38. package/dist/types.d.ts.map +0 -1
  39. package/dist/types.js +0 -6
  40. package/dist/types.js.map +0 -1
  41. package/dist/utils.d.ts +0 -203
  42. package/dist/utils.d.ts.map +0 -1
  43. package/dist/utils.js +0 -497
  44. package/dist/utils.js.map +0 -1
  45. package/dist/validators.d.ts +0 -1876
  46. package/dist/validators.d.ts.map +0 -1
  47. package/dist/validators.js +0 -302
  48. package/dist/validators.js.map +0 -1
  49. package/src/__tests__/README.md +0 -20
  50. package/src/__tests__/example.test.ts +0 -43
  51. package/src/__tests__/example.ts +0 -186
  52. package/src/__tests__/mock-data.ts +0 -624
  53. package/src/guards.ts +0 -341
  54. package/src/nodes.ts +0 -327
  55. package/src/types.ts +0 -565
  56. package/src/utils.ts +0 -652
  57. package/src/validators.ts +0 -336
package/README.md CHANGED
@@ -1,176 +1,315 @@
1
- # glost
1
+ # GLOST - Glossed Syntax Tree
2
2
 
3
- Core types and node creation for GLOST (Glossed Syntax Tree).
3
+ [![npm version](https://img.shields.io/npm/v/glost.svg)](https://www.npmjs.com/package/glost)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
5
 
5
- ## What is GLOST?
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
- GLOST (Glossed Syntax Tree) is a Concrete Syntax Tree format that extends nlcst to support language learning annotations:
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
- pnpm add glost
11
+ npm install glost
20
12
  ```
21
13
 
22
- ## Usage
23
-
24
14
  ```typescript
25
- import { createGLOSTWordNode, createGLOSTRootNode } from "glost";
26
- import type { GLOSTWord, GLOSTRoot } from "glost";
27
-
28
- // Create a word node with annotations
29
- // Language codes: ISO-639-1, ISO-639-3, or BCP-47 all work
30
- const word = createGLOSTWordNode({
31
- value: "สวัสดี", // Thai: hello
32
- transcription: {
33
- rtgs: { text: "sà-wàt-dii", system: "rtgs" },
34
- ipa: { text: "sa.wàt.diː", system: "ipa" }
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
- ## API
37
+ ## What's Included
46
38
 
47
- ### Node Factory Functions
39
+ The `glost` package is a convenient meta-package that includes:
48
40
 
49
- All factory functions accept a single options object for better readability and extensibility.
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
- #### `createGLOSTWordNode(options)`
48
+ ### 🚀 Unified-Style Processor
52
49
 
53
- Create a word node with transcription and metadata.
50
+ Fluent API for plugin composition:
54
51
 
55
52
  ```typescript
56
- const word = createGLOSTWordNode({
57
- value: "hello",
58
- transcription: { ipa: { text: "həˈloʊ", system: "ipa" } },
59
- metadata: { partOfSpeech: "interjection" },
60
- lang: "en", // optional
61
- script: "latin", // optional
62
- extras: {} // optional extension data
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
- #### `createGLOSTSentenceNode(options)`
62
+ ### 🔍 Plugin Discovery
67
63
 
68
- Create a sentence node containing word nodes.
64
+ Find and validate plugins:
69
65
 
70
66
  ```typescript
71
- const sentence = createGLOSTSentenceNode({
72
- originalText: "Hello world",
73
- lang: "en",
74
- script: "latin",
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
- #### `createGLOSTRootNode(options)`
73
+ ### 📦 Presets
82
74
 
83
- Create a root document node.
75
+ Quick setup with common configurations:
84
76
 
85
77
  ```typescript
86
- const root = createGLOSTRootNode({
87
- lang: "en",
88
- script: "latin",
89
- children: [paragraphNode], // optional
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
- ### Helper Functions
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
- Convenience functions for common language patterns:
93
+ Built-in support for:
94
+ - Thai (`glost-th`)
95
+ - Japanese (`glost-ja`)
96
+ - Korean (`glost-ko`)
97
+ - English (`glost-en`)
98
98
 
99
- #### `createSimpleWord(options)`
99
+ ### 🔧 Extensible
100
+
101
+ Create custom plugins or use community plugins:
100
102
 
101
103
  ```typescript
102
- const word = createSimpleWord({
103
- text: "hello",
104
- transliteration: "həˈloʊ",
105
- system: "ipa", // default: "ipa"
106
- partOfSpeech: "noun" // default: "unknown"
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
- ### Language-Specific Helpers
116
+ ## Package Structure
111
117
 
112
- **Note:** As of v0.2.0, language-specific helpers have been moved to separate packages.
118
+ GLOST is organized as a monorepo:
113
119
 
114
- #### Thai Language Support
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-th
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 { createThaiWord } from 'glost-th';
122
-
123
- const word = createThaiWord({
124
- text: "สวัสดี",
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
- See [glost-th documentation](../languages/th/README.md).
166
+ ### With Processor
133
167
 
134
- #### Japanese Language Support
168
+ ```typescript
169
+ import { glost } from "glost";
135
170
 
136
- ```bash
137
- npm install glost-ja
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 { createJapaneseWord } from 'glost-ja';
202
+ import { pluginRegistry } from "glost";
142
203
 
143
- const word = createJapaneseWord({
144
- text: "こんにちは",
145
- romaji: "konnichiwa",
146
- partOfSpeech: "interjection",
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
- See [glost-ja documentation](../languages/ja/README.md).
223
+ ## CLI Tools
152
224
 
153
- **Migration:** See [MIGRATION.md](../../MIGRATION.md) for upgrading from v0.1.x.
225
+ Install CLI tools globally:
154
226
 
155
- ## Features
227
+ ```bash
228
+ npm install -g glost-cli
229
+ ```
156
230
 
157
- - TypeScript support
158
- - Extends nlcst (Natural Language Concrete Syntax Tree)
159
- - Aims for compatibility with unist ecosystem
160
- - Framework-agnostic
161
- - Includes Zod validation schemas
231
+ ```bash
232
+ # List plugins
233
+ glost plugins list
162
234
 
163
- ## Related Packages
235
+ # Search
236
+ glost plugins search transcription
164
237
 
165
- ### Core Packages
166
- - `glost-common` - Shared utilities and language configs
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
- ### Language Packages
171
- - `glost-th` - Thai language support
172
- - `glost-ja` - Japanese language support
241
+ # Validate
242
+ glost plugins validate transcription translation frequency
243
+ ```
173
244
 
174
245
  ## Documentation
175
246
 
176
- See the main GLOST repository for full documentation.
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
- export * from "./types";
2
- export * from "./nodes";
3
- export * from "./utils";
4
- export * from "./validators";
5
- export * from "./guards";
6
- export type { ParagraphLike } from "./utils";
7
- export { getAllWords, getAllSentences, getAllParagraphs, getAllClauses, getAllPhrases, getAllSyllables, getAllCharacters, getWordsFromDocument, getFirstSentence, getWordsFromSentence, getWordsFromParagraph, findNodesByType, findWordsByLanguage, findWordsByTranscriptionSystem, isGLOSTWord, isGLOSTSentence, isGLOSTParagraph, isGLOSTRoot, isGLOSTClause, isGLOSTPhrase, isGLOSTSyllable, isGLOSTCharacter, getWordText, getWordTranscription, hasWordTranscription, getWordTranslation, getWordMeaning, getWordPartOfSpeech, getWordDifficulty, getSentenceTranslation, getGLOSTWordCount, adaptParagraphLikeToGLOST, parseLanguageTag, getBaseLanguage, areLanguagesCompatible, findBestLanguageMatch, getLanguageFallback, normalizeLanguageTag, isValidLanguageTag, } from "./utils";
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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AAIzB,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C,OAAO,EAEL,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EAGrB,eAAe,EACf,mBAAmB,EACnB,8BAA8B,EAG9B,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,aAAa,EACb,eAAe,EACf,gBAAgB,EAGhB,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EAGjB,sBAAsB,EAGtB,iBAAiB,EACjB,yBAAyB,EAGzB,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,SAAS,CAAC"}
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
- // GLOST - Glossed Syntax Tree
2
- // Extends nlcst for language learning with annotations
3
- export * from "./types";
4
- export * from "./nodes";
5
- export * from "./utils";
6
- export * from "./validators";
7
- export * from "./guards";
8
- // Re-export key utilities for transcription components
9
- export {
10
- // Tree traversal
11
- getAllWords, getAllSentences, getAllParagraphs, getAllClauses, getAllPhrases, getAllSyllables, getAllCharacters, getWordsFromDocument, getFirstSentence, getWordsFromSentence, getWordsFromParagraph,
12
- // Node finding
13
- findNodesByType, findWordsByLanguage, findWordsByTranscriptionSystem,
14
- // Type guards (most are now exported via guards.ts)
15
- isGLOSTWord, isGLOSTSentence, isGLOSTParagraph, isGLOSTRoot, isGLOSTClause, isGLOSTPhrase, isGLOSTSyllable, isGLOSTCharacter,
16
- // Word utilities
17
- getWordText, getWordTranscription, hasWordTranscription, getWordTranslation, getWordMeaning, getWordPartOfSpeech, getWordDifficulty,
18
- // Sentence utilities
19
- getSentenceTranslation,
20
- // Content statistics utilities
21
- getGLOSTWordCount, adaptParagraphLikeToGLOST,
22
- // BCP-47 Language utilities
23
- parseLanguageTag, getBaseLanguage, areLanguagesCompatible, findBestLanguageMatch, getLanguageFallback, normalizeLanguageTag, isValidLanguageTag, } from "./utils";
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,8BAA8B;AAC9B,uDAAuD;AAEvD,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AAMzB,uDAAuD;AACvD,OAAO;AACL,iBAAiB;AACjB,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB;AAErB,eAAe;AACf,eAAe,EACf,mBAAmB,EACnB,8BAA8B;AAE9B,oDAAoD;AACpD,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,aAAa,EACb,eAAe,EACf,gBAAgB;AAEhB,iBAAiB;AACjB,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,iBAAiB;AAEjB,qBAAqB;AACrB,sBAAsB;AAEtB,+BAA+B;AAC/B,iBAAiB,EACjB,yBAAyB;AAEzB,4BAA4B;AAC5B,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,SAAS,CAAC"}
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"}
@@ -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,7 @@
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
+ //# sourceMappingURL=processor.js.map
@@ -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"}
@@ -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"}