@keymanapp/kmc-model 17.0.282-beta → 17.0.284-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/build/src/lexical-model-compiler.d.ts +61 -4
- package/build/src/lexical-model-compiler.d.ts.map +1 -1
- package/build/src/lexical-model-compiler.js +56 -6
- package/build/src/lexical-model-compiler.js.map +1 -1
- package/build/src/lexical-model.d.ts +9 -0
- package/build/src/lexical-model.d.ts.map +1 -1
- package/build/src/main.d.ts +2 -1
- package/build/src/main.d.ts.map +1 -1
- package/build/src/main.js +2 -2
- package/build/src/main.js.map +1 -1
- package/build/src/model-compiler-messages.d.ts +6 -0
- package/build/src/model-compiler-messages.d.ts.map +1 -1
- package/build/src/model-compiler-messages.js +8 -2
- package/build/src/model-compiler-messages.js.map +1 -1
- package/build/src/model-defaults.d.ts.map +1 -1
- package/build/src/model-defaults.js +6 -10
- package/build/src/model-defaults.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,31 +1,88 @@
|
|
|
1
1
|
import { LexicalModelSource } from "./lexical-model.js";
|
|
2
2
|
import { CompilerCallbacks, CompilerOptions, KeymanCompiler, KeymanCompilerArtifact, KeymanCompilerArtifacts, KeymanCompilerResult } from "@keymanapp/common-types";
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
* Internal in-memory build artifacts from a successful compilation
|
|
6
|
+
*/
|
|
3
7
|
export interface LexicalModelCompilerArtifacts extends KeymanCompilerArtifacts {
|
|
8
|
+
/**
|
|
9
|
+
* Javascript model filedata and filename - installable into KeymanWeb,
|
|
10
|
+
* Keyman mobile products
|
|
11
|
+
*/
|
|
4
12
|
js: KeymanCompilerArtifact;
|
|
5
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* @public
|
|
16
|
+
* Build artifacts from the lexical model compiler
|
|
17
|
+
*/
|
|
6
18
|
export interface LexicalModelCompilerResult extends KeymanCompilerResult {
|
|
19
|
+
/**
|
|
20
|
+
* Internal in-memory build artifacts from a successful compilation. Caller
|
|
21
|
+
* can write these to disk with {@link LexicalModelCompiler.write}
|
|
22
|
+
*/
|
|
7
23
|
artifacts: LexicalModelCompilerArtifacts;
|
|
8
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* @public
|
|
27
|
+
* Compiles a .model.ts file to a .model.js. The compiler does not read or write
|
|
28
|
+
* from filesystem or network directly, but relies on callbacks for all external
|
|
29
|
+
* IO.
|
|
30
|
+
*/
|
|
9
31
|
export declare class LexicalModelCompiler implements KeymanCompiler {
|
|
32
|
+
/**
|
|
33
|
+
* Initialize the compiler. There are currently no options
|
|
34
|
+
* specific to the lexical model compiler
|
|
35
|
+
* @param callbacks - Callbacks for external interfaces, including message
|
|
36
|
+
* reporting and file io
|
|
37
|
+
* @param options - Compiler options
|
|
38
|
+
* @returns always succeeds and returns true
|
|
39
|
+
*/
|
|
10
40
|
init(callbacks: CompilerCallbacks, _options: CompilerOptions): Promise<boolean>;
|
|
41
|
+
/**
|
|
42
|
+
* Compiles a .model.ts file to .model.js. Returns an object containing binary
|
|
43
|
+
* artifacts on success. The files are passed in by name, and the compiler
|
|
44
|
+
* will use callbacks as passed to the {@link LexicalModelCompiler.init}
|
|
45
|
+
* function to read any input files by disk.
|
|
46
|
+
* @param infile - Path to source file. Path will be parsed to find relative
|
|
47
|
+
* references in the .kmn file, such as icon or On Screen
|
|
48
|
+
* Keyboard file
|
|
49
|
+
* @param outfile - Path to output file. The file will not be written to, but
|
|
50
|
+
* will be included in the result for use by
|
|
51
|
+
* {@link LexicalModelCompiler.write}.
|
|
52
|
+
* @returns Binary artifacts on success, null on failure.
|
|
53
|
+
*/
|
|
11
54
|
run(inputFilename: string, outputFilename?: string): Promise<LexicalModelCompilerResult>;
|
|
55
|
+
/**
|
|
56
|
+
* Write artifacts from a successful compile to disk, via callbacks methods.
|
|
57
|
+
* The artifacts written may include:
|
|
58
|
+
*
|
|
59
|
+
* - .model.js file - Javascript lexical model for web and touch platforms
|
|
60
|
+
*
|
|
61
|
+
* @param artifacts - object containing artifact binary data to write out
|
|
62
|
+
* @returns always returns true
|
|
63
|
+
*/
|
|
12
64
|
write(artifacts: LexicalModelCompilerArtifacts): Promise<boolean>;
|
|
13
65
|
/**
|
|
66
|
+
* @internal
|
|
14
67
|
* Loads a lexical model's source module from the given filename.
|
|
15
68
|
*
|
|
16
|
-
* @param filename path to the model source file.
|
|
69
|
+
* @param filename - path to the model source file.
|
|
17
70
|
*/
|
|
18
71
|
loadFromFilename(filename: string): LexicalModelSource;
|
|
19
72
|
/**
|
|
73
|
+
* @internal
|
|
20
74
|
* Returns the generated code for the model that will ultimately be loaded by
|
|
21
75
|
* the LMLayer worker. This code contains all model parameters, and specifies
|
|
22
76
|
* word breakers and auxilary functions that may be required.
|
|
23
77
|
*
|
|
24
|
-
* @param model_id
|
|
25
|
-
* @param modelSource
|
|
26
|
-
* @param sourcePath
|
|
78
|
+
* @param model_id - The model ID. TODO: not sure if this is actually required!
|
|
79
|
+
* @param modelSource - A specification of the model to compile
|
|
80
|
+
* @param sourcePath - Where to find auxilary sources files
|
|
27
81
|
*/
|
|
28
82
|
generateLexicalModelCode(model_id: string, modelSource: LexicalModelSource, sourcePath: string): string;
|
|
83
|
+
/**
|
|
84
|
+
* @internal
|
|
85
|
+
*/
|
|
29
86
|
transpileSources(sources: Array<string>): Array<string>;
|
|
30
87
|
}
|
|
31
88
|
//# sourceMappingURL=lexical-model-compiler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lexical-model-compiler.d.ts","sourceRoot":"","sources":["../../src/lexical-model-compiler.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,kBAAkB,EAA0C,MAAM,oBAAoB,CAAC;AAGhG,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAWpK,MAAM,WAAW,6BAA8B,SAAQ,uBAAuB;IAC5E,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EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;CAUxD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="719bbea3-035d-5f91-bf8b-44e7affdb351")}catch(e){}}();
|
|
2
2
|
/*
|
|
3
3
|
lexical-model-compiler.ts: base file for lexical model compiler.
|
|
4
4
|
*/
|
|
@@ -12,11 +12,38 @@ import { callbacks, setCompilerCallbacks } from "./compiler-callbacks.js";
|
|
|
12
12
|
;
|
|
13
13
|
;
|
|
14
14
|
;
|
|
15
|
+
/**
|
|
16
|
+
* @public
|
|
17
|
+
* Compiles a .model.ts file to a .model.js. The compiler does not read or write
|
|
18
|
+
* from filesystem or network directly, but relies on callbacks for all external
|
|
19
|
+
* IO.
|
|
20
|
+
*/
|
|
15
21
|
export class LexicalModelCompiler {
|
|
22
|
+
/**
|
|
23
|
+
* Initialize the compiler. There are currently no options
|
|
24
|
+
* specific to the lexical model compiler
|
|
25
|
+
* @param callbacks - Callbacks for external interfaces, including message
|
|
26
|
+
* reporting and file io
|
|
27
|
+
* @param options - Compiler options
|
|
28
|
+
* @returns always succeeds and returns true
|
|
29
|
+
*/
|
|
16
30
|
async init(callbacks, _options) {
|
|
17
31
|
setCompilerCallbacks(callbacks);
|
|
18
32
|
return true;
|
|
19
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Compiles a .model.ts file to .model.js. Returns an object containing binary
|
|
36
|
+
* artifacts on success. The files are passed in by name, and the compiler
|
|
37
|
+
* will use callbacks as passed to the {@link LexicalModelCompiler.init}
|
|
38
|
+
* function to read any input files by disk.
|
|
39
|
+
* @param infile - Path to source file. Path will be parsed to find relative
|
|
40
|
+
* references in the .kmn file, such as icon or On Screen
|
|
41
|
+
* Keyboard file
|
|
42
|
+
* @param outfile - Path to output file. The file will not be written to, but
|
|
43
|
+
* will be included in the result for use by
|
|
44
|
+
* {@link LexicalModelCompiler.write}.
|
|
45
|
+
* @returns Binary artifacts on success, null on failure.
|
|
46
|
+
*/
|
|
20
47
|
async run(inputFilename, outputFilename) {
|
|
21
48
|
try {
|
|
22
49
|
let modelSource = this.loadFromFilename(inputFilename);
|
|
@@ -39,14 +66,24 @@ export class LexicalModelCompiler {
|
|
|
39
66
|
return null;
|
|
40
67
|
}
|
|
41
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Write artifacts from a successful compile to disk, via callbacks methods.
|
|
71
|
+
* The artifacts written may include:
|
|
72
|
+
*
|
|
73
|
+
* - .model.js file - Javascript lexical model for web and touch platforms
|
|
74
|
+
*
|
|
75
|
+
* @param artifacts - object containing artifact binary data to write out
|
|
76
|
+
* @returns always returns true
|
|
77
|
+
*/
|
|
42
78
|
async write(artifacts) {
|
|
43
79
|
callbacks.fs.writeFileSync(artifacts.js.filename, artifacts.js.data);
|
|
44
80
|
return true;
|
|
45
81
|
}
|
|
46
82
|
/**
|
|
83
|
+
* @internal
|
|
47
84
|
* Loads a lexical model's source module from the given filename.
|
|
48
85
|
*
|
|
49
|
-
* @param filename path to the model source file.
|
|
86
|
+
* @param filename - path to the model source file.
|
|
50
87
|
*/
|
|
51
88
|
loadFromFilename(filename) {
|
|
52
89
|
let sourceCode = new TextDecoder().decode(callbacks.loadFile(filename));
|
|
@@ -74,13 +111,14 @@ export class LexicalModelCompiler {
|
|
|
74
111
|
return moduleExports['default'];
|
|
75
112
|
}
|
|
76
113
|
/**
|
|
114
|
+
* @internal
|
|
77
115
|
* Returns the generated code for the model that will ultimately be loaded by
|
|
78
116
|
* the LMLayer worker. This code contains all model parameters, and specifies
|
|
79
117
|
* word breakers and auxilary functions that may be required.
|
|
80
118
|
*
|
|
81
|
-
* @param model_id
|
|
82
|
-
* @param modelSource
|
|
83
|
-
* @param sourcePath
|
|
119
|
+
* @param model_id - The model ID. TODO: not sure if this is actually required!
|
|
120
|
+
* @param modelSource - A specification of the model to compile
|
|
121
|
+
* @param sourcePath - Where to find auxilary sources files
|
|
84
122
|
*/
|
|
85
123
|
generateLexicalModelCode(model_id, modelSource, sourcePath) {
|
|
86
124
|
// TODO: add metadata in comment
|
|
@@ -132,6 +170,9 @@ export class LexicalModelCompiler {
|
|
|
132
170
|
func += fileSuffix;
|
|
133
171
|
return func;
|
|
134
172
|
}
|
|
173
|
+
/**
|
|
174
|
+
* @internal
|
|
175
|
+
*/
|
|
135
176
|
transpileSources(sources) {
|
|
136
177
|
return sources.map((source) => ts.transpileModule(source, {
|
|
137
178
|
compilerOptions: {
|
|
@@ -144,6 +185,7 @@ export class LexicalModelCompiler {
|
|
|
144
185
|
}
|
|
145
186
|
;
|
|
146
187
|
/**
|
|
188
|
+
* @internal
|
|
147
189
|
* Returns a JavaScript expression (as a string) that can serve as a word
|
|
148
190
|
* breaking function.
|
|
149
191
|
*/
|
|
@@ -157,6 +199,9 @@ function compileWordBreaker(spec) {
|
|
|
157
199
|
}
|
|
158
200
|
return wordBreakerCode;
|
|
159
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* @internal
|
|
204
|
+
*/
|
|
160
205
|
function compileJoinDecorator(spec, existingWordBreakerCode) {
|
|
161
206
|
// Bundle the source of the join decorator, as an IIFE,
|
|
162
207
|
// like this: (function join(breaker, joiners) {/*...*/}(breaker, joiners))
|
|
@@ -170,6 +215,7 @@ function compileScriptOverrides(spec, existingWordBreakerCode) {
|
|
|
170
215
|
return `(${decorateWithScriptOverrides.toString()}(${existingWordBreakerCode}, '${spec.overrideScriptDefaults}'))`;
|
|
171
216
|
}
|
|
172
217
|
/**
|
|
218
|
+
* @internal
|
|
173
219
|
* Compiles the base word breaker, that may be decorated later.
|
|
174
220
|
* Returns the source code of a JavaScript expression.
|
|
175
221
|
*/
|
|
@@ -187,6 +233,7 @@ function compileInnerWordBreaker(spec) {
|
|
|
187
233
|
}
|
|
188
234
|
}
|
|
189
235
|
/**
|
|
236
|
+
* @internal
|
|
190
237
|
* Given a word breaker specification in any of the messy ways,
|
|
191
238
|
* normalizes it to a common form that the compiler can deal with.
|
|
192
239
|
*/
|
|
@@ -206,8 +253,11 @@ function normalizeWordBreakerSpec(wordBreakerSpec) {
|
|
|
206
253
|
throw new ModelCompilerError(ModelCompilerMessages.Error_UnknownWordBreaker({ spec: wordBreakerSpec.toString() }));
|
|
207
254
|
}
|
|
208
255
|
}
|
|
256
|
+
/**
|
|
257
|
+
* @internal
|
|
258
|
+
*/
|
|
209
259
|
function isSimpleWordBreaker(spec) {
|
|
210
260
|
return typeof spec === "function" || spec === "default" || spec === "ascii";
|
|
211
261
|
}
|
|
212
|
-
//# debugId=
|
|
262
|
+
//# debugId=719bbea3-035d-5f91-bf8b-44e7affdb351
|
|
213
263
|
//# sourceMappingURL=lexical-model-compiler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"debug_id":"
|
|
1
|
+
{"debug_id":"719bbea3-035d-5f91-bf8b-44e7affdb351","file":"lexical-model-compiler.js","mappings":";AAAA;;EAEE;AAEF,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAC,gBAAgB,EAAC,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAC,2BAA2B,EAAC,MAAM,iCAAiC,CAAC;AAE5E,OAAO,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACtH,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAUzE,CAAC;AAYD,CAAC;A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KACxB;SAAM;QACL,MAAM,IAAI,kBAAkB,CAAC,qBAAqB,CAAC,wBAAwB,CAAC,EAAC,IAAI,EAAE,eAAe,CAAC,QAAQ,EAAE,EAAC,CAAC,CAAC,CAAC;KAClH;AACH,CAAC;AAED;;GAEG;AACH,SAAS,mBAAmB,CAAC,IAA6C;IACxE,OAAO,OAAO,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,OAAO,CAAC;AAC9E,CAAC","names":[],"sourceRoot":"","sources":["../../src/lexical-model-compiler.ts"],"version":3}
|
|
@@ -7,6 +7,7 @@ export interface LexicalModelDeclaration {
|
|
|
7
7
|
readonly format: 'trie-1.0' | 'fst-foma-1.0' | 'custom-1.0';
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
+
* @public
|
|
10
11
|
* Keyman 14.0+ word breaker specification:
|
|
11
12
|
*
|
|
12
13
|
* Can support all old word breaking specification,
|
|
@@ -35,24 +36,28 @@ export interface WordBreakerSpec {
|
|
|
35
36
|
readonly overrideScriptDefaults?: OverrideScriptDefaults;
|
|
36
37
|
}
|
|
37
38
|
/**
|
|
39
|
+
* @public
|
|
38
40
|
* Simplified word breaker specification.
|
|
39
41
|
*
|
|
40
42
|
* @since 11.0
|
|
41
43
|
*/
|
|
42
44
|
export type SimpleWordBreakerSpec = 'default' | 'ascii' | WordBreakingFunction;
|
|
43
45
|
/**
|
|
46
|
+
* @public
|
|
44
47
|
* Simplifies input text to facilitate finding entries within a lexical model's
|
|
45
48
|
* lexicon.
|
|
46
49
|
* @since 11.0
|
|
47
50
|
*/
|
|
48
51
|
export type SimpleWordformToKeySpec = (term: string) => string;
|
|
49
52
|
/**
|
|
53
|
+
* @public
|
|
50
54
|
* Simplifies input text to facilitate finding entries within a lexical model's
|
|
51
55
|
* lexicon, using the model's `applyCasing` function to assist in the keying process.
|
|
52
56
|
* @since 14.0
|
|
53
57
|
*/
|
|
54
58
|
export type CasedWordformToKeySpec = (term: string, applyCasing?: CasingFunction) => string;
|
|
55
59
|
/**
|
|
60
|
+
* @public
|
|
56
61
|
* Simplifies input text to facilitate finding entries within a lexical model's
|
|
57
62
|
* lexicon.
|
|
58
63
|
*/
|
|
@@ -82,6 +87,10 @@ export type WordformToKeySpec = SimpleWordformToKeySpec | CasedWordformToKeySpec
|
|
|
82
87
|
* @since 14.0
|
|
83
88
|
*/
|
|
84
89
|
export type OverrideScriptDefaults = 'break-words-at-spaces';
|
|
90
|
+
/**
|
|
91
|
+
* @public
|
|
92
|
+
* Base interface for a lexical model source definition
|
|
93
|
+
*/
|
|
85
94
|
export interface LexicalModelSource extends LexicalModelDeclaration {
|
|
86
95
|
readonly sources: Array<string>;
|
|
87
96
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lexical-model.d.ts","sourceRoot":"","sources":["../../src/lexical-model.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAC,cAAc,GAAC,YAAY,CAAC;CAEzD;AAED
|
|
1
|
+
{"version":3,"file":"lexical-model.d.ts","sourceRoot":"","sources":["../../src/lexical-model.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAC,cAAc,GAAC,YAAY,CAAC;CAEzD;AAED;;;;;;;;GAQG;AACF,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,GAAG,EAAE,qBAAqB,CAAC;IACpC;;;;;;;OAOG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhC;;;;;;OAMG;IACH,QAAQ,CAAC,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;CAC1D;AAED;;;;;GAKG;AACF,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,OAAO,GAAG,oBAAoB,CAAC;AAEhF;;;;;GAKG;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,cAAc,KAAK,MAAM,CAAC;AAE5F;;;;GAIG;AACF,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,GAAG,sBAAsB,CAAC;AAElF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,sBAAsB,GAAG,uBAAuB,CAAC;AAG7D;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,uBAAuB;IACjE,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAChC;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAE3B;;;;OAIG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAErC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,cAAc,CAAA;IAErC;;;;;;;;OAQG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,eAAe,GAAG,qBAAqB,CAAC;IAE/D;;;OAGG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,iBAAiB,CAAC;IAE7C;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,uBAAuB,CAAC;CAChD;AAED,MAAM,WAAW,oBAAqB,SAAQ,uBAAuB;IACnE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB"}
|
package/build/src/main.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export { LexicalModelCompiler } from './lexical-model-compiler.js';
|
|
1
|
+
export { LexicalModelCompiler, LexicalModelCompilerResult, LexicalModelCompilerArtifacts } from './lexical-model-compiler.js';
|
|
2
|
+
export { LexicalModelSource, WordformToKeySpec, SimpleWordformToKeySpec, CasedWordformToKeySpec, WordBreakerSpec, SimpleWordBreakerSpec, } from './lexical-model.js';
|
|
2
3
|
export { ModelCompilerMessages } from './model-compiler-messages.js';
|
|
3
4
|
//# sourceMappingURL=main.d.ts.map
|
package/build/src/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC9H,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,eAAe,EACf,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC"}
|
package/build/src/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="178380da-30fc-5d27-8aed-e4805f1433b1")}catch(e){}}();
|
|
2
2
|
export { LexicalModelCompiler } from './lexical-model-compiler.js';
|
|
3
3
|
export { ModelCompilerMessages } from './model-compiler-messages.js';
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=178380da-30fc-5d27-8aed-e4805f1433b1
|
|
5
5
|
//# sourceMappingURL=main.js.map
|
package/build/src/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"debug_id":"
|
|
1
|
+
{"debug_id":"178380da-30fc-5d27-8aed-e4805f1433b1","file":"main.js","mappings":";AAAA,OAAO,EAAE,oBAAoB,EAA6D,MAAM,6BAA6B,CAAC;AAS9H,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC","names":[],"sourceRoot":"","sources":["../../src/main.ts"],"version":3}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { CompilerEvent } from "@keymanapp/common-types";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
2
5
|
export declare class ModelCompilerMessageContext {
|
|
3
6
|
static line: number;
|
|
4
7
|
static filename: string;
|
|
5
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
6
12
|
export declare class ModelCompilerMessages {
|
|
7
13
|
static FATAL_UnexpectedException: number;
|
|
8
14
|
static Fatal_UnexpectedException: (o: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-compiler-messages.d.ts","sourceRoot":"","sources":["../../src/model-compiler-messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiD,aAAa,EAAoF,MAAM,yBAAyB,CAAC;AAqBzL,qBAAa,2BAA2B;IAEtC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC;CACzB;AAED,qBAAa,qBAAqB;IAEhC,MAAM,CAAC,yBAAyB,SAAqB;IACrD,MAAM,CAAC,yBAAyB,MAAM;QAAC,CAAC,EAAE,GAAG,CAAA;KAAC,mBAAuE;IAErH,MAAM,CAAC,4BAA4B,SAAoB;IACvD,MAAM,CAAC,4BAA4B,MAAM;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAC,mBACuB;IAElF,MAAM,CAAC,4BAA4B,SAAoB;IACvD,MAAM,CAAC,4BAA4B,MAAM;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAC,mBACiB;IAE5E,MAAM,CAA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Q,EAAE,MAAM,CAAA;KAAC,mBACuB;IAElF,MAAM,CAAC,4BAA4B,SAAoB;IACvD,MAAM,CAAC,4BAA4B,MAAM;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAC,mBACiB;IAE5E,MAAM,CAAC,8BAA8B,SAAqB;IAC1D,MAAM,CAAC,8BAA8B,MAAM;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,mBACT;IAElD,MAAM,CAAC,wBAAwB,SAAqB;IACpD,MAAM,CAAC,wBAAwB,MAAM;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,mBACH;IAElD,MAAM,CAAC,qBAAqB,SAAqB;IACjD,MAAM,CAAC,qBAAqB,sBACwE;IAEpG,MAAM,CAAC,8CAA8C,SAAqB;IAC1E,MAAM,CAAC,8CAA8C,sBACH;IAElD,MAAM,CAAC,wBAAwB,SAAqB;IACpD,MAAM,CAAC,wBAAwB,sBAAqE;IAEpG,MAAM,CAAC,wBAAwB,SAAqB;IACpD,MAAM,CAAC,wBAAwB,MAAM;QAAC,IAAI,EAAC,MAAM,CAAA;KAAC,mBACR;IAE1C,MAAM,CAAC,+BAA+B,SAAqB;IAC3D,MAAM,CAAC,+BAA+B,MAAM;QAAC,MAAM,EAAC,MAAM,CAAA;KAAC,mBACR;CACpD;AAED;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IACxB,KAAK,EAAE,aAAa;gBAApB,KAAK,EAAE,aAAa;CAGxC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b781c9e0-1012-5d01-8ce7-3bc015949ab3")}catch(e){}}();
|
|
2
2
|
import { CompilerErrorNamespace, CompilerErrorSeverity, CompilerMessageSpec, CompilerMessageDef as def, CompilerMessageSpecWithException } from "@keymanapp/common-types";
|
|
3
3
|
const Namespace = CompilerErrorNamespace.ModelCompiler;
|
|
4
4
|
// const SevInfo = CompilerErrorSeverity.Info | Namespace;
|
|
@@ -16,11 +16,17 @@ const m_e = (code, message, exceptionVar) => ({
|
|
|
16
16
|
line: ModelCompilerMessageContext.line,
|
|
17
17
|
filename: ModelCompilerMessageContext.filename,
|
|
18
18
|
});
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
19
22
|
export class ModelCompilerMessageContext {
|
|
20
23
|
// Context added to all messages
|
|
21
24
|
static line;
|
|
22
25
|
static filename;
|
|
23
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
24
30
|
export class ModelCompilerMessages {
|
|
25
31
|
static FATAL_UnexpectedException = SevFatal | 0x0001;
|
|
26
32
|
static Fatal_UnexpectedException = (o) => m_e(this.FATAL_UnexpectedException, null, o.e ?? 'unknown error');
|
|
@@ -56,5 +62,5 @@ export class ModelCompilerError extends Error {
|
|
|
56
62
|
this.event = event;
|
|
57
63
|
}
|
|
58
64
|
}
|
|
59
|
-
//# debugId=
|
|
65
|
+
//# debugId=b781c9e0-1012-5d01-8ce7-3bc015949ab3
|
|
60
66
|
//# sourceMappingURL=model-compiler-messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"debug_id":"
|
|
1
|
+
{"debug_id":"b781c9e0-1012-5d01-8ce7-3bc015949ab3","file":"model-compiler-messages.js","mappings":";AAAA,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAiB,mBAAmB,EAAE,kBAAkB,IAAI,GAAG,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAC;AAEzL,MAAM,SAAS,GAAG,sBAAsB,CAAC,aAAa,CAAC;AACvD,0DAA0D;AAC1D,M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BAAwB,GAAG,QAAQ,GAAG,MAAM,CAAC;IACpD,MAAM,CAAC,wBAAwB,GAAG,CAAC,CAAe,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,wBAAwB,EACpF,yBAAyB,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAE1C,MAAM,CAAC,+BAA+B,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3D,MAAM,CAAC,+BAA+B,GAAG,CAAC,CAAiB,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,+BAA+B,EACpG,gCAAgC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;;AACpD,CAAC;AAEF;;;;GAIG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IACxB;IAAnB,YAAmB,KAAoB;QACrC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QADJ,UAAK,GAAL,KAAK,CAAe;IAEvC,CAAC;CACF","names":[],"sourceRoot":"","sources":["../../src/model-compiler-messages.ts"],"version":3}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-defaults.d.ts","sourceRoot":"","sources":["../../src/model-defaults.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"model-defaults.d.ts","sourceRoot":"","sources":["../../src/model-defaults.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAS/D;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,GAAG,MAAM,CAejG;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CA2B3E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2ae29ec9-eed0-568a-afa7-1797b21bd3e2")}catch(e){}}();
|
|
2
2
|
/**
|
|
3
3
|
* Converts wordforms into an indexable form. It does this by
|
|
4
4
|
* normalizing the letter case of characters INDIVIDUALLY (to disregard
|
|
@@ -26,11 +26,9 @@ export function defaultSearchTermToKey(wordform) {
|
|
|
26
26
|
// Remove any combining diacritics (if input is in NFKD)
|
|
27
27
|
.replace(/[\u0300-\u036F]/g, '')
|
|
28
28
|
// Replace directional quotation marks with plain apostrophes
|
|
29
|
-
.replace(
|
|
30
|
-
.replace(/’/, "'")
|
|
29
|
+
.replace(/[‘’]/g, "'")
|
|
31
30
|
// Also double-quote marks.
|
|
32
|
-
.replace(
|
|
33
|
-
.replace(/”/, '"');
|
|
31
|
+
.replace(/[“”]/g, '"');
|
|
34
32
|
}
|
|
35
33
|
/**
|
|
36
34
|
* Converts wordforms into an indexable form. It does this by
|
|
@@ -64,11 +62,9 @@ export function defaultCasedSearchTermToKey(wordform, applyCasing) {
|
|
|
64
62
|
.map(function (c) { return applyCasing('lower', c); })
|
|
65
63
|
.join('')
|
|
66
64
|
// Replace directional quotation marks with plain apostrophes
|
|
67
|
-
.replace(
|
|
68
|
-
.replace(/’/, "'")
|
|
65
|
+
.replace(/[‘’]/g, "'")
|
|
69
66
|
// Also double-quote marks.
|
|
70
|
-
.replace(
|
|
71
|
-
.replace(/”/, '"');
|
|
67
|
+
.replace(/[“”]/g, '"');
|
|
72
68
|
}
|
|
73
69
|
/**
|
|
74
70
|
* Specifies default casing behavior for lexical models when `languageUsesCasing` is
|
|
@@ -104,5 +100,5 @@ export function defaultApplyCasing(casing, text) {
|
|
|
104
100
|
.concat(text.substring(headUnitLength)); // tail - lowercased
|
|
105
101
|
}
|
|
106
102
|
}
|
|
107
|
-
//# debugId=
|
|
103
|
+
//# debugId=2ae29ec9-eed0-568a-afa7-1797b21bd3e2
|
|
108
104
|
//# sourceMappingURL=model-defaults.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"debug_id":"
|
|
1
|
+
{"debug_id":"2ae29ec9-eed0-568a-afa7-1797b21bd3e2","file":"model-defaults.js","mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAgB;IACrD,OAAO,QAAQ;SACV,SAAS,CAAC,MAAM,CAAC;QAClB,wDAAwD;SACvD,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;QAChC,6DAA6D;SAC5D,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;QACtB,2BAA2B;SAC1B,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;AAC7B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,2BAA2B,CAAC,QAAgB,EAAE,WAA2B;IACvF,6FAA6F;IAC7F,gGAAgG;IAChG,qCAAqC;IACrC,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ;SACnB,SAAS,CAAC,MAAM,CAAC;QAClB,wDAAwD;SACvD,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CACjC,CAAC,sBAAsB;SACvB,GAAG,CAAC,UAAS,CAAC,IAAI,OAAO,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA,CAAA,CAAC,CAAC;SAClD,IAAI,CAAC,EAAE,CAAC;QACT,6DAA6D;SAC5D,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;QACtB,2BAA2B;SAC1B,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;AAC7B,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAkB,EAAE,IAAY;IACjE,QAAO,MAAM,EAAE;QACb,KAAK,OAAO;YACV,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;QAC5B,KAAK,OAAO;YACV,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;QAC5B,KAAK,SAAS;YACZ,IAAI,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAClC,iEAAiE;YACjE,IAAI,cAAc,GAAG,CAAC,CAAC;YAEvB,6EAA6E;YAC7E,4EAA4E;YAC5E,IAAG,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,IAAI,MAAM,IAAI,QAAQ,IAAI,MAAM,EAAE;gBAC9D,qDAAqD;gBACrD,IAAI,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;gBAE1C,IAAG,gBAAgB,IAAI,MAAM,IAAI,gBAAgB,IAAI,MAAM,EAAE;oBAC3D,gEAAgE;oBAChE,cAAc,EAAE,CAAC;iBAClB;aACF;YAED,0EAA0E;YAC1E,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,WAAW,EAAE,CAAC,oBAAoB;iBACnE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,CAAQ,oBAAoB;KAC9E;AACH,CAAC","names":[],"sourceRoot":"","sources":["../../src/model-defaults.ts"],"version":3}
|
package/package.json
CHANGED
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"url": "https://github.com/keymanapp/keyman/issues"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@keymanapp/common-types": "17.0.
|
|
34
|
-
"@keymanapp/keyman-version": "17.0.
|
|
35
|
-
"@keymanapp/models-types": "17.0.
|
|
33
|
+
"@keymanapp/common-types": "17.0.284-beta",
|
|
34
|
+
"@keymanapp/keyman-version": "17.0.284-beta",
|
|
35
|
+
"@keymanapp/models-types": "17.0.284-beta",
|
|
36
36
|
"typescript": "^4.9.5"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@keymanapp/developer-test-helpers": "17.0.
|
|
39
|
+
"@keymanapp/developer-test-helpers": "17.0.284-beta",
|
|
40
40
|
"@types/chai": "^4.1.7",
|
|
41
41
|
"@types/mocha": "^5.2.7",
|
|
42
42
|
"@types/node": "^20.4.1",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"type": "git",
|
|
70
70
|
"url": "git+https://github.com/keymanapp/keyman.git"
|
|
71
71
|
},
|
|
72
|
-
"version": "17.0.
|
|
72
|
+
"version": "17.0.284-beta"
|
|
73
73
|
}
|