Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 1.23 KB

File metadata and controls

38 lines (28 loc) · 1.23 KB

TypesMatch

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.

Installation

npm install typesmatch

The Match type

import type { Match } from "typesmatch";

interface Match {
    id: string;
    source: XMLElement;
    target: XMLElement;
    origin: string;
    type: string;
    similarity: number;
    properties: Record<string, string>;
}
  • id — an identifier for the match, unique within whatever produced it.
  • source / target — the matched segment pair, as typesxml XMLElements.
  • origin — the name of the memory, server, or MT provider the match came from.
  • type — what kind of match this is (for example tm, mt, or am).
  • similarity — a 0-100 match quality score.
  • properties — arbitrary metadata attached to the match (for example creationdate).

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.

License

Eclipse Public License 1.0 — see LICENSE.