mtranserver 4.0.30 → 4.0.31
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/dist/-cc07y4t8.DS_Store +0 -0
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/index.js +25 -9
- package/dist/main.js +57 -34
- package/dist/services/engine.d.ts.map +1 -1
- package/package.json +1 -1
|
Binary file
|
package/dist/config/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,MAAM;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,MAAM;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,EAAE,OAAO,CAAC;CACjC;AAkFD,wBAAgB,SAAS,IAAI,MAAM,CA4ClC;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,QAGhD;AAED,wBAAgB,WAAW,SAG1B;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,QAOrD;AAED,wBAAgB,eAAe,SAU9B"}
|
package/dist/index.js
CHANGED
|
@@ -149,6 +149,7 @@ function getConfig() {
|
|
|
149
149
|
workerIdleTimeout: getInt("--worker-idle-timeout", "MT_WORKER_IDLE_TIMEOUT", fileConfig.workerIdleTimeout ?? 60),
|
|
150
150
|
workersPerLanguage: getInt("--workers-per-language", "MT_WORKERS_PER_LANGUAGE", fileConfig.workersPerLanguage ?? 1),
|
|
151
151
|
maxSentenceLength: getInt("--max-sentence-length", "MT_MAX_SENTENCE_LENGTH", fileConfig.maxSentenceLength ?? 512),
|
|
152
|
+
fullwidthZhPunctuation: getBool("--fullwidth-zh-punctuation", "MT_FULLWIDTH_ZH_PUNCTUATION", fileConfig.fullwidthZhPunctuation ?? true),
|
|
152
153
|
apiToken: getString("--api-token", "MT_API_TOKEN", fileConfig.apiToken || ""),
|
|
153
154
|
logToFile: getBool("--log-to-file", "MT_LOG_TO_FILE", fileConfig.logToFile ?? false),
|
|
154
155
|
logConsole: getBool("--log-console", "MT_LOG_CONSOLE", fileConfig.logConsole ?? true),
|
|
@@ -3992,7 +3993,7 @@ var init_bergamot_translator = () => {};
|
|
|
3992
3993
|
|
|
3993
3994
|
// src/lib/cld2/cld2.js
|
|
3994
3995
|
var require_cld2 = __commonJS((exports, module) => {
|
|
3995
|
-
var __dirname = "/
|
|
3996
|
+
var __dirname = "/Volumes/MacData/Users/xxnuo/projects/MTranServer/src/lib/cld2", __filename = "/Volumes/MacData/Users/xxnuo/projects/MTranServer/src/lib/cld2/cld2.js";
|
|
3996
3997
|
var loadCLD2 = (() => {
|
|
3997
3998
|
var _scriptName = globalThis.document?.currentScript?.src;
|
|
3998
3999
|
return async function(moduleArg = {}) {
|
|
@@ -5552,6 +5553,15 @@ var init_cache = __esm(() => {
|
|
|
5552
5553
|
import path6 from "path";
|
|
5553
5554
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
5554
5555
|
import { readFile as readFile2 } from "fs/promises";
|
|
5556
|
+
function formatChinesePunctuation(text, toLang, isHTML, enabled) {
|
|
5557
|
+
if (!enabled || isHTML || !toLang.startsWith("zh")) {
|
|
5558
|
+
return text;
|
|
5559
|
+
}
|
|
5560
|
+
if (!zhPunctTest.test(text)) {
|
|
5561
|
+
return text;
|
|
5562
|
+
}
|
|
5563
|
+
return text.replace(zhPunctGlobal, (ch) => String.fromCharCode(ch.charCodeAt(0) + 65248));
|
|
5564
|
+
}
|
|
5555
5565
|
function needsPivotTranslation(fromLang, toLang) {
|
|
5556
5566
|
if (fromLang === "en" || toLang === "en") {
|
|
5557
5567
|
return false;
|
|
@@ -5686,13 +5696,15 @@ async function translateSegment(fromLang, toLang, text, isHTML) {
|
|
|
5686
5696
|
}
|
|
5687
5697
|
async function translateWithPivot(fromLang, toLang, text, isHTML = false) {
|
|
5688
5698
|
debug(`TranslateWithPivot: ${fromLang} -> ${toLang}, text length: ${text.length}, isHTML: ${isHTML}`);
|
|
5699
|
+
const config2 = getConfig();
|
|
5700
|
+
const shouldFullwidth = config2.fullwidthZhPunctuation ?? true;
|
|
5689
5701
|
if (fromLang !== "auto" && fromLang === toLang) {
|
|
5690
|
-
return text;
|
|
5702
|
+
return formatChinesePunctuation(text, toLang, isHTML, shouldFullwidth);
|
|
5691
5703
|
}
|
|
5692
5704
|
if (fromLang !== "auto" && text.length <= 512) {
|
|
5693
|
-
|
|
5705
|
+
const translated = await translateSegment(fromLang, toLang, text, isHTML);
|
|
5706
|
+
return formatChinesePunctuation(translated, toLang, isHTML, shouldFullwidth);
|
|
5694
5707
|
}
|
|
5695
|
-
const config2 = getConfig();
|
|
5696
5708
|
const segments = await detectMultipleLanguages(text);
|
|
5697
5709
|
if (segments.length <= 1) {
|
|
5698
5710
|
let effectiveFromLang;
|
|
@@ -5708,12 +5720,14 @@ async function translateWithPivot(fromLang, toLang, text, isHTML = false) {
|
|
|
5708
5720
|
effectiveFromLang = fromLang;
|
|
5709
5721
|
}
|
|
5710
5722
|
if (effectiveFromLang === toLang) {
|
|
5711
|
-
return text;
|
|
5723
|
+
return formatChinesePunctuation(text, toLang, isHTML, shouldFullwidth);
|
|
5712
5724
|
}
|
|
5713
5725
|
if (text.length > config2.maxSentenceLength && !isHTML) {
|
|
5714
|
-
|
|
5726
|
+
const translated2 = await translateLongText(effectiveFromLang, toLang, text);
|
|
5727
|
+
return formatChinesePunctuation(translated2, toLang, isHTML, shouldFullwidth);
|
|
5715
5728
|
}
|
|
5716
|
-
|
|
5729
|
+
const translated = await translateSegment(effectiveFromLang, toLang, text, isHTML);
|
|
5730
|
+
return formatChinesePunctuation(translated, toLang, isHTML, shouldFullwidth);
|
|
5717
5731
|
}
|
|
5718
5732
|
debug(`Detected ${segments.length} language segments`);
|
|
5719
5733
|
let result = "";
|
|
@@ -5738,7 +5752,7 @@ async function translateWithPivot(fromLang, toLang, text, isHTML = false) {
|
|
|
5738
5752
|
if (lastEnd < text.length) {
|
|
5739
5753
|
result += text.substring(lastEnd);
|
|
5740
5754
|
}
|
|
5741
|
-
return result;
|
|
5755
|
+
return formatChinesePunctuation(result, toLang, isHTML, shouldFullwidth);
|
|
5742
5756
|
}
|
|
5743
5757
|
async function translateLongText(fromLang, toLang, text) {
|
|
5744
5758
|
debug(`Splitting long text (${text.length} chars) into sentences`);
|
|
@@ -5773,7 +5787,7 @@ function cleanupAllEngines() {
|
|
|
5773
5787
|
engines.clear();
|
|
5774
5788
|
info("All engines cleaned up successfully");
|
|
5775
5789
|
}
|
|
5776
|
-
var import_bergamot_translator, engines, loadingPromises;
|
|
5790
|
+
var import_bergamot_translator, engines, loadingPromises, zhPunctTest, zhPunctGlobal;
|
|
5777
5791
|
var init_engine2 = __esm(() => {
|
|
5778
5792
|
init_engine();
|
|
5779
5793
|
init_factory();
|
|
@@ -5786,6 +5800,8 @@ var init_engine2 = __esm(() => {
|
|
|
5786
5800
|
import_bergamot_translator = __toESM(require_bergamot_translator(), 1);
|
|
5787
5801
|
engines = new Map;
|
|
5788
5802
|
loadingPromises = new Map;
|
|
5803
|
+
zhPunctTest = /[!-/:-@[-`{-~]/;
|
|
5804
|
+
zhPunctGlobal = /[!-/:-@[-`{-~]/g;
|
|
5789
5805
|
});
|
|
5790
5806
|
|
|
5791
5807
|
// src/services/index.ts
|
package/dist/main.js
CHANGED
|
@@ -150,6 +150,7 @@ function getConfig() {
|
|
|
150
150
|
workerIdleTimeout: getInt("--worker-idle-timeout", "MT_WORKER_IDLE_TIMEOUT", fileConfig.workerIdleTimeout ?? 60),
|
|
151
151
|
workersPerLanguage: getInt("--workers-per-language", "MT_WORKERS_PER_LANGUAGE", fileConfig.workersPerLanguage ?? 1),
|
|
152
152
|
maxSentenceLength: getInt("--max-sentence-length", "MT_MAX_SENTENCE_LENGTH", fileConfig.maxSentenceLength ?? 512),
|
|
153
|
+
fullwidthZhPunctuation: getBool("--fullwidth-zh-punctuation", "MT_FULLWIDTH_ZH_PUNCTUATION", fileConfig.fullwidthZhPunctuation ?? true),
|
|
153
154
|
apiToken: getString("--api-token", "MT_API_TOKEN", fileConfig.apiToken || ""),
|
|
154
155
|
logToFile: getBool("--log-to-file", "MT_LOG_TO_FILE", fileConfig.logToFile ?? false),
|
|
155
156
|
logConsole: getBool("--log-console", "MT_LOG_CONSOLE", fileConfig.logConsole ?? true),
|
|
@@ -3993,7 +3994,7 @@ var init_bergamot_translator = () => {};
|
|
|
3993
3994
|
|
|
3994
3995
|
// src/lib/cld2/cld2.js
|
|
3995
3996
|
var require_cld2 = __commonJS((exports, module) => {
|
|
3996
|
-
var __dirname = "/
|
|
3997
|
+
var __dirname = "/Volumes/MacData/Users/xxnuo/projects/MTranServer/src/lib/cld2", __filename = "/Volumes/MacData/Users/xxnuo/projects/MTranServer/src/lib/cld2/cld2.js";
|
|
3997
3998
|
var loadCLD2 = (() => {
|
|
3998
3999
|
var _scriptName = globalThis.document?.currentScript?.src;
|
|
3999
4000
|
return async function(moduleArg = {}) {
|
|
@@ -5553,6 +5554,15 @@ var init_cache = __esm(() => {
|
|
|
5553
5554
|
import path6 from "path";
|
|
5554
5555
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
5555
5556
|
import { readFile as readFile2 } from "fs/promises";
|
|
5557
|
+
function formatChinesePunctuation(text, toLang, isHTML, enabled) {
|
|
5558
|
+
if (!enabled || isHTML || !toLang.startsWith("zh")) {
|
|
5559
|
+
return text;
|
|
5560
|
+
}
|
|
5561
|
+
if (!zhPunctTest.test(text)) {
|
|
5562
|
+
return text;
|
|
5563
|
+
}
|
|
5564
|
+
return text.replace(zhPunctGlobal, (ch) => String.fromCharCode(ch.charCodeAt(0) + 65248));
|
|
5565
|
+
}
|
|
5556
5566
|
function needsPivotTranslation(fromLang, toLang) {
|
|
5557
5567
|
if (fromLang === "en" || toLang === "en") {
|
|
5558
5568
|
return false;
|
|
@@ -5687,13 +5697,15 @@ async function translateSegment(fromLang, toLang, text, isHTML) {
|
|
|
5687
5697
|
}
|
|
5688
5698
|
async function translateWithPivot(fromLang, toLang, text, isHTML = false) {
|
|
5689
5699
|
debug(`TranslateWithPivot: ${fromLang} -> ${toLang}, text length: ${text.length}, isHTML: ${isHTML}`);
|
|
5700
|
+
const config2 = getConfig();
|
|
5701
|
+
const shouldFullwidth = config2.fullwidthZhPunctuation ?? true;
|
|
5690
5702
|
if (fromLang !== "auto" && fromLang === toLang) {
|
|
5691
|
-
return text;
|
|
5703
|
+
return formatChinesePunctuation(text, toLang, isHTML, shouldFullwidth);
|
|
5692
5704
|
}
|
|
5693
5705
|
if (fromLang !== "auto" && text.length <= 512) {
|
|
5694
|
-
|
|
5706
|
+
const translated = await translateSegment(fromLang, toLang, text, isHTML);
|
|
5707
|
+
return formatChinesePunctuation(translated, toLang, isHTML, shouldFullwidth);
|
|
5695
5708
|
}
|
|
5696
|
-
const config2 = getConfig();
|
|
5697
5709
|
const segments = await detectMultipleLanguages(text);
|
|
5698
5710
|
if (segments.length <= 1) {
|
|
5699
5711
|
let effectiveFromLang;
|
|
@@ -5709,12 +5721,14 @@ async function translateWithPivot(fromLang, toLang, text, isHTML = false) {
|
|
|
5709
5721
|
effectiveFromLang = fromLang;
|
|
5710
5722
|
}
|
|
5711
5723
|
if (effectiveFromLang === toLang) {
|
|
5712
|
-
return text;
|
|
5724
|
+
return formatChinesePunctuation(text, toLang, isHTML, shouldFullwidth);
|
|
5713
5725
|
}
|
|
5714
5726
|
if (text.length > config2.maxSentenceLength && !isHTML) {
|
|
5715
|
-
|
|
5727
|
+
const translated2 = await translateLongText(effectiveFromLang, toLang, text);
|
|
5728
|
+
return formatChinesePunctuation(translated2, toLang, isHTML, shouldFullwidth);
|
|
5716
5729
|
}
|
|
5717
|
-
|
|
5730
|
+
const translated = await translateSegment(effectiveFromLang, toLang, text, isHTML);
|
|
5731
|
+
return formatChinesePunctuation(translated, toLang, isHTML, shouldFullwidth);
|
|
5718
5732
|
}
|
|
5719
5733
|
debug(`Detected ${segments.length} language segments`);
|
|
5720
5734
|
let result = "";
|
|
@@ -5739,7 +5753,7 @@ async function translateWithPivot(fromLang, toLang, text, isHTML = false) {
|
|
|
5739
5753
|
if (lastEnd < text.length) {
|
|
5740
5754
|
result += text.substring(lastEnd);
|
|
5741
5755
|
}
|
|
5742
|
-
return result;
|
|
5756
|
+
return formatChinesePunctuation(result, toLang, isHTML, shouldFullwidth);
|
|
5743
5757
|
}
|
|
5744
5758
|
async function translateLongText(fromLang, toLang, text) {
|
|
5745
5759
|
debug(`Splitting long text (${text.length} chars) into sentences`);
|
|
@@ -5774,7 +5788,7 @@ function cleanupAllEngines() {
|
|
|
5774
5788
|
engines.clear();
|
|
5775
5789
|
info("All engines cleaned up successfully");
|
|
5776
5790
|
}
|
|
5777
|
-
var import_bergamot_translator, engines, loadingPromises;
|
|
5791
|
+
var import_bergamot_translator, engines, loadingPromises, zhPunctTest, zhPunctGlobal;
|
|
5778
5792
|
var init_engine2 = __esm(() => {
|
|
5779
5793
|
init_engine();
|
|
5780
5794
|
init_factory();
|
|
@@ -5787,6 +5801,8 @@ var init_engine2 = __esm(() => {
|
|
|
5787
5801
|
import_bergamot_translator = __toESM(require_bergamot_translator(), 1);
|
|
5788
5802
|
engines = new Map;
|
|
5789
5803
|
loadingPromises = new Map;
|
|
5804
|
+
zhPunctTest = /[!-/:-@[-`{-~]/;
|
|
5805
|
+
zhPunctGlobal = /[!-/:-@[-`{-~]/g;
|
|
5790
5806
|
});
|
|
5791
5807
|
|
|
5792
5808
|
// src/services/index.ts
|
|
@@ -25360,7 +25376,7 @@ var require_source_map_support = __commonJS((exports, module) => {
|
|
|
25360
25376
|
|
|
25361
25377
|
// node_modules/typescript/lib/typescript.js
|
|
25362
25378
|
var require_typescript = __commonJS((exports, module) => {
|
|
25363
|
-
var __dirname = "/
|
|
25379
|
+
var __dirname = "/Volumes/MacData/Users/xxnuo/projects/MTranServer/node_modules/typescript/lib", __filename = "/Volumes/MacData/Users/xxnuo/projects/MTranServer/node_modules/typescript/lib/typescript.js";
|
|
25364
25380
|
/*! *****************************************************************************
|
|
25365
25381
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
25366
25382
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
@@ -208588,7 +208604,7 @@ var require_routeGenerator = __commonJS((exports) => {
|
|
|
208588
208604
|
|
|
208589
208605
|
// node_modules/@tsoa/cli/dist/routeGeneration/defaultRouteGenerator.js
|
|
208590
208606
|
var require_defaultRouteGenerator = __commonJS((exports) => {
|
|
208591
|
-
var __dirname = "/
|
|
208607
|
+
var __dirname = "/Volumes/MacData/Users/xxnuo/projects/MTranServer/node_modules/@tsoa/cli/dist/routeGeneration";
|
|
208592
208608
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
208593
208609
|
if (k2 === undefined)
|
|
208594
208610
|
k2 = k;
|
|
@@ -208714,7 +208730,7 @@ var require_defaultRouteGenerator = __commonJS((exports) => {
|
|
|
208714
208730
|
|
|
208715
208731
|
// node_modules/@tsoa/cli/dist/module/generate-routes.js
|
|
208716
208732
|
var require_generate_routes = __commonJS((exports) => {
|
|
208717
|
-
var __dirname = "/
|
|
208733
|
+
var __dirname = "/Volumes/MacData/Users/xxnuo/projects/MTranServer/node_modules/@tsoa/cli/dist/module";
|
|
208718
208734
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
208719
208735
|
if (k2 === undefined)
|
|
208720
208736
|
k2 = k;
|
|
@@ -211643,7 +211659,7 @@ var require_require_directory = __commonJS((exports, module) => {
|
|
|
211643
211659
|
|
|
211644
211660
|
// node_modules/yargs/build/index.cjs
|
|
211645
211661
|
var require_build4 = __commonJS((exports, module) => {
|
|
211646
|
-
var __dirname = "/
|
|
211662
|
+
var __dirname = "/Volumes/MacData/Users/xxnuo/projects/MTranServer/node_modules/yargs/build";
|
|
211647
211663
|
var t = __require("assert");
|
|
211648
211664
|
|
|
211649
211665
|
class e extends Error {
|
|
@@ -213914,7 +213930,7 @@ __export(exports_version, {
|
|
|
213914
213930
|
function getVersion() {
|
|
213915
213931
|
return VERSION;
|
|
213916
213932
|
}
|
|
213917
|
-
var VERSION = "4.0.
|
|
213933
|
+
var VERSION = "4.0.31";
|
|
213918
213934
|
|
|
213919
213935
|
// src/server/index.ts
|
|
213920
213936
|
init_config();
|
|
@@ -215716,7 +215732,7 @@ var swagger_default = {
|
|
|
215716
215732
|
},
|
|
215717
215733
|
info: {
|
|
215718
215734
|
title: "MTranServer API",
|
|
215719
|
-
version: "4.0.
|
|
215735
|
+
version: "4.0.31",
|
|
215720
215736
|
description: "Translation server API",
|
|
215721
215737
|
license: {
|
|
215722
215738
|
name: "Apache-2.0"
|
|
@@ -216244,21 +216260,25 @@ import { fileURLToPath as fileURLToPath3 } from "url";
|
|
|
216244
216260
|
// ui/dist/icon.png
|
|
216245
216261
|
var icon_default = "./icon-encyk9bj.png";
|
|
216246
216262
|
|
|
216263
|
+
// ui/dist/index.html
|
|
216264
|
+
var dist_default = "./index-4y48gktb.html";
|
|
216265
|
+
|
|
216266
|
+
// ui/dist/.DS_Store
|
|
216267
|
+
var __default = "./-cc07y4t8.DS_Store";
|
|
216268
|
+
|
|
216247
216269
|
// ui/dist/assets/index-Dhhm9ekC.js
|
|
216248
216270
|
var index_Dhhm9ekC_default = "./index-Dhhm9ekC-q0c5t73v.js";
|
|
216249
216271
|
|
|
216250
216272
|
// ui/dist/assets/index-CGhxHjBc.css
|
|
216251
216273
|
var index_CGhxHjBc_default = "./index-CGhxHjBc-k71z57he.css";
|
|
216252
216274
|
|
|
216253
|
-
// ui/dist/index.html
|
|
216254
|
-
var dist_default = "./index-4y48gktb.html";
|
|
216255
|
-
|
|
216256
216275
|
// src/assets/ui.ts
|
|
216257
216276
|
var assets = {
|
|
216258
216277
|
"/icon.png": icon_default,
|
|
216278
|
+
"/index.html": dist_default,
|
|
216279
|
+
"/.DS_Store": __default,
|
|
216259
216280
|
"/assets/index-Dhhm9ekC.js": index_Dhhm9ekC_default,
|
|
216260
|
-
"/assets/index-CGhxHjBc.css": index_CGhxHjBc_default
|
|
216261
|
-
"/index.html": dist_default
|
|
216281
|
+
"/assets/index-CGhxHjBc.css": index_CGhxHjBc_default
|
|
216262
216282
|
};
|
|
216263
216283
|
|
|
216264
216284
|
// src/middleware/ui.ts
|
|
@@ -216307,14 +216327,17 @@ import { readFile as readFile4 } from "fs/promises";
|
|
|
216307
216327
|
import { dirname as dirname2, resolve as resolve2, isAbsolute as isAbsolute2 } from "path";
|
|
216308
216328
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
216309
216329
|
|
|
216310
|
-
// node_modules/swagger-ui-dist/
|
|
216311
|
-
var
|
|
216330
|
+
// node_modules/swagger-ui-dist/favicon-16x16.png
|
|
216331
|
+
var favicon_16x16_default = "./favicon-16x16-xwsy16sv.png";
|
|
216332
|
+
|
|
216333
|
+
// node_modules/swagger-ui-dist/swagger-ui.js
|
|
216334
|
+
var swagger_ui_default = "./swagger-ui-bycaq9jd.js";
|
|
216312
216335
|
|
|
216313
216336
|
// node_modules/swagger-ui-dist/oauth2-redirect.js
|
|
216314
216337
|
var oauth2_redirect_default = "./oauth2-redirect-bqxabm9x.js";
|
|
216315
216338
|
|
|
216316
|
-
// node_modules/swagger-ui-dist/swagger-
|
|
216317
|
-
var
|
|
216339
|
+
// node_modules/swagger-ui-dist/swagger-ui.css
|
|
216340
|
+
var swagger_ui_default2 = "./swagger-ui-bfxfcsxh.css";
|
|
216318
216341
|
|
|
216319
216342
|
// node_modules/swagger-ui-dist/swagger-ui-bundle.js
|
|
216320
216343
|
var swagger_ui_bundle_default = "./swagger-ui-bundle-a3dgbj09.js";
|
|
@@ -216322,24 +216345,21 @@ var swagger_ui_bundle_default = "./swagger-ui-bundle-a3dgbj09.js";
|
|
|
216322
216345
|
// node_modules/swagger-ui-dist/swagger-ui-standalone-preset.js
|
|
216323
216346
|
var swagger_ui_standalone_preset_default = "./swagger-ui-standalone-preset-9dtac9s6.js";
|
|
216324
216347
|
|
|
216325
|
-
// node_modules/swagger-ui-dist/swagger-
|
|
216326
|
-
var
|
|
216327
|
-
|
|
216328
|
-
// node_modules/swagger-ui-dist/favicon-16x16.png
|
|
216329
|
-
var favicon_16x16_default = "./favicon-16x16-xwsy16sv.png";
|
|
216348
|
+
// node_modules/swagger-ui-dist/swagger-initializer.js
|
|
216349
|
+
var swagger_initializer_default = "./swagger-initializer-55m7yyx2.js";
|
|
216330
216350
|
|
|
216331
216351
|
// node_modules/swagger-ui-dist/favicon-32x32.png
|
|
216332
216352
|
var favicon_32x32_default = "./favicon-32x32-zstv2hmc.png";
|
|
216333
216353
|
|
|
216334
216354
|
// src/assets/swagger.ts
|
|
216335
216355
|
var swaggerAssets = {
|
|
216336
|
-
"/
|
|
216356
|
+
"/favicon-16x16.png": favicon_16x16_default,
|
|
216357
|
+
"/swagger-ui.js": swagger_ui_default,
|
|
216337
216358
|
"/oauth2-redirect.js": oauth2_redirect_default,
|
|
216338
|
-
"/swagger-
|
|
216359
|
+
"/swagger-ui.css": swagger_ui_default2,
|
|
216339
216360
|
"/swagger-ui-bundle.js": swagger_ui_bundle_default,
|
|
216340
216361
|
"/swagger-ui-standalone-preset.js": swagger_ui_standalone_preset_default,
|
|
216341
|
-
"/swagger-
|
|
216342
|
-
"/favicon-16x16.png": favicon_16x16_default,
|
|
216362
|
+
"/swagger-initializer.js": swagger_initializer_default,
|
|
216343
216363
|
"/favicon-32x32.png": favicon_32x32_default
|
|
216344
216364
|
};
|
|
216345
216365
|
|
|
@@ -216443,6 +216463,7 @@ async function startServer({ handleSignals = true } = {}) {
|
|
|
216443
216463
|
logConsole: current.logConsole,
|
|
216444
216464
|
logRequests: current.logRequests,
|
|
216445
216465
|
maxSentenceLength: current.maxSentenceLength,
|
|
216466
|
+
fullwidthZhPunctuation: current.fullwidthZhPunctuation,
|
|
216446
216467
|
checkUpdate: current.checkUpdate,
|
|
216447
216468
|
cacheSize: current.cacheSize,
|
|
216448
216469
|
modelDir: current.modelDir,
|
|
@@ -216485,6 +216506,7 @@ async function startServer({ handleSignals = true } = {}) {
|
|
|
216485
216506
|
logConsole: toBool(input.logConsole, current.logConsole),
|
|
216486
216507
|
logRequests: toBool(input.logRequests, current.logRequests),
|
|
216487
216508
|
maxSentenceLength: toNumber(input.maxSentenceLength, current.maxSentenceLength),
|
|
216509
|
+
fullwidthZhPunctuation: toBool(input.fullwidthZhPunctuation, current.fullwidthZhPunctuation),
|
|
216488
216510
|
checkUpdate: toBool(input.checkUpdate, current.checkUpdate),
|
|
216489
216511
|
cacheSize: toNumber(input.cacheSize, current.cacheSize),
|
|
216490
216512
|
modelDir: toString2(input.modelDir, current.modelDir),
|
|
@@ -216682,6 +216704,7 @@ Options:
|
|
|
216682
216704
|
--offline Enable offline mode (default: false)
|
|
216683
216705
|
--worker-idle-timeout Worker idle timeout in seconds (default: 60)
|
|
216684
216706
|
--workers-per-language Number of workers per language pair (default: 1)
|
|
216707
|
+
--fullwidth-zh-punctuation Fullwidth punctuation for Chinese output (default: true)
|
|
216685
216708
|
--api-token <token> API access token
|
|
216686
216709
|
--log-to-file Enable logging to file (default: false)
|
|
216687
216710
|
--log-console Enable logging to console (default: true)
|
|
@@ -216696,7 +216719,7 @@ Environment Variables:
|
|
|
216696
216719
|
MT_HOST, MT_PORT, MT_LOG_LEVEL, MT_CONFIG_DIR, MT_MODEL_DIR,
|
|
216697
216720
|
MT_LOG_DIR, MT_ENABLE_UI, MT_OFFLINE, MT_WORKER_IDLE_TIMEOUT,
|
|
216698
216721
|
MT_WORKERS_PER_LANGUAGE, MT_API_TOKEN, MT_LOG_TO_FILE, MT_LOG_CONSOLE,
|
|
216699
|
-
MT_CHECK_UPDATE
|
|
216722
|
+
MT_CHECK_UPDATE, MT_FULLWIDTH_ZH_PUNCTUATION
|
|
216700
216723
|
`);
|
|
216701
216724
|
process.exit(0);
|
|
216702
216725
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/services/engine.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/services/engine.ts"],"names":[],"mappings":"AAkOA,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,OAAe,GACtB,OAAO,CAAC,MAAM,CAAC,CA0EjB;AAkCD,wBAAgB,iBAAiB,SAahC"}
|