typesmatch 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 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,38 @@
1
+ # TypesMatch
2
+
3
+ TypesMatch defines the `Match` type shared by translation memory and machine translation engines: `TypesTM`, `TypesRemoteTM`, `HybridTM`, and `mtengines` all use it, so a result from any of them is interchangeable with any other.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install typesmatch
9
+ ```
10
+
11
+ ## The `Match` type
12
+
13
+ ```ts
14
+ import type { Match } from "typesmatch";
15
+
16
+ interface Match {
17
+ id: string;
18
+ source: XMLElement;
19
+ target: XMLElement;
20
+ origin: string;
21
+ type: string;
22
+ similarity: number;
23
+ properties: Record<string, string>;
24
+ }
25
+ ```
26
+
27
+ - `id` — an identifier for the match, unique within whatever produced it.
28
+ - `source` / `target` — the matched segment pair, as `typesxml` `XMLElement`s.
29
+ - `origin` — the name of the memory, server, or MT provider the match came from.
30
+ - `type` — what kind of match this is (for example `tm`, `mt`, or `am`).
31
+ - `similarity` — a 0-100 match quality score.
32
+ - `properties` — arbitrary metadata attached to the match (for example `creationdate`).
33
+
34
+ This package has no logic of its own — it exists only so every engine that produces a `Match` agrees on its shape without depending on any one engine's implementation package.
35
+
36
+ ## License
37
+
38
+ Eclipse Public License 1.0 — see [LICENSE](LICENSE).
@@ -0,0 +1,22 @@
1
+ /*******************************************************************************
2
+ * Copyright (c) 2026 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
+ import type { XMLElement } from "typesxml";
13
+ export type MatchType = "am" | "mt" | "icm" | "idm" | "tb" | "tm" | "other";
14
+ export interface Match {
15
+ id: string;
16
+ source: XMLElement;
17
+ target: XMLElement;
18
+ origin: string;
19
+ type: MatchType;
20
+ similarity: number;
21
+ properties: Record<string, string>;
22
+ }
package/dist/Match.js ADDED
@@ -0,0 +1,13 @@
1
+ /*******************************************************************************
2
+ * Copyright (c) 2026 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 {};
13
+ //# sourceMappingURL=Match.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Match.js","sourceRoot":"","sources":["../ts/Match.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;iFAUiF"}
@@ -0,0 +1,12 @@
1
+ /*******************************************************************************
2
+ * Copyright (c) 2026 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 type { Match, MatchType } from "./Match.js";
package/dist/index.js ADDED
@@ -0,0 +1,13 @@
1
+ /*******************************************************************************
2
+ * Copyright (c) 2026 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 {};
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../ts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;iFAUiF"}
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "typesmatch",
3
+ "productName": "TypesMatch",
4
+ "version": "0.1.0",
5
+ "description": "Shared Match type for Translation Memory and Machine Translation engines",
6
+ "keywords": [
7
+ "Translation Memory",
8
+ "Machine Translation",
9
+ "Match",
10
+ "TypeScript"
11
+ ],
12
+ "type": "module",
13
+ "main": "./dist/index.js",
14
+ "types": "./dist/index.d.ts",
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "default": "./dist/index.js"
19
+ },
20
+ "./package.json": "./package.json"
21
+ },
22
+ "files": [
23
+ "/dist"
24
+ ],
25
+ "scripts": {
26
+ "build": "tsc"
27
+ },
28
+ "author": {
29
+ "name": "Rodolfo M. Raya",
30
+ "url": "https://maxprograms.com",
31
+ "email": "rmraya@maxprograms.com"
32
+ },
33
+ "license": "EPL-1.0",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://github.com/maxprograms-com/TypesMatch.git"
37
+ },
38
+ "engines": {
39
+ "node": ">=24.0.0"
40
+ },
41
+ "devDependencies": {
42
+ "@types/node": "^24.13.2",
43
+ "typescript": "^6.0.3"
44
+ },
45
+ "dependencies": {
46
+ "typesxml": "^2.2.0"
47
+ }
48
+ }