@keymanapp/kmc-model 17.0.256-alpha → 17.0.258-alpha
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/build-trie.d.ts +40 -42
- package/build/src/build-trie.d.ts.map +1 -1
- package/build/src/compiler-callbacks.d.ts +4 -6
- package/build/src/compiler-callbacks.d.ts.map +1 -1
- package/build/src/join-word-breaker-decorator.d.ts +10 -12
- package/build/src/join-word-breaker-decorator.d.ts.map +1 -1
- package/build/src/lexical-model-compiler.d.ts +31 -33
- package/build/src/lexical-model-compiler.d.ts.map +1 -1
- package/build/src/lexical-model.d.ts +135 -137
- package/build/src/lexical-model.d.ts.map +1 -1
- package/build/src/main.d.ts +3 -5
- package/build/src/main.d.ts.map +1 -1
- package/build/src/model-compiler-messages.d.ts +51 -53
- package/build/src/model-compiler-messages.d.ts.map +1 -1
- package/build/src/model-defaults.d.ts +56 -58
- package/build/src/model-defaults.d.ts.map +1 -1
- package/build/src/model-definitions.d.ts +71 -73
- package/build/src/model-definitions.d.ts.map +1 -1
- package/build/src/script-overrides-decorator.d.ts +4 -6
- package/build/src/script-overrides-decorator.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -1,42 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* - UTF-
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* @param
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* @param
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
//# debugId=82977ed1-376e-5f0d-8872-7a0c42176370
|
|
42
|
-
//# sourceMappingURL=build-trie.d.ts.map
|
|
1
|
+
/**
|
|
2
|
+
* A word list is (conceptually) an array of pairs: the concrete word form itself + a
|
|
3
|
+
* non-negative count.
|
|
4
|
+
*
|
|
5
|
+
* Since each word should only appear once within the list, we represent it with
|
|
6
|
+
* an associative array pattern keyed by the wordform.
|
|
7
|
+
*/
|
|
8
|
+
export type WordList = {
|
|
9
|
+
[wordform: string]: number;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Returns a data structure that can be loaded by the TrieModel.
|
|
13
|
+
*
|
|
14
|
+
* It implements a **weighted** trie, whose indices (paths down the trie) are
|
|
15
|
+
* generated by a search key, and not concrete wordforms themselves.
|
|
16
|
+
*
|
|
17
|
+
* @param sourceFiles an array of source files that will be read to generate the trie.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createTrieDataStructure(filenames: string[], searchTermToKey?: (wf: string) => string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Parses a word list from a file, merging duplicate entries.
|
|
22
|
+
*
|
|
23
|
+
* The word list may be encoded in:
|
|
24
|
+
*
|
|
25
|
+
* - UTF-8, with or without BOM [exported by most software]
|
|
26
|
+
* - UTF-16, little endian, with BOM [exported by Microsoft Excel]
|
|
27
|
+
*
|
|
28
|
+
* @param wordlist word list to merge entries into (may have existing entries)
|
|
29
|
+
* @param filename filename of the word list
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseWordListFromFilename(wordlist: WordList, filename: string): void;
|
|
32
|
+
/**
|
|
33
|
+
* Parses a word list from a string. The string should have multiple lines
|
|
34
|
+
* with LF or CRLF line terminators.
|
|
35
|
+
*
|
|
36
|
+
* @param wordlist word list to merge entries into (may have existing entries)
|
|
37
|
+
* @param filename filename of the word list
|
|
38
|
+
*/
|
|
39
|
+
export declare function parseWordListFromContents(wordlist: WordList, contents: string): void;
|
|
40
|
+
//# sourceMappingURL=build-trie.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"version":3,"file":"build-trie.d.ts","sourceRoot":"","sources":["../../src/build-trie.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,GAAG;IAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;CAAC,CAAC;AAEpD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAU7G;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAGpF;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAGpF"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare
|
|
4
|
-
|
|
5
|
-
//# debugId=5109171c-973d-5245-a6d1-34f3dcd574be
|
|
6
|
-
//# sourceMappingURL=compiler-callbacks.d.ts.map
|
|
1
|
+
import { CompilerCallbacks } from "@keymanapp/common-types";
|
|
2
|
+
export declare let callbacks: CompilerCallbacks;
|
|
3
|
+
export declare function setCompilerCallbacks(c: CompilerCallbacks): void;
|
|
4
|
+
//# sourceMappingURL=compiler-callbacks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"version":3,"file":"compiler-callbacks.d.ts","sourceRoot":"","sources":["../../src/compiler-callbacks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,eAAO,IAAI,SAAS,EAAE,iBAAiB,CAAC;AAExC,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,iBAAiB,QAExD"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
/// <reference types="@keymanapp/models-types" />
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @param
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
//# debugId=ca1f6008-5474-5b1f-a8e0-5e03178980fa
|
|
12
|
-
//# sourceMappingURL=join-word-breaker-decorator.d.ts.map
|
|
1
|
+
/// <reference types="@keymanapp/models-types" />
|
|
2
|
+
/**
|
|
3
|
+
* Returns a word breaker that joins spans of an existing word breaker.
|
|
4
|
+
* Spans are joined if they are connected by a delimiter.
|
|
5
|
+
*
|
|
6
|
+
* @param breaker The word breaker whose results will be decorated.
|
|
7
|
+
* @param joiners What delimiters should be used to join spans.
|
|
8
|
+
*/
|
|
9
|
+
export declare function decorateWithJoin(breaker: WordBreakingFunction, joiners: string[]): WordBreakingFunction;
|
|
10
|
+
//# sourceMappingURL=join-word-breaker-decorator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"version":3,"file":"join-word-breaker-decorator.d.ts","sourceRoot":"","sources":["../../src/join-word-breaker-decorator.ts"],"names":[],"mappings":";AAEA;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,oBAAoB,CA4HvG"}
|
|
@@ -1,33 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* @param
|
|
26
|
-
* @param
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
//# debugId=1bc80df3-48dc-5244-9634-1f202c49337f
|
|
33
|
-
//# sourceMappingURL=lexical-model-compiler.d.ts.map
|
|
1
|
+
import { LexicalModelSource } from "./lexical-model.js";
|
|
2
|
+
import { CompilerCallbacks, CompilerOptions, KeymanCompiler, KeymanCompilerArtifact, KeymanCompilerArtifacts, KeymanCompilerResult } from "@keymanapp/common-types";
|
|
3
|
+
export interface LexicalModelCompilerArtifacts extends KeymanCompilerArtifacts {
|
|
4
|
+
js: KeymanCompilerArtifact;
|
|
5
|
+
}
|
|
6
|
+
export interface LexicalModelCompilerResult extends KeymanCompilerResult {
|
|
7
|
+
artifacts: LexicalModelCompilerArtifacts;
|
|
8
|
+
}
|
|
9
|
+
export declare class LexicalModelCompiler implements KeymanCompiler {
|
|
10
|
+
init(callbacks: CompilerCallbacks, _options: CompilerOptions): Promise<boolean>;
|
|
11
|
+
run(inputFilename: string, outputFilename?: string): Promise<LexicalModelCompilerResult>;
|
|
12
|
+
write(artifacts: LexicalModelCompilerArtifacts): Promise<boolean>;
|
|
13
|
+
/**
|
|
14
|
+
* Loads a lexical model's source module from the given filename.
|
|
15
|
+
*
|
|
16
|
+
* @param filename path to the model source file.
|
|
17
|
+
*/
|
|
18
|
+
loadFromFilename(filename: string): LexicalModelSource;
|
|
19
|
+
/**
|
|
20
|
+
* Returns the generated code for the model that will ultimately be loaded by
|
|
21
|
+
* the LMLayer worker. This code contains all model parameters, and specifies
|
|
22
|
+
* word breakers and auxilary functions that may be required.
|
|
23
|
+
*
|
|
24
|
+
* @param model_id The model ID. TODO: not sure if this is actually required!
|
|
25
|
+
* @param modelSource A specification of the model to compile
|
|
26
|
+
* @param sourcePath Where to find auxilary sources files
|
|
27
|
+
*/
|
|
28
|
+
generateLexicalModelCode(model_id: string, modelSource: LexicalModelSource, sourcePath: string): string;
|
|
29
|
+
transpileSources(sources: Array<string>): Array<string>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=lexical-model-compiler.d.ts.map
|
|
@@ -1 +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,EAAE,EAAE,sBAAsB,CAAC;CAC5B;AAED,MAAM,WAAW,0BAA2B,SAAQ,oBAAoB;IACtE,SAAS,EAAE,6BAA6B,CAAC;CAC1C;AAED,qBAAa,oBAAqB,YAAW,cAAc;IAEnD,IAAI,CAAC,SAAS,EAAE,iBAAiB,EAAE,QAAQ,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC;IAK/E,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAwBxF,KAAK,CAAC,SAAS,EAAE,6BAA6B,GAAG,OAAO,CAAC,OAAO,CAAC;IAKvE;;;;OAIG;IACI,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB;IA8B7D;;;;;;;;OAQG;IACH,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM;IAiE9F,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;CAUxD"}
|
|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92
|
-
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
* - '
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* -
|
|
117
|
-
* - word
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
*
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
//# debugId=94f66ee3-becb-53a9-9cc1-28e99f0ada0e
|
|
137
|
-
//# sourceMappingURL=lexical-model.d.ts.map
|
|
1
|
+
/**
|
|
2
|
+
* Interfaces and constants used by the lexical model compiler. These target
|
|
3
|
+
* the LMLayer's internal worker code, so we provide those definitions too.
|
|
4
|
+
*/
|
|
5
|
+
/// <reference types="@keymanapp/models-types" />
|
|
6
|
+
export interface LexicalModelDeclaration {
|
|
7
|
+
readonly format: 'trie-1.0' | 'fst-foma-1.0' | 'custom-1.0';
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Keyman 14.0+ word breaker specification:
|
|
11
|
+
*
|
|
12
|
+
* Can support all old word breaking specification,
|
|
13
|
+
* but can also be extended with options.
|
|
14
|
+
*
|
|
15
|
+
* @since 14.0
|
|
16
|
+
*/
|
|
17
|
+
export interface WordBreakerSpec {
|
|
18
|
+
readonly use: SimpleWordBreakerSpec;
|
|
19
|
+
/**
|
|
20
|
+
* If present, joins words that were split by the word breaker
|
|
21
|
+
* together at the given strings. e.g.,
|
|
22
|
+
*
|
|
23
|
+
* joinWordsAt: ['-'] // to keep hyphenated items together
|
|
24
|
+
*
|
|
25
|
+
* @since 14.0
|
|
26
|
+
*/
|
|
27
|
+
readonly joinWordsAt?: string[];
|
|
28
|
+
/**
|
|
29
|
+
* Overrides word splitting behaviour for certain scripts.
|
|
30
|
+
* For example, specifing that spaces break words in certain South-East
|
|
31
|
+
* Asian scripts that otherwise do not use spaces.
|
|
32
|
+
*
|
|
33
|
+
* @since 14.0
|
|
34
|
+
*/
|
|
35
|
+
readonly overrideScriptDefaults?: OverrideScriptDefaults;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Simplified word breaker specification.
|
|
39
|
+
*
|
|
40
|
+
* @since 11.0
|
|
41
|
+
*/
|
|
42
|
+
export type SimpleWordBreakerSpec = 'default' | 'ascii' | WordBreakingFunction;
|
|
43
|
+
/**
|
|
44
|
+
* Simplifies input text to facilitate finding entries within a lexical model's
|
|
45
|
+
* lexicon.
|
|
46
|
+
* @since 11.0
|
|
47
|
+
*/
|
|
48
|
+
export type SimpleWordformToKeySpec = (term: string) => string;
|
|
49
|
+
/**
|
|
50
|
+
* Simplifies input text to facilitate finding entries within a lexical model's
|
|
51
|
+
* lexicon, using the model's `applyCasing` function to assist in the keying process.
|
|
52
|
+
* @since 14.0
|
|
53
|
+
*/
|
|
54
|
+
export type CasedWordformToKeySpec = (term: string, applyCasing?: CasingFunction) => string;
|
|
55
|
+
/**
|
|
56
|
+
* Simplifies input text to facilitate finding entries within a lexical model's
|
|
57
|
+
* lexicon.
|
|
58
|
+
*/
|
|
59
|
+
export type WordformToKeySpec = SimpleWordformToKeySpec | CasedWordformToKeySpec;
|
|
60
|
+
/**
|
|
61
|
+
* Override the default word breaking behaviour for some scripts.
|
|
62
|
+
*
|
|
63
|
+
* There is currently only one option:
|
|
64
|
+
*
|
|
65
|
+
* 'break-words-at-spaces'
|
|
66
|
+
* : some South-East Asian scripts conventionally do not use space or any
|
|
67
|
+
* explicit word boundary character to write word breaks. These scripts are:
|
|
68
|
+
*
|
|
69
|
+
* * Burmese
|
|
70
|
+
* * Khmer
|
|
71
|
+
* * Thai
|
|
72
|
+
* * Laos
|
|
73
|
+
*
|
|
74
|
+
* (this list may be incomplete and extended in the future)
|
|
75
|
+
*
|
|
76
|
+
* For these scripts, the default word breaker breaks at **every**
|
|
77
|
+
* letter/syllable/ideograph. However, in languages that use these scripts BUT
|
|
78
|
+
* use spaces (or some other delimier) as word breaks, enable
|
|
79
|
+
* 'break-words-at-spaces'; enabling 'break-words-at-spaces' prevents the word
|
|
80
|
+
* breaker from making too many breaks in these scripts.
|
|
81
|
+
*
|
|
82
|
+
* @since 14.0
|
|
83
|
+
*/
|
|
84
|
+
export type OverrideScriptDefaults = 'break-words-at-spaces';
|
|
85
|
+
export interface LexicalModelSource extends LexicalModelDeclaration {
|
|
86
|
+
readonly sources: Array<string>;
|
|
87
|
+
/**
|
|
88
|
+
* The name of the type to instantiate (without parameters) as the base object for a custom predictive model.
|
|
89
|
+
*/
|
|
90
|
+
readonly rootClass?: string;
|
|
91
|
+
/**
|
|
92
|
+
* When set to `true`, suggestions will attempt to match the case of the input text even if
|
|
93
|
+
* the lexicon entries use a different casing scheme due to search term keying effects.
|
|
94
|
+
* @since 14.0
|
|
95
|
+
*/
|
|
96
|
+
readonly languageUsesCasing?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Specifies the casing rules for a language. Should implement three casing forms:
|
|
99
|
+
* - 'lower' -- a fully-lowercased version of the text appropriate for the language's
|
|
100
|
+
* use of the writing system.
|
|
101
|
+
* - 'upper' -- a fully-uppercased version of the text
|
|
102
|
+
* - 'initial' -- a version preserving the input casing aside from the initial character,
|
|
103
|
+
* which is uppercased (like with proper nouns and sentence-initial words in English
|
|
104
|
+
* sentences.)
|
|
105
|
+
*
|
|
106
|
+
* This is only utilized if `languageUsesCasing` is defined and set to `true`.
|
|
107
|
+
* @since 14.0
|
|
108
|
+
*/
|
|
109
|
+
readonly applyCasing?: CasingFunction;
|
|
110
|
+
/**
|
|
111
|
+
* Which word breaker to use. Choose from:
|
|
112
|
+
*
|
|
113
|
+
* - 'default' -- breaks according to Unicode UAX #29 §4.1 Default Word
|
|
114
|
+
* Boundary Specification, which works well for *most* languages.
|
|
115
|
+
* - 'ascii' -- a very simple word breaker, for demonstration purposes only.
|
|
116
|
+
* - word breaking function -- provide your own function that breaks words.
|
|
117
|
+
* - class-based word-breaker - may be supported in the future.
|
|
118
|
+
*/
|
|
119
|
+
readonly wordBreaker?: WordBreakerSpec | SimpleWordBreakerSpec;
|
|
120
|
+
/**
|
|
121
|
+
* How to simplify words, to convert them into simplified search keys
|
|
122
|
+
* This often involves removing accents, lowercasing, etc.
|
|
123
|
+
*/
|
|
124
|
+
readonly searchTermToKey?: WordformToKeySpec;
|
|
125
|
+
/**
|
|
126
|
+
* Punctuation and spacing suggested by the model.
|
|
127
|
+
*
|
|
128
|
+
* @see LexicalModelPunctuation
|
|
129
|
+
*/
|
|
130
|
+
readonly punctuation?: LexicalModelPunctuation;
|
|
131
|
+
}
|
|
132
|
+
export interface LexicalModelCompiled extends LexicalModelDeclaration {
|
|
133
|
+
readonly id: string;
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=lexical-model.d.ts.map
|
|
@@ -1 +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;;;;;;;GAOG;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,sBAAs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53de-a527-92aa4f2e19d0
|
|
5
|
-
//# sourceMappingURL=main.d.ts.map
|
|
1
|
+
export { LexicalModelCompiler } from './lexical-model-compiler.js';
|
|
2
|
+
export { ModelCompilerMessages } from './model-compiler-messages.js';
|
|
3
|
+
//# sourceMappingURL=main.d.ts.map
|
package/build/src/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -1,53 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
static
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
static
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
static
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
static
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
static
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
static
|
|
28
|
-
static
|
|
29
|
-
static
|
|
30
|
-
static
|
|
31
|
-
static
|
|
32
|
-
static
|
|
33
|
-
static
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
static
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
event: CompilerEvent;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
//# debugId=d754c5c8-0a2c-5d7a-895e-3a8bec5326f4
|
|
53
|
-
//# sourceMappingURL=model-compiler-messages.d.ts.map
|
|
1
|
+
import { CompilerEvent } from "@keymanapp/common-types";
|
|
2
|
+
export declare class ModelCompilerMessageContext {
|
|
3
|
+
static line: number;
|
|
4
|
+
static filename: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class ModelCompilerMessages {
|
|
7
|
+
static Fatal_UnexpectedException: (o: {
|
|
8
|
+
e: any;
|
|
9
|
+
}) => CompilerEvent;
|
|
10
|
+
static FATAL_UnexpectedException: number;
|
|
11
|
+
static Hint_MixedNormalizationForms: (o: {
|
|
12
|
+
wordform: string;
|
|
13
|
+
}) => CompilerEvent;
|
|
14
|
+
static HINT_MixedNormalizationForms: number;
|
|
15
|
+
static Hint_DuplicateWordInSameFile: (o: {
|
|
16
|
+
wordform: string;
|
|
17
|
+
}) => CompilerEvent;
|
|
18
|
+
static HINT_DuplicateWordInSameFile: number;
|
|
19
|
+
static Error_UnimplementedModelFormat: (o: {
|
|
20
|
+
format: string;
|
|
21
|
+
}) => CompilerEvent;
|
|
22
|
+
static ERROR_UnimplementedModelFormat: number;
|
|
23
|
+
static Error_UnknownModelFormat: (o: {
|
|
24
|
+
format: string;
|
|
25
|
+
}) => CompilerEvent;
|
|
26
|
+
static ERROR_UnknownModelFormat: number;
|
|
27
|
+
static Error_NoDefaultExport: () => CompilerEvent;
|
|
28
|
+
static ERROR_NoDefaultExport: number;
|
|
29
|
+
static Error_SearchTermToKeyMustBeExplicitlySpecified: () => CompilerEvent;
|
|
30
|
+
static ERROR_SearchTermToKeyMustBeExplicitlySpecified: number;
|
|
31
|
+
static Error_UTF16BEUnsupported: () => CompilerEvent;
|
|
32
|
+
static ERROR_UTF16BEUnsupported: number;
|
|
33
|
+
static Error_UnknownWordBreaker: (o: {
|
|
34
|
+
spec: string;
|
|
35
|
+
}) => CompilerEvent;
|
|
36
|
+
static ERROR_UnknownWordBreaker: number;
|
|
37
|
+
static Error_UnsupportedScriptOverride: (o: {
|
|
38
|
+
option: string;
|
|
39
|
+
}) => CompilerEvent;
|
|
40
|
+
static ERROR_UnsupportedScriptOverride: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A ModelCompilerError should be thrown when an unrecoverable error occurs that
|
|
44
|
+
* would block further compilation. It will be caught in the top-most compiler
|
|
45
|
+
* API endpoint and converted into a callback message.
|
|
46
|
+
*/
|
|
47
|
+
export declare class ModelCompilerError extends Error {
|
|
48
|
+
event: CompilerEvent;
|
|
49
|
+
constructor(event: CompilerEvent);
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=model-compiler-messages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"version":3,"file":"model-compiler-messages.d.ts","sourceRoot":"","sources":["../../src/model-compiler-messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiD,aAAa,EAAuB,MAAM,yBAAyB,CAAC;AAe5H,qBAAa,2BAA2B;IAEtC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC;CACzB;AAED,qBAAa,qBAAqB;IAEhC,MAAM,CAAC,yBAAyB,MAAM;QAAC,CAAC,EAAE,GAAG,CAAA;KAAC,mBAAqE;IACnH,MAAM,CAAC,yBAAyB,SAAqB;IAErD,MAAM,CAAC,4BAA4B,MAAM;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAC,mBACkB;IAC7E,MAAM,CAAC,4BAA4B,SAAoB;IAEvD,MAAM,CAAC,4BAA4B,MAAM;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAC,mBACY;IACvE,MAAM,CAAC,4BAA4B,SAAoB;IAEvD,MAAM,CAAC,8BAA8B,MAAM;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,mBACd;IAC7C,MAAM,CAAC,8BAA8B,SAAqB;IAE1D,MAAM,CAAC,wBAAwB,MAAM;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,mBACR;IAC7C,MAAM,CAAC,wBAAwB,SAAqB;IAEpD,MAAM,CAAC,qBAAqB,sBACwE;IACpG,MAA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50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
//# debugId=9a5871e0-b721-5738-8625-272cb6f5e965
|
|
58
|
-
//# sourceMappingURL=model-defaults.d.ts.map
|
|
1
|
+
/// <reference types="@keymanapp/models-types" />
|
|
2
|
+
/**
|
|
3
|
+
* Converts wordforms into an indexable form. It does this by
|
|
4
|
+
* normalizing the letter case of characters INDIVIDUALLY (to disregard
|
|
5
|
+
* context-sensitive case transformations), normalizing to NFKD form,
|
|
6
|
+
* and removing common diacritical marks.
|
|
7
|
+
*
|
|
8
|
+
* This is a very speculative implementation, that might work with
|
|
9
|
+
* your language. We don't guarantee that this will be perfect for your
|
|
10
|
+
* language, but it's a start.
|
|
11
|
+
*
|
|
12
|
+
* This uses String.prototype.normalize() to convert normalize into NFKD.
|
|
13
|
+
* NFKD neutralizes some funky distinctions, e.g., ꬲ, e, e should all be the
|
|
14
|
+
* same character; plus, it's an easy way to separate a Latin character from
|
|
15
|
+
* its diacritics; Even then, orthographies regularly use code points
|
|
16
|
+
* that, under NFKD normalization, do NOT decompose appropriately for your
|
|
17
|
+
* language (e.g., SENĆOŦEN, Plains Cree in syllabics).
|
|
18
|
+
*
|
|
19
|
+
* Use this in early iterations of the model. For a production lexical model,
|
|
20
|
+
* you will probably write/generate your own key function, tailored to your
|
|
21
|
+
* language. There is a chance the default will work properly out of the box.
|
|
22
|
+
*/
|
|
23
|
+
export declare function defaultSearchTermToKey(wordform: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Converts wordforms into an indexable form. It does this by
|
|
26
|
+
* normalizing the letter case of characters INDIVIDUALLY (to disregard
|
|
27
|
+
* context-sensitive case transformations), normalizing to NFKD form,
|
|
28
|
+
* and removing common diacritical marks.
|
|
29
|
+
*
|
|
30
|
+
* This is a very speculative implementation, that might work with
|
|
31
|
+
* your language. We don't guarantee that this will be perfect for your
|
|
32
|
+
* language, but it's a start.
|
|
33
|
+
*
|
|
34
|
+
* This uses String.prototype.normalize() to convert normalize into NFKD.
|
|
35
|
+
* NFKD neutralizes some funky distinctions, e.g., ꬲ, e, e should all be the
|
|
36
|
+
* same character; plus, it's an easy way to separate a Latin character from
|
|
37
|
+
* its diacritics; Even then, orthographies regularly use code points
|
|
38
|
+
* that, under NFKD normalization, do NOT decompose appropriately for your
|
|
39
|
+
* language (e.g., SENĆOŦEN, Plains Cree in syllabics).
|
|
40
|
+
*
|
|
41
|
+
* Use this in early iterations of the model. For a production lexical model,
|
|
42
|
+
* you will probably write/generate your own key function, tailored to your
|
|
43
|
+
* language. There is a chance the default will work properly out of the box.
|
|
44
|
+
*/
|
|
45
|
+
export declare function defaultCasedSearchTermToKey(wordform: string, applyCasing: CasingFunction): string;
|
|
46
|
+
/**
|
|
47
|
+
* Specifies default casing behavior for lexical models when `languageUsesCasing` is
|
|
48
|
+
* set to true.
|
|
49
|
+
* @param casing One of 'lower' (lowercased), 'upper' (uppercased), or 'initial'.
|
|
50
|
+
*
|
|
51
|
+
* 'initial' is designed to cover cases like sentence-initial & proper noun capitalization in English.
|
|
52
|
+
* This may be overwritten as appropriate in model-specific implementations.
|
|
53
|
+
* @param text The text to be modified.
|
|
54
|
+
*/
|
|
55
|
+
export declare function defaultApplyCasing(casing: CasingForm, text: string): string;
|
|
56
|
+
//# sourceMappingURL=model-defaults.d.ts.map
|
|
@@ -1 +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,CAW/D;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,GAAG,MAAM,CAiBjG;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CA2B3E"}
|
|
@@ -1,73 +1,71 @@
|
|
|
1
|
-
/// <reference types="@keymanapp/models-types" />
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
*
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
*
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
//# debugId=da50a2a7-71d5-57a0-9a0c-c905d304ad11
|
|
73
|
-
//# sourceMappingURL=model-definitions.d.ts.map
|
|
1
|
+
/// <reference types="@keymanapp/models-types" />
|
|
2
|
+
import { LexicalModelSource, WordformToKeySpec } from "./lexical-model.js";
|
|
3
|
+
/**
|
|
4
|
+
* Processes certain defined model behaviors in such a way that the needed closures
|
|
5
|
+
* may be safely compiled to a JS file and loaded within the LMLayer.
|
|
6
|
+
*
|
|
7
|
+
* This is accomplished by writing out a 'pseudoclosure' within the model's IIFE,
|
|
8
|
+
* then used to build _actual_ closures at LMLayer load time. This 'pseudoclosure'
|
|
9
|
+
* will very closely match the organizational patterns of this class in order to
|
|
10
|
+
* facilitate the maintenance of this approach.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ModelDefinitions {
|
|
13
|
+
static readonly COMPILED_NAME = "definitions";
|
|
14
|
+
/**
|
|
15
|
+
* A closure fully implementing the model's defined `applyCasing` behavior with
|
|
16
|
+
* the function parameter preset to the version-appropriate default.
|
|
17
|
+
* `defaults.applyCasing` is captured as part of the closure.
|
|
18
|
+
*
|
|
19
|
+
* During compilation of some models (such as Trie-based wordlist templated models),
|
|
20
|
+
* this closure will be directly used as part of searchTermToKey.
|
|
21
|
+
*
|
|
22
|
+
* In compiled code, this will instead be defined in-line as an autogenerated closure
|
|
23
|
+
* using the other properties of the pseudoclosure.
|
|
24
|
+
*/
|
|
25
|
+
applyCasing?: CasingFunction;
|
|
26
|
+
/**
|
|
27
|
+
* A closure fully implementing the model's defined `searchTermToKey` behavior
|
|
28
|
+
* based upon the model's specified casing rules. The `applyCasing` closure is
|
|
29
|
+
* itself captured within this closure.
|
|
30
|
+
*
|
|
31
|
+
* During compilation of some models (such as Trie-based wordlist templated models),
|
|
32
|
+
* this closure will be directly utilized when compiling the lexicon.
|
|
33
|
+
*
|
|
34
|
+
* In compiled code, this will instead be defined in-line as an autogenerated closure
|
|
35
|
+
* using the other properties of the pseudoclosure.
|
|
36
|
+
*/
|
|
37
|
+
searchTermToKey?: WordformToKeySpec;
|
|
38
|
+
/**
|
|
39
|
+
* Contains embedded 'default' implementations that may be needed for
|
|
40
|
+
* closures in the compiled version, annotated with the current version
|
|
41
|
+
* of Developer.
|
|
42
|
+
*/
|
|
43
|
+
private defaults;
|
|
44
|
+
/**
|
|
45
|
+
* Contains the model-specific definitions specified in the model's source.
|
|
46
|
+
*
|
|
47
|
+
* These definitions may expect `defaults.applyCasing` as a parameter in
|
|
48
|
+
* their final closures.
|
|
49
|
+
*/
|
|
50
|
+
private model;
|
|
51
|
+
constructor(modelSource: LexicalModelSource);
|
|
52
|
+
/**
|
|
53
|
+
* Writes out a compiled JS version of the pseudoclosure, preserving all function
|
|
54
|
+
* implementations.
|
|
55
|
+
*
|
|
56
|
+
* This should be written to the file within the same IIFE as the model but BEFORE
|
|
57
|
+
* the model itself, as the model will need to refer to the definitions herein.
|
|
58
|
+
*/
|
|
59
|
+
compileDefinitions(): string;
|
|
60
|
+
/**
|
|
61
|
+
* Compiles the model-options entry for `searchTermToKey` in reference to the
|
|
62
|
+
* compiled pseudoclosure.
|
|
63
|
+
*/
|
|
64
|
+
compileSearchTermToKey(): string;
|
|
65
|
+
/**
|
|
66
|
+
* Compiles the model-options entry for `applyCasing` in reference to the
|
|
67
|
+
* compiled pseudoclosure.
|
|
68
|
+
*/
|
|
69
|
+
compileApplyCasing(): string;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=model-definitions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"version":3,"file":"model-definitions.d.ts","sourceRoot":"","sources":["../../src/model-definitions.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE3E;;;;;;;;GAQG;AACH,qBAAa,gBAAgB;IAC3B,MAAM,CAAC,QAAQ,CAAC,aAAa,iBAAiB;IAC9C;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAE7B;;;;;;;;;;OAUG;IACH,eAAe,CAAC,EAAE,iBAAiB,CAAC;IAEpC;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAKd;IAEF;;;;;OAKG;IACH,OAAO,CAAC,KAAK,CAGN;gBAEK,WAAW,EAAE,kBAAkB;IAsD3C;;;;;;OAMG;IACH,kBAAkB,IAAI,MAAM;IAuE5B;;;OAGG;IACH,sBAAsB,IAAI,MAAM;IAMhC;;;OAGG;IACH,kBAAkB,IAAI,MAAM;CAI7B"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/// <reference types="@keymanapp/models-types" />
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
//# debugId=82b84a7e-8421-59a6-8b07-a1c5850d036b
|
|
6
|
-
//# sourceMappingURL=script-overrides-decorator.d.ts.map
|
|
1
|
+
/// <reference types="@keymanapp/models-types" />
|
|
2
|
+
import { OverrideScriptDefaults } from "./lexical-model.js";
|
|
3
|
+
export declare function decorateWithScriptOverrides(breaker: WordBreakingFunction, option: OverrideScriptDefaults): (phrase: string) => Span[];
|
|
4
|
+
//# sourceMappingURL=script-overrides-decorator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"version":3,"file":"script-overrides-decorator.d.ts","sourceRoot":"","sources":["../../src/script-overrides-decorator.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAG5D,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,sBAAsB,YAgB/D,MAAM,KAAG,IAAI,EAAE,CAwDxD"}
|
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.258-alpha",
|
|
34
|
+
"@keymanapp/keyman-version": "17.0.258-alpha",
|
|
35
|
+
"@keymanapp/models-types": "17.0.258-alpha",
|
|
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.258-alpha",
|
|
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.258-alpha"
|
|
73
73
|
}
|