hybridtm 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +233 -0
- package/README.md +116 -0
- package/dist/batchimporter.d.ts +22 -0
- package/dist/batchimporter.js +203 -0
- package/dist/batchimporter.js.map +1 -0
- package/dist/constants.d.ts +15 -0
- package/dist/constants.js +16 -0
- package/dist/constants.js.map +1 -0
- package/dist/debug-progress.d.ts +12 -0
- package/dist/debug-progress.js +49 -0
- package/dist/debug-progress.js.map +1 -0
- package/dist/hybridtm.d.ts +66 -0
- package/dist/hybridtm.js +912 -0
- package/dist/hybridtm.js.map +1 -0
- package/dist/hybridtmFactory.d.ts +43 -0
- package/dist/hybridtmFactory.js +165 -0
- package/dist/hybridtmFactory.js.map +1 -0
- package/dist/importOptions.d.ts +21 -0
- package/dist/importOptions.js +24 -0
- package/dist/importOptions.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/langEntry.d.ts +64 -0
- package/dist/langEntry.js +13 -0
- package/dist/langEntry.js.map +1 -0
- package/dist/match.d.ts +22 -0
- package/dist/match.js +38 -0
- package/dist/match.js.map +1 -0
- package/dist/matchQuality.d.ts +16 -0
- package/dist/matchQuality.js +83 -0
- package/dist/matchQuality.js.map +1 -0
- package/dist/ngramIndex.d.ts +31 -0
- package/dist/ngramIndex.js +132 -0
- package/dist/ngramIndex.js.map +1 -0
- package/dist/ngrams.d.ts +21 -0
- package/dist/ngrams.js +73 -0
- package/dist/ngrams.js.map +1 -0
- package/dist/pendingEntry.d.ts +24 -0
- package/dist/pendingEntry.js +13 -0
- package/dist/pendingEntry.js.map +1 -0
- package/dist/progressProvider.d.ts +17 -0
- package/dist/progressProvider.js +14 -0
- package/dist/progressProvider.js.map +1 -0
- package/dist/searchFilters.d.ts +24 -0
- package/dist/searchFilters.js +13 -0
- package/dist/searchFilters.js.map +1 -0
- package/dist/simplexlifftest.d.ts +1 -0
- package/dist/simplexlifftest.js +23 -0
- package/dist/simplexlifftest.js.map +1 -0
- package/dist/test-import.d.ts +12 -0
- package/dist/test-import.js +101 -0
- package/dist/test-import.js.map +1 -0
- package/dist/test-progress-fix.d.ts +1 -0
- package/dist/test-progress-fix.js +32 -0
- package/dist/test-progress-fix.js.map +1 -0
- package/dist/test-progress.d.ts +12 -0
- package/dist/test-progress.js +32 -0
- package/dist/test-progress.js.map +1 -0
- package/dist/tests/vectorSimilarityComparison.d.ts +12 -0
- package/dist/tests/vectorSimilarityComparison.js +153 -0
- package/dist/tests/vectorSimilarityComparison.js.map +1 -0
- package/dist/tmxhandler.d.ts +61 -0
- package/dist/tmxhandler.js +347 -0
- package/dist/tmxhandler.js.map +1 -0
- package/dist/tmxreader.d.ts +25 -0
- package/dist/tmxreader.js +51 -0
- package/dist/tmxreader.js.map +1 -0
- package/dist/tmxtest.d.ts +16 -0
- package/dist/tmxtest.js +316 -0
- package/dist/tmxtest.js.map +1 -0
- package/dist/utils.d.ts +17 -0
- package/dist/utils.js +49 -0
- package/dist/utils.js.map +1 -0
- package/dist/vectorSimilarityTester.d.ts +56 -0
- package/dist/vectorSimilarityTester.js +164 -0
- package/dist/vectorSimilarityTester.js.map +1 -0
- package/dist/xliffhandler.d.ts +67 -0
- package/dist/xliffhandler.js +522 -0
- package/dist/xliffhandler.js.map +1 -0
- package/dist/xliffreader.d.ts +25 -0
- package/dist/xliffreader.js +50 -0
- package/dist/xliffreader.js.map +1 -0
- package/dist/xlifftest.d.ts +54 -0
- package/dist/xlifftest.js +245 -0
- package/dist/xlifftest.js.map +1 -0
- package/package.json +33 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
Eclipse Public License - v 1.0
|
|
2
|
+
|
|
3
|
+
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
|
|
4
|
+
PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF
|
|
5
|
+
THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
|
6
|
+
|
|
7
|
+
1. DEFINITIONS
|
|
8
|
+
|
|
9
|
+
"Contribution" means:
|
|
10
|
+
|
|
11
|
+
a) in the case of the initial Contributor, the initial code and
|
|
12
|
+
documentation distributed under this Agreement, and
|
|
13
|
+
|
|
14
|
+
b) in the case of each subsequent Contributor:
|
|
15
|
+
|
|
16
|
+
i) changes to the Program, and
|
|
17
|
+
|
|
18
|
+
ii) additions to the Program;
|
|
19
|
+
|
|
20
|
+
where such changes and/or additions to the Program originate from
|
|
21
|
+
and are distributed by that particular Contributor. A Contribution
|
|
22
|
+
'originates' from a Contributor if it was added to the Program by
|
|
23
|
+
such Contributor itself or anyone acting on such Contributor's
|
|
24
|
+
behalf. Contributions do not include additions to the Program
|
|
25
|
+
which: (i) are separate modules of software distributed in
|
|
26
|
+
conjunction with the Program under their own license agreement,
|
|
27
|
+
and (ii) are not derivative works of the Program.
|
|
28
|
+
|
|
29
|
+
"Contributor" means any person or entity that distributes the Program.
|
|
30
|
+
|
|
31
|
+
"Licensed Patents" mean patent claims licensable by a Contributor
|
|
32
|
+
which are necessarily infringed by the use or sale of its Contribution
|
|
33
|
+
alone or when combined with the Program.
|
|
34
|
+
|
|
35
|
+
"Program" means the Contributions distributed in accordance with this
|
|
36
|
+
Agreement.
|
|
37
|
+
|
|
38
|
+
"Recipient" means anyone who receives the Program under this
|
|
39
|
+
Agreement, including all Contributors.
|
|
40
|
+
|
|
41
|
+
2. GRANT OF RIGHTS
|
|
42
|
+
|
|
43
|
+
a) Subject to the terms of this Agreement, each Contributor hereby
|
|
44
|
+
grants Recipient a non-exclusive, worldwide, royalty-free
|
|
45
|
+
copyright license to reproduce, prepare derivative works of,
|
|
46
|
+
publicly display, publicly perform, distribute and sublicense the
|
|
47
|
+
Contribution of such Contributor, if any, and such derivative
|
|
48
|
+
works, in source code and object code form.
|
|
49
|
+
|
|
50
|
+
b) Subject to the terms of this Agreement, each Contributor hereby
|
|
51
|
+
grants Recipient a non-exclusive, worldwide, royalty-free patent
|
|
52
|
+
license under Licensed Patents to make, use, sell, offer to sell,
|
|
53
|
+
import and otherwise transfer the Contribution of such
|
|
54
|
+
Contributor, if any, in source code and object code form. This
|
|
55
|
+
patent license shall apply to the combination of the Contribution
|
|
56
|
+
and the Program if, at the time the Contribution is added by the
|
|
57
|
+
Contributor, such addition of the Contribution causes such
|
|
58
|
+
combination to be covered by the Licensed Patents. The patent
|
|
59
|
+
license shall not apply to any other combinations which include
|
|
60
|
+
the Contribution. No hardware per se is licensed hereunder.
|
|
61
|
+
|
|
62
|
+
c) Recipient understands that although each Contributor grants the
|
|
63
|
+
licenses to its Contributions set forth herein, no assurances are
|
|
64
|
+
provided by any Contributor that the Program does not infringe the
|
|
65
|
+
patent or other intellectual property rights of any other
|
|
66
|
+
entity. Each Contributor disclaims any liability to Recipient for
|
|
67
|
+
claims brought by any other entity based on infringement of
|
|
68
|
+
intellectual property rights or otherwise. As a condition to
|
|
69
|
+
exercising the rights and licenses granted hereunder, each
|
|
70
|
+
Recipient hereby assumes sole responsibility to secure any other
|
|
71
|
+
intellectual property rights needed, if any. For example, if a
|
|
72
|
+
third party patent license is required to allow Recipient to
|
|
73
|
+
distribute the Program, it is Recipient's responsibility to
|
|
74
|
+
acquire that license before distributing the Program.
|
|
75
|
+
|
|
76
|
+
d) Each Contributor represents that to its knowledge it has
|
|
77
|
+
sufficient copyright rights in its Contribution, if any, to grant
|
|
78
|
+
the copyright license set forth in this Agreement.
|
|
79
|
+
|
|
80
|
+
3. REQUIREMENTS
|
|
81
|
+
|
|
82
|
+
A Contributor may choose to distribute the Program in object code form
|
|
83
|
+
under its own license agreement, provided that:
|
|
84
|
+
|
|
85
|
+
a) it complies with the terms and conditions of this Agreement;
|
|
86
|
+
and
|
|
87
|
+
|
|
88
|
+
b) its license agreement:
|
|
89
|
+
|
|
90
|
+
i) effectively disclaims on behalf of all Contributors all
|
|
91
|
+
warranties and conditions, express and implied, including
|
|
92
|
+
warranties or conditions of title and non-infringement, and
|
|
93
|
+
implied warranties or conditions of merchantability and fitness
|
|
94
|
+
for a particular purpose;
|
|
95
|
+
|
|
96
|
+
ii) effectively excludes on behalf of all Contributors all
|
|
97
|
+
liability for damages, including direct, indirect, special,
|
|
98
|
+
incidental and consequential damages, such as lost profits;
|
|
99
|
+
|
|
100
|
+
iii) states that any provisions which differ from this Agreement
|
|
101
|
+
are offered by that Contributor alone and not by any other party;
|
|
102
|
+
and
|
|
103
|
+
|
|
104
|
+
iv) states that source code for the Program is available from such
|
|
105
|
+
Contributor, and informs licensees how to obtain it in a
|
|
106
|
+
reasonable manner on or through a medium customarily used for
|
|
107
|
+
software exchange.
|
|
108
|
+
|
|
109
|
+
When the Program is made available in source code form:
|
|
110
|
+
|
|
111
|
+
a) it must be made available under this Agreement; and
|
|
112
|
+
|
|
113
|
+
b) a copy of this Agreement must be included with each copy of the
|
|
114
|
+
Program.
|
|
115
|
+
|
|
116
|
+
Contributors may not remove or alter any copyright notices contained
|
|
117
|
+
within the Program.
|
|
118
|
+
|
|
119
|
+
Each Contributor must identify itself as the originator of its
|
|
120
|
+
Contribution, if any, in a manner that reasonably allows subsequent
|
|
121
|
+
Recipients to identify the originator of the Contribution.
|
|
122
|
+
|
|
123
|
+
4. COMMERCIAL DISTRIBUTION
|
|
124
|
+
|
|
125
|
+
Commercial distributors of software may accept certain
|
|
126
|
+
responsibilities with respect to end users, business partners and the
|
|
127
|
+
like. While this license is intended to facilitate the commercial use
|
|
128
|
+
of the Program, the Contributor who includes the Program in a
|
|
129
|
+
commercial product offering should do so in a manner which does not
|
|
130
|
+
create potential liability for other Contributors. Therefore, if a
|
|
131
|
+
Contributor includes the Program in a commercial product offering,
|
|
132
|
+
such Contributor ("Commercial Contributor") hereby agrees to defend
|
|
133
|
+
and indemnify every other Contributor ("Indemnified Contributor")
|
|
134
|
+
against any losses, damages and costs (collectively "Losses") arising
|
|
135
|
+
from claims, lawsuits and other legal actions brought by a third party
|
|
136
|
+
against the Indemnified Contributor to the extent caused by the acts
|
|
137
|
+
or omissions of such Commercial Contributor in connection with its
|
|
138
|
+
distribution of the Program in a commercial product offering. The
|
|
139
|
+
obligations in this section do not apply to any claims or Losses
|
|
140
|
+
relating to any actual or alleged intellectual property
|
|
141
|
+
infringement. In order to qualify, an Indemnified Contributor must: a)
|
|
142
|
+
promptly notify the Commercial Contributor in writing of such claim,
|
|
143
|
+
and b) allow the Commercial Contributor to control, and cooperate with
|
|
144
|
+
the Commercial Contributor in, the defense and any related settlement
|
|
145
|
+
negotiations. The Indemnified Contributor may participate in any such
|
|
146
|
+
claim at its own expense.
|
|
147
|
+
|
|
148
|
+
For example, a Contributor might include the Program in a commercial
|
|
149
|
+
product offering, Product X. That Contributor is then a Commercial
|
|
150
|
+
Contributor. If that Commercial Contributor then makes performance
|
|
151
|
+
claims, or offers warranties related to Product X, those performance
|
|
152
|
+
claims and warranties are such Commercial Contributor's responsibility
|
|
153
|
+
alone. Under this section, the Commercial Contributor would have to
|
|
154
|
+
defend claims against the other Contributors related to those
|
|
155
|
+
performance claims and warranties, and if a court requires any other
|
|
156
|
+
Contributor to pay any damages as a result, the Commercial Contributor
|
|
157
|
+
must pay those damages.
|
|
158
|
+
|
|
159
|
+
5. NO WARRANTY
|
|
160
|
+
|
|
161
|
+
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
|
|
162
|
+
PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
163
|
+
KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
|
|
164
|
+
WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
|
|
165
|
+
OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
|
|
166
|
+
responsible for determining the appropriateness of using and
|
|
167
|
+
distributing the Program and assumes all risks associated with its
|
|
168
|
+
exercise of rights under this Agreement , including but not limited to
|
|
169
|
+
the risks and costs of program errors, compliance with applicable
|
|
170
|
+
laws, damage to or loss of data, programs or equipment, and
|
|
171
|
+
unavailability or interruption of operations.
|
|
172
|
+
|
|
173
|
+
6. DISCLAIMER OF LIABILITY
|
|
174
|
+
|
|
175
|
+
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR
|
|
176
|
+
ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
|
|
177
|
+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
|
|
178
|
+
WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
|
|
179
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
180
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
|
|
181
|
+
DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
|
|
182
|
+
HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
183
|
+
|
|
184
|
+
7. GENERAL
|
|
185
|
+
|
|
186
|
+
If any provision of this Agreement is invalid or unenforceable under
|
|
187
|
+
applicable law, it shall not affect the validity or enforceability of
|
|
188
|
+
the remainder of the terms of this Agreement, and without further
|
|
189
|
+
action by the parties hereto, such provision shall be reformed to the
|
|
190
|
+
minimum extent necessary to make such provision valid and enforceable.
|
|
191
|
+
|
|
192
|
+
If Recipient institutes patent litigation against any entity
|
|
193
|
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
194
|
+
the Program itself (excluding combinations of the Program with other
|
|
195
|
+
software or hardware) infringes such Recipient's patent(s), then such
|
|
196
|
+
Recipient's rights granted under Section 2(b) shall terminate as of
|
|
197
|
+
the date such litigation is filed.
|
|
198
|
+
|
|
199
|
+
All Recipient's rights under this Agreement shall terminate if it
|
|
200
|
+
fails to comply with any of the material terms or conditions of this
|
|
201
|
+
Agreement and does not cure such failure in a reasonable period of
|
|
202
|
+
time after becoming aware of such noncompliance. If all Recipient's
|
|
203
|
+
rights under this Agreement terminate, Recipient agrees to cease use
|
|
204
|
+
and distribution of the Program as soon as reasonably
|
|
205
|
+
practicable. However, Recipient's obligations under this Agreement and
|
|
206
|
+
any licenses granted by Recipient relating to the Program shall
|
|
207
|
+
continue and survive.
|
|
208
|
+
|
|
209
|
+
Everyone is permitted to copy and distribute copies of this Agreement,
|
|
210
|
+
but in order to avoid inconsistency the Agreement is copyrighted and
|
|
211
|
+
may only be modified in the following manner. The Agreement Steward
|
|
212
|
+
reserves the right to publish new versions (including revisions) of
|
|
213
|
+
this Agreement from time to time. No one other than the Agreement
|
|
214
|
+
Steward has the right to modify this Agreement. The Eclipse Foundation
|
|
215
|
+
is the initial Agreement Steward. The Eclipse Foundation may assign
|
|
216
|
+
the responsibility to serve as the Agreement Steward to a suitable
|
|
217
|
+
separate entity. Each new version of the Agreement will be given a
|
|
218
|
+
distinguishing version number. The Program (including Contributions)
|
|
219
|
+
may always be distributed subject to the version of the Agreement
|
|
220
|
+
under which it was received. In addition, after a new version of the
|
|
221
|
+
Agreement is published, Contributor may elect to distribute the
|
|
222
|
+
Program (including its Contributions) under the new version. Except as
|
|
223
|
+
expressly stated in Sections 2(a) and 2(b) above, Recipient receives
|
|
224
|
+
no rights or licenses to the intellectual property of any Contributor
|
|
225
|
+
under this Agreement, whether expressly, by implication, estoppel or
|
|
226
|
+
otherwise. All rights in the Program not expressly granted under this
|
|
227
|
+
Agreement are reserved.
|
|
228
|
+
|
|
229
|
+
This Agreement is governed by the laws of the State of New York and
|
|
230
|
+
the intellectual property laws of the United States of America. No
|
|
231
|
+
party to this Agreement will bring a legal action under this Agreement
|
|
232
|
+
more than one year after the cause of action arose. Each party waives
|
|
233
|
+
its rights to a jury trial in any resulting litigation.
|
package/README.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# HybridTM
|
|
2
|
+
|
|
3
|
+
HybridTM is a TypeScript translation memory engine that stores bilingual content in LanceDB and scores matches by combining semantic embeddings (Xenova/Transformers.js) with the built-in MatchQuality fuzzy metric.
|
|
4
|
+
|
|
5
|
+
## Highlights
|
|
6
|
+
|
|
7
|
+
- Imports XLIFF 2.x and TMX 1.4b files, preserving metadata, notes, and custom properties
|
|
8
|
+
- Generates semantic vectors with any Xenova-compatible text model (default: `HybridTM.QUALITY_MODEL`, LaBSE)
|
|
9
|
+
- Provides `semanticTranslationSearch`, `semanticSearch`, and `concordanceSearch` APIs with metadata-aware filtering
|
|
10
|
+
- Streams data into LanceDB through a JSONL-based batch importer to keep memory usage predictable
|
|
11
|
+
- Prevents duplicate segments by rewriting entries with deterministic IDs (`fileId:unitId:segmentIndex:lang`)
|
|
12
|
+
|
|
13
|
+
Models download automatically the first time you initialize an instance and are cached in the standard Hugging Face directory.
|
|
14
|
+
|
|
15
|
+
## Requirements
|
|
16
|
+
|
|
17
|
+
- Node.js 22 LTS or later
|
|
18
|
+
- npm 11+
|
|
19
|
+
- Disk space for both the LanceDB directory you choose and the embedding model cache
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install hybridtm
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Quick start
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
import path from 'node:path';
|
|
31
|
+
import { HybridTM, HybridTMFactory, Utils } from 'hybridtm';
|
|
32
|
+
|
|
33
|
+
const INSTANCE_NAME = 'docs-basic';
|
|
34
|
+
const DB_PATH = path.resolve('.hybridtm', INSTANCE_NAME + '.lancedb');
|
|
35
|
+
|
|
36
|
+
function getOrCreateTM(): HybridTM {
|
|
37
|
+
return HybridTMFactory.getInstance(INSTANCE_NAME)
|
|
38
|
+
?? HybridTMFactory.createInstance(INSTANCE_NAME, DB_PATH, HybridTM.QUALITY_MODEL);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async function main(): Promise<void> {
|
|
42
|
+
const tm = getOrCreateTM();
|
|
43
|
+
const source = Utils.buildXMLElement('<source>Hello world</source>');
|
|
44
|
+
const target = Utils.buildXMLElement('<target>Hola mundo</target>');
|
|
45
|
+
|
|
46
|
+
await tm.storeLangEntry('demo', 'demo.xlf', 'unit1', 'en', 'Hello world', source, undefined, 1, 1, { state: 'final' });
|
|
47
|
+
await tm.storeLangEntry('demo', 'demo.xlf', 'unit1', 'es', 'Hola mundo', target, undefined, 1, 1, { state: 'final' });
|
|
48
|
+
|
|
49
|
+
const matches = await tm.semanticTranslationSearch('Hi world', 'en', 'es', 50, 5);
|
|
50
|
+
matches.forEach((match) => {
|
|
51
|
+
console.log('Hybrid', match.hybridScore(), 'Semantic', match.semantic, 'Fuzzy', match.fuzzy);
|
|
52
|
+
console.log('Source:', match.source.toString());
|
|
53
|
+
console.log('Target:', match.target.toString());
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
await tm.close();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
main().catch((error) => {
|
|
60
|
+
console.error(error);
|
|
61
|
+
process.exit(1);
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Import XLIFF/TMX content at any time:
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
await tm.importXLIFF('./translations/project.xlf', { minState: 'reviewed' });
|
|
69
|
+
await tm.importTMX('./translations/legacy.tmx');
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
`semanticTranslationSearch` automatically pairs every source hit with its matching target segment (same `fileId`, `unitId`, and `segmentIndex`), making the output ready for CAT integrations.
|
|
73
|
+
|
|
74
|
+
## Documentation
|
|
75
|
+
|
|
76
|
+
- [01 · Getting Started](docs/01-getting-started.md)
|
|
77
|
+
- [02 · Importing Data](docs/02-importing-data.md)
|
|
78
|
+
- [03 · Search and Filtering](docs/03-search-and-filtering.md)
|
|
79
|
+
- [04 · Sample Scenarios](docs/04-sample-scenarios.md)
|
|
80
|
+
|
|
81
|
+
Each guide is short and task-oriented, so you can jump directly to the workflow you need.
|
|
82
|
+
|
|
83
|
+
## Runnable samples
|
|
84
|
+
|
|
85
|
+
The [samples](docs/04-sample-scenarios.md) project contains three scripts (`dev:basic`, `dev:import`, `dev:filters`) plus miniature XLIFF/TMX fixtures.
|
|
86
|
+
|
|
87
|
+
When working on the repository:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npm install
|
|
91
|
+
npm run build
|
|
92
|
+
cd samples
|
|
93
|
+
npm install
|
|
94
|
+
npm run dev:basic
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
If you copy `samples/` elsewhere, update `samples/package.json` so the `hybridtm` dependency points to the published version you intend to test, then run `npm install`.
|
|
98
|
+
|
|
99
|
+
## Project layout
|
|
100
|
+
|
|
101
|
+
- `ts/` – source files for the library
|
|
102
|
+
- `dist/` – compiled JavaScript and declarations (`npm run build`)
|
|
103
|
+
- `docs/` – task-focused tutorials referenced above
|
|
104
|
+
- `samples/` – standalone TypeScript project with runnable workflows
|
|
105
|
+
- `models/` – local cache for pre-downloaded Xenova models (optional)
|
|
106
|
+
|
|
107
|
+
## Development
|
|
108
|
+
|
|
109
|
+
- `npm run build` – compile TypeScript to `dist/`
|
|
110
|
+
- `node dist/tmxtest.js` and `node dist/xlifftest.js` – regression checks for the TMX and XLIFF importers (run after building)
|
|
111
|
+
|
|
112
|
+
Contributions should include unit or integration coverage when you touch importer or search logic. Use `HybridTMFactory.removeInstance(name)` to clean up any throwaway databases you create during manual tests.
|
|
113
|
+
|
|
114
|
+
## License
|
|
115
|
+
|
|
116
|
+
Eclipse Public License 1.0 — see [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*******************************************************************************
|
|
2
|
+
* Copyright (c) 2025-2026 Maxprograms.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials
|
|
5
|
+
* are made available under the terms of the Eclipse License 1.0
|
|
6
|
+
* which accompanies this distribution, and is available at
|
|
7
|
+
* https://www.eclipse.org/org/documents/epl-v10.html
|
|
8
|
+
*
|
|
9
|
+
* Contributors:
|
|
10
|
+
* Maxprograms - initial API and implementation
|
|
11
|
+
*******************************************************************************/
|
|
12
|
+
import { HybridTM } from './hybridtm.js';
|
|
13
|
+
export declare class BatchImporter {
|
|
14
|
+
private tm;
|
|
15
|
+
private tempFilePath;
|
|
16
|
+
private batchSize;
|
|
17
|
+
private totalEntries;
|
|
18
|
+
constructor(tm: HybridTM, tempFilePath: string, totalEntries?: number, batchSize?: number);
|
|
19
|
+
import(): Promise<void>;
|
|
20
|
+
private parseMetadata;
|
|
21
|
+
private cleanup;
|
|
22
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/*******************************************************************************
|
|
2
|
+
* Copyright (c) 2025-2026 Maxprograms.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials
|
|
5
|
+
* are made available under the terms of the Eclipse License 1.0
|
|
6
|
+
* which accompanies this distribution, and is available at
|
|
7
|
+
* https://www.eclipse.org/org/documents/epl-v10.html
|
|
8
|
+
*
|
|
9
|
+
* Contributors:
|
|
10
|
+
* Maxprograms - initial API and implementation
|
|
11
|
+
*******************************************************************************/
|
|
12
|
+
import { createReadStream, existsSync, unlinkSync } from "node:fs";
|
|
13
|
+
import { createInterface } from 'node:readline';
|
|
14
|
+
import { Utils } from './utils.js';
|
|
15
|
+
export class BatchImporter {
|
|
16
|
+
tm;
|
|
17
|
+
tempFilePath;
|
|
18
|
+
batchSize;
|
|
19
|
+
totalEntries;
|
|
20
|
+
constructor(tm, tempFilePath, totalEntries = 0, batchSize = 1000) {
|
|
21
|
+
this.tm = tm;
|
|
22
|
+
this.tempFilePath = tempFilePath;
|
|
23
|
+
this.totalEntries = totalEntries;
|
|
24
|
+
this.batchSize = batchSize;
|
|
25
|
+
}
|
|
26
|
+
async import() {
|
|
27
|
+
try {
|
|
28
|
+
console.log('Starting batch import from ' + this.tempFilePath + '...');
|
|
29
|
+
if (this.totalEntries > 0) {
|
|
30
|
+
console.log('Total entries to import: ' + this.totalEntries.toLocaleString());
|
|
31
|
+
}
|
|
32
|
+
const fileStream = createReadStream(this.tempFilePath, { encoding: 'utf8' });
|
|
33
|
+
const rl = createInterface({
|
|
34
|
+
input: fileStream,
|
|
35
|
+
crlfDelay: Infinity
|
|
36
|
+
});
|
|
37
|
+
let batch = [];
|
|
38
|
+
let totalProcessed = 0;
|
|
39
|
+
let batchCount = 0;
|
|
40
|
+
const startTime = Date.now();
|
|
41
|
+
for await (const line of rl) {
|
|
42
|
+
if (!line.trim()) {
|
|
43
|
+
continue; // Skip empty lines
|
|
44
|
+
}
|
|
45
|
+
try {
|
|
46
|
+
const jsonEntry = JSON.parse(line);
|
|
47
|
+
const segmentIndex = typeof jsonEntry.segmentIndex === 'number' ? jsonEntry.segmentIndex : 0;
|
|
48
|
+
const segmentCount = typeof jsonEntry.segmentCount === 'number' ? jsonEntry.segmentCount : 1;
|
|
49
|
+
const metadata = this.parseMetadata(jsonEntry.metadata);
|
|
50
|
+
// Convert JSON entry to PendingEntry
|
|
51
|
+
const entry = {
|
|
52
|
+
language: jsonEntry.language,
|
|
53
|
+
fileId: jsonEntry.fileId,
|
|
54
|
+
original: jsonEntry.original,
|
|
55
|
+
unitId: jsonEntry.unitId,
|
|
56
|
+
pureText: jsonEntry.pureText,
|
|
57
|
+
element: Utils.buildXMLElement(jsonEntry.element),
|
|
58
|
+
segmentIndex,
|
|
59
|
+
segmentCount,
|
|
60
|
+
metadata
|
|
61
|
+
};
|
|
62
|
+
batch.push(entry);
|
|
63
|
+
// Process batch when it reaches the batch size
|
|
64
|
+
if (batch.length >= this.batchSize) {
|
|
65
|
+
batchCount++;
|
|
66
|
+
await this.tm.storeBatchEntries(batch);
|
|
67
|
+
totalProcessed += batch.length;
|
|
68
|
+
// Calculate progress and ETA
|
|
69
|
+
const elapsed = Date.now() - startTime;
|
|
70
|
+
const rate = totalProcessed / (elapsed / 1000); // entries per second
|
|
71
|
+
if (this.totalEntries > 0) {
|
|
72
|
+
const progress = (totalProcessed / this.totalEntries) * 100;
|
|
73
|
+
const remaining = this.totalEntries - totalProcessed;
|
|
74
|
+
const etaSeconds = remaining / rate;
|
|
75
|
+
const etaMinutes = Math.floor(etaSeconds / 60);
|
|
76
|
+
const etaSecondsRemainder = Math.floor(etaSeconds % 60);
|
|
77
|
+
console.log('Progress: ' + totalProcessed.toLocaleString() + '/' + this.totalEntries.toLocaleString() + ' (' + progress.toFixed(1) + '%) - ETA: ' + etaMinutes + 'm ' + etaSecondsRemainder + 's - ' + rate.toFixed(1) + ' entries/sec');
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
console.log('Processed: ' + totalProcessed.toLocaleString() + ' entries - ' + rate.toFixed(1) + ' entries/sec');
|
|
81
|
+
}
|
|
82
|
+
batch = [];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
catch (parseErr) {
|
|
86
|
+
console.error('Error parsing JSONL line: ' + parseErr);
|
|
87
|
+
// Continue with next line
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// Process any remaining entries in the final batch
|
|
91
|
+
if (batch.length > 0) {
|
|
92
|
+
batchCount++;
|
|
93
|
+
await this.tm.storeBatchEntries(batch);
|
|
94
|
+
totalProcessed += batch.length;
|
|
95
|
+
}
|
|
96
|
+
const totalTime = (Date.now() - startTime) / 1000;
|
|
97
|
+
const minutes = Math.floor(totalTime / 60);
|
|
98
|
+
const seconds = Math.floor(totalTime % 60);
|
|
99
|
+
const avgRate = totalProcessed / totalTime;
|
|
100
|
+
console.log('\nBatch import complete!');
|
|
101
|
+
console.log('Total entries imported: ' + totalProcessed.toLocaleString());
|
|
102
|
+
console.log('Total time: ' + minutes + 'm ' + seconds + 's');
|
|
103
|
+
console.log('Average rate: ' + avgRate.toFixed(1) + ' entries/sec');
|
|
104
|
+
// Clean up the temporary file
|
|
105
|
+
await this.cleanup();
|
|
106
|
+
}
|
|
107
|
+
catch (err) {
|
|
108
|
+
console.error('Error during batch import:', err);
|
|
109
|
+
throw err;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
parseMetadata(metadata) {
|
|
113
|
+
if (!metadata || typeof metadata !== 'object') {
|
|
114
|
+
return {};
|
|
115
|
+
}
|
|
116
|
+
const result = {};
|
|
117
|
+
const source = metadata;
|
|
118
|
+
const copyString = (key) => {
|
|
119
|
+
const value = source[key];
|
|
120
|
+
if (typeof value === 'string' && value.length > 0) {
|
|
121
|
+
result[key] = value;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
const copyNumber = (key) => {
|
|
125
|
+
const value = source[key];
|
|
126
|
+
if (typeof value === 'number' && !Number.isNaN(value)) {
|
|
127
|
+
result[key] = value;
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
copyString('state');
|
|
131
|
+
copyString('subState');
|
|
132
|
+
copyNumber('quality');
|
|
133
|
+
copyString('creationDate');
|
|
134
|
+
copyString('creationId');
|
|
135
|
+
copyString('changeDate');
|
|
136
|
+
copyString('changeId');
|
|
137
|
+
copyString('creationTool');
|
|
138
|
+
copyString('creationToolVersion');
|
|
139
|
+
copyString('context');
|
|
140
|
+
copyNumber('usageCount');
|
|
141
|
+
copyString('lastUsageDate');
|
|
142
|
+
const notes = source.notes;
|
|
143
|
+
if (Array.isArray(notes)) {
|
|
144
|
+
const filtered = notes.filter((item) => typeof item === 'string' && item.length > 0);
|
|
145
|
+
if (filtered.length > 0) {
|
|
146
|
+
result.notes = filtered;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
const properties = source.properties;
|
|
150
|
+
if (properties && typeof properties === 'object') {
|
|
151
|
+
const props = {};
|
|
152
|
+
Object.entries(properties).forEach(([key, value]) => {
|
|
153
|
+
if (typeof value === 'string') {
|
|
154
|
+
props[key] = value;
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
if (Object.keys(props).length > 0) {
|
|
158
|
+
result.properties = props;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
const segment = source.segment;
|
|
162
|
+
if (segment && typeof segment === 'object') {
|
|
163
|
+
const segmentSource = segment;
|
|
164
|
+
const segmentMetadata = {};
|
|
165
|
+
const copySegmentString = (key) => {
|
|
166
|
+
const value = segmentSource[key];
|
|
167
|
+
if (typeof value === 'string' && value.length > 0) {
|
|
168
|
+
segmentMetadata[key] = value;
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
const copySegmentNumber = (key) => {
|
|
172
|
+
const value = segmentSource[key];
|
|
173
|
+
if (typeof value === 'number' && !Number.isNaN(value)) {
|
|
174
|
+
segmentMetadata[key] = value;
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
copySegmentString('provider');
|
|
178
|
+
copySegmentString('fileHash');
|
|
179
|
+
copySegmentString('fileId');
|
|
180
|
+
copySegmentString('unitId');
|
|
181
|
+
copySegmentString('segmentId');
|
|
182
|
+
copySegmentString('segmentKey');
|
|
183
|
+
copySegmentNumber('segmentIndex');
|
|
184
|
+
copySegmentNumber('segmentCount');
|
|
185
|
+
if (Object.keys(segmentMetadata).length > 0) {
|
|
186
|
+
result.segment = segmentMetadata;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return Object.keys(result).length > 0 ? result : {};
|
|
190
|
+
}
|
|
191
|
+
async cleanup() {
|
|
192
|
+
try {
|
|
193
|
+
if (existsSync(this.tempFilePath)) {
|
|
194
|
+
unlinkSync(this.tempFilePath);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
catch (err) {
|
|
198
|
+
console.error('Error cleaning up temporary file ' + this.tempFilePath + ':', err);
|
|
199
|
+
// Don't throw - cleanup failure shouldn't fail the import
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
//# sourceMappingURL=batchImporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":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0D;QAC9D,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*******************************************************************************
|
|
2
|
+
* Copyright (c) 2025-2026 Maxprograms.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials
|
|
5
|
+
* are made available under the terms of the Eclipse License 1.0
|
|
6
|
+
* which accompanies this distribution, and is available at
|
|
7
|
+
* https://www.eclipse.org/org/documents/epl-v10.html
|
|
8
|
+
*
|
|
9
|
+
* Contributors:
|
|
10
|
+
* Maxprograms - initial API and implementation
|
|
11
|
+
*******************************************************************************/
|
|
12
|
+
export declare class Constants {
|
|
13
|
+
static readonly VERSION: string;
|
|
14
|
+
static readonly BUILD: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*******************************************************************************
|
|
2
|
+
* Copyright (c) 2025-2026 Maxprograms.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials
|
|
5
|
+
* are made available under the terms of the Eclipse License 1.0
|
|
6
|
+
* which accompanies this distribution, and is available at
|
|
7
|
+
* https://www.eclipse.org/org/documents/epl-v10.html
|
|
8
|
+
*
|
|
9
|
+
* Contributors:
|
|
10
|
+
* Maxprograms - initial API and implementation
|
|
11
|
+
*******************************************************************************/
|
|
12
|
+
export class Constants {
|
|
13
|
+
static VERSION = "1.0.0";
|
|
14
|
+
static BUILD = "20260104_0539";
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../ts/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;iFAUiF;AAEjF,MAAM,OAAO,SAAS;IACX,MAAM,CAAU,OAAO,GAAW,OAAO,CAAC;IAC1C,MAAM,CAAU,KAAK,GAAW,eAAe,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*******************************************************************************
|
|
2
|
+
* Copyright (c) 2025 Maxprograms.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials
|
|
5
|
+
* are made available under the terms of the Eclipse Public License 1.0
|
|
6
|
+
* which accompanies this distribution, and is available at
|
|
7
|
+
* https://www.eclipse.org/org/documents/epl-v10.html
|
|
8
|
+
*
|
|
9
|
+
* Contributors:
|
|
10
|
+
* Maxprograms - initial API and implementation
|
|
11
|
+
*******************************************************************************/
|
|
12
|
+
export {};
|