mtengines
Version:
Machine Translation (MT) library written in TypeScript
50 lines (49 loc) • 1.9 kB
TypeScript
/*******************************************************************************
* Copyright (c) 2023-2026 Maxprograms.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse License 1.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-v10.html
*
* Contributors:
* Maxprograms - initial API and implementation
*******************************************************************************/
import { XMLElement } from "typesxml";
import { MTEngine } from "./MTEngine.js";
import { MTMatch } from "./MTMatch.js";
export declare class QwenTranslator implements MTEngine {
apiKey: string;
srcLang: string;
tgtLang: string;
model: string | undefined;
currentRegion: string;
models: {
[key: string]: string[];
};
regions: {
[key: string]: string;
};
constructor(apiKey: string, region: string, model?: string);
getName(): string;
setModel(model: string): void;
getShortName(): string;
getSourceLanguages(): Promise<string[]>;
getTargetLanguages(): Promise<string[]>;
setSourceLanguage(lang: string): void;
getSourceLanguage(): string;
setTargetLanguage(lang: string): void;
getTargetLanguage(): string;
translate(source: string): Promise<string>;
getMTMatch(source: XMLElement, terms: {
source: string;
target: string;
}[]): Promise<MTMatch>;
handlesTags(): boolean;
fixMatch(originalSource: XMLElement, matchSource: XMLElement, matchTarget: XMLElement): Promise<MTMatch>;
fixTranslation(originalSource: XMLElement, matchSource: XMLElement, matchTarget: XMLElement): Promise<string>;
fixesMatches(): boolean;
fixesTags(): boolean;
fixTags(source: XMLElement, target: XMLElement): Promise<XMLElement>;
getAvailableModels(): Promise<string[][]>;
}