@sharpee/if-domain 0.9.60-beta
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 +71 -0
- package/dist/changes.d.ts +8 -0
- package/dist/changes.d.ts.map +1 -0
- package/dist/changes.js +6 -0
- package/dist/changes.js.map +1 -0
- package/dist/contracts.d.ts +270 -0
- package/dist/contracts.d.ts.map +1 -0
- package/dist/contracts.js +6 -0
- package/dist/contracts.js.map +1 -0
- package/dist/events.d.ts +124 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +123 -0
- package/dist/events.js.map +1 -0
- package/dist/grammar/grammar-builder.d.ts +507 -0
- package/dist/grammar/grammar-builder.d.ts.map +1 -0
- package/dist/grammar/grammar-builder.js +47 -0
- package/dist/grammar/grammar-builder.js.map +1 -0
- package/dist/grammar/grammar-engine.d.ts +65 -0
- package/dist/grammar/grammar-engine.d.ts.map +1 -0
- package/dist/grammar/grammar-engine.js +370 -0
- package/dist/grammar/grammar-engine.js.map +1 -0
- package/dist/grammar/index.d.ts +10 -0
- package/dist/grammar/index.d.ts.map +1 -0
- package/dist/grammar/index.js +26 -0
- package/dist/grammar/index.js.map +1 -0
- package/dist/grammar/pattern-compiler.d.ts +38 -0
- package/dist/grammar/pattern-compiler.d.ts.map +1 -0
- package/dist/grammar/pattern-compiler.js +22 -0
- package/dist/grammar/pattern-compiler.js.map +1 -0
- package/dist/grammar/scope-builder.d.ts +26 -0
- package/dist/grammar/scope-builder.d.ts.map +1 -0
- package/dist/grammar/scope-builder.js +67 -0
- package/dist/grammar/scope-builder.js.map +1 -0
- package/dist/grammar/vocabulary-provider.d.ts +163 -0
- package/dist/grammar/vocabulary-provider.d.ts.map +1 -0
- package/dist/grammar/vocabulary-provider.js +89 -0
- package/dist/grammar/vocabulary-provider.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/dist/language-provider.d.ts +106 -0
- package/dist/language-provider.d.ts.map +1 -0
- package/dist/language-provider.js +14 -0
- package/dist/language-provider.js.map +1 -0
- package/dist/parser-contracts/index.d.ts +10 -0
- package/dist/parser-contracts/index.d.ts.map +1 -0
- package/dist/parser-contracts/index.js +26 -0
- package/dist/parser-contracts/index.js.map +1 -0
- package/dist/parser-contracts/parser-factory.d.ts +46 -0
- package/dist/parser-contracts/parser-factory.d.ts.map +1 -0
- package/dist/parser-contracts/parser-factory.js +78 -0
- package/dist/parser-contracts/parser-factory.js.map +1 -0
- package/dist/parser-contracts/parser-internals.d.ts +125 -0
- package/dist/parser-contracts/parser-internals.d.ts.map +1 -0
- package/dist/parser-contracts/parser-internals.js +26 -0
- package/dist/parser-contracts/parser-internals.js.map +1 -0
- package/dist/parser-contracts/parser-types.d.ts +128 -0
- package/dist/parser-contracts/parser-types.d.ts.map +1 -0
- package/dist/parser-contracts/parser-types.js +9 -0
- package/dist/parser-contracts/parser-types.js.map +1 -0
- package/dist/parser-language-provider.d.ts +158 -0
- package/dist/parser-language-provider.d.ts.map +1 -0
- package/dist/parser-language-provider.js +10 -0
- package/dist/parser-language-provider.js.map +1 -0
- package/dist/sequencing.d.ts +53 -0
- package/dist/sequencing.d.ts.map +1 -0
- package/dist/sequencing.js +6 -0
- package/dist/sequencing.js.map +1 -0
- package/dist/vocabulary-contracts/index.d.ts +7 -0
- package/dist/vocabulary-contracts/index.d.ts.map +1 -0
- package/dist/vocabulary-contracts/index.js +23 -0
- package/dist/vocabulary-contracts/index.js.map +1 -0
- package/dist/vocabulary-contracts/vocabulary-adapters.d.ts +19 -0
- package/dist/vocabulary-contracts/vocabulary-adapters.d.ts.map +1 -0
- package/dist/vocabulary-contracts/vocabulary-adapters.js +73 -0
- package/dist/vocabulary-contracts/vocabulary-adapters.js.map +1 -0
- package/dist/vocabulary-contracts/vocabulary-registry.d.ts +98 -0
- package/dist/vocabulary-contracts/vocabulary-registry.d.ts.map +1 -0
- package/dist/vocabulary-contracts/vocabulary-registry.js +383 -0
- package/dist/vocabulary-contracts/vocabulary-registry.js.map +1 -0
- package/dist/vocabulary-contracts/vocabulary-types.d.ts +240 -0
- package/dist/vocabulary-contracts/vocabulary-types.d.ts.map +1 -0
- package/dist/vocabulary-contracts/vocabulary-types.js +64 -0
- package/dist/vocabulary-contracts/vocabulary-types.js.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Vocabulary adapters for converting language-specific vocabulary
|
|
4
|
+
* to the standard vocabulary types used by the parser
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.adaptVerbVocabulary = adaptVerbVocabulary;
|
|
8
|
+
exports.adaptDirectionVocabulary = adaptDirectionVocabulary;
|
|
9
|
+
exports.adaptSpecialVocabulary = adaptSpecialVocabulary;
|
|
10
|
+
/**
|
|
11
|
+
* Adapt verb vocabulary from language provider format
|
|
12
|
+
*/
|
|
13
|
+
function adaptVerbVocabulary(languageProvider) {
|
|
14
|
+
// If provider has direct getVerbs method, use it
|
|
15
|
+
if (languageProvider.getVerbs) {
|
|
16
|
+
return languageProvider.getVerbs();
|
|
17
|
+
}
|
|
18
|
+
// Otherwise try to build from mappings
|
|
19
|
+
const verbs = [];
|
|
20
|
+
const verbMappings = languageProvider.getVerbMappings?.() || {};
|
|
21
|
+
for (const [actionId, verbList] of Object.entries(verbMappings)) {
|
|
22
|
+
if (Array.isArray(verbList)) {
|
|
23
|
+
verbs.push({
|
|
24
|
+
actionId,
|
|
25
|
+
verbs: verbList,
|
|
26
|
+
pattern: languageProvider.getVerbPattern?.(actionId)
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return verbs;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Adapt direction vocabulary from language provider format
|
|
34
|
+
*/
|
|
35
|
+
function adaptDirectionVocabulary(languageProvider) {
|
|
36
|
+
// If provider has direct getDirections method, use it
|
|
37
|
+
if (languageProvider.getDirections) {
|
|
38
|
+
return languageProvider.getDirections();
|
|
39
|
+
}
|
|
40
|
+
// Otherwise try to build from mappings
|
|
41
|
+
const directions = [];
|
|
42
|
+
const directionMappings = languageProvider.getDirectionMappings?.() || {};
|
|
43
|
+
for (const [direction, words] of Object.entries(directionMappings)) {
|
|
44
|
+
if (Array.isArray(words)) {
|
|
45
|
+
// Separate full words from abbreviations (1-2 character words)
|
|
46
|
+
const fullWords = words.filter(w => w.length > 2);
|
|
47
|
+
const abbreviations = words.filter(w => w.length <= 2);
|
|
48
|
+
directions.push({
|
|
49
|
+
direction,
|
|
50
|
+
words: fullWords.length > 0 ? fullWords : words,
|
|
51
|
+
abbreviations: abbreviations.length > 0 ? abbreviations : undefined
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return directions;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Adapt special vocabulary from language provider format
|
|
59
|
+
*/
|
|
60
|
+
function adaptSpecialVocabulary(languageProvider) {
|
|
61
|
+
// If provider has direct getSpecialVocabulary method, use it
|
|
62
|
+
if (languageProvider.getSpecialVocabulary) {
|
|
63
|
+
return languageProvider.getSpecialVocabulary();
|
|
64
|
+
}
|
|
65
|
+
// Otherwise build from individual methods
|
|
66
|
+
return {
|
|
67
|
+
pronouns: languageProvider.getPronouns?.() || ['it', 'them'],
|
|
68
|
+
allWords: languageProvider.getAllWords?.() || ['all', 'everything'],
|
|
69
|
+
exceptWords: languageProvider.getExceptWords?.() || ['except', 'but'],
|
|
70
|
+
articles: languageProvider.getArticles?.() || ['a', 'an', 'the']
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=vocabulary-adapters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocabulary-adapters.js","sourceRoot":"","sources":["../../src/vocabulary-contracts/vocabulary-adapters.ts"],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ates vocabulary from multiple sources:
|
|
5
|
+
* - Base vocabulary from language packages
|
|
6
|
+
* - Extension vocabulary
|
|
7
|
+
* - Story-specific vocabulary
|
|
8
|
+
* - Dynamic entity vocabulary
|
|
9
|
+
*/
|
|
10
|
+
import { VocabularyEntry, VocabularySet, VocabularyProvider, PartOfSpeech, EntityVocabulary, VerbVocabulary, DirectionVocabulary, SpecialVocabulary } from './vocabulary-types';
|
|
11
|
+
/**
|
|
12
|
+
* Central vocabulary registry
|
|
13
|
+
*/
|
|
14
|
+
export declare class VocabularyRegistry {
|
|
15
|
+
private providers;
|
|
16
|
+
private entityVocabulary;
|
|
17
|
+
private cachedVocabulary;
|
|
18
|
+
private dirtyCache;
|
|
19
|
+
/**
|
|
20
|
+
* Register a vocabulary provider
|
|
21
|
+
*/
|
|
22
|
+
registerProvider(provider: VocabularyProvider): void;
|
|
23
|
+
/**
|
|
24
|
+
* Unregister a vocabulary provider
|
|
25
|
+
*/
|
|
26
|
+
unregisterProvider(providerId: string): void;
|
|
27
|
+
/**
|
|
28
|
+
* Register vocabulary for an entity
|
|
29
|
+
*/
|
|
30
|
+
registerEntity(vocab: EntityVocabulary): void;
|
|
31
|
+
/**
|
|
32
|
+
* Unregister vocabulary for an entity
|
|
33
|
+
*/
|
|
34
|
+
unregisterEntity(entityId: string): void;
|
|
35
|
+
/**
|
|
36
|
+
* Update entity scope status
|
|
37
|
+
*/
|
|
38
|
+
updateEntityScope(entityId: string, inScope: boolean): void;
|
|
39
|
+
/**
|
|
40
|
+
* Get all vocabulary
|
|
41
|
+
*/
|
|
42
|
+
getVocabulary(): VocabularySet;
|
|
43
|
+
/**
|
|
44
|
+
* Look up a word in the vocabulary
|
|
45
|
+
*/
|
|
46
|
+
lookup(word: string, partOfSpeech?: PartOfSpeech): VocabularyEntry[];
|
|
47
|
+
/**
|
|
48
|
+
* Get all words of a specific part of speech
|
|
49
|
+
*/
|
|
50
|
+
getByPartOfSpeech(partOfSpeech: PartOfSpeech): VocabularyEntry[];
|
|
51
|
+
/**
|
|
52
|
+
* Check if a word exists in vocabulary
|
|
53
|
+
*/
|
|
54
|
+
hasWord(word: string, partOfSpeech?: PartOfSpeech): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Get vocabulary for entities in scope
|
|
57
|
+
*/
|
|
58
|
+
getInScopeEntities(): EntityVocabulary[];
|
|
59
|
+
/**
|
|
60
|
+
* Clear all vocabulary
|
|
61
|
+
*/
|
|
62
|
+
clear(): void;
|
|
63
|
+
/**
|
|
64
|
+
* Register standard verb vocabulary
|
|
65
|
+
*/
|
|
66
|
+
registerVerbs(verbs: VerbVocabulary[]): void;
|
|
67
|
+
/**
|
|
68
|
+
* Register additional verbs dynamically (e.g., from stories)
|
|
69
|
+
* These have lower priority than standard verbs by default
|
|
70
|
+
*/
|
|
71
|
+
registerDynamicVerbs(verbs: VerbVocabulary[], source?: string): void;
|
|
72
|
+
/**
|
|
73
|
+
* Register direction vocabulary
|
|
74
|
+
*/
|
|
75
|
+
registerDirections(directions: DirectionVocabulary[]): void;
|
|
76
|
+
/**
|
|
77
|
+
* Register prepositions
|
|
78
|
+
*/
|
|
79
|
+
registerPrepositions(prepositions: string[]): void;
|
|
80
|
+
/**
|
|
81
|
+
* Register determiners (beyond articles)
|
|
82
|
+
*/
|
|
83
|
+
registerDeterminers(determiners: string[]): void;
|
|
84
|
+
/**
|
|
85
|
+
* Register conjunctions
|
|
86
|
+
*/
|
|
87
|
+
registerConjunctions(conjunctions: string[]): void;
|
|
88
|
+
/**
|
|
89
|
+
* Register numbers (both words and digits)
|
|
90
|
+
*/
|
|
91
|
+
registerNumbers(numbers: string[]): void;
|
|
92
|
+
/**
|
|
93
|
+
* Register special vocabulary (pronouns, articles, etc.)
|
|
94
|
+
*/
|
|
95
|
+
registerSpecial(special: SpecialVocabulary): void;
|
|
96
|
+
}
|
|
97
|
+
export declare const vocabularyRegistry: VocabularyRegistry;
|
|
98
|
+
//# sourceMappingURL=vocabulary-registry.d.ts.map
|
|
@@ -0,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G,IAAI;IAyB5C;;;OAGG;IACH,oBAAoB,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,MAAM,GAAE,MAAgB,GAAG,IAAI;IA0B7E;;OAEG;IACH,kBAAkB,CAAC,UAAU,EAAE,mBAAmB,EAAE,GAAG,IAAI;IAmC3D;;OAEG;IACH,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI;IAmBlD;;OAEG;IACH,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI;IAmBhD;;OAEG;IACH,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI;IAmBlD;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAmBxC;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI;CAiDlD;AAGD,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Vocabulary Registry - Central management of all vocabulary in the system
|
|
4
|
+
*
|
|
5
|
+
* The registry aggregates vocabulary from multiple sources:
|
|
6
|
+
* - Base vocabulary from language packages
|
|
7
|
+
* - Extension vocabulary
|
|
8
|
+
* - Story-specific vocabulary
|
|
9
|
+
* - Dynamic entity vocabulary
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.vocabularyRegistry = exports.VocabularyRegistry = void 0;
|
|
13
|
+
const vocabulary_types_1 = require("./vocabulary-types");
|
|
14
|
+
/**
|
|
15
|
+
* Central vocabulary registry
|
|
16
|
+
*/
|
|
17
|
+
class VocabularyRegistry {
|
|
18
|
+
providers = new Map();
|
|
19
|
+
entityVocabulary = new Map();
|
|
20
|
+
cachedVocabulary = null;
|
|
21
|
+
dirtyCache = true;
|
|
22
|
+
/**
|
|
23
|
+
* Register a vocabulary provider
|
|
24
|
+
*/
|
|
25
|
+
registerProvider(provider) {
|
|
26
|
+
this.providers.set(provider.id, provider);
|
|
27
|
+
this.dirtyCache = true;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Unregister a vocabulary provider
|
|
31
|
+
*/
|
|
32
|
+
unregisterProvider(providerId) {
|
|
33
|
+
this.providers.delete(providerId);
|
|
34
|
+
this.dirtyCache = true;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Register vocabulary for an entity
|
|
38
|
+
*/
|
|
39
|
+
registerEntity(vocab) {
|
|
40
|
+
this.entityVocabulary.set(vocab.entityId, vocab);
|
|
41
|
+
this.dirtyCache = true;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Unregister vocabulary for an entity
|
|
45
|
+
*/
|
|
46
|
+
unregisterEntity(entityId) {
|
|
47
|
+
this.entityVocabulary.delete(entityId);
|
|
48
|
+
this.dirtyCache = true;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Update entity scope status
|
|
52
|
+
*/
|
|
53
|
+
updateEntityScope(entityId, inScope) {
|
|
54
|
+
const vocab = this.entityVocabulary.get(entityId);
|
|
55
|
+
if (vocab) {
|
|
56
|
+
vocab.inScope = inScope;
|
|
57
|
+
// Don't need to rebuild cache for scope changes
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Get all vocabulary
|
|
62
|
+
*/
|
|
63
|
+
getVocabulary() {
|
|
64
|
+
if (!this.dirtyCache && this.cachedVocabulary) {
|
|
65
|
+
return this.cachedVocabulary;
|
|
66
|
+
}
|
|
67
|
+
const entries = [];
|
|
68
|
+
const byWord = new Map();
|
|
69
|
+
const byPartOfSpeech = new Map();
|
|
70
|
+
// Collect from providers (sorted by priority)
|
|
71
|
+
const sortedProviders = Array.from(this.providers.values())
|
|
72
|
+
.sort((a, b) => (b.priority || 0) - (a.priority || 0));
|
|
73
|
+
for (const provider of sortedProviders) {
|
|
74
|
+
const providerEntries = provider.getVocabulary();
|
|
75
|
+
entries.push(...providerEntries);
|
|
76
|
+
}
|
|
77
|
+
// Add entity vocabulary
|
|
78
|
+
for (const [entityId, vocab] of this.entityVocabulary) {
|
|
79
|
+
// Add nouns
|
|
80
|
+
for (const noun of vocab.nouns) {
|
|
81
|
+
entries.push({
|
|
82
|
+
word: noun.toLowerCase(),
|
|
83
|
+
partOfSpeech: vocabulary_types_1.PartOfSpeech.NOUN,
|
|
84
|
+
mapsTo: entityId,
|
|
85
|
+
source: 'entity',
|
|
86
|
+
priority: vocab.priority,
|
|
87
|
+
metadata: { inScope: vocab.inScope }
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
// Add adjectives
|
|
91
|
+
for (const adj of vocab.adjectives) {
|
|
92
|
+
entries.push({
|
|
93
|
+
word: adj.toLowerCase(),
|
|
94
|
+
partOfSpeech: vocabulary_types_1.PartOfSpeech.ADJECTIVE,
|
|
95
|
+
mapsTo: entityId,
|
|
96
|
+
source: 'entity',
|
|
97
|
+
priority: vocab.priority,
|
|
98
|
+
metadata: { inScope: vocab.inScope }
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// Build lookup maps
|
|
103
|
+
for (const entry of entries) {
|
|
104
|
+
// By word
|
|
105
|
+
const wordKey = entry.word.toLowerCase();
|
|
106
|
+
if (!byWord.has(wordKey)) {
|
|
107
|
+
byWord.set(wordKey, []);
|
|
108
|
+
}
|
|
109
|
+
const wordEntries = byWord.get(wordKey);
|
|
110
|
+
if (wordEntries) {
|
|
111
|
+
wordEntries.push(entry);
|
|
112
|
+
}
|
|
113
|
+
// By part of speech
|
|
114
|
+
if (!byPartOfSpeech.has(entry.partOfSpeech)) {
|
|
115
|
+
byPartOfSpeech.set(entry.partOfSpeech, []);
|
|
116
|
+
}
|
|
117
|
+
const posEntries = byPartOfSpeech.get(entry.partOfSpeech);
|
|
118
|
+
if (posEntries) {
|
|
119
|
+
posEntries.push(entry);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// Sort entries by priority within each word
|
|
123
|
+
for (const entries of byWord.values()) {
|
|
124
|
+
entries.sort((a, b) => (b.priority || 0) - (a.priority || 0));
|
|
125
|
+
}
|
|
126
|
+
this.cachedVocabulary = { entries, byWord, byPartOfSpeech };
|
|
127
|
+
this.dirtyCache = false;
|
|
128
|
+
return this.cachedVocabulary;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Look up a word in the vocabulary
|
|
132
|
+
*/
|
|
133
|
+
lookup(word, partOfSpeech) {
|
|
134
|
+
const vocab = this.getVocabulary();
|
|
135
|
+
const entries = vocab.byWord.get(word.toLowerCase()) || [];
|
|
136
|
+
if (partOfSpeech) {
|
|
137
|
+
return entries.filter(e => e.partOfSpeech === partOfSpeech);
|
|
138
|
+
}
|
|
139
|
+
return entries;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Get all words of a specific part of speech
|
|
143
|
+
*/
|
|
144
|
+
getByPartOfSpeech(partOfSpeech) {
|
|
145
|
+
const vocab = this.getVocabulary();
|
|
146
|
+
return vocab.byPartOfSpeech.get(partOfSpeech) || [];
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Check if a word exists in vocabulary
|
|
150
|
+
*/
|
|
151
|
+
hasWord(word, partOfSpeech) {
|
|
152
|
+
return this.lookup(word, partOfSpeech).length > 0;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Get vocabulary for entities in scope
|
|
156
|
+
*/
|
|
157
|
+
getInScopeEntities() {
|
|
158
|
+
return Array.from(this.entityVocabulary.values())
|
|
159
|
+
.filter(v => v.inScope);
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Clear all vocabulary
|
|
163
|
+
*/
|
|
164
|
+
clear() {
|
|
165
|
+
this.providers.clear();
|
|
166
|
+
this.entityVocabulary.clear();
|
|
167
|
+
this.cachedVocabulary = null;
|
|
168
|
+
this.dirtyCache = true;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Register standard verb vocabulary
|
|
172
|
+
*/
|
|
173
|
+
registerVerbs(verbs) {
|
|
174
|
+
const entries = [];
|
|
175
|
+
for (const verbDef of verbs) {
|
|
176
|
+
for (const verb of verbDef.verbs) {
|
|
177
|
+
entries.push({
|
|
178
|
+
word: verb.toLowerCase(),
|
|
179
|
+
partOfSpeech: vocabulary_types_1.PartOfSpeech.VERB,
|
|
180
|
+
mapsTo: verbDef.actionId,
|
|
181
|
+
source: 'base',
|
|
182
|
+
metadata: {
|
|
183
|
+
pattern: verbDef.pattern,
|
|
184
|
+
prepositions: verbDef.prepositions
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
this.registerProvider({
|
|
190
|
+
id: 'standard-verbs',
|
|
191
|
+
getVocabulary: () => entries,
|
|
192
|
+
priority: 100
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Register additional verbs dynamically (e.g., from stories)
|
|
197
|
+
* These have lower priority than standard verbs by default
|
|
198
|
+
*/
|
|
199
|
+
registerDynamicVerbs(verbs, source = 'story') {
|
|
200
|
+
const entries = [];
|
|
201
|
+
for (const verbDef of verbs) {
|
|
202
|
+
for (const verb of verbDef.verbs) {
|
|
203
|
+
entries.push({
|
|
204
|
+
word: verb.toLowerCase(),
|
|
205
|
+
partOfSpeech: vocabulary_types_1.PartOfSpeech.VERB,
|
|
206
|
+
mapsTo: verbDef.actionId,
|
|
207
|
+
source: source,
|
|
208
|
+
priority: 80, // Lower than standard verbs
|
|
209
|
+
metadata: {
|
|
210
|
+
pattern: verbDef.pattern,
|
|
211
|
+
prepositions: verbDef.prepositions
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
this.registerProvider({
|
|
217
|
+
id: `dynamic-verbs-${source}`,
|
|
218
|
+
getVocabulary: () => entries,
|
|
219
|
+
priority: 80
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Register direction vocabulary
|
|
224
|
+
*/
|
|
225
|
+
registerDirections(directions) {
|
|
226
|
+
const entries = [];
|
|
227
|
+
for (const dir of directions) {
|
|
228
|
+
// Full words
|
|
229
|
+
for (const word of dir.words) {
|
|
230
|
+
entries.push({
|
|
231
|
+
word: word.toLowerCase(),
|
|
232
|
+
partOfSpeech: vocabulary_types_1.PartOfSpeech.DIRECTION,
|
|
233
|
+
mapsTo: dir.direction,
|
|
234
|
+
source: 'base'
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
// Abbreviations
|
|
238
|
+
if (dir.abbreviations) {
|
|
239
|
+
for (const abbr of dir.abbreviations) {
|
|
240
|
+
entries.push({
|
|
241
|
+
word: abbr.toLowerCase(),
|
|
242
|
+
partOfSpeech: vocabulary_types_1.PartOfSpeech.DIRECTION,
|
|
243
|
+
mapsTo: dir.direction,
|
|
244
|
+
source: 'base',
|
|
245
|
+
priority: 90 // Slightly lower priority than full words
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
this.registerProvider({
|
|
251
|
+
id: 'standard-directions',
|
|
252
|
+
getVocabulary: () => entries,
|
|
253
|
+
priority: 100
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Register prepositions
|
|
258
|
+
*/
|
|
259
|
+
registerPrepositions(prepositions) {
|
|
260
|
+
const entries = [];
|
|
261
|
+
for (const prep of prepositions) {
|
|
262
|
+
entries.push({
|
|
263
|
+
word: prep.toLowerCase(),
|
|
264
|
+
partOfSpeech: vocabulary_types_1.PartOfSpeech.PREPOSITION,
|
|
265
|
+
mapsTo: prep.toUpperCase(),
|
|
266
|
+
source: 'base'
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
this.registerProvider({
|
|
270
|
+
id: 'standard-prepositions',
|
|
271
|
+
getVocabulary: () => entries,
|
|
272
|
+
priority: 100
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Register determiners (beyond articles)
|
|
277
|
+
*/
|
|
278
|
+
registerDeterminers(determiners) {
|
|
279
|
+
const entries = [];
|
|
280
|
+
for (const det of determiners) {
|
|
281
|
+
entries.push({
|
|
282
|
+
word: det.toLowerCase(),
|
|
283
|
+
partOfSpeech: vocabulary_types_1.PartOfSpeech.DETERMINER,
|
|
284
|
+
mapsTo: det.toUpperCase(),
|
|
285
|
+
source: 'base'
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
this.registerProvider({
|
|
289
|
+
id: 'standard-determiners',
|
|
290
|
+
getVocabulary: () => entries,
|
|
291
|
+
priority: 100
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Register conjunctions
|
|
296
|
+
*/
|
|
297
|
+
registerConjunctions(conjunctions) {
|
|
298
|
+
const entries = [];
|
|
299
|
+
for (const conj of conjunctions) {
|
|
300
|
+
entries.push({
|
|
301
|
+
word: conj.toLowerCase(),
|
|
302
|
+
partOfSpeech: vocabulary_types_1.PartOfSpeech.CONJUNCTION,
|
|
303
|
+
mapsTo: conj.toUpperCase(),
|
|
304
|
+
source: 'base'
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
this.registerProvider({
|
|
308
|
+
id: 'standard-conjunctions',
|
|
309
|
+
getVocabulary: () => entries,
|
|
310
|
+
priority: 100
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Register numbers (both words and digits)
|
|
315
|
+
*/
|
|
316
|
+
registerNumbers(numbers) {
|
|
317
|
+
const entries = [];
|
|
318
|
+
for (const num of numbers) {
|
|
319
|
+
entries.push({
|
|
320
|
+
word: num.toLowerCase(),
|
|
321
|
+
partOfSpeech: vocabulary_types_1.PartOfSpeech.NUMBER,
|
|
322
|
+
mapsTo: num,
|
|
323
|
+
source: 'base'
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
this.registerProvider({
|
|
327
|
+
id: 'standard-numbers',
|
|
328
|
+
getVocabulary: () => entries,
|
|
329
|
+
priority: 100
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Register special vocabulary (pronouns, articles, etc.)
|
|
334
|
+
*/
|
|
335
|
+
registerSpecial(special) {
|
|
336
|
+
const entries = [];
|
|
337
|
+
// Pronouns
|
|
338
|
+
for (const pronoun of special.pronouns) {
|
|
339
|
+
entries.push({
|
|
340
|
+
word: pronoun.toLowerCase(),
|
|
341
|
+
partOfSpeech: vocabulary_types_1.PartOfSpeech.PRONOUN,
|
|
342
|
+
mapsTo: 'IT',
|
|
343
|
+
source: 'base'
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
// Articles
|
|
347
|
+
for (const article of special.articles) {
|
|
348
|
+
entries.push({
|
|
349
|
+
word: article.toLowerCase(),
|
|
350
|
+
partOfSpeech: vocabulary_types_1.PartOfSpeech.ARTICLE,
|
|
351
|
+
mapsTo: 'ARTICLE',
|
|
352
|
+
source: 'base'
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
// All words
|
|
356
|
+
for (const allWord of special.allWords) {
|
|
357
|
+
entries.push({
|
|
358
|
+
word: allWord.toLowerCase(),
|
|
359
|
+
partOfSpeech: vocabulary_types_1.PartOfSpeech.SPECIAL,
|
|
360
|
+
mapsTo: 'ALL',
|
|
361
|
+
source: 'base'
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
// Except words
|
|
365
|
+
for (const exceptWord of special.exceptWords) {
|
|
366
|
+
entries.push({
|
|
367
|
+
word: exceptWord.toLowerCase(),
|
|
368
|
+
partOfSpeech: vocabulary_types_1.PartOfSpeech.SPECIAL,
|
|
369
|
+
mapsTo: 'EXCEPT',
|
|
370
|
+
source: 'base'
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
this.registerProvider({
|
|
374
|
+
id: 'special-vocabulary',
|
|
375
|
+
getVocabulary: () => entries,
|
|
376
|
+
priority: 100
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
exports.VocabularyRegistry = VocabularyRegistry;
|
|
381
|
+
// Global vocabulary registry instance
|
|
382
|
+
exports.vocabularyRegistry = new VocabularyRegistry();
|
|
383
|
+
//# sourceMappingURL=vocabulary-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocabulary-registry.js","sourceRoot":"","sources":["../../src/vocabulary-contracts/vocabulary-registry.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEH,yDAS4B;AAE5B;;GAEG;AACH,MAAa,kBAAkB;IACrB,SAAS,GAAoC,IAAI,GAAG,EAAE,CAAC;IACvD,gBAAgB,GAAkC,IAAI,GAAG,EAAE,CAAC;IAC5D,gBAAgB,GAAyB,IAAI,CAAC;IAC9C,UAAU,GAAG,IAAI,CAAC;IAE1B;;OAEG;IACH,gBAAgB,CAAC,QAA4B;QAC3C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QAC1C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,kBAAkB,CAAC,UAAkB;QACnC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAClC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,cAAc,CAAC,KAAuB;QACpC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QACjD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,gBAAgB,CAAC,QAAgB;QAC/B,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,CAAC,UAAU,GAAG,IAAI,CA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