diff --git a/build.sh b/build.sh
index ada6b37f..d0c710bf 100755
--- a/build.sh
+++ b/build.sh
@@ -30,9 +30,9 @@ do_build() {
# Check if ASan should be enabled
if [ "$ENABLE_ASAN" = "ON" ]; then
- cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DENABLE_ASAN=ON ../source
+ cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11 -DENABLE_ASAN=ON ../source
else
- cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ../source
+ cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11 ../source
fi
make -j${CORES}
diff --git a/docker/workdir/TABLE/otmxml.c b/docker/workdir/TABLE/otmxml.c
index b607be07..9302cb94 100755
--- a/docker/workdir/TABLE/otmxml.c
+++ b/docker/workdir/TABLE/otmxml.c
@@ -236,23 +236,6 @@ EQF_BOOL /*APIENTRY*/ EQFPOSTUNSEGW(
-USHORT /*APIENTRY*/ EQFQUERYEXITINFO(PSZ pszTagTable, // name of the markup table, e.g. "OTMHTM32"
- USHORT usMode, // type of information being queried
- PSZ pszBuffer, // buffer area receiving the information returned by the exit
- USHORT usBufLen // length of buffer area
-)
-{
-
- if( usMode == QUERYEXIT_ADDFILES) {
- QueryExportFiles(pszTagTable, pszBuffer, usBufLen, FALSE);
- }
-
- return 0;
-}
-
-
-
-
/*******************************************************************************
*
* function: IsFileUTF16
diff --git a/docs/index.html b/docs/index.html
new file mode 100644
index 00000000..5758e384
--- /dev/null
+++ b/docs/index.html
@@ -0,0 +1,23 @@
+
+
+
+
+ T5Memory API
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/t5memory.apidog.json b/docs/t5memory.apidog.json
new file mode 100644
index 00000000..c4c0a0ae
--- /dev/null
+++ b/docs/t5memory.apidog.json
@@ -0,0 +1,5194 @@
+{
+ "apidogProject": "0.7.36",
+ "$schema": {
+ "app": "apidog",
+ "type": "project",
+ "version": "1.2.0"
+ },
+ "info": {
+ "name": "t5memory",
+ "description": "",
+ "mockRule": {
+ "rules": [],
+ "enableSystemRule": true
+ }
+ },
+ "apiCollection": [
+ {
+ "name": "Root",
+ "id": 4550416,
+ "auth": {},
+ "securityScheme": {},
+ "parentId": 0,
+ "serverId": "",
+ "description": "",
+ "identityPattern": {
+ "httpApi": {
+ "type": "methodAndPath",
+ "bodyType": "",
+ "fields": []
+ }
+ },
+ "shareSettings": {},
+ "visibility": "SHARED",
+ "moduleId": 845181,
+ "preProcessors": [
+ {
+ "id": "inheritProcessors",
+ "type": "inheritProcessors",
+ "data": {}
+ }
+ ],
+ "postProcessors": [
+ {
+ "id": "inheritProcessors",
+ "type": "inheritProcessors",
+ "data": {}
+ }
+ ],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {},
+ "items": [
+ {
+ "name": "Flush memory",
+ "api": {
+ "id": "20097720",
+ "method": "get",
+ "path": "/t5memory/{{memory}}/flush",
+ "parameters": {},
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "28998661",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "msg"
+ ],
+ "x-apidog-orders": [
+ "msg"
+ ]
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [
+ {
+ "name": "Success",
+ "data": "{\n\t\"msg\": \"Mem ID9612-en-uk was flushed to the disk successfully\"\n}",
+ "responseId": 28998661,
+ "ordering": 1,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ }
+ ],
+ "requestBody": {
+ "type": "none",
+ "parameters": [],
+ "mediaType": "",
+ "examples": [],
+ "oasExtensions": ""
+ },
+ "description": "Endpoint is sync(blocking)\n\nIf tm is not found on the disk - returns 404\nIf tm is not open - returns 400 with message\nThen t5memory requests writes pointer to the tm (so it waits till other requests that's working with the tm would finish) and then it flushes it to the disk\nCould also return an error if flushing got some issue.\nWould not open the tm, if it's not opened yet, but instead would return an error.",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 130,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.28998661"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "Tag replacement",
+ "api": {
+ "id": "20097882",
+ "method": "post",
+ "path": "/t5memory_service/tagreplacement",
+ "parameters": {
+ "query": [],
+ "path": [],
+ "cookie": [],
+ "header": [
+ {
+ "id": "xMxiCFLsH9",
+ "name": "Accept",
+ "required": true,
+ "description": "",
+ "example": "application/json; charset=utf-8",
+ "type": "string",
+ "enable": true
+ },
+ {
+ "id": "OEUJrQ83Sh",
+ "name": "Accept-Charset",
+ "required": true,
+ "description": "",
+ "example": "UTF-8",
+ "type": "string",
+ "enable": true
+ }
+ ]
+ },
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "28998668",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {},
+ "x-apidog-orders": []
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [],
+ "requestBody": {
+ "type": "application/json",
+ "parameters": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "src": {
+ "type": "string"
+ },
+ "trg": {
+ "type": "string"
+ },
+ "req": {
+ "type": "string",
+ "description": "Used to test Fuzzy search tag replacement"
+ }
+ },
+ "required": [
+ "src",
+ "trg"
+ ],
+ "x-apidog-orders": [
+ "src",
+ "trg",
+ "req"
+ ]
+ },
+ "mediaType": "",
+ "examples": [
+ {
+ "value": "{\n \"src\": \"Tap View o get strongdisplayedView two strongUS patents.\",\n \"trg\": \"View tap to got strongdosplaydVeiw two strongUS patents.\",\n \"req\": \"Tap View o get strongdisplayedView two strongUS patents.\"\n}",
+ "mediaType": "application/json",
+ "description": ""
+ }
+ ],
+ "oasExtensions": ""
+ },
+ "description": "Fuzzy search tag replacement and Import tag replacement test",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 105,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.28998668"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "Flags",
+ "api": {
+ "id": "20120389",
+ "method": "get",
+ "path": "/t5memory_service/flags",
+ "parameters": {},
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "29040387",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {}
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [
+ {
+ "name": "Success",
+ "data": "{\n {\n \"name\": \"alsologtoemail\",\n \"value\": \"\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"log messages go to these email addresses in addition to logfiles\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"alsologtostderr\",\n \"value\": \"true\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"log messages go to stderr in addition to logfiles\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"colorlogtostderr\",\n \"value\": \"true\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"color messages logged to stderr (if supported by terminal)\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"drop_log_memory\",\n \"value\": \"true\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Drop in-memory buffers of log contents. Logs can grow very quickly and they are rarely read before they need to be evicted from memory. Instead, drop them from memory as soon as they are flushed to disk.\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"log_backtrace_at\",\n \"value\": \"\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Emit a backtrace when logging at file:linenum.\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"log_dir\",\n \"value\": \"/root/.t5memory/LOG/\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"If specified, logfiles are written into this directory instead of the default logging directory.\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"log_link\",\n \"value\": \"\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Put additional links to the log files in this directory\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"log_prefix\",\n \"value\": \"true\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Prepend the log prefix to the start of each log line\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"logbuflevel\",\n \"value\": \"0\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Buffer log messages logged at this level or lower (-1 means don't buffer; 0 means buffer INFO only; ...)\",\n \"type\": \"int32\",\n \"default\": \"0\"\n },\n {\n \"name\": \"logbufsecs\",\n \"value\": \"30\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Buffer log messages for at most this many seconds\",\n \"type\": \"int32\",\n \"default\": \"30\"\n },\n {\n \"name\": \"logemaillevel\",\n \"value\": \"999\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Email log messages logged at this level or higher (0 means email all; 3 means email FATAL only; ...)\",\n \"type\": \"int32\",\n \"default\": \"999\"\n },\n {\n \"name\": \"logfile_mode\",\n \"value\": \"436\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Log file mode/permissions.\",\n \"type\": \"int32\",\n \"default\": \"436\"\n },\n {\n \"name\": \"logmailer\",\n \"value\": \"/bin/mail\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Mailer used to send logging email\",\n \"type\": \"string\",\n \"default\": \"/bin/mail\"\n },\n {\n \"name\": \"logtostderr\",\n \"value\": \"false\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"log messages go to stderr instead of logfiles\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"max_log_size\",\n \"value\": \"1800\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"approx. maximum log file size (in MB). A value of 0 will be silently overridden to 1.\",\n \"type\": \"int32\",\n \"default\": \"1800\"\n },\n {\n \"name\": \"minloglevel\",\n \"value\": \"0\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Messages logged at a lower level than this don't actually get logged anywhere\",\n \"type\": \"int32\",\n \"default\": \"0\"\n },\n {\n \"name\": \"stderrthreshold\",\n \"value\": \"2\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"log messages at or above this level are copied to stderr in addition to logfiles. This flag obsoletes --alsologtostderr.\",\n \"type\": \"int32\",\n \"default\": \"2\"\n },\n {\n \"name\": \"stop_logging_if_full_disk\",\n \"value\": \"false\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Stop attempting to log to disk if the disk is full.\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"symbolize_stacktrace\",\n \"value\": \"true\"\t\",\tfrom\": \"./src/utilities.cc\",\n \"description\": \"Symbolize the stack trace in the tombstone\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"v\",\n \"value\": \"2\"\t\",\tfrom\": \"./src/vlog_is_on.cc\",\n \"description\": \"Show all VLOG(m) messages for m <= this. Overridable by --vmodule.\",\n \"type\": \"int32\",\n \"default\": \"0\"\n },\n {\n \"name\": \"vmodule\",\n \"value\": \"\"\t\",\tfrom\": \"./src/vlog_is_on.cc\",\n \"description\": \"per-module verbose level. Argument is a comma-separated list of =. is a glob pattern, matched against the filename base (that is, name ignoring .cc/.h./-inl.h). overrides any value given by --v.\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"flagfile\",\n \"value\": \"\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags.cc\",\n \"description\": \"load flags from file\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"fromenv\",\n \"value\": \"\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags.cc\",\n \"description\": \"set flags from the environment [use 'export FLAGS_flag1=value']\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"tryfromenv\",\n \"value\": \"\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags.cc\",\n \"description\": \"set flags from the environment if present\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"undefok\",\n \"value\": \"\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags.cc\",\n \"description\": \"comma-separated list of flag names that it is okay to specify on the command line even if the program does not define a flag with that name. IMPORTANT: flags in this list that have arguments MUST use the flag=value format\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"tab_completion_columns\",\n \"value\": \"80\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_completions.cc\",\n \"description\": \"Number of columns to use in output for tab completion\",\n \"type\": \"int32\",\n \"default\": \"80\"\n },\n {\n \"name\": \"tab_completion_word\",\n \"value\": \"\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_completions.cc\",\n \"description\": \"If non-empty, HandleCommandLineCompletions() will hijack the process and attempt to do bash-style command line flag completion on this value.\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"help\",\n \"value\": \"false\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"show help on all flags [tip: all flags can have two dashes]\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"helpfull\",\n \"value\": \"false\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"show help on all flags -- same as -help\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"helpmatch\",\n \"value\": \"\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"show help on modules whose name contains the specified substr\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"helpon\",\n \"value\": \"\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"show help on the modules named by this flag value\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"helppackage\",\n \"value\": \"false\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"show help on all modules in the main package\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"helpshort\",\n \"value\": \"false\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"show help on only the main module for this program\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"helpxml\",\n \"value\": \"false\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"produce an xml version of help\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"version\",\n \"value\": \"false\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"show version and build info and exit\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"folly_memory_idler_madvise_stacks\",\n \"value\": \"true\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/folly/folly/detail/MemoryIdler.cpp\",\n \"description\": \"if enabled, folly memory-idler madvises dontneed stacks on thread idle\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"folly_memory_idler_purge_arenas\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/folly/folly/detail/MemoryIdler.cpp\",\n \"description\": \"if enabled, folly memory-idler purges jemalloc arenas on thread idle\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"dynamic_iothreadpoolexecutor\",\n \"value\": \"true\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/folly/folly/executors/IOThreadPoolExecutor.cpp\",\n \"description\": \"IOThreadPoolExecutor will dynamically create threads\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"folly_iothreadpoolexecutor_max_read_at_once\",\n \"value\": \"-1\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/folly/folly/executors/IOThreadPoolExecutor.cpp\",\n \"description\": \"IOThreadPoolExecutor will use this value as default for maxReadAtOnce in its event bases, valid values are [0, inf)\",\n \"type\": \"int32\",\n \"default\": \"-1\"\n },\n {\n \"name\": \"threadtimeout_ms\",\n \"value\": \"60000\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/folly/folly/executors/ThreadPoolExecutor.cpp\",\n \"description\": \"Idle time before ThreadPoolExecutor threads are joined\",\n \"type\": \"int64\",\n \"default\": \"60000\"\n },\n {\n \"name\": \"observer_manager_pool_size\",\n \"value\": \"4\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/folly/folly/observer/detail/ObserverManager.cpp\",\n \"description\": \"How many internal threads ObserverManager should use\",\n \"type\": \"int32\",\n \"default\": \"4\"\n },\n {\n \"name\": \"folly_hazptr_use_executor\",\n \"value\": \"true\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/folly/folly/synchronization/Hazptr.cpp\",\n \"description\": \"Use an executor for hazptr asynchronous reclamation\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"dcache_unit_test\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/wangle/wangle/ssl/SSLSessionCacheManager.cpp\",\n \"description\": \"All VIPs share one session cache\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"zlib_compressor_buffer_growth\",\n \"value\": \"2024\"\t\",\tfrom\": \"/home/libs/proxygen/lib/utils/ZlibStreamCompressor.cpp\",\n \"description\": \"The buffer growth size to use during IOBuf zlib deflation\",\n \"type\": \"int64\",\n \"default\": \"2024\"\n },\n {\n \"name\": \"request_number\",\n \"value\": \"true\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/RestAPI/ProxygenHandler.cpp\",\n \"description\": \"Include request sequence number in response\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"add_tokens_to_fuzzy\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \" If set to true, list of tokens would be returned in fuzzy responce. Could make execution a bit slower, could be usefull if you think that fuzzy match is wrong to check how tokens was parsed in sentence and what hashes they had(or track hash collisions)\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"allowLoadingMultipleTmsSimultaneously\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, multiple tms could be loaded from the disk at the same time. Loading multiple TMs at the same time was disabled because of I/0 disk operation limit at the server. Enable this if you don't care about num of IO operations and want some perfomance boost\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"allowedram\",\n \"value\": \"10000\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets amought RAM(in MB) allowed for service to use\",\n \"type\": \"int64\",\n \"default\": \"5000\"\n },\n {\n \"name\": \"allowedtmdsize\",\n \"value\": \"190\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets max size of tmd file(in MB) after which t5m would not allow to add new data to the tm. This helps fight btree and lookup table issues when tm gets bigger.\",\n \"type\": \"int64\",\n \"default\": \"190\"\n },\n {\n \"name\": \"debug_sleep_in_request_run\",\n \"value\": \"0\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set, provide artificial delay in every request handling execution equal to provided num of microseconds\",\n \"type\": \"int64\",\n \"default\": \"0\"\n },\n {\n \"name\": \"disable_aslr\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, process personality would be set to ADDR_NO_RANDOMIZE, affect memory layout, set to true if you have some linker or asan issue at the launch\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"enable_newlines_in_logs\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"(not working - instead of using function to remove newlines in runtime, logs was edited to have better perfomance)if set to true, would keep newline symbols in the logs, otherwise(by default) newlines would be removed and logs would be oneliners. This just calls function to remove newlines,\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"flush_tm_at_shutdown\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, flushes tm when shutting down the app not using shutdown request\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"flush_tm_to_disk_with_every_update\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, flushes tm to disk with every successfull update request\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"forbiddeletefiles\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Set to true to keep all files(including temporary and tm)\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"keep_tm_backups\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"if set to true, when saving tmd and tmi files, old copies would be saved with .old suffix\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"limit_num_of_active_requests\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, it would be possible to handle only up to servicethreads-1 requests at the same time, the last thread would respond with 503 to eliminate creating queue of requests waiting to be handled.\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"logMutexes\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"if set to true you would see mutex logs\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"log_every_request_end\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets log for every request end with it's url, method etc...\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"log_every_request_start\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets log for every request call with it's url, method etc...\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"log_file_locks\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, action about locking tmd and tmi file would be logged\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"log_hashes_in_hash_sentence\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \" If set to true, and --v=2 and --t5loglevel=4, tokens and their hashed would be logged, could be usefull if you think that fuzzy match is wrong to check how tokens was parsed in sentence and what hashes they had(or track hash collisions)\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"log_memmove_in_compareputdata\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"if set to true, when saving segment and causing memmove in compareputdata functions, just before memmove, data would be logged - use this to debug btree crashes. In that spot in come corrupted data, memmove could crash t5memory(or cause asan crash). Just to set low log level(v=2,t5logleve=0), reproduce the crash and check if the last log was one that started with \"memmove size = ...\"\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"log_tm_lifetime\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \" If set to true, and --v=2 and --t5loglevel=4, TMs ctor(when tm object was created-so before it started loading tm) and dctor(when tm object was destroyed - so after closing tm) would have transaction level logs\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"maxBadSegmentsIdsSaved\",\n \"value\": \"20\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Defines how many segments(it's id's) that failed during import or reorganize would be saved to the status response\",\n \"type\": \"int32\",\n \"default\": \"20\"\n },\n {\n \"name\": \"newEntryIfOnlyContextAndTimestampDifferent\",\n \"value\": \"true\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If it is set to true, the behavior should be: A new entry should be saved to the TM, if only timestamp and context are different and all other params the same;\t If it is set to false, the beahvior should be: if context is different and timestamp is different, the context and timestamp of the new to be saved segment should overwrite the context and segment of an entry, that already exists and where all other params are the same as in the new segment. This is basically the same behavior it would have, if context would not be set for both segments (the old and the new).\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"port\",\n \"value\": \"4040\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"What port to listen on\",\n \"type\": \"int32\",\n \"default\": \"4080\"\n },\n {\n \"name\": \"saveDifferentTargetsForSameSource\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If it is set to true, when saving new segment, and found matching source and attributes, to replace previous need to have matching targets(old target = new target), if false -> previous target would be replaced with new one. In other words, true would make t5memory save multiple translation to exactly same source and attributes(document, authors etc), false would still save multiple pairs of attributes, but translation could be replaced with newer.\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"servicename\",\n \"value\": \"t5memory\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets service name to use in url\",\n \"type\": \"string\",\n \"default\": \"t5memory\"\n },\n {\n \"name\": \"servicethreads\",\n \"value\": \"10\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets amought of worker threads for service\",\n \"type\": \"int32\",\n \"default\": \"5\"\n },\n {\n \"name\": \"skipStartupLogs\",\n \"value\": \"true\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"if set to true, values from --t5loglevel would be applied immediately, if set to false- you would see all startup logs and --v and --t5loglevel would be applied only after start of the service and it's init message. Set to false if you have issues at startup\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"skip_default_flags_in_init_msg\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"if set to true, all default flags would be skipped in init msg\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"suppressTmVersionCheck\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If sets to true, allow to open tms, which was created in version, that's outside of supported versions scope. You can use this if you have version mismatch error\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"t5_ip\",\n \"value\": \"\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Which ip to use in t5memory(default is any). Should be in format '1.1.1.1', default is to listen to all available ip\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"t5globversion_max_supported\",\n \"value\": \"0\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"set max global version in which tm was created to be supported for open in current. it's the X(GLOB) in vX.Y.Z; by default it's current version\",\n \"type\": \"int32\",\n \"default\": \"0\"\n },\n {\n \"name\": \"t5globversion_min_supported\",\n \"value\": \"0\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"sets minimal global version in which tm was created to be supported for open in current. it's the X(GLOB) in vX.Y.Z\",\n \"type\": \"int32\",\n \"default\": \"0\"\n },\n {\n \"name\": \"t5loglevel\",\n \"value\": \"4\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets t5memory log level threshold from DEVELOP(0) to TRANSACTION(6)\",\n \"type\": \"int32\",\n \"default\": \"2\"\n },\n {\n \"name\": \"t5majversion_max_supported\",\n \"value\": \"7\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"set max major version in which tm was created to be supported for open in current. it's the Y(MAJ) in vX.Y.Z; by default it's current version\",\n \"type\": \"int32\",\n \"default\": \"7\"\n },\n {\n \"name\": \"t5majversion_min_supported\",\n \"value\": \"5\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"sets minimal major version in which tm was created to be supported for open in current. it's the Y(MAJ) in vX.Y.Z\",\n \"type\": \"int32\",\n \"default\": \"5\"\n },\n {\n \"name\": \"t5minversion_max_supported\",\n \"value\": \"14\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"(disabled)sets max minor version in which tm was created to be supported for open in current. it's the Z(MIN) in vX.Y.Z; by default it's current version\",\n \"type\": \"int32\",\n \"default\": \"14\"\n },\n {\n \"name\": \"t5minversion_min_supported\",\n \"value\": \"60\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"sets minimal minor version in which tm was created to be supported for open in current. it's the Z(MIN) in vX.Y.Z\",\n \"type\": \"int32\",\n \"default\": \"60\"\n },\n {\n \"name\": \"timeout\",\n \"value\": \"180000\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets timeout for service request handling\",\n \"type\": \"int32\",\n \"default\": \"180000\"\n },\n {\n \"name\": \"tmListLockDefaultTimeout\",\n \"value\": \"3000\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets tm mutex lock timeout(in ms) for TM list(which is used to open and close tms, and hold list of opened tms), after which operation would be canceled and mutex would return an error, if set to 0, mutex lock would be waited without timeout\",\n \"type\": \"int64\",\n \"default\": \"3000\"\n },\n {\n \"name\": \"tmLockDefaultTimeout\",\n \"value\": \"3000\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets tm mutex lock timeout(in ms) for TM after which operation would be canceled and mutex would return an error, if set to 0, mutex lock would be waited without timeout\",\n \"type\": \"int64\",\n \"default\": \"3000\"\n },\n {\n \"name\": \"tmMaxIdleTimeSec\",\n \"value\": \"7200\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set some value, except, 0, during request, tm list would bee cleaned up from tms that are longer inactive than this number\",\n \"type\": \"int64\",\n \"default\": \"7200\"\n },\n {\n \"name\": \"tmRequestLockDefaultTimeout\",\n \"value\": \"3000\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets tm mutex lock timeout(in ms) for part where request is requesting tm(which is used to open and close tms, and hold list of opened tms), after which operation would be canceled and mutex would return an error, if set to 0, mutex lock would be waited without timeout\",\n \"type\": \"int64\",\n \"default\": \"3000\"\n },\n {\n \"name\": \"triplesthreshold\",\n \"value\": \"5\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets threshold to pre fuzzy filtering based on hashes of neibour tokens, range[0...100]. It's pre fuzzy filtering of the segments, when t5memory tries to predict how high fuzzy rate would be for some segment based on data that doesn't require as mych work as fuzzy calculations. When value is low, it can select more suggestions for fuzzy calculation, but if it set high, some best matches could be skipped. In opentm2 default value was 33, but that value seems like not working well with segments, where there are a lot of tags.\",\n \"type\": \"int32\",\n \"default\": \"5\"\n },\n {\n \"name\": \"useTimedMutexesForReorganizeAndImport\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, in reorganize or import thread would be used mutexes with timeouts, and reorganizee or import could be canceled, false(by default) - would be used non timed mutexes\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"wait_for_import_and_reorganize_requests\",\n \"value\": \"true\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, waiting for all import and reorganize processes to be done at shutdown when not using shutdown request\",\n \"type\": \"bool\",\n \"default\": \"true\"\n }\n}",
+ "responseId": 29040387,
+ "ordering": 1,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ }
+ ],
+ "requestBody": {
+ "type": "none",
+ "parameters": [],
+ "mediaType": "",
+ "examples": [],
+ "oasExtensions": ""
+ },
+ "description": "Return all available commandline flags. Do not spam too much because gflags documentation says that that's slow. Useful to collect configuration data about t5memory to do debugging.",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 140,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.29040387"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "Multifuzzy",
+ "api": {
+ "id": "20124748",
+ "method": "post",
+ "path": "/t5memory/{{memory}}/multifuzzysearch",
+ "parameters": {
+ "query": [],
+ "path": [],
+ "cookie": [],
+ "header": []
+ },
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "29046185",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "responses": {
+ "type": "object",
+ "properties": {
+ "first": {
+ "type": "object",
+ "properties": {
+ "ReturnValue": {
+ "type": "integer"
+ },
+ "ErrorMsg": {
+ "type": "string"
+ },
+ "NumOfFoundProposals": {
+ "type": "integer"
+ },
+ "searchedSrc": {
+ "type": "string"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "forceFuzzy": {
+ "type": "integer"
+ },
+ "results": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "segmentId": {
+ "type": "integer"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "timestamp": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "additionalInfo": {
+ "type": "string"
+ },
+ "internalKey": {
+ "type": "string"
+ },
+ "matchType": {
+ "type": "string"
+ },
+ "matchRate": {
+ "type": "integer"
+ },
+ "fuzzyWords": {
+ "type": "integer"
+ },
+ "fuzzyDiffs": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "source",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey",
+ "matchType",
+ "matchRate",
+ "fuzzyWords",
+ "fuzzyDiffs"
+ ],
+ "x-apidog-orders": [
+ "source",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey",
+ "matchType",
+ "matchRate",
+ "fuzzyWords",
+ "fuzzyDiffs"
+ ]
+ }
+ }
+ },
+ "required": [
+ "ReturnValue",
+ "ErrorMsg",
+ "NumOfFoundProposals",
+ "searchedSrc",
+ "customId",
+ "forceFuzzy"
+ ],
+ "x-apidog-orders": [
+ "ReturnValue",
+ "ErrorMsg",
+ "NumOfFoundProposals",
+ "searchedSrc",
+ "customId",
+ "forceFuzzy",
+ "results"
+ ],
+ "description": "key \"first\" is an exampe. it was set because request has \"customId\": \"first\""
+ },
+ "second": {
+ "type": "object",
+ "properties": {
+ "ReturnValue": {
+ "type": "integer"
+ },
+ "ErrorMsg": {
+ "type": "string"
+ },
+ "NumOfFoundProposals": {
+ "type": "integer"
+ },
+ "searchedSrc": {
+ "type": "string"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "forceFuzzy": {
+ "type": "integer"
+ },
+ "results": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "segmentId": {
+ "type": "integer"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "timestamp": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "additionalInfo": {
+ "type": "string"
+ },
+ "internalKey": {
+ "type": "string"
+ },
+ "matchType": {
+ "type": "string"
+ },
+ "matchRate": {
+ "type": "integer"
+ },
+ "fuzzyWords": {
+ "type": "integer"
+ },
+ "fuzzyDiffs": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "source",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey",
+ "matchType",
+ "matchRate",
+ "fuzzyWords",
+ "fuzzyDiffs"
+ ],
+ "x-apidog-orders": [
+ "source",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey",
+ "matchType",
+ "matchRate",
+ "fuzzyWords",
+ "fuzzyDiffs"
+ ]
+ }
+ }
+ },
+ "required": [
+ "ReturnValue",
+ "ErrorMsg",
+ "NumOfFoundProposals",
+ "searchedSrc",
+ "customId",
+ "forceFuzzy"
+ ],
+ "x-apidog-orders": [
+ "ReturnValue",
+ "ErrorMsg",
+ "NumOfFoundProposals",
+ "searchedSrc",
+ "customId",
+ "forceFuzzy",
+ "results"
+ ],
+ "description": "key \"second\" is an exampe. it was set because request has \"customId\": \"second\""
+ }
+ },
+ "required": [
+ "first",
+ "second"
+ ],
+ "x-apidog-orders": [
+ "first",
+ "second"
+ ]
+ }
+ },
+ "required": [
+ "responses"
+ ],
+ "x-apidog-orders": [
+ "responses"
+ ]
+ },
+ "description": "Each response object in responses has a key and value of it contains response of simple fuzzy search.\nName of a key comes from \"customId\" in request.",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [
+ {
+ "name": "Success",
+ "data": "{\n\t\"responses\": {\n\t\t\"first\": {\n\t\t\t\"ReturnValue\": 0,\n\t\t\t\"ErrorMsg\": \"\",\n\t\t\t\"NumOfFoundProposals\": 2,\n\t\t\t\"searchedSrc\": \"First segment with int\",\n\t\t\t\"customId\": \"first\",\n\t\t\t\"forceFuzzy\": 0,\n\t\t\t\"results\": [\n\t\t\t\t{\n\t\t\t\t\t\"source\": \"First segment with int 10\",\n\t\t\t\t\t\"target\": \"Перший сегмент з числом 10\",\n\t\t\t\t\t\"segmentId\": 6,\n\t\t\t\t\t\"customId\": \"\",\n\t\t\t\t\t\"documentName\": \"none\",\n\t\t\t\t\t\"sourceLang\": \"en\",\n\t\t\t\t\t\"targetLang\": \"UK\",\n\t\t\t\t\t\"type\": \"Manual\",\n\t\t\t\t\t\"author\": \"MANAGER\",\n\t\t\t\t\t\"timestamp\": \"20250716T084347Z\",\n\t\t\t\t\t\"markupTable\": \"OTMXUXLF\",\n\t\t\t\t\t\"context\": \"\",\n\t\t\t\t\t\"additionalInfo\": \"\",\n\t\t\t\t\t\"internalKey\": \"10:1\",\n\t\t\t\t\t\"matchType\": \"Fuzzy\",\n\t\t\t\t\t\"matchRate\": 80,\n\t\t\t\t\t\"fuzzyWords\": 5,\n\t\t\t\t\t\"fuzzyDiffs\": 1\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"source\": \"First segment with int \",\n\t\t\t\t\t\"target\": \"Перший сегмент з числом \",\n\t\t\t\t\t\"segmentId\": 2,\n\t\t\t\t\t\"customId\": \"\",\n\t\t\t\t\t\"documentName\": \"none\",\n\t\t\t\t\t\"sourceLang\": \"en\",\n\t\t\t\t\t\"targetLang\": \"UK\",\n\t\t\t\t\t\"type\": \"Manual\",\n\t\t\t\t\t\"author\": \"MANAGER\",\n\t\t\t\t\t\"timestamp\": \"20250716T084347Z\",\n\t\t\t\t\t\"markupTable\": \"OTMXUXLF\",\n\t\t\t\t\t\"context\": \"\",\n\t\t\t\t\t\"additionalInfo\": \"\",\n\t\t\t\t\t\"internalKey\": \"7:1\",\n\t\t\t\t\t\"matchType\": \"Fuzzy\",\n\t\t\t\t\t\"matchRate\": 80,\n\t\t\t\t\t\"fuzzyWords\": 5,\n\t\t\t\t\t\"fuzzyDiffs\": 1\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t\"second\": {\n\t\t\t\"ReturnValue\": 0,\n\t\t\t\"ErrorMsg\": \"\",\n\t\t\t\"NumOfFoundProposals\": 2,\n\t\t\t\"searchedSrc\": \"Third segment with\",\n\t\t\t\"customId\": \"second\",\n\t\t\t\"forceFuzzy\": 0,\n\t\t\t\"results\": [\n\t\t\t\t{\n\t\t\t\t\t\"source\": \"Third segment with int 10 and float 1.100\",\n\t\t\t\t\t\"target\": \"третій сегмент з числом 10 і 1.100, друге захищене як ціле з точкою\",\n\t\t\t\t\t\"segmentId\": 8,\n\t\t\t\t\t\"customId\": \"\",\n\t\t\t\t\t\"documentName\": \"none\",\n\t\t\t\t\t\"sourceLang\": \"en\",\n\t\t\t\t\t\"targetLang\": \"UK\",\n\t\t\t\t\t\"type\": \"Manual\",\n\t\t\t\t\t\"author\": \"MANAGER\",\n\t\t\t\t\t\"timestamp\": \"20250716T084347Z\",\n\t\t\t\t\t\"markupTable\": \"OTMXUXLF\",\n\t\t\t\t\t\"context\": \"\",\n\t\t\t\t\t\"additionalInfo\": \"\",\n\t\t\t\t\t\"internalKey\": \"11:1\",\n\t\t\t\t\t\"matchType\": \"Fuzzy\",\n\t\t\t\t\t\"matchRate\": 37,\n\t\t\t\t\t\"fuzzyWords\": 8,\n\t\t\t\t\t\"fuzzyDiffs\": 5\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"source\": \"Third segment with int and float \",\n\t\t\t\t\t\"target\": \"третій сегмент з числом і , друге захищене як ціле з точкою\",\n\t\t\t\t\t\"segmentId\": 4,\n\t\t\t\t\t\"customId\": \"\",\n\t\t\t\t\t\"documentName\": \"none\",\n\t\t\t\t\t\"sourceLang\": \"en\",\n\t\t\t\t\t\"targetLang\": \"UK\",\n\t\t\t\t\t\"type\": \"Manual\",\n\t\t\t\t\t\"author\": \"MANAGER\",\n\t\t\t\t\t\"timestamp\": \"20250716T084347Z\",\n\t\t\t\t\t\"markupTable\": \"OTMXUXLF\",\n\t\t\t\t\t\"context\": \"\",\n\t\t\t\t\t\"additionalInfo\": \"\",\n\t\t\t\t\t\"internalKey\": \"8:1\",\n\t\t\t\t\t\"matchType\": \"Fuzzy\",\n\t\t\t\t\t\"matchRate\": 37,\n\t\t\t\t\t\"fuzzyWords\": 8,\n\t\t\t\t\t\"fuzzyDiffs\": 5\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t}\n}",
+ "responseId": 29046185,
+ "ordering": 1,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ }
+ ],
+ "requestBody": {
+ "type": "application/json",
+ "parameters": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "requests": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "sourceLang": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "source": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "customId": {
+ "type": "string",
+ "description": "If provided will be ased as key in response block"
+ }
+ },
+ "required": [
+ "sourceLang",
+ "targetLang",
+ "source",
+ "documentName",
+ "context"
+ ],
+ "x-apidog-orders": [
+ "sourceLang",
+ "targetLang",
+ "source",
+ "documentName",
+ "context",
+ "customId"
+ ]
+ }
+ }
+ },
+ "required": [
+ "requests"
+ ],
+ "x-apidog-orders": [
+ "requests"
+ ]
+ },
+ "mediaType": "",
+ "examples": [
+ {
+ "name": "Example 1",
+ "value": "{\n \"requests\": [\n {\n \"sourceLang\": \"en\",\n \"targetLang\": \"uk\",\n \"source\": \"First segment with int\",\n \"documentName\": \"\",\n \"context\": \"\",\n \"customId\": \"first\"\n },\n {\n \"sourceLang\": \"en\",\n \"targetLang\": \"uk\",\n \"source\": \"Third segment with\",\n \"documentName\": \"\",\n \"context\": \"\",\n \"customId\": \"second\"\n }\n ]\n}",
+ "mediaType": "application/json"
+ }
+ ],
+ "oasExtensions": ""
+ },
+ "description": "Sends multiple fuzzysearches in the same tm in a row",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 150,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.29046185"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "Multi Update",
+ "api": {
+ "id": "20128944",
+ "method": "post",
+ "path": "/t5memory/{{memory}}/multiupdate",
+ "parameters": {
+ "query": [],
+ "path": [],
+ "cookie": [],
+ "header": []
+ },
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "29051393",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "responses": {
+ "type": "object",
+ "properties": {
+ "fourth": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string"
+ },
+ "sourceNPRepl": {
+ "type": "string"
+ },
+ "sourceNorm": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "segmentId": {
+ "type": "integer"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "timestamp": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "additionalInfo": {
+ "type": "string"
+ },
+ "internalKey": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "source",
+ "sourceNPRepl",
+ "sourceNorm",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey"
+ ],
+ "x-apidog-orders": [
+ "source",
+ "sourceNPRepl",
+ "sourceNorm",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey"
+ ],
+ "description": "Key \"fourth\" comes from request \"customId\""
+ },
+ "fifth": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string"
+ },
+ "sourceNPRepl": {
+ "type": "string"
+ },
+ "sourceNorm": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "segmentId": {
+ "type": "integer"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "timestamp": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "additionalInfo": {
+ "type": "string"
+ },
+ "internalKey": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "source",
+ "sourceNPRepl",
+ "sourceNorm",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey"
+ ],
+ "x-apidog-orders": [
+ "source",
+ "sourceNPRepl",
+ "sourceNorm",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey"
+ ]
+ }
+ },
+ "required": [
+ "fourth",
+ "fifth"
+ ],
+ "x-apidog-orders": [
+ "fourth",
+ "fifth"
+ ]
+ },
+ "save2disk": {
+ "type": "string",
+ "enum": [
+ "1",
+ "0"
+ ],
+ "x-apidog-enum": [
+ {
+ "value": "1",
+ "name": "Saved",
+ "description": ""
+ },
+ {
+ "value": "0",
+ "name": "Not saved",
+ "description": ""
+ }
+ ],
+ "description": "Represents if new segmnets are saved to disk right away"
+ }
+ },
+ "required": [
+ "responses",
+ "save2disk"
+ ],
+ "x-apidog-orders": [
+ "responses",
+ "save2disk"
+ ]
+ },
+ "description": "Each response object in responses has a key and value of it contains response of simple update.\nName of a key comes from \"customId\" in request.",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [
+ {
+ "name": "Success",
+ "data": "{\n\t\"responses\": {\n\t\t\"fourth\": {\n\t\t\t\"source\": \"Fourth segmnet\",\n\t\t\t\"sourceNPRepl\": \"Fourth segmnet\",\n\t\t\t\"sourceNorm\": \"Fourth segmnet\",\n\t\t\t\"target\": \"Четвертий сегмент\",\n\t\t\t\"segmentId\": 9,\n\t\t\t\"customId\": \"fourth\",\n\t\t\t\"documentName\": \"test.xlsx.sdlxliff\",\n\t\t\t\"sourceLang\": \"UK\",\n\t\t\t\"targetLang\": \"EN\",\n\t\t\t\"type\": \"Manual\",\n\t\t\t\"author\": \"PROJECT MANAGER\",\n\t\t\t\"timestamp\": \"20250812T125637Z\",\n\t\t\t\"markupTable\": \"OTMXUXLF\",\n\t\t\t\"context\": \"390\",\n\t\t\t\"additionalInfo\": \"\",\n\t\t\t\"internalKey\": \"12:1\"\n\t\t},\n\t\t\"fifth\": {\n\t\t\t\"source\": \"Fifth segment\",\n\t\t\t\"sourceNPRepl\": \"Fifth segment\",\n\t\t\t\"sourceNorm\": \"Fifth segment\",\n\t\t\t\"target\": \"Пʼятий сегмент\",\n\t\t\t\"segmentId\": 10,\n\t\t\t\"customId\": \"fifth\",\n\t\t\t\"documentName\": \"translation.docx\",\n\t\t\t\"sourceLang\": \"UK\",\n\t\t\t\"targetLang\": \"EN\",\n\t\t\t\"type\": \"Manual\",\n\t\t\t\"author\": \"EDITOR\",\n\t\t\t\"timestamp\": \"20250812T125637Z\",\n\t\t\t\"markupTable\": \"OTMXUXLF\",\n\t\t\t\"context\": \"200\",\n\t\t\t\"additionalInfo\": \"\",\n\t\t\t\"internalKey\": \"13:1\"\n\t\t}\n\t},\n\t\"save2disk\": \"0\"\n}",
+ "responseId": 29051393,
+ "ordering": 1,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ }
+ ],
+ "requestBody": {
+ "type": "application/json",
+ "parameters": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "requests": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "customId": {
+ "type": "string",
+ "description": "If provided will be used as field name for result in response"
+ },
+ "source": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "save2disk": {
+ "type": "string",
+ "enum": [
+ "1",
+ "0"
+ ],
+ "x-apidog-enum": [
+ {
+ "value": "1",
+ "name": "yes",
+ "description": ""
+ },
+ {
+ "value": "0",
+ "name": "no",
+ "description": ""
+ }
+ ],
+ "description": "If 1 provided will save new segmnet to disk right away, else - only in RAM until flush happens"
+ }
+ },
+ "required": [
+ "source",
+ "target",
+ "targetLang",
+ "sourceLang",
+ "documentName",
+ "author",
+ "context"
+ ],
+ "x-apidog-orders": [
+ "customId",
+ "source",
+ "target",
+ "type",
+ "markupTable",
+ "targetLang",
+ "sourceLang",
+ "documentName",
+ "author",
+ "context",
+ "save2disk"
+ ]
+ }
+ }
+ },
+ "required": [
+ "requests"
+ ],
+ "x-apidog-orders": [
+ "requests"
+ ]
+ },
+ "mediaType": "",
+ "examples": [
+ {
+ "name": "Example 1",
+ "value": "{\n \"requests\": [\n {\n \"customId\": \"fourth\",\n \"source\": \"Fourth segmnet\",\n \"target\": \"Четвертий сегмент\",\n \"type\": \"Manual\",\n \"markupTable\": \"OTMXUXLF\",\n \"targetLang\": \"en\",\n \"sourceLang\": \"uk\",\n \"documentName\": \"test.xlsx.sdlxliff\",\n \"author\": \"Project Manager\",\n \"context\": \"390\"\n },\n {\n \"customId\": \"fifth\",\n \"source\": \"Fifth segment\",\n \"target\": \"Пʼятий сегмент\",\n \"type\": \"Manual\",\n \"markupTable\": \"OTMXUXLF\",\n \"targetLang\": \"en\",\n \"sourceLang\": \"uk\",\n \"documentName\": \"translation.docx\",\n \"author\": \"Editor\",\n \"context\": \"200\"\n }\n ]\n}",
+ "mediaType": "application/json"
+ }
+ ],
+ "oasExtensions": ""
+ },
+ "description": "Send multiple updateEntry requests to the same tm with one call",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 156,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.29051393"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "Tables",
+ "api": {
+ "id": "20146676",
+ "method": "get",
+ "path": "/t5memory/{{memory}}/tables",
+ "parameters": {
+ "path": [],
+ "header": [
+ {
+ "required": false,
+ "description": "",
+ "type": "string",
+ "id": "k0UsRIj2NS",
+ "example": "application/json",
+ "enable": true,
+ "name": "Accept"
+ }
+ ]
+ },
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "29077795",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {}
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [
+ {
+ "name": "Success",
+ "data": "{\n \"tableName(additional info)(INTERNAL_KEY_OF_THE_TABLE)\": \"position)idInTable: value;\",\n \"tagTablesTable(4)\": \"0)0: \\\"\\\"; \",\n \"langTable(1)\": \"0)2: \\\"EN\\\"; 1)1: \\\"UK\\\"; 2)0: \\\"\\\"; \",\n \"langGroupTable(virtual)(8)\":\"0)1: \\\"E\\\"; 1)2: \\\"U\\\"; 2)0: \\\"\u0000\\\"; \",\n \"authors(3)\": \"0)3: \\\"EDITOR\\\"; 1)1: \\\"MANAGER\\\"; 2)2: \\\"PROJECT MANAGER\\\"; 3)0: \\\"\\\"; \",\n \"filenames(long)(5)\": \"0)1: \\\"none\\\"; 1)1: \\\"none\\\"; 2)1: \\\"none\\\"; 3)2: \\\"test.xlsx.sdlxliff\\\"; 4)5: \\\"test.xlsx.sdlxliff\\\"; 5)6: \\\"translation.docx\\\"; 6)0: \\\"\\\"; \",\n \"filenames(long, caseign, virtual)(5)\": \"0)1: \\\"NONE\\\"; 1)1: \\\"NONE\\\"; 2)1: \\\"NONE\\\"; 3)5: \\\"TEST.XLSX.SDLXLIFF\\\"; 4)6: \\\"TRANSLATION.DOCX\\\"; 5)2: \\\"TRANSLATION.TXT\\\"; 6)0: \\\"\\\"; \",\n \"filenames(short)(2)\": \"0)1: \\\"none\\\"; 1)5: \\\"test.xlsx.sdlxliff\\\"; 2)6: \\\"translation.docx\\\"; 3)0: \\\"\\\"; \"\n}",
+ "responseId": 29077795,
+ "ordering": 1,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ }
+ ],
+ "requestBody": {
+ "type": "none",
+ "parameters": [],
+ "mediaType": "",
+ "examples": [],
+ "oasExtensions": ""
+ },
+ "description": "Get author, lang, langGroup(virtual- created in runtime and not saved on the disk), tagtable(deprecated - only one record), document(long filename, long filename caseignore-virtual, short filename- part deprecated)\n\nTables are provided in format - name(internal key): \"position) idInTable:value;\"\n\nhttps://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-Tables\nWhen adding new entry, for new Id t5memory uses basicaly size of the table before adding+1, so Id should start from id=1. \nWhen doing fuzzy search, some field could also be saved to the table, to generate then id(or find matching) to compare with saved data.\nThere are 2 types of entries- older, fixed size, and long filename. For older, every entry has the same size, 39 bytes+endOfLine. You can have up to 389 entries saved in that way in each of the tables. Longname table manage size dynamically, so it's not clear what's the maximum size, but for filenames there are duplicates in old style docname table and in longname(which are used only for this type of data). For filename search, first used longname table, then generated on tm loading caseignore longname table, then short name table. Usually entries in tables are caseignore. \n\nIn the record t5memory saves only id to the table. Maybe it make sense to implement endpoint to edit that table, if something is missing or corrupted. Exception for saving id are context and additional info, some data, that could be saved as int(segId, time), and source and target.\nTo clear or fix tag tables, you need to do reorganize, but if some entry is missing from the table, you would not restore it on export or segment exctraction via id. So tables could be used to check health of the tm. And for some ways for concordance search or some other checks.",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 166,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.29077795"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "Add to table",
+ "api": {
+ "id": "20502616",
+ "method": "post",
+ "path": "/t5memory/{{memory}}/addtotable",
+ "parameters": {},
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "29731405",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {}
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [
+ {
+ "name": "Invalid table key",
+ "data": "{\n \"ReturnValue\": 400,\n \"ErrorMsg\": \"Invalid table key(0); available keys = LANG_KEY(1), FILE_KEY(2), AUTHOR_KEY(3)\"\n}",
+ "responseId": 29731405,
+ "ordering": 1,
+ "description": "Endpoint have a lot of checks and response. If you wouldn't set tableKey or send just empty body, you would have this message",
+ "oasKey": "",
+ "oasExtensions": ""
+ },
+ {
+ "name": "Table already have entry with matching id",
+ "data": "{\n \"ReturnValue\": 400,\n \"ErrorMsg\": \"Id match in Table 2 already have entry with matching id = 100 and value = \\\"Teaser Page.xlsx\\\";\"\n}",
+ "responseId": 29731405,
+ "ordering": 2,
+ "description": "It wouldn't allow to dublicate id in the table and would return in that case already saved entry, I added valueIsEmpty check after checking if id is in the table, so you can use request in read-only mode - just skip",
+ "oasKey": "",
+ "oasExtensions": ""
+ },
+ {
+ "name": "Value field is empty",
+ "data": "{\n \"ReturnValue\": 400,\n \"ErrorMsg\": \"Value field is empty\"\n}",
+ "responseId": 29731405,
+ "ordering": 3,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ }
+ ],
+ "requestBody": {
+ "type": "application/json",
+ "parameters": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "string"
+ },
+ "entryId": {
+ "type": "integer"
+ },
+ "tableKey": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "value",
+ "entryId",
+ "tableKey"
+ ],
+ "x-apidog-orders": [
+ "value",
+ "entryId",
+ "tableKey"
+ ]
+ },
+ "mediaType": "",
+ "examples": [
+ {
+ "name": "Example 1",
+ "value": "{\n \"value\": \"MY new entry\",\n \"entryId\": 100,\n \"tableKey\": 2\n}",
+ "mediaType": "application/json"
+ }
+ ],
+ "oasExtensions": ""
+ },
+ "description": "You can add new entry to the tables but then it's better to reorganize tm(in case if after adding new entry with missing id and there are other entry with the same value but other id - which could be the case- in binary search that could cause problems - so just reorganize it afterwards). You can check table by just doing something like full export(or concordance search for full tm), and check logs for that 2222 errors.\n\nValues shouldn't be longer than 39 bytes(utf8), and 256 for filename,it's tables limits, for that it also have checks.\nIn cases like with those tms, you can also check if x-1 and x+1 id is present. Usually they are in those bug.\nalso you can check tables via tables request\nAlso logicaly FILE_KEY=2, but that was only for shortname, which was also 39 bytes, but real key for long name table is 5. But for requests and internal handling t5memory uses 2.\nId should be between 1 and 65k, request also checks for that",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 186,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.29731405"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "Create",
+ "api": {
+ "id": "19983316",
+ "method": "post",
+ "path": "/t5memory/",
+ "parameters": {
+ "query": [],
+ "path": [],
+ "cookie": [],
+ "header": []
+ },
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "28804546",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Created TM name"
+ }
+ },
+ "x-apidog-orders": [
+ "name"
+ ],
+ "required": [
+ "name"
+ ]
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ },
+ {
+ "id": "28812960",
+ "code": 200,
+ "name": "Error",
+ "headers": [],
+ "jsonSchema": {
+ "title": "",
+ "type": "object",
+ "properties": {
+ "ReturnValue": {
+ "type": "integer",
+ "description": "Error code"
+ },
+ "ErrorMsg": {
+ "type": "string",
+ "description": "Message to explain error"
+ }
+ },
+ "x-apidog-orders": [
+ "ReturnValue",
+ "ErrorMsg"
+ ],
+ "required": [
+ "ReturnValue",
+ "ErrorMsg"
+ ]
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [
+ {
+ "name": "Success",
+ "data": "{\n \"name\": \"examle_tm2\"\n}",
+ "responseId": 28804546,
+ "ordering": 1,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ },
+ {
+ "name": "Error",
+ "data": "{\n \"ReturnValue\": 7272,\n \"ErrorMsg\": \"::ERROR_MEM_NAME_EXISTS:: TM with this name already exists: test-memory; res = 0\"\n}",
+ "responseId": 28812960,
+ "ordering": 2,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ }
+ ],
+ "requestBody": {
+ "type": "application/json",
+ "parameters": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "New TM name"
+ },
+ "sourceLang": {
+ "type": "string",
+ "description": "rfc5646"
+ }
+ },
+ "required": [
+ "name",
+ "sourceLang"
+ ],
+ "x-apidog-orders": [
+ "name",
+ "sourceLang"
+ ]
+ },
+ "mediaType": "",
+ "examples": [
+ {
+ "value": "{\n \"name\": \"examle_tm2\",\n \"sourceLang\": \"de-DE\"\n}",
+ "mediaType": "application/json",
+ "description": ""
+ }
+ ],
+ "oasExtensions": ""
+ },
+ "description": "",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 0,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.28804546",
+ "BLANK.28812960"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "Create and import TM",
+ "api": {
+ "id": "19983317",
+ "method": "post",
+ "path": "/t5memory/",
+ "parameters": {
+ "query": [],
+ "path": [],
+ "cookie": [],
+ "header": []
+ },
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "28804547",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Created memory name"
+ }
+ },
+ "x-apidog-orders": [
+ "name"
+ ],
+ "required": [
+ "name"
+ ]
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ },
+ {
+ "id": "28812906",
+ "code": 200,
+ "name": "Error",
+ "headers": [],
+ "jsonSchema": {
+ "title": "",
+ "type": "object",
+ "properties": {
+ "ReturnValue": {
+ "type": "integer",
+ "description": "Error code"
+ },
+ "ErrorMsg": {
+ "type": "string",
+ "description": "Message to explain error"
+ }
+ },
+ "x-apidog-orders": [
+ "ReturnValue",
+ "ErrorMsg"
+ ],
+ "required": [
+ "ReturnValue",
+ "ErrorMsg"
+ ]
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [
+ {
+ "name": "Success",
+ "data": "{\n \"name\": \"test-memory\"\n}",
+ "responseId": 28804547,
+ "ordering": 1,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ },
+ {
+ "name": "Error",
+ "data": "{\n \"ReturnValue\": 7272,\n \"ErrorMsg\": \"::ERROR_MEM_NAME_EXISTS:: TM with this name already exists: test-memory; res = 0\"\n}",
+ "responseId": 28812906,
+ "ordering": 2,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ }
+ ],
+ "requestBody": {
+ "type": "application/json",
+ "parameters": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "New memory name"
+ },
+ "sourceLang": {
+ "type": "string",
+ "description": "rfc5646"
+ },
+ "data": {
+ "type": "string",
+ "description": "Binary TM file encode with base64"
+ }
+ },
+ "required": [
+ "name",
+ "sourceLang",
+ "data"
+ ],
+ "x-apidog-orders": [
+ "name",
+ "sourceLang",
+ "data"
+ ]
+ },
+ "mediaType": "",
+ "examples": [
+ {
+ "value": "{ \n \"name\": \"test-memory\",\n \"sourceLang\": \"en-GB\",\n \"data\": \"UEsDBBQACAgIAFJmeFYAAAAAAAAAAAAAAAAoAAQASUQ2MzItR0VPLUxlaWNhLUhlbHAtTWFjaGluZSBDb250cm9sLk1FTQEAAADtzssKQEAUgOFjoTwGWR+5lPW4TCjDxgtomqI0I3lzLyBvIEUW59v829+GrinTJMaK99iqWY5Yq2VFMcpp1sotjN43swSCC/gSzw551bHu7MGLlMYqh6d8xrpBhBFjPnhACCGE/MMJUEsHCKEIpyRnAAAAAAAAAAAIAAAAAAAAUEsDBBQACAgIAFJmeFYAAAAAAAAAAAAAAAAoAAQASUQ2MzItR0VPLUxlaWNhLUhlbHAtTWFjaGluZSBDb250cm9sLlRNRAEAAADt3bFKI0EYB/BvNzFaXCXH1Vdcc3h7xR14xXEsd5pTwRgIEWwlBBRCFPEFbKx9BJ/DJ7CyshYrCwsbX0A3GtykFQnE329ZZnb+u92wMMXMt9FupBFxlERxRVTi+mPwCrNjLe9b+nw/qcRqq77UbC0HwCSdR/3vfafozSVry4s/f2Qr9Wa23t3tbGer3d5+1tju7Oz2u5+X9vqHB3u97+3Gm/24uv1s5V8AAAAAAAAAAAAAAAAAABHzg13/hVqcRSuPOM7P8sv8NG/lvTwAAAAAAAAAAAAAAAAAAABgasxFEjOD3rAO+EwpqQ56Jx+eRmqlpBLlj5JSUhtJqqUkGUnSUhIjQ5UYG4jiLIA7O/4BAAAAAAAAAAAAAAAAAABgAqrPJwHMx2zcfvryNdKbP1e/Iy5+LS58W3h8BgAAAAAAAAAAAJgO6Wg7rK7UbDe2NrfW/5dfTYJp9VI7a1i/CwAAYGLGVqq8U+YBBfOAgnnAowdQSwcITWiheHEBAAAAAAAAAAABAAAAAABQSwMEFAAICAgAUmZ4VgAAAAAAAAAAAAAAACgABABJRDYzMi1HRU8tTGVpY2EtSGVscC1NYWNoaW5lIENvbnRyb2wuVE1JAQAAAO3dwWkCYRAG0NFTzlaQBv4cEsg1JLqokI0gNiDLQgRZQ7ABu7MaLxawKijqWWQPvjcMM1PEx/xM8nZErCJa++J2dV1fTR5b+9inazDOuqNxLwCatI7sc1sctqfWsPf+9pr62Sh9l7Nimgbl/C/l0+J3VpXP3UW1/F/MXyb5MO6krFL/KwAAAAAAAAAAAAAAAACAiM5F6r8Tm48AAAAAAAAAAAAAAAAAAAAAGnD+TS7/DwAAAAAAAAAAAAAAAAAAAM3YAVBLBwgGVIGewwAAAAAAAAAAwAAAAAAAAFBLAQIAABQACAgIALRlVFahCKckZwAAAAAIAAAoAAQAAAAAAAAAAACkgQAAAABJRDYzMi1HRU8tTGVpY2EtSGVscC1NYWNoaW5lIENvbnRyb2wuTUVNAQAAAFBLAQIAABQACAgIAGdralZNaKF4cQEAAAAAAQAoAAQAAAAAAAAAAACkgckAAABJRDYzMi1HRU8tTGVpY2EtSGVscC1NYWNoaW5lIENvbnRyb2wuVE1EAQAAAFBLAQIAABQACAgIAFJmeFYGVIGewwAAAADAAAAoAAQAAAAAAAAAAACkgZwCAABJRDYzMi1HRU8tTGVpY2EtSGVscC1NYWNoaW5lIENvbnRyb2wuVE1JAQAAAFBLBgYsAAAAAAAAAB4DLQAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAOAQAAAAAAAMEDAAAAAAAAUEsGBwAAAADPBAAAAAAAAAEAAABQSwUGAAAAAAMAAwAOAQAAwQMAAAAA\"\n}",
+ "mediaType": "application/json",
+ "description": ""
+ }
+ ],
+ "oasExtensions": ""
+ },
+ "description": "",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 6,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.28804547",
+ "BLANK.28812906"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "Get",
+ "api": {
+ "id": "19983318",
+ "method": "get",
+ "path": "/t5memory/",
+ "parameters": {
+ "query": [],
+ "path": [],
+ "cookie": [],
+ "header": []
+ },
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "28804548",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "Open": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "TM name"
+ }
+ },
+ "x-apidog-orders": [
+ "name"
+ ],
+ "required": [
+ "name"
+ ]
+ },
+ "description": "Memories loaded into RAM"
+ },
+ "Available on disk": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "TM name"
+ }
+ },
+ "x-apidog-orders": [
+ "name"
+ ],
+ "required": [
+ "name"
+ ]
+ },
+ "description": "Memories available on disk"
+ }
+ },
+ "x-apidog-orders": [
+ "Open",
+ "Available on disk"
+ ],
+ "required": [
+ "Open",
+ "Available on disk"
+ ]
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [
+ {
+ "name": "Success",
+ "data": "{\n\t\"Open\": [\n\t\t{\n\t\t\t\"name\": \"test-memory\"\n\t\t}\n\t],\n\t\"Available on disk\": [\n\t\t{\n\t\t\t\"name\": \"test-memory-1\"\n\t\t}\n\t]\n}",
+ "responseId": 28804548,
+ "ordering": 1,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ }
+ ],
+ "requestBody": {
+ "type": "none",
+ "parameters": [],
+ "mediaType": "",
+ "examples": [],
+ "oasExtensions": ""
+ },
+ "description": "",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 12,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.28804548"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "Resources",
+ "api": {
+ "id": "19983319",
+ "method": "get",
+ "path": "/t5memory_service/resources",
+ "parameters": {
+ "query": [],
+ "path": [],
+ "cookie": [],
+ "header": []
+ },
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "28804549",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {},
+ "x-apidog-orders": []
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [
+ {
+ "name": "Success",
+ "data": "{\n \"filebuffers\": [\n {\n \"name\": \"/root/.t5memory/TABLE/OTMXUXLF.TBL\",\n \"size\": 3660\n }\n ],\n \"totalOccupiedByFilebuffersRAM\": 3660,\n \"tms\": [\n {\n \"name\": \"test-memory\",\n \"status\": \"open\",\n \"size\": 134976,\n \"activeRequest\": \"\",\n \"expectedSize\": 0,\n \"StatusInfo\": {\n \"status\": \"open\",\n \"sizeInRAM\": 134976,\n \"activeRequest\": \"\",\n \"tmxImportStatus\": \"available\",\n \"importProgress\": 100,\n \"importTime\": \"Overall import time is : 0:00:00\\n\",\n \"segmentsImported\": 2,\n \"invalidSegments\": 0,\n \"tmxSegmentCount\": 2,\n \"importRuntimeSec\": 0,\n \"importTimeoutSec\": 0,\n \"newEntryIfOnlyContextAndTimestampDifferent\": 1,\n \"saveDifferentTargetsForSameSource\": 0,\n \"invalidSegmentsRCs\": \"\",\n \"firstInvalidSegments(num:segId:errCode)\": \"\",\n \"invalidSymbolErrors\": 0,\n \"errorMsg\": \"\",\n \"rc\": 0,\n \"lastAccessTime\": \"20250801T153723Z\",\n \"creationTime\": \"20250801T123723Z\",\n \"tmCreatedInT5M_version\": \"0:7:14\",\n \"segmentIndex\": 2,\n \"sourceLang\": \"de\",\n \"internalDescription\": \"\",\n \"tmd fbuffer was modified\": 1,\n \"tmi fbuffer was modified\": 1\n }\n }\n ],\n \"totalOccupiedByTMsInRAM\": 712165696,\n \"Run date\": \"Wed Jul 30 16:08:09 2025 \",\n \"Build date\": \"2025/07/29 16:08:46\",\n \"Git commit info\": \"dff40cb9 * updated to v0.7.14 + added skipStartupLogs flags(default true) * fixed non-asan builds * fixed nextInternalKey is empty log on failed export\",\n \"Version\": \"0.7.14\",\n \"Worker threads\": 10,\n \"Timeout(ms)\": 180000,\n \"Resident set\": 1.4483e+12,\n \"Virtual memory usage\": 3.74334e+15,\n \"Requests\": {\n \"RequestCount\": 6829,\n \"RequestExecutionSumTime(sec)\": 14.484,\n \"CreateMem\": {\n \"ReqCount\": 44,\n \"SumTime(sec)\": 0.065,\n \"AvrgReqTime\": 0.00147727\n },\n \"DeleteMem\": {\n \"ReqCount\": 0,\n \"SumTime(sec)\": 0,\n \"AvrgReqTime\": 0\n },\n \"ImportMem\": {\n \"ReqCount\": 29,\n \"SumTime(sec)\": 0.016,\n \"AvrgReqTime\": 0.000551724\n },\n \"ExportMem\": {\n \"ReqCount\": 13,\n \"SumTime(sec)\": 0.09,\n \"AvrgReqTime\": 0.00692308\n },\n \"CloneTmLocaly\": {\n \"ReqCount\": 0,\n \"SumTime(sec)\": 0,\n \"AvrgReqTime\": 0\n },\n \"Reorganize\": {\n \"ReqCount\": 0,\n \"SumTime(sec)\": 0,\n \"AvrgReqTime\": 0\n },\n \"StatusMem\": {\n \"ReqCount\": 109,\n \"SumTime(sec)\": 0.011,\n \"AvrgReqTime\": 0.000100917\n },\n \"FlushMem\": {\n \"ReqCount\": 0,\n \"SumTime(sec)\": 0,\n \"AvrgReqTime\": 0\n },\n \"Fuzzy\": {\n \"ReqCount\": 98,\n \"SumTime(sec)\": 1.034,\n \"AvrgReqTime\": 0.010551\n },\n \"MultiFuzzy\": {\n \"ReqCount\": 0,\n \"SumTime(sec)\": 0,\n \"AvrgReqTime\": 0\n },\n \"Concordance\": {\n \"ReqCount\": 0,\n \"SumTime(sec)\": 0,\n \"AvrgReqTime\": 0\n },\n \"UpdateEntry\": {\n \"ReqCount\": 6,\n \"SumTime(sec)\": 0.013,\n \"AvrgReqTime\": 0.00216667\n },\n \"MultiUpdate\": {\n \"ReqCount\": 0,\n \"SumTime(sec)\": 0,\n \"AvrgReqTime\": 0\n },\n \"GetEntry\": {\n \"ReqCount\": 0,\n \"SumTime(sec)\": 0,\n \"AvrgReqTime\": 0\n },\n \"DeleteEntry\": {\n \"ReqCount\": 0,\n \"SumTime(sec)\": 0,\n \"AvrgReqTime\": 0\n },\n \"SaveAllTms\": {\n \"ReqCount\": 0,\n \"SumTime(sec)\": 0,\n \"AvrgReqTime\": 0\n },\n \"ListOfMemories\": {\n \"ReqCount\": 6474,\n \"SumTime(sec)\": 13.221,\n \"AvrgReqTime\": 0.00204217\n },\n \"Resources\": {\n \"ReqCount\": 22,\n \"SumTime(sec)\": 0.016,\n \"AvrgReqTime\": 0.000727273\n },\n \"Flags\": {\n \"ReqCount\": 0,\n \"SumTime(sec)\": 0,\n \"AvrgReqTime\": 0\n },\n \"Other\": {\n \"ReqCount\": 0,\n \"SumTime(sec)\": 0,\n \"AvrgReqTime\": 0\n },\n \"Unrecognized\": {\n \"ReqCount\": 0,\n \"SumTime(sec)\": 0,\n \"AvrgReqTime\": 0\n }\n },\n \"RAM limit(MB)\": 10000\n}",
+ "responseId": 28804549,
+ "ordering": 1,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ }
+ ],
+ "requestBody": {
+ "type": "none",
+ "parameters": [],
+ "mediaType": "",
+ "examples": [],
+ "oasExtensions": ""
+ },
+ "description": "",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 18,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.28804549"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "Status",
+ "api": {
+ "id": "19983320",
+ "method": "get",
+ "path": "/t5memory/{{memory}}/status",
+ "parameters": {
+ "query": [],
+ "path": [],
+ "cookie": [],
+ "header": []
+ },
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "28804550",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "description": "Statuses:\nopen - memory already in RAM ready to use\navailable - not loaded but present on disk\nloading - loading from disk to RAM\nnot found - error status of absent memory\nreorganize running - Reorganizing in process\nimport running - Import in process\nwaiting for loading - loading requsted but not done yet\nfailed to open - corrupted TM file"
+ },
+ "sizeInRAM": {
+ "type": "integer"
+ },
+ "activeRequest": {
+ "type": "string",
+ "description": " "
+ },
+ "lastAccessTime": {
+ "type": "string"
+ },
+ "creationTime": {
+ "type": "string"
+ },
+ "tmCreatedInT5M_version": {
+ "type": "string",
+ "description": "version of t5memory on momemt of TM creation"
+ },
+ "segmentIndex": {
+ "type": "integer",
+ "description": "index of last inserted segment (not queriable)"
+ },
+ "sourceLang": {
+ "type": "string",
+ "description": "rfc5646"
+ },
+ "internalDescription": {
+ "type": "string"
+ },
+ "tmd fbuffer was modified": {
+ "type": "integer"
+ },
+ "tmi fbuffer was modified": {
+ "type": "integer"
+ }
+ },
+ "x-apidog-orders": [
+ "status",
+ "sizeInRAM",
+ "activeRequest",
+ "lastAccessTime",
+ "creationTime",
+ "tmCreatedInT5M_version",
+ "segmentIndex",
+ "sourceLang",
+ "internalDescription",
+ "tmd fbuffer was modified",
+ "tmi fbuffer was modified"
+ ],
+ "required": [
+ "status",
+ "sizeInRAM",
+ "activeRequest",
+ "lastAccessTime",
+ "creationTime",
+ "tmCreatedInT5M_version",
+ "segmentIndex",
+ "sourceLang",
+ "internalDescription",
+ "tmd fbuffer was modified",
+ "tmi fbuffer was modified"
+ ]
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ },
+ {
+ "id": "28828312",
+ "code": 200,
+ "name": "Import processed status",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string"
+ },
+ "sizeInRAM": {
+ "type": "integer"
+ },
+ "activeRequest": {
+ "type": "string"
+ },
+ "tmxImportStatus": {
+ "type": "string",
+ "description": "Statuses of ongoing improt:\navailable - not tipical. If returned and \"importTime\" == \"not finished\" then import still ongoing\nimport - ongoing import"
+ },
+ "importProgress": {
+ "type": "integer",
+ "description": "Progress in persents"
+ },
+ "importTime": {
+ "type": "string"
+ },
+ "segmentsImported": {
+ "type": "integer",
+ "description": "NUmber of successfully imported segments"
+ },
+ "invalidSegments": {
+ "type": "integer",
+ "description": "Number of invalid segments found in TMX"
+ },
+ "tmxSegmentCount": {
+ "type": "integer",
+ "description": "Number of found segmnets in import TMX file"
+ },
+ "importRuntimeSec": {
+ "type": "integer"
+ },
+ "importTimeoutSec": {
+ "type": "integer"
+ },
+ "newEntryIfOnlyContextAndTimestampDifferent": {
+ "type": "integer"
+ },
+ "saveDifferentTargetsForSameSource": {
+ "type": "integer",
+ "description": "0 or 1 - considered as bool value"
+ },
+ "invalidSegmentsRCs": {
+ "type": "string"
+ },
+ "firstInvalidSegments(num:segId:errCode)": {
+ "type": "string"
+ },
+ "invalidSymbolErrors": {
+ "type": "integer"
+ },
+ "errorMsg": {
+ "type": "string"
+ },
+ "rc": {
+ "type": "integer"
+ },
+ "lastAccessTime": {
+ "type": "string"
+ },
+ "creationTime": {
+ "type": "string"
+ },
+ "tmCreatedInT5M_version": {
+ "type": "string"
+ },
+ "segmentIndex": {
+ "type": "integer"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "internalDescription": {
+ "type": "string"
+ },
+ "tmd fbuffer was modified": {
+ "type": "integer"
+ },
+ "tmi fbuffer was modified": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "status",
+ "sizeInRAM",
+ "activeRequest",
+ "tmxImportStatus",
+ "importProgress",
+ "importTime",
+ "segmentsImported",
+ "invalidSegments",
+ "tmxSegmentCount",
+ "importRuntimeSec",
+ "importTimeoutSec",
+ "newEntryIfOnlyContextAndTimestampDifferent",
+ "saveDifferentTargetsForSameSource",
+ "invalidSegmentsRCs",
+ "firstInvalidSegments(num:segId:errCode)",
+ "invalidSymbolErrors",
+ "errorMsg",
+ "rc",
+ "lastAccessTime",
+ "creationTime",
+ "tmCreatedInT5M_version",
+ "segmentIndex",
+ "sourceLang",
+ "internalDescription",
+ "tmd fbuffer was modified",
+ "tmi fbuffer was modified"
+ ],
+ "x-apidog-orders": [
+ "status",
+ "sizeInRAM",
+ "activeRequest",
+ "tmxImportStatus",
+ "importProgress",
+ "importTime",
+ "segmentsImported",
+ "invalidSegments",
+ "tmxSegmentCount",
+ "importRuntimeSec",
+ "importTimeoutSec",
+ "newEntryIfOnlyContextAndTimestampDifferent",
+ "saveDifferentTargetsForSameSource",
+ "invalidSegmentsRCs",
+ "firstInvalidSegments(num:segId:errCode)",
+ "invalidSymbolErrors",
+ "errorMsg",
+ "rc",
+ "lastAccessTime",
+ "creationTime",
+ "tmCreatedInT5M_version",
+ "segmentIndex",
+ "sourceLang",
+ "internalDescription",
+ "tmd fbuffer was modified",
+ "tmi fbuffer was modified"
+ ]
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [
+ {
+ "name": "Success",
+ "data": "{\n \"status\": \"open\",\n \"sizeInRAM\": 134976,\n \"activeRequest\": \"\",\n \"lastAccessTime\": \"20250801T160913Z\",\n \"creationTime\": \"20250716T102923Z\",\n \"tmCreatedInT5M_version\": \"0:7:7\",\n \"segmentIndex\": 5,\n \"sourceLang\": \"en\",\n \"internalDescription\": \"\",\n \"tmd fbuffer was modified\": 1,\n \"tmi fbuffer was modified\": 1\n}",
+ "responseId": 28804550,
+ "ordering": 1,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ },
+ {
+ "name": "Success",
+ "data": "{\n \"status\": \"open\",\n \"sizeInRAM\": 134976,\n \"activeRequest\": \"\",\n \"tmxImportStatus\": \"available\",\n \"importProgress\": 100,\n \"importTime\": \"Overall import time is : 0:00:00\\n\",\n \"segmentsImported\": 4,\n \"invalidSegments\": 0,\n \"tmxSegmentCount\": 4,\n \"importRuntimeSec\": 0,\n \"importTimeoutSec\": 0,\n \"newEntryIfOnlyContextAndTimestampDifferent\": 1,\n \"saveDifferentTargetsForSameSource\": 0,\n \"invalidSegmentsRCs\": \"\",\n \"firstInvalidSegments(num:segId:errCode)\": \"\",\n \"invalidSymbolErrors\": 0,\n \"errorMsg\": \"\",\n \"rc\": 0,\n \"lastAccessTime\": \"20250807T130822Z\",\n \"creationTime\": \"20250716T102923Z\",\n \"tmCreatedInT5M_version\": \"0:7:7\",\n \"segmentIndex\": 9,\n \"sourceLang\": \"en\",\n \"internalDescription\": \"\",\n \"tmd fbuffer was modified\": 1,\n \"tmi fbuffer was modified\": 1\n}",
+ "responseId": 28828312,
+ "ordering": 2,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ }
+ ],
+ "requestBody": {
+ "type": "none",
+ "parameters": [],
+ "mediaType": "",
+ "examples": [],
+ "oasExtensions": ""
+ },
+ "description": "https://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-GetthestatusofTM",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 24,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.28804550",
+ "BLANK.28828312"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "IMPORT TMX",
+ "api": {
+ "id": "19983322",
+ "method": "post",
+ "path": "/t5memory/{{memory}}/importtmx",
+ "parameters": {
+ "query": [],
+ "path": [],
+ "cookie": [],
+ "header": []
+ },
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "28804552",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {},
+ "x-apidog-orders": []
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [
+ {
+ "name": "Success",
+ "data": "{\n\t\"msg\": \"success\"\n}",
+ "responseId": 28804552,
+ "ordering": 1,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ }
+ ],
+ "requestBody": {
+ "type": "multipart/form-data",
+ "parameters": [
+ {
+ "required": true,
+ "description": "json pretty print string.\n\n\"framingTags\" key possible values:\n\"saveAll\" - default behaviour, do nothing\n\"skipAll\" - skip all enclosing tags, including standalone tags\n\"skipPaired\" - skip only paired enclosing tags\n\nBoth newEntryIfOnlyContextAndTimestampDifferent and saveDifferentTargetsForSameSource impact how similar translation would be saved. In case if source and other field(doc, author, lang) are the same, but target different, and newEntryIfOnlyContextAndTimestampDifferent is set to true, you would have 2 translation, otherwise you would have 1 translation saved - with higher updateTime. but if you have different attributes, like document, you would have 2 translation anyway. \nnewEntryIfOnlyContextAndTimestampDifferent would also increase number of saved segments. If values was not provided, default values from flags would be used.",
+ "type": "string",
+ "id": "nBnfbWCL1O",
+ "example": "{\n \"framingTags\": \"saveAll\",\n \"newEntryIfOnlyContextAndTimestampDifferent\": 0,\n \"saveDifferentTargetsForSameSource\": 0,\n \"timeout\": 100000\n}\n",
+ "enable": true,
+ "name": "json_data",
+ "schema": {
+ "type": "string"
+ },
+ "contentType": "application/json"
+ },
+ {
+ "required": true,
+ "description": "tmx file to import into TM",
+ "type": "file",
+ "id": "xBgBcJUP8I",
+ "example": "",
+ "enable": true,
+ "name": "file",
+ "schema": {
+ "format": "binary",
+ "type": "string"
+ }
+ }
+ ],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {},
+ "x-apidog-orders": []
+ },
+ "mediaType": "",
+ "examples": [
+ {
+ "value": "{\n \"tmxData\": \"PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHRteCB2ZXJzaW9uPSIxLjQiPgogIDxoZWFkZXIgY3JlYXRpb250b29sPSJTREwgTGFuZ3VhZ2UgUGxhdGZvcm0iIGNyZWF0aW9udG9vbHZlcnNpb249IjguMCIgby10bWY9IlNETCBUTTggRm9ybWF0IiBkYXRhdHlwZT0ieG1sIiBzZWd0eXBlPSJzZW50ZW5jZSIgYWRtaW5sYW5nPSJlbi1HQiIgc3JjbGFuZz0iYmctQkciIGNyZWF0aW9uZGF0ZT0iMjAxNTA4MjFUMDkyNjE0WiIgY3JlYXRpb25pZD0idGVzdCIvPgogIDxib2R5PgoJPHR1IGNyZWF0aW9uZGF0ZT0iMjAxODAyMTZUMTU1MTA1WiIgY3JlYXRpb25pZD0iREVTS1RPUC1SNTlCT0tCXFBDMiIgY2hhbmdlZGF0ZT0iMjAxODAyMTZUMTU1MTA4WiIgY2hhbmdlaWQ9IkRFU0tUT1AtUjU5Qk9LQlxQQzIiIGxhc3R1c2FnZWRhdGU9IjIwMTgwMjE2VDE2MTMwNVoiIHVzYWdlY291bnQ9IjEiPgogICAgICA8dHV2IHhtbDpsYW5nPSJiZy1CRyI+CiAgICAgICAgPHNlZz5UaGUgPHBoIC8+IGVuZDwvc2VnPgogICAgICA8L3R1dj4KICAgICAgPHR1diB4bWw6bGFuZz0iZW4tR0IiPgogICAgICAgIDxzZWc+RXRoIDxwaCAvPiBkbmU8L3NlZz4KICAgICAgPC90dXY+CiAgICA8L3R1PgogIDwvYm9keT4KPC90bXg+Cg==\"\n}",
+ "mediaType": "application/json",
+ "description": ""
+ }
+ ],
+ "oasExtensions": ""
+ },
+ "description": "Rout is async. So when import is finished should be checked with status call",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 36,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.28804552"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "EXPORT TMX",
+ "api": {
+ "id": "19983323",
+ "method": "get",
+ "path": "/t5memory/{{memory}}/download.tmx",
+ "parameters": {
+ "query": [],
+ "path": [],
+ "cookie": [],
+ "header": [
+ {
+ "id": "CWZEZZXTgD",
+ "name": "Accept",
+ "required": true,
+ "description": "",
+ "example": "application/xml",
+ "type": "string",
+ "enable": true
+ }
+ ]
+ },
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "28804553",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {},
+ "x-apidog-orders": []
+ },
+ "description": "In response headers \"NextInternalKey\" will contain \"startFromInternalKey\" for next call.\nIf \"NextInternalKey\" == \"0:0\" - then you reached end of TM",
+ "contentType": "xml",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [
+ {
+ "name": "Success",
+ "data": "\n\n\n \n \n \n 2\n 7: 1\n OTMXUXLF\n none\n \n First segment\n \n \n Перший сегмент\n \n \n \n",
+ "responseId": 28804553,
+ "ordering": 1,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ }
+ ],
+ "requestBody": {
+ "type": "application/json",
+ "parameters": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "limit": {
+ "type": "string"
+ },
+ "startFromInternalKey": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "limit",
+ "startFromInternalKey"
+ ],
+ "x-apidog-orders": [
+ "limit",
+ "startFromInternalKey"
+ ]
+ },
+ "description": "",
+ "mediaType": "",
+ "examples": [
+ {
+ "name": "Example 1",
+ "value": "{\n \"limit\": \"100\",\n \"startFromInternalKey\": \"1:1\"\n}",
+ "mediaType": "application/json"
+ }
+ ],
+ "oasExtensions": ""
+ },
+ "description": "JSON pretty print string:\nlimit - number of segments to fetch at a time\nstartFromInternalKey - internal key to start export from\n\nWorks as cursor pagination.\n\nIf no body provided, export starts from the beginning (key 7:1) to the end.",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 42,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.28804553"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "Concordance search",
+ "api": {
+ "id": "19983324",
+ "method": "post",
+ "path": "/t5memory/{{memory}}/search",
+ "parameters": {
+ "query": [],
+ "path": [],
+ "cookie": [],
+ "header": [
+ {
+ "id": "YAsH0YBsjZ",
+ "name": "Accept",
+ "required": true,
+ "description": "",
+ "example": "application/json; charset=utf-8",
+ "type": "string",
+ "enable": true
+ },
+ {
+ "id": "wdM5iC91yw",
+ "name": "Accept-Charset",
+ "required": true,
+ "description": "",
+ "example": "UTF-8",
+ "type": "string",
+ "enable": true
+ }
+ ]
+ },
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "28804554",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "Filters": {
+ "type": "string"
+ },
+ "GlobalSearchOptions": {
+ "type": "string"
+ },
+ "ReturnValue": {
+ "type": "integer"
+ },
+ "ReturnMessage": {
+ "type": "string"
+ },
+ "NewSearchPosition": {
+ "type": "null"
+ },
+ "NumOfFoundSegments": {
+ "type": "integer"
+ },
+ "results": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "segmentId": {
+ "type": "integer"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "timestamp": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "additionalInfo": {
+ "type": "string"
+ },
+ "internalKey": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "source",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey"
+ ],
+ "x-apidog-orders": [
+ "source",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey"
+ ]
+ }
+ }
+ },
+ "required": [
+ "Filters",
+ "GlobalSearchOptions",
+ "ReturnValue",
+ "ReturnMessage",
+ "NewSearchPosition",
+ "NumOfFoundSegments",
+ "results"
+ ],
+ "x-apidog-orders": [
+ "Filters",
+ "GlobalSearchOptions",
+ "ReturnValue",
+ "ReturnMessage",
+ "NewSearchPosition",
+ "NumOfFoundSegments",
+ "results"
+ ]
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [
+ {
+ "name": "Success",
+ "data": "{\n \"Filters\": \"Search filter, field: SOURCE FilterType::CONTAINS SearchStr: 'FIRST'; Options: SEARCH_CASEINSENSITIVE_OPT|;\\nSearch filter, field: TARGET FilterType::CONTAINS SearchStr: ''; Options: SEARCH_CASEINSENSITIVE_OPT|;\\nSearch filter, field: ADDINFO FilterType::CONTAINS SearchStr: ''; Options: SEARCH_CASEINSENSITIVE_OPT|;\\nSearch filter, field: CONTEXT FilterType::CONTAINS SearchStr: ''; Options: SEARCH_CASEINSENSITIVE_OPT|;\\nSearch filter, field: AUTHOR FilterType::CONTAINS SearchStr: ''; Options: SEARCH_CASEINSENSITIVE_OPT|;\\nSearch filter, field: DOCUMENT FilterType::CONTAINS SearchStr: ''; Options: SEARCH_CASEINSENSITIVE_OPT|;\\nSearch filter, field: TIMESTAMP FilterType::RANGE Range: 19691231T230000Z - 20260628T220000Z Options: ;\\n\",\n \"GlobalSearchOptions\": \"SEARCH_FILTERS_LOGICAL_AND\",\n \"ReturnValue\": 10010,\n \"ReturnMessage\": \"ENDREACHED_RC\",\n \"NewSearchPosition\": null,\n \"NumOfFoundSegments\": 2,\n \"results\": [\n {\n \"source\": \"First segment with int \",\n \"target\": \"Перший сегмент з числом \",\n \"segmentId\": 2,\n \"customId\": \"\",\n \"documentName\": \"none\",\n \"sourceLang\": \"en\",\n \"targetLang\": \"UK\",\n \"type\": \"Manual\",\n \"author\": \"MANAGER\",\n \"timestamp\": \"20250716T084347Z\",\n \"markupTable\": \"OTMXUXLF\",\n \"context\": \"\",\n \"additionalInfo\": \"\",\n \"internalKey\": \"7:1\"\n },\n {\n \"source\": \"First segment with int 10\",\n \"target\": \"Перший сегмент з числом 10\",\n \"segmentId\": 6,\n \"customId\": \"\",\n \"documentName\": \"none\",\n \"sourceLang\": \"en\",\n \"targetLang\": \"UK\",\n \"type\": \"Manual\",\n \"author\": \"MANAGER\",\n \"timestamp\": \"20250716T084347Z\",\n \"markupTable\": \"OTMXUXLF\",\n \"context\": \"\",\n \"additionalInfo\": \"\",\n \"internalKey\": \"11:1\"\n }\n ]\n}",
+ "responseId": 28804554,
+ "ordering": 1,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ }
+ ],
+ "requestBody": {
+ "type": "application/json",
+ "parameters": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string",
+ "description": "Sets what to look for in source of the segments, based on type of search, specified in sourceSearchMode(exact, concordance). If sourceSearchMode is not specified, returns an error."
+ },
+ "sourceSearchMode": {
+ "type": "string",
+ "description": "String with required \nEXACT or CONCORDANCE \n(or CONTAINS, what's equal to CONCORDANCE)\nwords and some optional, like\nCASEINSENSETIVE for non case sensetive comparison,\nWHITESPACETOLERANT for\nmodifying whitespaces(result of this actions you can see in filters in responce)\nINVERTED for applying filter in inverted state, so to return false on match and true \nif no match. Logical NOT\n\nAttributes is not case sensetive, \nSeparator doen't matters"
+ },
+ "target": {
+ "type": "string",
+ "description": "Sets what to look for in source of the segments, based on type of search, specified in sourceSearchMode(exact, concordance). If sourceSearchMode is not specified, returns an error."
+ },
+ "targetSearchMode": {
+ "type": "string",
+ "description": "String with required \nEXACT or CONCORDANCE \n(or CONTAINS, what's equal to CONCORDANCE)\nwords and some optional, like\nCASEINSENSETIVE for non case sensetive comparison,\nWHITESPACETOLERANT for\nmodifying whitespaces(result of this actions you can see in filters in responce)\nINVERTED for applying filter in inverted state, so to return false on match and true \nif no match. Logical NOT\n\nAttributes is not case sensetive, \nSeparator doen't matters"
+ },
+ "document": {
+ "type": "string",
+ "description": "Sets what to look for in source of the segments, based on type of search, specified in sourceSearchMode(exact, concordance). If sourceSearchMode is not specified, returns an error."
+ },
+ "documentSearchMode": {
+ "type": "string",
+ "description": "String with required \nEXACT or CONCORDANCE \n(or CONTAINS, what's equal to CONCORDANCE)\nwords and some optional, like\nCASEINSENSETIVE for non case sensetive comparison,\nWHITESPACETOLERANT for\nmodifying whitespaces(result of this actions you can see in filters in responce)\nINVERTED for applying filter in inverted state, so to return false on match and true \nif no match. Logical NOT\n\nAttributes is not case sensetive, \nSeparator doen't matters"
+ },
+ "author": {
+ "type": "string",
+ "description": "Sets what to look for in source of the segments, based on type of search, specified in sourceSearchMode(exact, concordance). If sourceSearchMode is not specified, returns an error."
+ },
+ "authorSearchMode": {
+ "type": "string",
+ "description": "String with required \nEXACT or CONCORDANCE \n(or CONTAINS, what's equal to CONCORDANCE)\nwords and some optional, like\nCASEINSENSETIVE for non case sensetive comparison,\nWHITESPACETOLERANT for\nmodifying whitespaces(result of this actions you can see in filters in responce)\nINVERTED for applying filter in inverted state, so to return false on match and true \nif no match. Logical NOT\n\nAttributes is not case sensetive, \nSeparator doen't matters"
+ },
+ "addInfo": {
+ "type": "string",
+ "description": "Sets what to look for in source of the segments, based on type of search, specified in sourceSearchMode(exact, concordance). If sourceSearchMode is not specified, returns an error."
+ },
+ "addInfoSearchMode": {
+ "type": "string",
+ "description": "String with required \nEXACT or CONCORDANCE \n(or CONTAINS, what's equal to CONCORDANCE)\nwords and some optional, like\nCASEINSENSETIVE for non case sensetive comparison,\nWHITESPACETOLERANT for\nmodifying whitespaces(result of this actions you can see in filters in responce)\nINVERTED for applying filter in inverted state, so to return false on match and true \nif no match. Logical NOT\n\nAttributes is not case sensetive, \nSeparator doen't matters"
+ },
+ "context": {
+ "type": "string",
+ "description": "Sets what to look for in source of the segments, based on type of search, specified in sourceSearchMode(exact, concordance). If sourceSearchMode is not specified, returns an error."
+ },
+ "contextSearchMode": {
+ "type": "string",
+ "description": "String with required \nEXACT or CONCORDANCE \n(or CONTAINS, what's equal to CONCORDANCE)\nwords and some optional, like\nCASEINSENSETIVE for non case sensetive comparison,\nWHITESPACETOLERANT for\nmodifying whitespaces(result of this actions you can see in filters in responce)\nINVERTED for applying filter in inverted state, so to return false on match and true \nif no match. Logical NOT\n\nAttributes is not case sensetive, \nSeparator doen't matters"
+ },
+ "timestampSpanStart": {
+ "type": "string",
+ "description": "String with date in format\n \"20240121T115234Z\""
+ },
+ "timestampSpanEnd": {
+ "type": "string",
+ "description": "String with date in format\n \"20240121T115234Z\""
+ },
+ "onlyCountSegments": {
+ "type": "string",
+ "description": "Instead of returning segment, would go in search till the end of tm and return total number of segments, that returns true with selected filters",
+ "enum": [
+ "1",
+ "0"
+ ],
+ "x-apidog-enum": [
+ {
+ "value": "1",
+ "name": "yes",
+ "description": ""
+ },
+ {
+ "value": "0",
+ "name": "no",
+ "description": ""
+ }
+ ]
+ },
+ "searchPosition": {
+ "type": "string",
+ "description": "Point where to start search in tmd file",
+ "examples": [
+ "8:1"
+ ]
+ },
+ "logicalOr": {
+ "type": "integer",
+ "enum": [
+ 1,
+ 0
+ ],
+ "x-apidog-enum": [
+ {
+ "value": 1,
+ "name": "yes",
+ "description": ""
+ },
+ {
+ "value": 0,
+ "name": "no",
+ "description": ""
+ }
+ ],
+ "description": "By default source, target, document, author, context, addinfo, timestamp is combined in logical AND, but by sending here \"OR\" you can switch that to logical OR, any other value would left it in default AND state.\nDoesn't apply to sourceLang and targetLang filters, they are always in AND state"
+ },
+ "numResults": {
+ "type": "integer",
+ "description": "Points how many matches return in current request",
+ "minimum": 0,
+ "maximum": 200,
+ "default": 5
+ },
+ "sourceLang": {
+ "type": "string",
+ "description": "Filter segments on src/trg lang attribute, \n\nIf specified lang is preffered, matching is done based on lang family,\notherwise on exact match"
+ },
+ "targetLang": {
+ "type": "string",
+ "description": "Filter segments on src/trg lang attribute, \n\nIf specified lang is preffered, matching is done based on lang family,\notherwise on exact match"
+ },
+ "msSearchAfterNumResults": {
+ "type": "integer",
+ "default": 0,
+ "description": "sets how many ms should pass between first found segment and search stop, if it didn't reach the end yet. "
+ },
+ "loggingThreshold": {
+ "type": "integer",
+ "maximum": 6,
+ "description": "HACK.\nAdditional field to set log level on the run.\nSets log level for t5memory process in general and not this request only"
+ }
+ },
+ "x-apidog-orders": [
+ "source",
+ "sourceSearchMode",
+ "target",
+ "targetSearchMode",
+ "document",
+ "documentSearchMode",
+ "author",
+ "authorSearchMode",
+ "addInfo",
+ "addInfoSearchMode",
+ "context",
+ "contextSearchMode",
+ "timestampSpanStart",
+ "timestampSpanEnd",
+ "onlyCountSegments",
+ "searchPosition",
+ "logicalOr",
+ "numResults",
+ "sourceLang",
+ "targetLang",
+ "msSearchAfterNumResults",
+ "loggingThreshold"
+ ]
+ },
+ "mediaType": "",
+ "examples": [
+ {
+ "value": "{\n \"source\": \"First\",\n \"sourceSearchMode\": \"contains, CASEINSENSETIVE\",\n \"target\": \"\",\n \"targetSearchMode\": \"contains, CASEINSENSETIVE\",\n \"document\": \"\",\n \"documentSearchMode\": \"contains, CASEINSENSETIVE\",\n \"author\": \"\",\n \"authorSearchMode\": \"contains, CASEINSENSETIVE\",\n \"addInfo\": \"\",\n \"addInfoSearchMode\": \"contains, CASEINSENSETIVE\",\n \"context\": \"\",\n \"contextSearchMode\": \"contains, CASEINSENSETIVE\",\n \"timestampSpanStart\": \"19691231T230000Z\",\n \"timestampSpanEnd\": \"20260628T220000Z\",\n \"onlyCountSegments\": \"0\",\n \"searchPosition\": \"\",\n \"logicalOr\": 0,\n \"numResults\": 200\n}",
+ "mediaType": "application/json",
+ "description": ""
+ }
+ ],
+ "oasExtensions": ""
+ },
+ "description": "All fields is optional, but some depends on other, so error should be returned in case of not providing required field.\nhttps://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-NewConcordancesearch",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 48,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.28804554"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "Concordance search (DEPRICATED)",
+ "api": {
+ "id": "19983326",
+ "method": "post",
+ "path": "/t5memory/{{memory}}/concordancesearch",
+ "parameters": {
+ "query": [],
+ "path": [],
+ "cookie": [],
+ "header": [
+ {
+ "id": "puP9JRtUNc",
+ "name": "Accept",
+ "required": true,
+ "description": "",
+ "example": "application/json; charset=utf-8",
+ "type": "string",
+ "enable": true
+ },
+ {
+ "id": "q4CWk6wlXh",
+ "name": "Accept-Charset",
+ "required": true,
+ "description": "",
+ "example": "UTF-8",
+ "type": "string",
+ "enable": true
+ }
+ ]
+ },
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "28804556",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "ReturnValue": {
+ "type": "integer"
+ },
+ "ReturnMessage": {
+ "type": "string"
+ },
+ "NewSearchPosition": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "results": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "segmentId": {
+ "type": "integer"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "timestamp": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "additionalInfo": {
+ "type": "string"
+ },
+ "internalKey": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "source",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey"
+ ],
+ "x-apidog-orders": [
+ "source",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey"
+ ]
+ }
+ }
+ },
+ "required": [
+ "ReturnValue",
+ "ReturnMessage",
+ "NewSearchPosition",
+ "results"
+ ],
+ "x-apidog-orders": [
+ "ReturnValue",
+ "ReturnMessage",
+ "NewSearchPosition",
+ "results"
+ ]
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [
+ {
+ "name": "Success",
+ "data": "{\n \"ReturnValue\": 10010,\n \"ReturnMessage\": \"ENDREACHED_RC\",\n \"NewSearchPosition\": null,\n \"results\": [\n {\n \"source\": \"First segment with int \",\n \"target\": \"Перший сегмент з числом \",\n \"segmentId\": 2,\n \"customId\": \"\",\n \"documentName\": \"none\",\n \"sourceLang\": \"en\",\n \"targetLang\": \"UK\",\n \"type\": \"Manual\",\n \"author\": \"MANAGER\",\n \"timestamp\": \"20250716T084347Z\",\n \"markupTable\": \"OTMXUXLF\",\n \"context\": \"\",\n \"additionalInfo\": \"\",\n \"internalKey\": \"7:1\"\n },\n {\n \"source\": \"First segment with int 10\",\n \"target\": \"Перший сегмент з числом 10\",\n \"segmentId\": 6,\n \"customId\": \"\",\n \"documentName\": \"none\",\n \"sourceLang\": \"en\",\n \"targetLang\": \"UK\",\n \"type\": \"Manual\",\n \"author\": \"MANAGER\",\n \"timestamp\": \"20250716T084347Z\",\n \"markupTable\": \"OTMXUXLF\",\n \"context\": \"\",\n \"additionalInfo\": \"\",\n \"internalKey\": \"11:1\"\n }\n ]\n}",
+ "responseId": 28804556,
+ "ordering": 1,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ }
+ ],
+ "requestBody": {
+ "type": "application/json",
+ "parameters": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "searchString": {
+ "type": "string"
+ },
+ "searchType": {
+ "type": "string",
+ "enum": [
+ "Source",
+ "Target",
+ "SourceAndTarget"
+ ],
+ "x-apidog-enum": [
+ {
+ "value": "Source",
+ "name": "",
+ "description": ""
+ },
+ {
+ "value": "Target",
+ "name": "",
+ "description": ""
+ },
+ {
+ "value": "SourceAndTarget",
+ "name": "",
+ "description": ""
+ }
+ ],
+ "examples": [
+ "Source",
+ "Target",
+ "SourceAndTarget"
+ ]
+ },
+ "searchPosition": {
+ "type": "null"
+ },
+ "numResults": {
+ "type": "integer"
+ },
+ "msSearchAfterNumResults": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "searchString",
+ "searchType"
+ ],
+ "x-apidog-orders": [
+ "searchString",
+ "searchType",
+ "searchPosition",
+ "numResults",
+ "msSearchAfterNumResults"
+ ]
+ },
+ "mediaType": "",
+ "examples": [
+ {
+ "value": "{\n \"searchString\": \"With nice text\",\n \"searchType\": \"source\",\n \"searchPosition\": null,\n \"numResults\": 20,\n \"msSearchAfterNumResults\": 250\n}",
+ "mediaType": "application/json",
+ "description": ""
+ }
+ ],
+ "oasExtensions": ""
+ },
+ "description": " SearchPosition / NewSearchPositionFormat: \"7:1\"\nFirst is segmeng\\record number, second is target number\nThe NextSearchposition is an internal key of the memory for the next position on sequential access. Since it is an internal key, maintained and understood by the underlying memory plug-in (for EqfMemoryPlugin is it the record number and the position in one record),\nno assumptions should be made regarding the content. It is just a string that, should be sent back to OpenTM2 on the next request, so that the search starts from there.\nSo is the implementation in Translate5: The first request to OpenTM2 contains SearchPosition with an empty string, OpenTM2 returns than a string in NewSearchPosition, which is just resent to OpenTM2 in the next request.\nhttps://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-Concordancesearch\n ",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 60,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.28804556"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "Fuzzy search",
+ "api": {
+ "id": "19983327",
+ "method": "post",
+ "path": "/t5memory/{{memory}}/fuzzysearch",
+ "parameters": {
+ "query": [],
+ "path": [],
+ "cookie": [],
+ "header": []
+ },
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "28804557",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "ReturnValue": {
+ "type": "integer"
+ },
+ "ErrorMsg": {
+ "type": "string"
+ },
+ "NumOfFoundProposals": {
+ "type": "integer"
+ },
+ "searchedSrc": {
+ "type": "string"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "forceFuzzy": {
+ "type": "integer"
+ },
+ "results": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "segmentId": {
+ "type": "integer"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "timestamp": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "additionalInfo": {
+ "type": "string"
+ },
+ "internalKey": {
+ "type": "string"
+ },
+ "matchType": {
+ "type": "string"
+ },
+ "matchRate": {
+ "type": "integer"
+ },
+ "fuzzyWords": {
+ "type": "integer"
+ },
+ "fuzzyDiffs": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "source",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey",
+ "matchType",
+ "matchRate",
+ "fuzzyWords",
+ "fuzzyDiffs"
+ ],
+ "x-apidog-orders": [
+ "source",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey",
+ "matchType",
+ "matchRate",
+ "fuzzyWords",
+ "fuzzyDiffs"
+ ]
+ }
+ }
+ },
+ "required": [
+ "ReturnValue",
+ "ErrorMsg",
+ "NumOfFoundProposals",
+ "searchedSrc",
+ "customId",
+ "forceFuzzy"
+ ],
+ "x-apidog-orders": [
+ "ReturnValue",
+ "ErrorMsg",
+ "NumOfFoundProposals",
+ "searchedSrc",
+ "customId",
+ "forceFuzzy",
+ "results"
+ ]
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [
+ {
+ "name": "Success",
+ "data": "{\n \"ReturnValue\": 0,\n \"ErrorMsg\": \"\",\n \"NumOfFoundProposals\": 2,\n \"searchedSrc\": \"First segment with int \",\n \"customId\": \"\",\n \"forceFuzzy\": 0,\n \"results\": [\n {\n \"source\": \"First segment with int 10\",\n \"target\": \"Перший сегмент з числом 10\",\n \"segmentId\": 6,\n \"customId\": \"\",\n \"documentName\": \"none\",\n \"sourceLang\": \"en\",\n \"targetLang\": \"UK\",\n \"type\": \"Manual\",\n \"author\": \"MANAGER\",\n \"timestamp\": \"20250716T084347Z\",\n \"markupTable\": \"OTMXUXLF\",\n \"context\": \"\",\n \"additionalInfo\": \"\",\n \"internalKey\": \"11:1\",\n \"matchType\": \"Fuzzy\",\n \"matchRate\": 80,\n \"fuzzyWords\": 5,\n \"fuzzyDiffs\": 1\n },\n {\n \"source\": \"First segment with int 11\",\n \"target\": \"Перший сегмент з числом 11\",\n \"segmentId\": 2,\n \"customId\": \"\",\n \"documentName\": \"none\",\n \"sourceLang\": \"en\",\n \"targetLang\": \"UK\",\n \"type\": \"Manual\",\n \"author\": \"MANAGER\",\n \"timestamp\": \"20250716T084347Z\",\n \"markupTable\": \"OTMXUXLF\",\n \"context\": \"\",\n \"additionalInfo\": \"\",\n \"internalKey\": \"7:1\",\n \"matchType\": \"Fuzzy\",\n \"matchRate\": 80,\n \"fuzzyWords\": 5,\n \"fuzzyDiffs\": 1\n }\n ]\n}",
+ "responseId": 28804557,
+ "ordering": 1,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ }
+ ],
+ "requestBody": {
+ "type": "application/json",
+ "parameters": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "sourceLang": {
+ "type": "string",
+ "description": "rfc5646"
+ },
+ "targetLang": {
+ "type": "string",
+ "description": "rfc5646"
+ },
+ "source": {
+ "type": "string",
+ "description": "Search string to look for"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string",
+ "description": "If there is no markup, default OTMXUXLF would be used.\nMarkup tables should be located inside ~/.t5memory/TABLE/%markup$.TBL"
+ },
+ "context": {
+ "type": "string"
+ },
+ "forceFuzzy": {
+ "type": "integer",
+ "enum": [
+ 1,
+ 0
+ ],
+ "x-apidog-enum": [
+ {
+ "value": 1,
+ "name": "yes",
+ "description": ""
+ },
+ {
+ "value": 0,
+ "name": "no",
+ "description": ""
+ }
+ ],
+ "description": "If yes - will return all potential fuzzies\nNo - only first exact match or most relevant matches"
+ },
+ "numOfProposals": {
+ "type": "integer",
+ "description": "Num of expected segments in output. By default it's 5"
+ }
+ },
+ "required": [
+ "sourceLang",
+ "targetLang",
+ "source"
+ ],
+ "x-apidog-orders": [
+ "sourceLang",
+ "targetLang",
+ "source",
+ "documentName",
+ "markupTable",
+ "context",
+ "forceFuzzy",
+ "numOfProposals"
+ ]
+ },
+ "mediaType": "",
+ "examples": [
+ {
+ "value": "{\n \"sourceLang\": \"en\",\n \"targetLang\": \"uk\",\n \"source\": \"Second segment \",\n \"documentName\": \"\",\n \"markupTable\": \"OTMXUXLF\",\n \"context\": \"\"\n}",
+ "mediaType": "application/json",
+ "description": ""
+ }
+ ],
+ "oasExtensions": ""
+ },
+ "description": "https://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-Fuzzysearch",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 66,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.28804557"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "Get entry",
+ "api": {
+ "id": "19983328",
+ "method": "post",
+ "path": "/t5memory/{{memory}}/getentry",
+ "parameters": {
+ "query": [],
+ "path": [],
+ "cookie": [],
+ "header": []
+ },
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "28804558",
+ "code": 200,
+ "name": "OK",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "segmentId": {
+ "type": "integer"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "timestamp": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "additionalInfo": {
+ "type": "string"
+ },
+ "internalKey": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "source",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey"
+ ],
+ "x-apidog-orders": [
+ "source",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey"
+ ]
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ },
+ {
+ "id": "28839642",
+ "code": 400,
+ "name": "Bad Request",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "ReturnValue": {
+ "type": "integer"
+ },
+ "ErrorMsg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "ReturnValue",
+ "ErrorMsg"
+ ],
+ "x-apidog-orders": [
+ "ReturnValue",
+ "ErrorMsg"
+ ]
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [
+ {
+ "name": "Success",
+ "data": "{\n \"source\": \"Third segment\",\n \"target\": \"третій сегмент\",\n \"segmentId\": 4,\n \"customId\": \"\",\n \"documentName\": \"none\",\n \"sourceLang\": \"en\",\n \"targetLang\": \"UK\",\n \"type\": \"Manual\",\n \"author\": \"MANAGER\",\n \"timestamp\": \"20250716T084347Z\",\n \"markupTable\": \"OTMXUXLF\",\n \"context\": \"\",\n \"additionalInfo\": \"\",\n \"internalKey\": \"9:1\"\n}",
+ "responseId": 28804558,
+ "ordering": 1,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ },
+ {
+ "name": "Success",
+ "data": "{\n \"ReturnValue\": 939,\n \"ErrorMsg\": \"Requested entry not found! Next internalKey after requested is : 10:1\"\n}",
+ "responseId": 28839642,
+ "ordering": 2,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ }
+ ],
+ "requestBody": {
+ "type": "application/json",
+ "parameters": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "recordKey": {
+ "type": "string"
+ },
+ "targetKey": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "recordKey",
+ "targetKey"
+ ],
+ "x-apidog-orders": [
+ "recordKey",
+ "targetKey"
+ ]
+ },
+ "mediaType": "",
+ "examples": [
+ {
+ "value": "{\n \"recordKey\": \"8\",\n \"targetKey\": \"2\"\n}",
+ "mediaType": "application/json",
+ "description": ""
+ }
+ ],
+ "oasExtensions": ""
+ },
+ "description": "Each segmnet entry in seach payloads has \"internalKey\": \"9:1\" like key-value.\nIn this example 9 is \"recordKey\" and 1 is \"targetKey\".",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 72,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.28804558",
+ "BLANK.28839642"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "Update",
+ "api": {
+ "id": "19983329",
+ "method": "post",
+ "path": "/t5memory/{{memory}}/entry",
+ "parameters": {
+ "query": [],
+ "path": [],
+ "cookie": [],
+ "header": [
+ {
+ "id": "1Lk9zS6LLP",
+ "name": "Accept",
+ "required": true,
+ "description": "",
+ "example": "application/json; charset=utf-8",
+ "type": "string",
+ "enable": true
+ },
+ {
+ "id": "XvSWvz3Bwl",
+ "name": "Accept-Charset",
+ "required": true,
+ "description": "",
+ "example": "UTF-8",
+ "type": "string",
+ "enable": true
+ }
+ ]
+ },
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "28804559",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string"
+ },
+ "sourceNPRepl": {
+ "type": "string"
+ },
+ "sourceNorm": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "segmentId": {
+ "type": "integer"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "timestamp": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "additionalInfo": {
+ "type": "string"
+ },
+ "internalKey": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "source",
+ "sourceNPRepl",
+ "sourceNorm",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey"
+ ],
+ "x-apidog-orders": [
+ "source",
+ "sourceNPRepl",
+ "sourceNorm",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey"
+ ]
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [
+ {
+ "name": "Success",
+ "data": "{\n \"source\": \"Second segment\",\n \"sourceNPRepl\": \"Second segment\",\n \"sourceNorm\": \"Second segment\",\n \"target\": \"Другий сегмент\",\n \"segmentId\": 14,\n \"customId\": \"\",\n \"documentName\": \"translation.txt\",\n \"sourceLang\": \"EN\",\n \"targetLang\": \"UK\",\n \"type\": \"Manual\",\n \"author\": \"PROJECT MANAGER\",\n \"timestamp\": \"20240111T111443Z\",\n \"markupTable\": \"OTMXUXLF\",\n \"context\": \"\",\n \"additionalInfo\": \"\",\n \"internalKey\": \"14:1\"\n}",
+ "responseId": 28804559,
+ "ordering": 1,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ }
+ ],
+ "requestBody": {
+ "type": "application/json",
+ "parameters": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string",
+ "description": "Segment source string"
+ },
+ "target": {
+ "type": "string",
+ "description": "Segment target string"
+ },
+ "markupTable": {
+ "type": "string",
+ "const": "OTMXUXLF",
+ "examples": [
+ "OTMXUXLF"
+ ],
+ "description": "Should be \"OTMXUXLF\""
+ },
+ "sourceLang": {
+ "type": "string",
+ "description": "rfc5646"
+ },
+ "targetLang": {
+ "type": "string",
+ "description": "rfc5646"
+ },
+ "timeStamp": {
+ "type": "string",
+ "pattern": "^\\d{8}T\\d{6}Z$",
+ "format": "yyyyMMdd'T'HHmmss'Z'",
+ "examples": [
+ "20240111T111443Z"
+ ],
+ "description": "Time of segment creation"
+ },
+ "documentName": {
+ "type": "string",
+ "description": "Name of document where segmnet comes from"
+ },
+ "author": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string",
+ "description": "Field that will be considered in fuzzy searches. Plays a role of aditional search option"
+ },
+ "save2disk": {
+ "type": "integer",
+ "description": "If true - segment will be written to disk right away, else - only set in RAM and saved when all memory is flushed",
+ "enum": [
+ 1,
+ 0
+ ],
+ "x-apidog-enum": [
+ {
+ "value": 1,
+ "name": "yes",
+ "description": ""
+ },
+ {
+ "value": 0,
+ "name": "no",
+ "description": ""
+ }
+ ],
+ "default": 0,
+ "examples": [
+ 1
+ ]
+ },
+ "saveDifferentTargetsForSameSource": {
+ "type": "integer",
+ "enum": [
+ 1,
+ 0
+ ],
+ "x-apidog-enum": [
+ {
+ "value": 1,
+ "name": "yes",
+ "description": ""
+ },
+ {
+ "value": 0,
+ "name": "no",
+ "description": ""
+ }
+ ],
+ "description": "If param set to 1 - new entry will be saved and old preserved even if all fileds of segmnet except target are same."
+ },
+ "type": {
+ "type": "string",
+ "examples": [
+ "Manual"
+ ],
+ "const": "Manual",
+ "description": "Should be set to \"Manual\""
+ }
+ },
+ "required": [
+ "source",
+ "target",
+ "sourceLang",
+ "targetLang",
+ "timeStamp",
+ "documentName",
+ "author",
+ "context",
+ "save2disk"
+ ],
+ "x-apidog-orders": [
+ "source",
+ "target",
+ "type",
+ "markupTable",
+ "sourceLang",
+ "targetLang",
+ "timeStamp",
+ "documentName",
+ "author",
+ "context",
+ "save2disk",
+ "saveDifferentTargetsForSameSource"
+ ]
+ },
+ "mediaType": "",
+ "examples": [
+ {
+ "value": "{\n \"source\": \" ... \",\n \"target\": \" ... \",\n \"type\": \"Manual\",\n \"markupTable\": \"OTMXUXLF\",\n \"sourceLang\": \"de-DE\",\n \"targetLang\": \"en-GB\",\n \"timeStamp\": \"20240111T111443Z\",\n \"documentName\": \"translation.txt\",\n \"author\": \"Project Manager\",\n \"context\": \"\",\n \"save2disk\": 1\n}",
+ "mediaType": "application/json",
+ "description": ""
+ }
+ ],
+ "oasExtensions": ""
+ },
+ "description": "https://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-Updateentry",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 78,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.28804559"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "Delete TM",
+ "api": {
+ "id": "19983330",
+ "method": "delete",
+ "path": "/t5memory/{{memory}}",
+ "parameters": {
+ "query": [],
+ "path": [],
+ "cookie": [],
+ "header": []
+ },
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "28804560",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {},
+ "x-apidog-orders": []
+ },
+ "description": "Response will contain json with memory name as key and \"deleted\" as value.\nMay return 500 with \"not found(error 48)\" as value that is simply indicates absense of TM",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ },
+ {
+ "id": "28898466",
+ "code": 500,
+ "name": "Not found",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {}
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [
+ {
+ "name": "Success",
+ "data": "{\n \"test-tm\": \"deleted\"\n}",
+ "responseId": 28804560,
+ "ordering": 1,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ },
+ {
+ "name": "Not found",
+ "data": "{\n \"test-tm\": \"not found(error 48)\"\n}",
+ "responseId": 28898466,
+ "ordering": 2,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ }
+ ],
+ "requestBody": {
+ "type": "text/plain",
+ "parameters": [],
+ "mediaType": "",
+ "examples": [],
+ "oasExtensions": ""
+ },
+ "description": "",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 84,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.28804560",
+ "BLANK.28898466"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "Delete entry",
+ "api": {
+ "id": "19983331",
+ "method": "post",
+ "path": "/t5memory/{{memory}}/entrydelete",
+ "parameters": {
+ "query": [],
+ "path": [],
+ "cookie": [],
+ "header": []
+ },
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "28804561",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "fileFlushed": {
+ "type": "integer",
+ "description": "Indicates was TM flushed to disk or not. Depends on \"save2disk\" value."
+ },
+ "results": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "segmentId": {
+ "type": "integer"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "timestamp": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "additionalInfo": {
+ "type": "string"
+ },
+ "internalKey": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "source",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey"
+ ],
+ "x-apidog-orders": [
+ "source",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey"
+ ]
+ }
+ },
+ "required": [
+ "fileFlushed",
+ "results"
+ ],
+ "x-apidog-orders": [
+ "fileFlushed",
+ "results"
+ ]
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ },
+ {
+ "id": "28988335",
+ "code": 400,
+ "name": "Bad Request",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "ReturnValue": {
+ "type": "integer"
+ },
+ "ErrorMsg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "ReturnValue",
+ "ErrorMsg"
+ ],
+ "x-apidog-orders": [
+ "ReturnValue",
+ "ErrorMsg"
+ ]
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ },
+ {
+ "id": "28988337",
+ "code": 500,
+ "name": "Server Error",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "ReturnValue": {
+ "type": "integer"
+ },
+ "ErrorMsg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "ReturnValue",
+ "ErrorMsg"
+ ],
+ "x-apidog-orders": [
+ "ReturnValue",
+ "ErrorMsg"
+ ]
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [
+ {
+ "name": "Example 1",
+ "data": "{\n \"fileFlushed\": 1,\n \"results\": {\n \"source\": \"Second segment\",\n \"target\": \"Другий сегмент\",\n \"segmentId\": 14,\n \"customId\": \"\",\n \"documentName\": \"translation.txt\",\n \"sourceLang\": \"en\",\n \"targetLang\": \"UK\",\n \"type\": \"Manual\",\n \"author\": \"PROJECT MANAGER\",\n \"timestamp\": \"20250811T101311Z\",\n \"markupTable\": \"OTMXUXLF\",\n \"context\": \"\",\n \"additionalInfo\": \"\",\n \"internalKey\": \"14:1\"\n }\n}",
+ "responseId": 28804561,
+ "ordering": 1,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ },
+ {
+ "name": "Example 1",
+ "data": "{\n \"ReturnValue\": 14002,\n \"ErrorMsg\": \"Error: to delete entry by key you should provide all three fields: recordKey, targetKey and segmentId\"\n}",
+ "responseId": 28988335,
+ "ordering": 1,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ },
+ {
+ "name": "Wrong segmnetId",
+ "data": "{\n \"ReturnValue\": 5005,\n \"ErrorMsg\": \"\"\n}",
+ "responseId": 28988337,
+ "ordering": 3,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ }
+ ],
+ "requestBody": {
+ "type": "application/json",
+ "parameters": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "recordKey": {
+ "type": "integer"
+ },
+ "targetKey": {
+ "type": "integer"
+ },
+ "segmentId": {
+ "type": "integer"
+ },
+ "save2disk": {
+ "type": "string",
+ "enum": [
+ "1",
+ "0"
+ ],
+ "x-apidog-enum": [
+ {
+ "value": "1",
+ "name": "yes",
+ "description": ""
+ },
+ {
+ "value": "0",
+ "name": "no",
+ "description": ""
+ }
+ ],
+ "default": "0",
+ "examples": [
+ "1"
+ ],
+ "description": "Save memory to disk right away.\nSaves if not passed."
+ }
+ },
+ "required": [
+ "recordKey",
+ "targetKey",
+ "segmentId"
+ ],
+ "x-apidog-orders": [
+ "recordKey",
+ "targetKey",
+ "segmentId",
+ "save2disk"
+ ]
+ },
+ "mediaType": "",
+ "examples": [
+ {
+ "value": "{\n \"recordKey\": 8,\n \"targetKey\": 4,\n \"segmentId\": 12\n}",
+ "mediaType": "application/json",
+ "description": ""
+ }
+ ],
+ "oasExtensions": ""
+ },
+ "description": "Each segmnet entry in seach payloads has \"internalKey\": \"9:1\" like key-value.\nIn this example 9 is \"recordKey\" and 1 is \"targetKey\".\nThere is also \"segmentId\" value.\nFor delete entry request it should be provided to validate that current state of t5memory data is same as at the moment when you got internalKey as internal key value may be regenerated at any moment of data processing on import or update rrquest handling.\nSo if you try to delete entry and getting error - try to fetch entry internalKey nad segmentId again and then retry delete action.",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 90,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.28804561",
+ "BLANK.28988335",
+ "BLANK.28988337"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "Delete batch",
+ "api": {
+ "id": "19983332",
+ "method": "post",
+ "path": "/t5memory/{{memory}}/entriesdelete",
+ "parameters": {
+ "query": [],
+ "path": [],
+ "cookie": [],
+ "header": []
+ },
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "28804562",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {},
+ "x-apidog-orders": []
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [],
+ "requestBody": {
+ "type": "application/json",
+ "parameters": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string"
+ },
+ "sourceSearchMode": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "targetSearchMode": {
+ "type": "string"
+ },
+ "document": {
+ "type": "string"
+ },
+ "documentSearchMode": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "authorSearchMode": {
+ "type": "string"
+ },
+ "addInfo": {
+ "type": "string"
+ },
+ "addInfoSearchMode": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "contextSearchMode": {
+ "type": "string"
+ },
+ "timestampSpanStart": {
+ "type": "string"
+ },
+ "timestampSpanEnd": {
+ "type": "string"
+ },
+ "searchPosition": {
+ "type": "string"
+ }
+ },
+ "x-apidog-orders": [
+ "source",
+ "sourceSearchMode",
+ "target",
+ "targetSearchMode",
+ "document",
+ "documentSearchMode",
+ "author",
+ "authorSearchMode",
+ "addInfo",
+ "addInfoSearchMode",
+ "context",
+ "contextSearchMode",
+ "timestampSpanStart",
+ "timestampSpanEnd",
+ "searchPosition"
+ ],
+ "required": [
+ "timestampSpanStart",
+ "timestampSpanEnd"
+ ]
+ },
+ "mediaType": "",
+ "examples": [
+ {
+ "value": "{\n \"source\": \"123\",\n \"sourceSearchMode\": \"contains, CASEINSENSETIVE\",\n \"target\": \"234\",\n \"targetSearchMode\": \"contains, CASEINSENSETIVE\",\n \"document\": \"\",\n \"documentSearchMode\": \"contains, CASEINSENSETIVE\",\n \"author\": \"\",\n \"authorSearchMode\": \"contains, CASEINSENSETIVE\",\n \"addInfo\": \"\",\n \"addInfoSearchMode\": \"contains, CASEINSENSETIVE\",\n \"context\": \"\",\n \"contextSearchMode\": \"contains, CASEINSENSETIVE\",\n \"timestampSpanStart\": \"19691231T230000Z\",\n \"timestampSpanEnd\": \"20240610T220000Z\",\n \"searchPosition\": \"\"\n}",
+ "mediaType": "application/json",
+ "description": ""
+ }
+ ],
+ "oasExtensions": ""
+ },
+ "description": "Asynchronious operation.\nThis would start reorganize process which would remove like reorganize bad segments and also would remove segments that gives true when checking with provided filters combined with logical AND. So if you provide timestamps and addInfo, only segments within provided timestamp and with that addInfo would not be imported to new TM(check reorganize process). \nEvery parameter is optional, so empty json would just start reorganize async process.\nIf you provide one of timestamps you would get error - please provide both. \nTo add parameter you should set it's SearchMode to be EXACT|CONCORDANCE(non case sensetive)\nIf only searched string provided, but not search mode - you would get error.",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 96,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.28804562"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "Shutdown",
+ "api": {
+ "id": "19983333",
+ "method": "post",
+ "path": "/t5memory_service/shutdown",
+ "parameters": {
+ "query": [
+ {
+ "required": false,
+ "description": "Skips saving tms, for now value doesn't matter, only presence.\nIf try to save tms before closing, would check if there is still import process going on\nIf there is some, would wait 1 second and check again. \nRepeats last step up to 10 min, then closes service anyway. ",
+ "type": "integer",
+ "id": "6G5xEpWiRA",
+ "enable": true,
+ "name": "dontsave",
+ "schema": {
+ "type": "integer"
+ }
+ }
+ ],
+ "path": [],
+ "cookie": [],
+ "header": [
+ {
+ "id": "xMxiCFLsH9",
+ "name": "Accept",
+ "required": true,
+ "description": "",
+ "example": "application/json; charset=utf-8",
+ "type": "string",
+ "enable": true
+ },
+ {
+ "id": "OEUJrQ83Sh",
+ "name": "Accept-Charset",
+ "required": true,
+ "description": "",
+ "example": "UTF-8",
+ "type": "string",
+ "enable": true
+ }
+ ]
+ },
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "28804563",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {},
+ "x-apidog-orders": []
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [],
+ "requestBody": {
+ "type": "none",
+ "parameters": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {},
+ "x-apidog-orders": []
+ },
+ "mediaType": "",
+ "examples": [
+ {
+ "value": "{\n \"Method\": \"update\",\n \"source\": \"The end\",\n \"target\": \"The target\",\n \"documentName\": \"Translate5 Demo Text-en-de.xlf\",\n \"author\": \"Thomas Lauria\",\n \"timeStamp\": \"20210621T071042Z\",\n \"context\": \"2_2\",\n \"type\": \"Manual\",\n \"markupTable\": \"OTMXUXLF\",\n \"sourceLang\": \"en\",\n \"targetLang\": \"de\"\n}",
+ "mediaType": "application/json",
+ "description": ""
+ }
+ ],
+ "oasExtensions": ""
+ },
+ "description": "Safely shutting down the service with\\without saving all loaded tm files to the disk.",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 102,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.28804563"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "Save TMs",
+ "api": {
+ "id": "19983334",
+ "method": "get",
+ "path": "/t5memory_service/savetms",
+ "parameters": {
+ "query": [],
+ "path": [],
+ "cookie": [],
+ "header": [
+ {
+ "id": "qDDSGk9gOz",
+ "name": "Accept",
+ "required": true,
+ "description": "",
+ "example": "application/json; charset=utf-8",
+ "type": "string",
+ "enable": true
+ },
+ {
+ "id": "7WSgqqWX2C",
+ "name": "Accept-Charset",
+ "required": true,
+ "description": "",
+ "example": "UTF-8",
+ "type": "string",
+ "enable": true
+ }
+ ]
+ },
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "28804564",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {},
+ "x-apidog-orders": []
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [
+ {
+ "name": "Success",
+ "data": "{\n \"saved 3 tms\": \"ID9580-de-fr_next-2, ID9612-en-uk, test-memory\",\n \"errMsg\": \"\"\n}",
+ "responseId": 28804564,
+ "ordering": 1,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ }
+ ],
+ "requestBody": {
+ "type": "none",
+ "parameters": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {},
+ "x-apidog-orders": []
+ },
+ "mediaType": "",
+ "examples": [
+ {
+ "value": "{\n \"Method\": \"update\",\n \"source\": \"The end\",\n \"target\": \"The target\",\n \"documentName\": \"Translate5 Demo Text-en-de.xlf\",\n \"author\": \"Thomas Lauria\",\n \"timeStamp\": \"20210621T071042Z\",\n \"context\": \"2_2\",\n \"type\": \"Manual\",\n \"markupTable\": \"OTMXUXLF\",\n \"sourceLang\": \"en\",\n \"targetLang\": \"de\"\n}",
+ "mediaType": "application/json",
+ "description": ""
+ }
+ ],
+ "oasExtensions": ""
+ },
+ "description": "Flushes all filebuffers(TMD, TMI files) into the filesystem. Reset 'Modified' flags for file buffers. \n\nFilebuffer is a file instance of .TMD or .TMI loaded into RAM. It provides better speed and safety when working with files.",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 108,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.28804564"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "Clone",
+ "api": {
+ "id": "19983335",
+ "method": "post",
+ "path": "/t5memory/{{memory}}/clone",
+ "parameters": {
+ "query": [],
+ "path": [],
+ "cookie": [],
+ "header": [
+ {
+ "id": "38R4HXnKSc",
+ "name": "Accept",
+ "required": true,
+ "description": "",
+ "example": "application/json; charset=utf-8",
+ "type": "string",
+ "enable": true
+ },
+ {
+ "id": "LXuAOp7SzH",
+ "name": "Accept-Charset",
+ "required": true,
+ "description": "",
+ "example": "UTF-8",
+ "type": "string",
+ "enable": true
+ }
+ ]
+ },
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "28804565",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "msg": {
+ "type": "string"
+ },
+ "time": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "msg",
+ "time"
+ ],
+ "x-apidog-orders": [
+ "msg",
+ "time"
+ ]
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [
+ {
+ "name": "Success",
+ "data": "{\n\t\"msg\": \"clonned-tm-1 was cloned successfully\",\n\t\"time\": \"1 ms\"\n}",
+ "responseId": 28804565,
+ "ordering": 1,
+ "description": "",
+ "oasKey": "",
+ "oasExtensions": ""
+ }
+ ],
+ "requestBody": {
+ "type": "application/json",
+ "parameters": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "newName": {
+ "type": "string",
+ "description": "Name of memory to be crreated"
+ }
+ },
+ "x-apidog-orders": [
+ "newName"
+ ],
+ "required": [
+ "newName"
+ ]
+ },
+ "mediaType": "",
+ "examples": [
+ {
+ "name": "Example 2",
+ "value": "{\n \"newName\": \"clonned-tm-1\"\n}",
+ "mediaType": "application/json"
+ }
+ ],
+ "oasExtensions": ""
+ },
+ "description": "Creates TM with the provided name and data cloned from provided memory",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 114,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.28804565"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ },
+ {
+ "name": "Reorganize",
+ "api": {
+ "id": "19983336",
+ "method": "get",
+ "path": "/t5memory/{{memory}}/reorganize",
+ "parameters": {
+ "query": [],
+ "path": [],
+ "cookie": [],
+ "header": [
+ {
+ "id": "AVqjeFavWC",
+ "name": "Accept",
+ "required": true,
+ "description": "",
+ "example": "application/json; charset=utf-8",
+ "type": "string",
+ "enable": true
+ },
+ {
+ "id": "pEssFEtOV3",
+ "name": "Accept-Charset",
+ "required": true,
+ "description": "",
+ "example": "UTF-8",
+ "type": "string",
+ "enable": true
+ }
+ ]
+ },
+ "auth": {},
+ "securityScheme": {},
+ "commonParameters": {
+ "query": [],
+ "body": [],
+ "cookie": [],
+ "header": []
+ },
+ "responses": [
+ {
+ "id": "28804566",
+ "code": 200,
+ "name": "Success",
+ "headers": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {},
+ "x-apidog-orders": []
+ },
+ "description": "",
+ "contentType": "json",
+ "mediaType": "",
+ "oasExtensions": ""
+ }
+ ],
+ "responseExamples": [],
+ "requestBody": {
+ "type": "application/json",
+ "parameters": [],
+ "jsonSchema": {
+ "type": "object",
+ "properties": {
+ "newEntryIfOnlyContextAndTimestampDifferent": {
+ "type": "string",
+ "enum": [
+ "1",
+ "0"
+ ],
+ "x-apidog-enum": [
+ {
+ "value": "1",
+ "name": "yes",
+ "description": ""
+ },
+ {
+ "value": "0",
+ "name": "no",
+ "description": ""
+ }
+ ],
+ "examples": [
+ "1",
+ "0"
+ ]
+ },
+ "saveDifferentTargetsForSameSource": {
+ "type": "string",
+ "enum": [
+ "1",
+ "0"
+ ],
+ "x-apidog-enum": [
+ {
+ "value": "1",
+ "name": "yes",
+ "description": ""
+ },
+ {
+ "value": "0",
+ "name": "",
+ "description": ""
+ }
+ ],
+ "examples": [
+ "1",
+ "0"
+ ]
+ }
+ },
+ "x-apidog-orders": [
+ "newEntryIfOnlyContextAndTimestampDifferent",
+ "saveDifferentTargetsForSameSource"
+ ]
+ },
+ "mediaType": "",
+ "examples": [],
+ "oasExtensions": ""
+ },
+ "description": "Under the hood it creates new tm with $Org- prefix, then reimport all segments one-by-one, and then deletes original TM and rename reorganized TM to replace original. \nThis request should flush tm(from RAM to the disk) before reorganizing\n\nhttps://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-ReorganizeTM\nBoth newEntryIfOnlyContextAndTimestampDifferent and saveDifferentTargetsForSameSource impact how similar translation would be saved. In case if source and other field(doc, author, lang) are the same, but target different, and newEntryIfOnlyContextAndTimestampDifferent is set to true, you would have 2 translation, otherwise you would have 1 translation saved - with higher updateTime. but if you have different attributes, like document, you would have 2 translation anyway. \nnewEntryIfOnlyContextAndTimestampDifferent would also increase number of saved segments. If values was not provided, defaule values from flags would be used.",
+ "tags": [],
+ "status": "released",
+ "serverId": "",
+ "operationId": "",
+ "sourceUrl": "",
+ "ordering": 120,
+ "cases": [],
+ "mocks": [],
+ "customApiFields": "{}",
+ "advancedSettings": {
+ "disabledSystemHeaders": {}
+ },
+ "mockScript": {},
+ "codeSamples": [],
+ "commonResponseStatus": {},
+ "responseChildren": [
+ "BLANK.28804566"
+ ],
+ "visibility": "INHERITED",
+ "moduleId": 845181,
+ "oasExtensions": "",
+ "type": "http",
+ "preProcessors": [],
+ "postProcessors": [],
+ "inheritPostProcessors": {},
+ "inheritPreProcessors": {}
+ }
+ }
+ ]
+ }
+ ],
+ "socketCollection": [],
+ "docCollection": [],
+ "webSocketCollection": [],
+ "socketIOCollection": [],
+ "responseCollection": [
+ {
+ "_databaseId": 1073315,
+ "updatedAt": "2025-08-07T08:42:35.000Z",
+ "name": "Root",
+ "type": "root",
+ "children": [],
+ "moduleId": 845181,
+ "parentId": 0,
+ "id": 1073315,
+ "ordering": [],
+ "items": []
+ }
+ ],
+ "schemaCollection": [
+ {
+ "id": 2408559,
+ "name": "Root",
+ "visibility": "SHARED",
+ "moduleId": 845181,
+ "items": [],
+ "ordering": []
+ }
+ ],
+ "securitySchemeCollection": [
+ {
+ "id": 680526,
+ "moduleId": 845181,
+ "name": "Root",
+ "items": [],
+ "ordering": []
+ }
+ ],
+ "requestCollection": [
+ {
+ "name": "Root",
+ "children": [],
+ "ordering": [
+ "requestFolder.7454461"
+ ],
+ "items": []
+ }
+ ],
+ "apiTestCaseCollection": [
+ {
+ "name": "Root",
+ "children": [],
+ "items": []
+ }
+ ],
+ "testCaseReferences": [],
+ "environments": [],
+ "commonScripts": [],
+ "databaseConnections": [],
+ "globalVariables": [
+ {
+ "id": "1029997",
+ "variables": []
+ }
+ ],
+ "commonParameters": null,
+ "projectSetting": {
+ "id": "1030033",
+ "auth": {},
+ "securityScheme": {},
+ "gateway": [],
+ "language": "en-US",
+ "apiStatuses": [
+ "developing",
+ "testing",
+ "released",
+ "deprecated"
+ ],
+ "mockSettings": {},
+ "preProcessors": [],
+ "postProcessors": [],
+ "advancedSettings": {
+ "enableJsonc": false,
+ "enableBigint": false,
+ "responseValidate": true,
+ "enableTestScenarioSetting": false,
+ "enableYAPICompatScript": false,
+ "isDefaultUrlEncoding": 3,
+ "publishedDocUrlRules": {
+ "defaultRule": "SLUGIFY_WITH_RESOURCE_KEY",
+ "resourceKeyStandard": "NEW"
+ }
+ },
+ "initialDisabledMockIds": [],
+ "servers": [
+ {
+ "id": "default",
+ "name": "Default Server"
+ }
+ ],
+ "cloudMock": {
+ "security": "free",
+ "enable": false,
+ "tokenKey": "apidogToken"
+ }
+ },
+ "customFunctions": [],
+ "projectTestCaseCategories": [],
+ "projectAssociations": []
+}
\ No newline at end of file
diff --git a/docs/t5memory.openapi.json b/docs/t5memory.openapi.json
new file mode 100644
index 00000000..5df2b67d
--- /dev/null
+++ b/docs/t5memory.openapi.json
@@ -0,0 +1,3526 @@
+{
+ "openapi": "3.0.1",
+ "info": {
+ "title": "t5memory",
+ "description": "",
+ "version": "0.7.36"
+ },
+ "tags": [],
+ "paths": {
+ "/t5memory/{memory}/flush": {
+ "get": {
+ "summary": "Flush memory",
+ "deprecated": false,
+ "description": "Endpoint is sync(blocking)\n\nIf tm is not found on the disk - returns 404\nIf tm is not open - returns 400 with message\nThen t5memory requests writes pointer to the tm (so it waits till other requests that's working with the tm would finish) and then it flushes it to the disk\nCould also return an error if flushing got some issue.\nWould not open the tm, if it's not opened yet, but instead would return an error.",
+ "tags": [],
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "msg"
+ ]
+ },
+ "example": {
+ "msg": "Mem ID9612-en-uk was flushed to the disk successfully"
+ }
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ },
+ "/t5memory_service/tagreplacement": {
+ "post": {
+ "summary": "Tag replacement",
+ "deprecated": false,
+ "description": "Fuzzy search tag replacement and Import tag replacement test",
+ "tags": [],
+ "parameters": [
+ {
+ "name": "Accept",
+ "in": "header",
+ "description": "",
+ "required": true,
+ "example": "application/json; charset=utf-8",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Accept-Charset",
+ "in": "header",
+ "description": "",
+ "required": true,
+ "example": "UTF-8",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "src": {
+ "type": "string"
+ },
+ "trg": {
+ "type": "string"
+ },
+ "req": {
+ "type": "string",
+ "description": "Used to test Fuzzy search tag replacement"
+ }
+ },
+ "required": [
+ "src",
+ "trg"
+ ]
+ },
+ "example": {
+ "src": "Tap View o get strongdisplayedView two strongUS patents.",
+ "trg": "View tap to got strongdosplaydVeiw two strongUS patents.",
+ "req": "Tap View o get strongdisplayedView two strongUS patents."
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {}
+ }
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ },
+ "/t5memory_service/flags": {
+ "get": {
+ "summary": "Flags",
+ "deprecated": false,
+ "description": "Return all available commandline flags. Do not spam too much because gflags documentation says that that's slow. Useful to collect configuration data about t5memory to do debugging.",
+ "tags": [],
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {}
+ },
+ "example": "{\n {\n \"name\": \"alsologtoemail\",\n \"value\": \"\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"log messages go to these email addresses in addition to logfiles\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"alsologtostderr\",\n \"value\": \"true\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"log messages go to stderr in addition to logfiles\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"colorlogtostderr\",\n \"value\": \"true\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"color messages logged to stderr (if supported by terminal)\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"drop_log_memory\",\n \"value\": \"true\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Drop in-memory buffers of log contents. Logs can grow very quickly and they are rarely read before they need to be evicted from memory. Instead, drop them from memory as soon as they are flushed to disk.\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"log_backtrace_at\",\n \"value\": \"\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Emit a backtrace when logging at file:linenum.\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"log_dir\",\n \"value\": \"/root/.t5memory/LOG/\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"If specified, logfiles are written into this directory instead of the default logging directory.\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"log_link\",\n \"value\": \"\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Put additional links to the log files in this directory\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"log_prefix\",\n \"value\": \"true\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Prepend the log prefix to the start of each log line\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"logbuflevel\",\n \"value\": \"0\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Buffer log messages logged at this level or lower (-1 means don't buffer; 0 means buffer INFO only; ...)\",\n \"type\": \"int32\",\n \"default\": \"0\"\n },\n {\n \"name\": \"logbufsecs\",\n \"value\": \"30\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Buffer log messages for at most this many seconds\",\n \"type\": \"int32\",\n \"default\": \"30\"\n },\n {\n \"name\": \"logemaillevel\",\n \"value\": \"999\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Email log messages logged at this level or higher (0 means email all; 3 means email FATAL only; ...)\",\n \"type\": \"int32\",\n \"default\": \"999\"\n },\n {\n \"name\": \"logfile_mode\",\n \"value\": \"436\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Log file mode/permissions.\",\n \"type\": \"int32\",\n \"default\": \"436\"\n },\n {\n \"name\": \"logmailer\",\n \"value\": \"/bin/mail\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Mailer used to send logging email\",\n \"type\": \"string\",\n \"default\": \"/bin/mail\"\n },\n {\n \"name\": \"logtostderr\",\n \"value\": \"false\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"log messages go to stderr instead of logfiles\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"max_log_size\",\n \"value\": \"1800\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"approx. maximum log file size (in MB). A value of 0 will be silently overridden to 1.\",\n \"type\": \"int32\",\n \"default\": \"1800\"\n },\n {\n \"name\": \"minloglevel\",\n \"value\": \"0\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Messages logged at a lower level than this don't actually get logged anywhere\",\n \"type\": \"int32\",\n \"default\": \"0\"\n },\n {\n \"name\": \"stderrthreshold\",\n \"value\": \"2\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"log messages at or above this level are copied to stderr in addition to logfiles. This flag obsoletes --alsologtostderr.\",\n \"type\": \"int32\",\n \"default\": \"2\"\n },\n {\n \"name\": \"stop_logging_if_full_disk\",\n \"value\": \"false\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Stop attempting to log to disk if the disk is full.\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"symbolize_stacktrace\",\n \"value\": \"true\"\t\",\tfrom\": \"./src/utilities.cc\",\n \"description\": \"Symbolize the stack trace in the tombstone\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"v\",\n \"value\": \"2\"\t\",\tfrom\": \"./src/vlog_is_on.cc\",\n \"description\": \"Show all VLOG(m) messages for m <= this. Overridable by --vmodule.\",\n \"type\": \"int32\",\n \"default\": \"0\"\n },\n {\n \"name\": \"vmodule\",\n \"value\": \"\"\t\",\tfrom\": \"./src/vlog_is_on.cc\",\n \"description\": \"per-module verbose level. Argument is a comma-separated list of =. is a glob pattern, matched against the filename base (that is, name ignoring .cc/.h./-inl.h). overrides any value given by --v.\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"flagfile\",\n \"value\": \"\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags.cc\",\n \"description\": \"load flags from file\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"fromenv\",\n \"value\": \"\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags.cc\",\n \"description\": \"set flags from the environment [use 'export FLAGS_flag1=value']\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"tryfromenv\",\n \"value\": \"\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags.cc\",\n \"description\": \"set flags from the environment if present\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"undefok\",\n \"value\": \"\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags.cc\",\n \"description\": \"comma-separated list of flag names that it is okay to specify on the command line even if the program does not define a flag with that name. IMPORTANT: flags in this list that have arguments MUST use the flag=value format\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"tab_completion_columns\",\n \"value\": \"80\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_completions.cc\",\n \"description\": \"Number of columns to use in output for tab completion\",\n \"type\": \"int32\",\n \"default\": \"80\"\n },\n {\n \"name\": \"tab_completion_word\",\n \"value\": \"\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_completions.cc\",\n \"description\": \"If non-empty, HandleCommandLineCompletions() will hijack the process and attempt to do bash-style command line flag completion on this value.\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"help\",\n \"value\": \"false\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"show help on all flags [tip: all flags can have two dashes]\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"helpfull\",\n \"value\": \"false\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"show help on all flags -- same as -help\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"helpmatch\",\n \"value\": \"\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"show help on modules whose name contains the specified substr\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"helpon\",\n \"value\": \"\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"show help on the modules named by this flag value\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"helppackage\",\n \"value\": \"false\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"show help on all modules in the main package\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"helpshort\",\n \"value\": \"false\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"show help on only the main module for this program\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"helpxml\",\n \"value\": \"false\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"produce an xml version of help\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"version\",\n \"value\": \"false\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"show version and build info and exit\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"folly_memory_idler_madvise_stacks\",\n \"value\": \"true\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/folly/folly/detail/MemoryIdler.cpp\",\n \"description\": \"if enabled, folly memory-idler madvises dontneed stacks on thread idle\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"folly_memory_idler_purge_arenas\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/folly/folly/detail/MemoryIdler.cpp\",\n \"description\": \"if enabled, folly memory-idler purges jemalloc arenas on thread idle\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"dynamic_iothreadpoolexecutor\",\n \"value\": \"true\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/folly/folly/executors/IOThreadPoolExecutor.cpp\",\n \"description\": \"IOThreadPoolExecutor will dynamically create threads\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"folly_iothreadpoolexecutor_max_read_at_once\",\n \"value\": \"-1\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/folly/folly/executors/IOThreadPoolExecutor.cpp\",\n \"description\": \"IOThreadPoolExecutor will use this value as default for maxReadAtOnce in its event bases, valid values are [0, inf)\",\n \"type\": \"int32\",\n \"default\": \"-1\"\n },\n {\n \"name\": \"threadtimeout_ms\",\n \"value\": \"60000\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/folly/folly/executors/ThreadPoolExecutor.cpp\",\n \"description\": \"Idle time before ThreadPoolExecutor threads are joined\",\n \"type\": \"int64\",\n \"default\": \"60000\"\n },\n {\n \"name\": \"observer_manager_pool_size\",\n \"value\": \"4\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/folly/folly/observer/detail/ObserverManager.cpp\",\n \"description\": \"How many internal threads ObserverManager should use\",\n \"type\": \"int32\",\n \"default\": \"4\"\n },\n {\n \"name\": \"folly_hazptr_use_executor\",\n \"value\": \"true\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/folly/folly/synchronization/Hazptr.cpp\",\n \"description\": \"Use an executor for hazptr asynchronous reclamation\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"dcache_unit_test\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/wangle/wangle/ssl/SSLSessionCacheManager.cpp\",\n \"description\": \"All VIPs share one session cache\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"zlib_compressor_buffer_growth\",\n \"value\": \"2024\"\t\",\tfrom\": \"/home/libs/proxygen/lib/utils/ZlibStreamCompressor.cpp\",\n \"description\": \"The buffer growth size to use during IOBuf zlib deflation\",\n \"type\": \"int64\",\n \"default\": \"2024\"\n },\n {\n \"name\": \"request_number\",\n \"value\": \"true\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/RestAPI/ProxygenHandler.cpp\",\n \"description\": \"Include request sequence number in response\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"add_tokens_to_fuzzy\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \" If set to true, list of tokens would be returned in fuzzy responce. Could make execution a bit slower, could be usefull if you think that fuzzy match is wrong to check how tokens was parsed in sentence and what hashes they had(or track hash collisions)\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"allowLoadingMultipleTmsSimultaneously\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, multiple tms could be loaded from the disk at the same time. Loading multiple TMs at the same time was disabled because of I/0 disk operation limit at the server. Enable this if you don't care about num of IO operations and want some perfomance boost\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"allowedram\",\n \"value\": \"10000\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets amought RAM(in MB) allowed for service to use\",\n \"type\": \"int64\",\n \"default\": \"5000\"\n },\n {\n \"name\": \"allowedtmdsize\",\n \"value\": \"190\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets max size of tmd file(in MB) after which t5m would not allow to add new data to the tm. This helps fight btree and lookup table issues when tm gets bigger.\",\n \"type\": \"int64\",\n \"default\": \"190\"\n },\n {\n \"name\": \"debug_sleep_in_request_run\",\n \"value\": \"0\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set, provide artificial delay in every request handling execution equal to provided num of microseconds\",\n \"type\": \"int64\",\n \"default\": \"0\"\n },\n {\n \"name\": \"disable_aslr\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, process personality would be set to ADDR_NO_RANDOMIZE, affect memory layout, set to true if you have some linker or asan issue at the launch\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"enable_newlines_in_logs\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"(not working - instead of using function to remove newlines in runtime, logs was edited to have better perfomance)if set to true, would keep newline symbols in the logs, otherwise(by default) newlines would be removed and logs would be oneliners. This just calls function to remove newlines,\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"flush_tm_at_shutdown\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, flushes tm when shutting down the app not using shutdown request\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"flush_tm_to_disk_with_every_update\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, flushes tm to disk with every successfull update request\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"forbiddeletefiles\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Set to true to keep all files(including temporary and tm)\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"keep_tm_backups\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"if set to true, when saving tmd and tmi files, old copies would be saved with .old suffix\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"limit_num_of_active_requests\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, it would be possible to handle only up to servicethreads-1 requests at the same time, the last thread would respond with 503 to eliminate creating queue of requests waiting to be handled.\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"logMutexes\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"if set to true you would see mutex logs\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"log_every_request_end\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets log for every request end with it's url, method etc...\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"log_every_request_start\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets log for every request call with it's url, method etc...\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"log_file_locks\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, action about locking tmd and tmi file would be logged\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"log_hashes_in_hash_sentence\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \" If set to true, and --v=2 and --t5loglevel=4, tokens and their hashed would be logged, could be usefull if you think that fuzzy match is wrong to check how tokens was parsed in sentence and what hashes they had(or track hash collisions)\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"log_memmove_in_compareputdata\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"if set to true, when saving segment and causing memmove in compareputdata functions, just before memmove, data would be logged - use this to debug btree crashes. In that spot in come corrupted data, memmove could crash t5memory(or cause asan crash). Just to set low log level(v=2,t5logleve=0), reproduce the crash and check if the last log was one that started with \"memmove size = ...\"\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"log_tm_lifetime\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \" If set to true, and --v=2 and --t5loglevel=4, TMs ctor(when tm object was created-so before it started loading tm) and dctor(when tm object was destroyed - so after closing tm) would have transaction level logs\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"maxBadSegmentsIdsSaved\",\n \"value\": \"20\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Defines how many segments(it's id's) that failed during import or reorganize would be saved to the status response\",\n \"type\": \"int32\",\n \"default\": \"20\"\n },\n {\n \"name\": \"newEntryIfOnlyContextAndTimestampDifferent\",\n \"value\": \"true\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If it is set to true, the behavior should be: A new entry should be saved to the TM, if only timestamp and context are different and all other params the same;\t If it is set to false, the beahvior should be: if context is different and timestamp is different, the context and timestamp of the new to be saved segment should overwrite the context and segment of an entry, that already exists and where all other params are the same as in the new segment. This is basically the same behavior it would have, if context would not be set for both segments (the old and the new).\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"port\",\n \"value\": \"4040\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"What port to listen on\",\n \"type\": \"int32\",\n \"default\": \"4080\"\n },\n {\n \"name\": \"saveDifferentTargetsForSameSource\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If it is set to true, when saving new segment, and found matching source and attributes, to replace previous need to have matching targets(old target = new target), if false -> previous target would be replaced with new one. In other words, true would make t5memory save multiple translation to exactly same source and attributes(document, authors etc), false would still save multiple pairs of attributes, but translation could be replaced with newer.\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"servicename\",\n \"value\": \"t5memory\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets service name to use in url\",\n \"type\": \"string\",\n \"default\": \"t5memory\"\n },\n {\n \"name\": \"servicethreads\",\n \"value\": \"10\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets amought of worker threads for service\",\n \"type\": \"int32\",\n \"default\": \"5\"\n },\n {\n \"name\": \"skipStartupLogs\",\n \"value\": \"true\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"if set to true, values from --t5loglevel would be applied immediately, if set to false- you would see all startup logs and --v and --t5loglevel would be applied only after start of the service and it's init message. Set to false if you have issues at startup\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"skip_default_flags_in_init_msg\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"if set to true, all default flags would be skipped in init msg\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"suppressTmVersionCheck\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If sets to true, allow to open tms, which was created in version, that's outside of supported versions scope. You can use this if you have version mismatch error\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"t5_ip\",\n \"value\": \"\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Which ip to use in t5memory(default is any). Should be in format '1.1.1.1', default is to listen to all available ip\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"t5globversion_max_supported\",\n \"value\": \"0\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"set max global version in which tm was created to be supported for open in current. it's the X(GLOB) in vX.Y.Z; by default it's current version\",\n \"type\": \"int32\",\n \"default\": \"0\"\n },\n {\n \"name\": \"t5globversion_min_supported\",\n \"value\": \"0\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"sets minimal global version in which tm was created to be supported for open in current. it's the X(GLOB) in vX.Y.Z\",\n \"type\": \"int32\",\n \"default\": \"0\"\n },\n {\n \"name\": \"t5loglevel\",\n \"value\": \"4\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets t5memory log level threshold from DEVELOP(0) to TRANSACTION(6)\",\n \"type\": \"int32\",\n \"default\": \"2\"\n },\n {\n \"name\": \"t5majversion_max_supported\",\n \"value\": \"7\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"set max major version in which tm was created to be supported for open in current. it's the Y(MAJ) in vX.Y.Z; by default it's current version\",\n \"type\": \"int32\",\n \"default\": \"7\"\n },\n {\n \"name\": \"t5majversion_min_supported\",\n \"value\": \"5\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"sets minimal major version in which tm was created to be supported for open in current. it's the Y(MAJ) in vX.Y.Z\",\n \"type\": \"int32\",\n \"default\": \"5\"\n },\n {\n \"name\": \"t5minversion_max_supported\",\n \"value\": \"14\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"(disabled)sets max minor version in which tm was created to be supported for open in current. it's the Z(MIN) in vX.Y.Z; by default it's current version\",\n \"type\": \"int32\",\n \"default\": \"14\"\n },\n {\n \"name\": \"t5minversion_min_supported\",\n \"value\": \"60\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"sets minimal minor version in which tm was created to be supported for open in current. it's the Z(MIN) in vX.Y.Z\",\n \"type\": \"int32\",\n \"default\": \"60\"\n },\n {\n \"name\": \"timeout\",\n \"value\": \"180000\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets timeout for service request handling\",\n \"type\": \"int32\",\n \"default\": \"180000\"\n },\n {\n \"name\": \"tmListLockDefaultTimeout\",\n \"value\": \"3000\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets tm mutex lock timeout(in ms) for TM list(which is used to open and close tms, and hold list of opened tms), after which operation would be canceled and mutex would return an error, if set to 0, mutex lock would be waited without timeout\",\n \"type\": \"int64\",\n \"default\": \"3000\"\n },\n {\n \"name\": \"tmLockDefaultTimeout\",\n \"value\": \"3000\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets tm mutex lock timeout(in ms) for TM after which operation would be canceled and mutex would return an error, if set to 0, mutex lock would be waited without timeout\",\n \"type\": \"int64\",\n \"default\": \"3000\"\n },\n {\n \"name\": \"tmMaxIdleTimeSec\",\n \"value\": \"7200\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set some value, except, 0, during request, tm list would bee cleaned up from tms that are longer inactive than this number\",\n \"type\": \"int64\",\n \"default\": \"7200\"\n },\n {\n \"name\": \"tmRequestLockDefaultTimeout\",\n \"value\": \"3000\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets tm mutex lock timeout(in ms) for part where request is requesting tm(which is used to open and close tms, and hold list of opened tms), after which operation would be canceled and mutex would return an error, if set to 0, mutex lock would be waited without timeout\",\n \"type\": \"int64\",\n \"default\": \"3000\"\n },\n {\n \"name\": \"triplesthreshold\",\n \"value\": \"5\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets threshold to pre fuzzy filtering based on hashes of neibour tokens, range[0...100]. It's pre fuzzy filtering of the segments, when t5memory tries to predict how high fuzzy rate would be for some segment based on data that doesn't require as mych work as fuzzy calculations. When value is low, it can select more suggestions for fuzzy calculation, but if it set high, some best matches could be skipped. In opentm2 default value was 33, but that value seems like not working well with segments, where there are a lot of tags.\",\n \"type\": \"int32\",\n \"default\": \"5\"\n },\n {\n \"name\": \"useTimedMutexesForReorganizeAndImport\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, in reorganize or import thread would be used mutexes with timeouts, and reorganizee or import could be canceled, false(by default) - would be used non timed mutexes\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"wait_for_import_and_reorganize_requests\",\n \"value\": \"true\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, waiting for all import and reorganize processes to be done at shutdown when not using shutdown request\",\n \"type\": \"bool\",\n \"default\": \"true\"\n }\n}"
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ },
+ "/t5memory/{memory}/multifuzzysearch": {
+ "post": {
+ "summary": "Multifuzzy",
+ "deprecated": false,
+ "description": "Sends multiple fuzzysearches in the same tm in a row",
+ "tags": [],
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "requests": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "sourceLang": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "source": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "customId": {
+ "type": "string",
+ "description": "If provided will be ased as key in response block"
+ }
+ },
+ "required": [
+ "sourceLang",
+ "targetLang",
+ "source",
+ "documentName",
+ "context"
+ ]
+ }
+ }
+ },
+ "required": [
+ "requests"
+ ]
+ },
+ "example": {
+ "requests": [
+ {
+ "sourceLang": "en",
+ "targetLang": "uk",
+ "source": "First segment with int",
+ "documentName": "",
+ "context": "",
+ "customId": "first"
+ },
+ {
+ "sourceLang": "en",
+ "targetLang": "uk",
+ "source": "Third segment with",
+ "documentName": "",
+ "context": "",
+ "customId": "second"
+ }
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Each response object in responses has a key and value of it contains response of simple fuzzy search.\nName of a key comes from \"customId\" in request.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "responses": {
+ "type": "object",
+ "properties": {
+ "first": {
+ "type": "object",
+ "properties": {
+ "ReturnValue": {
+ "type": "integer"
+ },
+ "ErrorMsg": {
+ "type": "string"
+ },
+ "NumOfFoundProposals": {
+ "type": "integer"
+ },
+ "searchedSrc": {
+ "type": "string"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "forceFuzzy": {
+ "type": "integer"
+ },
+ "results": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "segmentId": {
+ "type": "integer"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "timestamp": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "additionalInfo": {
+ "type": "string"
+ },
+ "internalKey": {
+ "type": "string"
+ },
+ "matchType": {
+ "type": "string"
+ },
+ "matchRate": {
+ "type": "integer"
+ },
+ "fuzzyWords": {
+ "type": "integer"
+ },
+ "fuzzyDiffs": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "source",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey",
+ "matchType",
+ "matchRate",
+ "fuzzyWords",
+ "fuzzyDiffs"
+ ]
+ }
+ }
+ },
+ "required": [
+ "ReturnValue",
+ "ErrorMsg",
+ "NumOfFoundProposals",
+ "searchedSrc",
+ "customId",
+ "forceFuzzy"
+ ],
+ "description": "key \"first\" is an exampe. it was set because request has \"customId\": \"first\""
+ },
+ "second": {
+ "type": "object",
+ "properties": {
+ "ReturnValue": {
+ "type": "integer"
+ },
+ "ErrorMsg": {
+ "type": "string"
+ },
+ "NumOfFoundProposals": {
+ "type": "integer"
+ },
+ "searchedSrc": {
+ "type": "string"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "forceFuzzy": {
+ "type": "integer"
+ },
+ "results": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "segmentId": {
+ "type": "integer"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "timestamp": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "additionalInfo": {
+ "type": "string"
+ },
+ "internalKey": {
+ "type": "string"
+ },
+ "matchType": {
+ "type": "string"
+ },
+ "matchRate": {
+ "type": "integer"
+ },
+ "fuzzyWords": {
+ "type": "integer"
+ },
+ "fuzzyDiffs": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "source",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey",
+ "matchType",
+ "matchRate",
+ "fuzzyWords",
+ "fuzzyDiffs"
+ ]
+ }
+ }
+ },
+ "required": [
+ "ReturnValue",
+ "ErrorMsg",
+ "NumOfFoundProposals",
+ "searchedSrc",
+ "customId",
+ "forceFuzzy"
+ ],
+ "description": "key \"second\" is an exampe. it was set because request has \"customId\": \"second\""
+ }
+ },
+ "required": [
+ "first",
+ "second"
+ ]
+ }
+ },
+ "required": [
+ "responses"
+ ]
+ },
+ "example": {
+ "responses": {
+ "first": {
+ "ReturnValue": 0,
+ "ErrorMsg": "",
+ "NumOfFoundProposals": 2,
+ "searchedSrc": "First segment with int",
+ "customId": "first",
+ "forceFuzzy": 0,
+ "results": [
+ {
+ "source": "First segment with int 10",
+ "target": "Перший сегмент з числом 10",
+ "segmentId": 6,
+ "customId": "",
+ "documentName": "none",
+ "sourceLang": "en",
+ "targetLang": "UK",
+ "type": "Manual",
+ "author": "MANAGER",
+ "timestamp": "20250716T084347Z",
+ "markupTable": "OTMXUXLF",
+ "context": "",
+ "additionalInfo": "",
+ "internalKey": "10:1",
+ "matchType": "Fuzzy",
+ "matchRate": 80,
+ "fuzzyWords": 5,
+ "fuzzyDiffs": 1
+ },
+ {
+ "source": "First segment with int ",
+ "target": "Перший сегмент з числом ",
+ "segmentId": 2,
+ "customId": "",
+ "documentName": "none",
+ "sourceLang": "en",
+ "targetLang": "UK",
+ "type": "Manual",
+ "author": "MANAGER",
+ "timestamp": "20250716T084347Z",
+ "markupTable": "OTMXUXLF",
+ "context": "",
+ "additionalInfo": "",
+ "internalKey": "7:1",
+ "matchType": "Fuzzy",
+ "matchRate": 80,
+ "fuzzyWords": 5,
+ "fuzzyDiffs": 1
+ }
+ ]
+ },
+ "second": {
+ "ReturnValue": 0,
+ "ErrorMsg": "",
+ "NumOfFoundProposals": 2,
+ "searchedSrc": "Third segment with",
+ "customId": "second",
+ "forceFuzzy": 0,
+ "results": [
+ {
+ "source": "Third segment with int 10 and float 1.100",
+ "target": "третій сегмент з числом 10 і 1.100, друге захищене як ціле з точкою",
+ "segmentId": 8,
+ "customId": "",
+ "documentName": "none",
+ "sourceLang": "en",
+ "targetLang": "UK",
+ "type": "Manual",
+ "author": "MANAGER",
+ "timestamp": "20250716T084347Z",
+ "markupTable": "OTMXUXLF",
+ "context": "",
+ "additionalInfo": "",
+ "internalKey": "11:1",
+ "matchType": "Fuzzy",
+ "matchRate": 37,
+ "fuzzyWords": 8,
+ "fuzzyDiffs": 5
+ },
+ {
+ "source": "Third segment with int and float ",
+ "target": "третій сегмент з числом і , друге захищене як ціле з точкою",
+ "segmentId": 4,
+ "customId": "",
+ "documentName": "none",
+ "sourceLang": "en",
+ "targetLang": "UK",
+ "type": "Manual",
+ "author": "MANAGER",
+ "timestamp": "20250716T084347Z",
+ "markupTable": "OTMXUXLF",
+ "context": "",
+ "additionalInfo": "",
+ "internalKey": "8:1",
+ "matchType": "Fuzzy",
+ "matchRate": 37,
+ "fuzzyWords": 8,
+ "fuzzyDiffs": 5
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ },
+ "/t5memory/{memory}/multiupdate": {
+ "post": {
+ "summary": "Multi Update",
+ "deprecated": false,
+ "description": "Send multiple updateEntry requests to the same tm with one call",
+ "tags": [],
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "requests": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "customId": {
+ "type": "string",
+ "description": "If provided will be used as field name for result in response"
+ },
+ "source": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "save2disk": {
+ "type": "string",
+ "enum": [
+ "1",
+ "0"
+ ],
+ "description": "If 1 provided will save new segmnet to disk right away, else - only in RAM until flush happens"
+ }
+ },
+ "required": [
+ "source",
+ "target",
+ "targetLang",
+ "sourceLang",
+ "documentName",
+ "author",
+ "context"
+ ]
+ }
+ }
+ },
+ "required": [
+ "requests"
+ ]
+ },
+ "example": {
+ "requests": [
+ {
+ "customId": "fourth",
+ "source": "Fourth segmnet",
+ "target": "Четвертий сегмент",
+ "type": "Manual",
+ "markupTable": "OTMXUXLF",
+ "targetLang": "en",
+ "sourceLang": "uk",
+ "documentName": "test.xlsx.sdlxliff",
+ "author": "Project Manager",
+ "context": "390"
+ },
+ {
+ "customId": "fifth",
+ "source": "Fifth segment",
+ "target": "Пʼятий сегмент",
+ "type": "Manual",
+ "markupTable": "OTMXUXLF",
+ "targetLang": "en",
+ "sourceLang": "uk",
+ "documentName": "translation.docx",
+ "author": "Editor",
+ "context": "200"
+ }
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Each response object in responses has a key and value of it contains response of simple update.\nName of a key comes from \"customId\" in request.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "responses": {
+ "type": "object",
+ "properties": {
+ "fourth": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string"
+ },
+ "sourceNPRepl": {
+ "type": "string"
+ },
+ "sourceNorm": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "segmentId": {
+ "type": "integer"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "timestamp": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "additionalInfo": {
+ "type": "string"
+ },
+ "internalKey": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "source",
+ "sourceNPRepl",
+ "sourceNorm",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey"
+ ],
+ "description": "Key \"fourth\" comes from request \"customId\""
+ },
+ "fifth": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string"
+ },
+ "sourceNPRepl": {
+ "type": "string"
+ },
+ "sourceNorm": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "segmentId": {
+ "type": "integer"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "timestamp": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "additionalInfo": {
+ "type": "string"
+ },
+ "internalKey": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "source",
+ "sourceNPRepl",
+ "sourceNorm",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey"
+ ]
+ }
+ },
+ "required": [
+ "fourth",
+ "fifth"
+ ]
+ },
+ "save2disk": {
+ "type": "string",
+ "enum": [
+ "1",
+ "0"
+ ],
+ "description": "Represents if new segmnets are saved to disk right away"
+ }
+ },
+ "required": [
+ "responses",
+ "save2disk"
+ ]
+ },
+ "example": {
+ "responses": {
+ "fourth": {
+ "source": "Fourth segmnet",
+ "sourceNPRepl": "Fourth segmnet",
+ "sourceNorm": "Fourth segmnet",
+ "target": "Четвертий сегмент",
+ "segmentId": 9,
+ "customId": "fourth",
+ "documentName": "test.xlsx.sdlxliff",
+ "sourceLang": "UK",
+ "targetLang": "EN",
+ "type": "Manual",
+ "author": "PROJECT MANAGER",
+ "timestamp": "20250812T125637Z",
+ "markupTable": "OTMXUXLF",
+ "context": "390",
+ "additionalInfo": "",
+ "internalKey": "12:1"
+ },
+ "fifth": {
+ "source": "Fifth segment",
+ "sourceNPRepl": "Fifth segment",
+ "sourceNorm": "Fifth segment",
+ "target": "Пʼятий сегмент",
+ "segmentId": 10,
+ "customId": "fifth",
+ "documentName": "translation.docx",
+ "sourceLang": "UK",
+ "targetLang": "EN",
+ "type": "Manual",
+ "author": "EDITOR",
+ "timestamp": "20250812T125637Z",
+ "markupTable": "OTMXUXLF",
+ "context": "200",
+ "additionalInfo": "",
+ "internalKey": "13:1"
+ }
+ },
+ "save2disk": "0"
+ }
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ },
+ "/t5memory/{memory}/tables": {
+ "get": {
+ "summary": "Tables",
+ "deprecated": false,
+ "description": "Get author, lang, langGroup(virtual- created in runtime and not saved on the disk), tagtable(deprecated - only one record), document(long filename, long filename caseignore-virtual, short filename- part deprecated)\n\nTables are provided in format - name(internal key): \"position) idInTable:value;\"\n\nhttps://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-Tables\nWhen adding new entry, for new Id t5memory uses basicaly size of the table before adding+1, so Id should start from id=1. \nWhen doing fuzzy search, some field could also be saved to the table, to generate then id(or find matching) to compare with saved data.\nThere are 2 types of entries- older, fixed size, and long filename. For older, every entry has the same size, 39 bytes+endOfLine. You can have up to 389 entries saved in that way in each of the tables. Longname table manage size dynamically, so it's not clear what's the maximum size, but for filenames there are duplicates in old style docname table and in longname(which are used only for this type of data). For filename search, first used longname table, then generated on tm loading caseignore longname table, then short name table. Usually entries in tables are caseignore. \n\nIn the record t5memory saves only id to the table. Maybe it make sense to implement endpoint to edit that table, if something is missing or corrupted. Exception for saving id are context and additional info, some data, that could be saved as int(segId, time), and source and target.\nTo clear or fix tag tables, you need to do reorganize, but if some entry is missing from the table, you would not restore it on export or segment exctraction via id. So tables could be used to check health of the tm. And for some ways for concordance search or some other checks.",
+ "tags": [],
+ "parameters": [
+ {
+ "name": "Accept",
+ "in": "header",
+ "description": "",
+ "required": false,
+ "example": "application/json",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {}
+ },
+ "example": "{\n \"tableName(additional info)(INTERNAL_KEY_OF_THE_TABLE)\": \"position)idInTable: value;\",\n \"tagTablesTable(4)\": \"0)0: \\\"\\\"; \",\n \"langTable(1)\": \"0)2: \\\"EN\\\"; 1)1: \\\"UK\\\"; 2)0: \\\"\\\"; \",\n \"langGroupTable(virtual)(8)\":\"0)1: \\\"E\\\"; 1)2: \\\"U\\\"; 2)0: \\\"\u0000\\\"; \",\n \"authors(3)\": \"0)3: \\\"EDITOR\\\"; 1)1: \\\"MANAGER\\\"; 2)2: \\\"PROJECT MANAGER\\\"; 3)0: \\\"\\\"; \",\n \"filenames(long)(5)\": \"0)1: \\\"none\\\"; 1)1: \\\"none\\\"; 2)1: \\\"none\\\"; 3)2: \\\"test.xlsx.sdlxliff\\\"; 4)5: \\\"test.xlsx.sdlxliff\\\"; 5)6: \\\"translation.docx\\\"; 6)0: \\\"\\\"; \",\n \"filenames(long, caseign, virtual)(5)\": \"0)1: \\\"NONE\\\"; 1)1: \\\"NONE\\\"; 2)1: \\\"NONE\\\"; 3)5: \\\"TEST.XLSX.SDLXLIFF\\\"; 4)6: \\\"TRANSLATION.DOCX\\\"; 5)2: \\\"TRANSLATION.TXT\\\"; 6)0: \\\"\\\"; \",\n \"filenames(short)(2)\": \"0)1: \\\"none\\\"; 1)5: \\\"test.xlsx.sdlxliff\\\"; 2)6: \\\"translation.docx\\\"; 3)0: \\\"\\\"; \"\n}"
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ },
+ "/t5memory/{memory}/addtotable": {
+ "post": {
+ "summary": "Add to table",
+ "deprecated": false,
+ "description": "You can add new entry to the tables but then it's better to reorganize tm(in case if after adding new entry with missing id and there are other entry with the same value but other id - which could be the case- in binary search that could cause problems - so just reorganize it afterwards). You can check table by just doing something like full export(or concordance search for full tm), and check logs for that 2222 errors.\n\nValues shouldn't be longer than 39 bytes(utf8), and 256 for filename,it's tables limits, for that it also have checks.\nIn cases like with those tms, you can also check if x-1 and x+1 id is present. Usually they are in those bug.\nalso you can check tables via tables request\nAlso logicaly FILE_KEY=2, but that was only for shortname, which was also 39 bytes, but real key for long name table is 5. But for requests and internal handling t5memory uses 2.\nId should be between 1 and 65k, request also checks for that",
+ "tags": [],
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "string"
+ },
+ "entryId": {
+ "type": "integer"
+ },
+ "tableKey": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "value",
+ "entryId",
+ "tableKey"
+ ]
+ },
+ "example": {
+ "value": "MY new entry",
+ "entryId": 100,
+ "tableKey": 2
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {}
+ },
+ "examples": {
+ "1": {
+ "summary": "Invalid table key",
+ "value": {
+ "ReturnValue": 400,
+ "ErrorMsg": "Invalid table key(0); available keys = LANG_KEY(1), FILE_KEY(2), AUTHOR_KEY(3)"
+ }
+ },
+ "2": {
+ "summary": "Table already have entry with matching id",
+ "value": {
+ "ReturnValue": 400,
+ "ErrorMsg": "Id match in Table 2 already have entry with matching id = 100 and value = \"Teaser Page.xlsx\";"
+ }
+ },
+ "3": {
+ "summary": "Value field is empty",
+ "value": {
+ "ReturnValue": 400,
+ "ErrorMsg": "Value field is empty"
+ }
+ }
+ }
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ },
+ "/t5memory/": {
+ "post": {
+ "summary": "Create TM",
+ "deprecated": false,
+ "description": "",
+ "tags": [],
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "New TM name"
+ },
+ "sourceLang": {
+ "type": "string",
+ "description": "rfc5646"
+ },
+ "data": {
+ "type": "string",
+ "deprecated": true,
+ "description": "Binary TM file encode with base64.\nCan be passed to create TM with data right away.\nUse with cautios!"
+ }
+ },
+ "required": [
+ "name",
+ "sourceLang"
+ ]
+ },
+ "examples": {
+ "1": {
+ "value": {
+ "name": "examle_tm2",
+ "sourceLang": "de-DE"
+ },
+ "summary": "Create TM"
+ },
+ "2": {
+ "value": {
+ "name": "test-memory",
+ "sourceLang": "en-GB",
+ "data": "UEsDBBQACAgIAFJmeFYAAAAAAAAAAAAAAAAoAAQASUQ2MzItR0VPLUxlaWNhLUhlbHAtTWFjaGluZSBDb250cm9sLk1FTQEAAADtzssKQEAUgOFjoTwGWR+5lPW4TCjDxgtomqI0I3lzLyBvIEUW59v829+GrinTJMaK99iqWY5Yq2VFMcpp1sotjN43swSCC/gSzw551bHu7MGLlMYqh6d8xrpBhBFjPnhACCGE/MMJUEsHCKEIpyRnAAAAAAAAAAAIAAAAAAAAUEsDBBQACAgIAFJmeFYAAAAAAAAAAAAAAAAoAAQASUQ2MzItR0VPLUxlaWNhLUhlbHAtTWFjaGluZSBDb250cm9sLlRNRAEAAADt3bFKI0EYB/BvNzFaXCXH1Vdcc3h7xR14xXEsd5pTwRgIEWwlBBRCFPEFbKx9BJ/DJ7CyshYrCwsbX0A3GtykFQnE329ZZnb+u92wMMXMt9FupBFxlERxRVTi+mPwCrNjLe9b+nw/qcRqq77UbC0HwCSdR/3vfafozSVry4s/f2Qr9Wa23t3tbGer3d5+1tju7Oz2u5+X9vqHB3u97+3Gm/24uv1s5V8AAAAAAAAAAAAAAAAAABHzg13/hVqcRSuPOM7P8sv8NG/lvTwAAAAAAAAAAAAAAAAAAABgasxFEjOD3rAO+EwpqQ56Jx+eRmqlpBLlj5JSUhtJqqUkGUnSUhIjQ5UYG4jiLIA7O/4BAAAAAAAAAAAAAAAAAABgAqrPJwHMx2zcfvryNdKbP1e/Iy5+LS58W3h8BgAAAAAAAAAAAJgO6Wg7rK7UbDe2NrfW/5dfTYJp9VI7a1i/CwAAYGLGVqq8U+YBBfOAgnnAowdQSwcITWiheHEBAAAAAAAAAAABAAAAAABQSwMEFAAICAgAUmZ4VgAAAAAAAAAAAAAAACgABABJRDYzMi1HRU8tTGVpY2EtSGVscC1NYWNoaW5lIENvbnRyb2wuVE1JAQAAAO3dwWkCYRAG0NFTzlaQBv4cEsg1JLqokI0gNiDLQgRZQ7ABu7MaLxawKijqWWQPvjcMM1PEx/xM8nZErCJa++J2dV1fTR5b+9inazDOuqNxLwCatI7sc1sctqfWsPf+9pr62Sh9l7Nimgbl/C/l0+J3VpXP3UW1/F/MXyb5MO6krFL/KwAAAAAAAAAAAAAAAACAiM5F6r8Tm48AAAAAAAAAAAAAAAAAAAAAGnD+TS7/DwAAAAAAAAAAAAAAAAAAAM3YAVBLBwgGVIGewwAAAAAAAAAAwAAAAAAAAFBLAQIAABQACAgIALRlVFahCKckZwAAAAAIAAAoAAQAAAAAAAAAAACkgQAAAABJRDYzMi1HRU8tTGVpY2EtSGVscC1NYWNoaW5lIENvbnRyb2wuTUVNAQAAAFBLAQIAABQACAgIAGdralZNaKF4cQEAAAAAAQAoAAQAAAAAAAAAAACkgckAAABJRDYzMi1HRU8tTGVpY2EtSGVscC1NYWNoaW5lIENvbnRyb2wuVE1EAQAAAFBLAQIAABQACAgIAFJmeFYGVIGewwAAAADAAAAoAAQAAAAAAAAAAACkgZwCAABJRDYzMi1HRU8tTGVpY2EtSGVscC1NYWNoaW5lIENvbnRyb2wuVE1JAQAAAFBLBgYsAAAAAAAAAB4DLQAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAOAQAAAAAAAMEDAAAAAAAAUEsGBwAAAADPBAAAAAAAAAEAAABQSwUGAAAAAAMAAwAOAQAAwQMAAAAA"
+ },
+ "summary": "Create with file for TM"
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Created TM name"
+ }
+ },
+ "required": [
+ "name"
+ ]
+ },
+ "example": {
+ "name": "examle_tm2"
+ }
+ }
+ },
+ "headers": {}
+ },
+ "x-200:Error": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "title": "",
+ "type": "object",
+ "properties": {
+ "ReturnValue": {
+ "type": "integer",
+ "description": "Error code"
+ },
+ "ErrorMsg": {
+ "type": "string",
+ "description": "Message to explain error"
+ }
+ },
+ "required": [
+ "ReturnValue",
+ "ErrorMsg"
+ ]
+ },
+ "example": {
+ "ReturnValue": 7272,
+ "ErrorMsg": "::ERROR_MEM_NAME_EXISTS:: TM with this name already exists: test-memory; res = 0"
+ }
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ },
+ "get": {
+ "summary": "Get TMs list",
+ "deprecated": false,
+ "description": "",
+ "tags": [],
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "Open": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "TM name"
+ }
+ },
+ "required": [
+ "name"
+ ]
+ },
+ "description": "Memories loaded into RAM"
+ },
+ "Available on disk": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "TM name"
+ }
+ },
+ "required": [
+ "name"
+ ]
+ },
+ "description": "Memories available on disk"
+ }
+ },
+ "required": [
+ "Open",
+ "Available on disk"
+ ]
+ },
+ "example": {
+ "Open": [
+ {
+ "name": "test-memory"
+ }
+ ],
+ "Available on disk": [
+ {
+ "name": "test-memory-1"
+ }
+ ]
+ }
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ },
+ "/t5memory_service/resources": {
+ "get": {
+ "summary": "Resources",
+ "deprecated": false,
+ "description": "",
+ "tags": [],
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {}
+ },
+ "example": {
+ "filebuffers": [
+ {
+ "name": "/root/.t5memory/TABLE/OTMXUXLF.TBL",
+ "size": 3660
+ }
+ ],
+ "totalOccupiedByFilebuffersRAM": 3660,
+ "tms": [
+ {
+ "name": "test-memory",
+ "status": "open",
+ "size": 134976,
+ "activeRequest": "",
+ "expectedSize": 0,
+ "StatusInfo": {
+ "status": "open",
+ "sizeInRAM": 134976,
+ "activeRequest": "",
+ "tmxImportStatus": "available",
+ "importProgress": 100,
+ "importTime": "Overall import time is : 0:00:00\n",
+ "segmentsImported": 2,
+ "invalidSegments": 0,
+ "tmxSegmentCount": 2,
+ "importRuntimeSec": 0,
+ "importTimeoutSec": 0,
+ "newEntryIfOnlyContextAndTimestampDifferent": 1,
+ "saveDifferentTargetsForSameSource": 0,
+ "invalidSegmentsRCs": "",
+ "firstInvalidSegments(num:segId:errCode)": "",
+ "invalidSymbolErrors": 0,
+ "errorMsg": "",
+ "rc": 0,
+ "lastAccessTime": "20250801T153723Z",
+ "creationTime": "20250801T123723Z",
+ "tmCreatedInT5M_version": "0:7:14",
+ "segmentIndex": 2,
+ "sourceLang": "de",
+ "internalDescription": "",
+ "tmd fbuffer was modified": 1,
+ "tmi fbuffer was modified": 1
+ }
+ }
+ ],
+ "totalOccupiedByTMsInRAM": 712165696,
+ "Run date": "Wed Jul 30 16:08:09 2025 ",
+ "Build date": "2025/07/29 16:08:46",
+ "Git commit info": "dff40cb9 * updated to v0.7.14 + added skipStartupLogs flags(default true) * fixed non-asan builds * fixed nextInternalKey is empty log on failed export",
+ "Version": "0.7.14",
+ "Worker threads": 10,
+ "Timeout(ms)": 180000,
+ "Resident set": 1448300000000,
+ "Virtual memory usage": 3743340000000000,
+ "Requests": {
+ "RequestCount": 6829,
+ "RequestExecutionSumTime(sec)": 14.484,
+ "CreateMem": {
+ "ReqCount": 44,
+ "SumTime(sec)": 0.065,
+ "AvrgReqTime": 0.00147727
+ },
+ "DeleteMem": {
+ "ReqCount": 0,
+ "SumTime(sec)": 0,
+ "AvrgReqTime": 0
+ },
+ "ImportMem": {
+ "ReqCount": 29,
+ "SumTime(sec)": 0.016,
+ "AvrgReqTime": 0.000551724
+ },
+ "ExportMem": {
+ "ReqCount": 13,
+ "SumTime(sec)": 0.09,
+ "AvrgReqTime": 0.00692308
+ },
+ "CloneTmLocaly": {
+ "ReqCount": 0,
+ "SumTime(sec)": 0,
+ "AvrgReqTime": 0
+ },
+ "Reorganize": {
+ "ReqCount": 0,
+ "SumTime(sec)": 0,
+ "AvrgReqTime": 0
+ },
+ "StatusMem": {
+ "ReqCount": 109,
+ "SumTime(sec)": 0.011,
+ "AvrgReqTime": 0.000100917
+ },
+ "FlushMem": {
+ "ReqCount": 0,
+ "SumTime(sec)": 0,
+ "AvrgReqTime": 0
+ },
+ "Fuzzy": {
+ "ReqCount": 98,
+ "SumTime(sec)": 1.034,
+ "AvrgReqTime": 0.010551
+ },
+ "MultiFuzzy": {
+ "ReqCount": 0,
+ "SumTime(sec)": 0,
+ "AvrgReqTime": 0
+ },
+ "Concordance": {
+ "ReqCount": 0,
+ "SumTime(sec)": 0,
+ "AvrgReqTime": 0
+ },
+ "UpdateEntry": {
+ "ReqCount": 6,
+ "SumTime(sec)": 0.013,
+ "AvrgReqTime": 0.00216667
+ },
+ "MultiUpdate": {
+ "ReqCount": 0,
+ "SumTime(sec)": 0,
+ "AvrgReqTime": 0
+ },
+ "GetEntry": {
+ "ReqCount": 0,
+ "SumTime(sec)": 0,
+ "AvrgReqTime": 0
+ },
+ "DeleteEntry": {
+ "ReqCount": 0,
+ "SumTime(sec)": 0,
+ "AvrgReqTime": 0
+ },
+ "SaveAllTms": {
+ "ReqCount": 0,
+ "SumTime(sec)": 0,
+ "AvrgReqTime": 0
+ },
+ "ListOfMemories": {
+ "ReqCount": 6474,
+ "SumTime(sec)": 13.221,
+ "AvrgReqTime": 0.00204217
+ },
+ "Resources": {
+ "ReqCount": 22,
+ "SumTime(sec)": 0.016,
+ "AvrgReqTime": 0.000727273
+ },
+ "Flags": {
+ "ReqCount": 0,
+ "SumTime(sec)": 0,
+ "AvrgReqTime": 0
+ },
+ "Other": {
+ "ReqCount": 0,
+ "SumTime(sec)": 0,
+ "AvrgReqTime": 0
+ },
+ "Unrecognized": {
+ "ReqCount": 0,
+ "SumTime(sec)": 0,
+ "AvrgReqTime": 0
+ }
+ },
+ "RAM limit(MB)": 10000
+ }
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ },
+ "/t5memory/{memory}/status": {
+ "get": {
+ "summary": "TM Status",
+ "deprecated": false,
+ "description": "https://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-GetthestatusofTM",
+ "tags": [],
+ "parameters": [],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "description": "Statuses:\nopen - memory already in RAM ready to use\navailable - not loaded but present on disk\nloading - loading from disk to RAM\nnot found - error status of absent memory\nreorganize running - Reorganizing in process\nimport running - Import in process\nwaiting for loading - loading requsted but not done yet\nfailed to open - corrupted TM file"
+ },
+ "sizeInRAM": {
+ "type": "integer"
+ },
+ "activeRequest": {
+ "type": "string",
+ "description": " "
+ },
+ "lastAccessTime": {
+ "type": "string"
+ },
+ "creationTime": {
+ "type": "string"
+ },
+ "tmCreatedInT5M_version": {
+ "type": "string",
+ "description": "version of t5memory on momemt of TM creation"
+ },
+ "segmentIndex": {
+ "type": "integer",
+ "description": "index of last inserted segment (not queriable)"
+ },
+ "sourceLang": {
+ "type": "string",
+ "description": "rfc5646"
+ },
+ "internalDescription": {
+ "type": "string"
+ },
+ "tmd fbuffer was modified": {
+ "type": "integer"
+ },
+ "tmi fbuffer was modified": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "status",
+ "sizeInRAM",
+ "activeRequest",
+ "lastAccessTime",
+ "creationTime",
+ "tmCreatedInT5M_version",
+ "segmentIndex",
+ "sourceLang",
+ "internalDescription",
+ "tmd fbuffer was modified",
+ "tmi fbuffer was modified"
+ ]
+ },
+ "example": {
+ "status": "open",
+ "sizeInRAM": 134976,
+ "activeRequest": "",
+ "lastAccessTime": "20250801T160913Z",
+ "creationTime": "20250716T102923Z",
+ "tmCreatedInT5M_version": "0:7:7",
+ "segmentIndex": 5,
+ "sourceLang": "en",
+ "internalDescription": "",
+ "tmd fbuffer was modified": 1,
+ "tmi fbuffer was modified": 1
+ }
+ }
+ },
+ "headers": {}
+ },
+ "x-200:Import processed status": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string"
+ },
+ "sizeInRAM": {
+ "type": "integer"
+ },
+ "activeRequest": {
+ "type": "string"
+ },
+ "tmxImportStatus": {
+ "type": "string",
+ "description": "Statuses of ongoing improt:\navailable - not tipical. If returned and \"importTime\" == \"not finished\" then import still ongoing\nimport - ongoing import"
+ },
+ "importProgress": {
+ "type": "integer",
+ "description": "Progress in persents"
+ },
+ "importTime": {
+ "type": "string"
+ },
+ "segmentsImported": {
+ "type": "integer",
+ "description": "NUmber of successfully imported segments"
+ },
+ "invalidSegments": {
+ "type": "integer",
+ "description": "Number of invalid segments found in TMX"
+ },
+ "tmxSegmentCount": {
+ "type": "integer",
+ "description": "Number of found segmnets in import TMX file"
+ },
+ "importRuntimeSec": {
+ "type": "integer"
+ },
+ "importTimeoutSec": {
+ "type": "integer"
+ },
+ "newEntryIfOnlyContextAndTimestampDifferent": {
+ "type": "integer"
+ },
+ "saveDifferentTargetsForSameSource": {
+ "type": "integer",
+ "description": "0 or 1 - considered as bool value"
+ },
+ "invalidSegmentsRCs": {
+ "type": "string"
+ },
+ "firstInvalidSegments(num:segId:errCode)": {
+ "type": "string"
+ },
+ "invalidSymbolErrors": {
+ "type": "integer"
+ },
+ "errorMsg": {
+ "type": "string"
+ },
+ "rc": {
+ "type": "integer"
+ },
+ "lastAccessTime": {
+ "type": "string"
+ },
+ "creationTime": {
+ "type": "string"
+ },
+ "tmCreatedInT5M_version": {
+ "type": "string"
+ },
+ "segmentIndex": {
+ "type": "integer"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "internalDescription": {
+ "type": "string"
+ },
+ "tmd fbuffer was modified": {
+ "type": "integer"
+ },
+ "tmi fbuffer was modified": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "status",
+ "sizeInRAM",
+ "activeRequest",
+ "tmxImportStatus",
+ "importProgress",
+ "importTime",
+ "segmentsImported",
+ "invalidSegments",
+ "tmxSegmentCount",
+ "importRuntimeSec",
+ "importTimeoutSec",
+ "newEntryIfOnlyContextAndTimestampDifferent",
+ "saveDifferentTargetsForSameSource",
+ "invalidSegmentsRCs",
+ "firstInvalidSegments(num:segId:errCode)",
+ "invalidSymbolErrors",
+ "errorMsg",
+ "rc",
+ "lastAccessTime",
+ "creationTime",
+ "tmCreatedInT5M_version",
+ "segmentIndex",
+ "sourceLang",
+ "internalDescription",
+ "tmd fbuffer was modified",
+ "tmi fbuffer was modified"
+ ]
+ },
+ "example": {
+ "status": "open",
+ "sizeInRAM": 134976,
+ "activeRequest": "",
+ "tmxImportStatus": "available",
+ "importProgress": 100,
+ "importTime": "Overall import time is : 0:00:00\n",
+ "segmentsImported": 4,
+ "invalidSegments": 0,
+ "tmxSegmentCount": 4,
+ "importRuntimeSec": 0,
+ "importTimeoutSec": 0,
+ "newEntryIfOnlyContextAndTimestampDifferent": 1,
+ "saveDifferentTargetsForSameSource": 0,
+ "invalidSegmentsRCs": "",
+ "firstInvalidSegments(num:segId:errCode)": "",
+ "invalidSymbolErrors": 0,
+ "errorMsg": "",
+ "rc": 0,
+ "lastAccessTime": "20250807T130822Z",
+ "creationTime": "20250716T102923Z",
+ "tmCreatedInT5M_version": "0:7:7",
+ "segmentIndex": 9,
+ "sourceLang": "en",
+ "internalDescription": "",
+ "tmd fbuffer was modified": 1,
+ "tmi fbuffer was modified": 1
+ }
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ },
+ "/t5memory/{memory}/importtmx": {
+ "post": {
+ "summary": "IMPORT TMX",
+ "deprecated": false,
+ "description": "Rout is async. So when import is finished should be checked with status call",
+ "tags": [],
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "multipart/form-data": {
+ "encoding": {
+ "json_data": {
+ "contentType": "application/json"
+ }
+ },
+ "schema": {
+ "type": "object",
+ "properties": {
+ "json_data": {
+ "type": "string",
+ "description": "json pretty print string.\n\n\"framingTags\" key possible values:\n\"saveAll\" - default behaviour, do nothing\n\"skipAll\" - skip all enclosing tags, including standalone tags\n\"skipPaired\" - skip only paired enclosing tags\n\nBoth newEntryIfOnlyContextAndTimestampDifferent and saveDifferentTargetsForSameSource impact how similar translation would be saved. In case if source and other field(doc, author, lang) are the same, but target different, and newEntryIfOnlyContextAndTimestampDifferent is set to true, you would have 2 translation, otherwise you would have 1 translation saved - with higher updateTime. but if you have different attributes, like document, you would have 2 translation anyway. \nnewEntryIfOnlyContextAndTimestampDifferent would also increase number of saved segments. If values was not provided, default values from flags would be used.",
+ "example": "{\n \"framingTags\": \"saveAll\",\n \"newEntryIfOnlyContextAndTimestampDifferent\": 0,\n \"saveDifferentTargetsForSameSource\": 0,\n \"timeout\": 100000\n}\n"
+ },
+ "file": {
+ "format": "binary",
+ "type": "string",
+ "description": "tmx file to import into TM",
+ "example": ""
+ }
+ },
+ "required": [
+ "json_data",
+ "file"
+ ]
+ },
+ "examples": {}
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {}
+ },
+ "example": {
+ "msg": "success"
+ }
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ },
+ "/t5memory/{memory}/download.tmx": {
+ "get": {
+ "summary": "EXPORT TMX",
+ "deprecated": false,
+ "description": "JSON pretty print string:\nlimit - number of segments to fetch at a time\nstartFromInternalKey - internal key to start export from\n\nWorks as cursor pagination.\n\nIf no body provided, export starts from the beginning (key 7:1) to the end.",
+ "tags": [],
+ "parameters": [
+ {
+ "name": "Accept",
+ "in": "header",
+ "description": "",
+ "required": true,
+ "example": "application/xml",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "limit": {
+ "type": "string"
+ },
+ "startFromInternalKey": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "limit",
+ "startFromInternalKey"
+ ]
+ },
+ "example": {
+ "limit": "100",
+ "startFromInternalKey": "1:1"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "In response headers \"NextInternalKey\" will contain \"startFromInternalKey\" for next call.\nIf \"NextInternalKey\" == \"0:0\" - then you reached end of TM",
+ "content": {
+ "application/xml": {
+ "schema": {
+ "type": "object",
+ "properties": {}
+ },
+ "example": "\n\n\n \n \n \n 2\n 7: 1\n OTMXUXLF\n none\n \n First segment\n \n \n Перший сегмент\n \n \n \n"
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ },
+ "/t5memory/{memory}/search": {
+ "post": {
+ "summary": "Concordance search",
+ "deprecated": false,
+ "description": "All fields is optional, but some depends on other, so error should be returned in case of not providing required field.\nhttps://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-NewConcordancesearch",
+ "tags": [],
+ "parameters": [
+ {
+ "name": "Accept",
+ "in": "header",
+ "description": "",
+ "required": true,
+ "example": "application/json; charset=utf-8",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Accept-Charset",
+ "in": "header",
+ "description": "",
+ "required": true,
+ "example": "UTF-8",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string",
+ "description": "Sets what to look for in source of the segments, based on type of search, specified in sourceSearchMode(exact, concordance). If sourceSearchMode is not specified, returns an error."
+ },
+ "sourceSearchMode": {
+ "type": "string",
+ "description": "String with required \nEXACT or CONCORDANCE \n(or CONTAINS, what's equal to CONCORDANCE)\nwords and some optional, like\nCASEINSENSETIVE for non case sensetive comparison,\nWHITESPACETOLERANT for\nmodifying whitespaces(result of this actions you can see in filters in responce)\nINVERTED for applying filter in inverted state, so to return false on match and true \nif no match. Logical NOT\n\nAttributes is not case sensetive, \nSeparator doen't matters"
+ },
+ "target": {
+ "type": "string",
+ "description": "Sets what to look for in source of the segments, based on type of search, specified in sourceSearchMode(exact, concordance). If sourceSearchMode is not specified, returns an error."
+ },
+ "targetSearchMode": {
+ "type": "string",
+ "description": "String with required \nEXACT or CONCORDANCE \n(or CONTAINS, what's equal to CONCORDANCE)\nwords and some optional, like\nCASEINSENSETIVE for non case sensetive comparison,\nWHITESPACETOLERANT for\nmodifying whitespaces(result of this actions you can see in filters in responce)\nINVERTED for applying filter in inverted state, so to return false on match and true \nif no match. Logical NOT\n\nAttributes is not case sensetive, \nSeparator doen't matters"
+ },
+ "document": {
+ "type": "string",
+ "description": "Sets what to look for in source of the segments, based on type of search, specified in sourceSearchMode(exact, concordance). If sourceSearchMode is not specified, returns an error."
+ },
+ "documentSearchMode": {
+ "type": "string",
+ "description": "String with required \nEXACT or CONCORDANCE \n(or CONTAINS, what's equal to CONCORDANCE)\nwords and some optional, like\nCASEINSENSETIVE for non case sensetive comparison,\nWHITESPACETOLERANT for\nmodifying whitespaces(result of this actions you can see in filters in responce)\nINVERTED for applying filter in inverted state, so to return false on match and true \nif no match. Logical NOT\n\nAttributes is not case sensetive, \nSeparator doen't matters"
+ },
+ "author": {
+ "type": "string",
+ "description": "Sets what to look for in source of the segments, based on type of search, specified in sourceSearchMode(exact, concordance). If sourceSearchMode is not specified, returns an error."
+ },
+ "authorSearchMode": {
+ "type": "string",
+ "description": "String with required \nEXACT or CONCORDANCE \n(or CONTAINS, what's equal to CONCORDANCE)\nwords and some optional, like\nCASEINSENSETIVE for non case sensetive comparison,\nWHITESPACETOLERANT for\nmodifying whitespaces(result of this actions you can see in filters in responce)\nINVERTED for applying filter in inverted state, so to return false on match and true \nif no match. Logical NOT\n\nAttributes is not case sensetive, \nSeparator doen't matters"
+ },
+ "addInfo": {
+ "type": "string",
+ "description": "Sets what to look for in source of the segments, based on type of search, specified in sourceSearchMode(exact, concordance). If sourceSearchMode is not specified, returns an error."
+ },
+ "addInfoSearchMode": {
+ "type": "string",
+ "description": "String with required \nEXACT or CONCORDANCE \n(or CONTAINS, what's equal to CONCORDANCE)\nwords and some optional, like\nCASEINSENSETIVE for non case sensetive comparison,\nWHITESPACETOLERANT for\nmodifying whitespaces(result of this actions you can see in filters in responce)\nINVERTED for applying filter in inverted state, so to return false on match and true \nif no match. Logical NOT\n\nAttributes is not case sensetive, \nSeparator doen't matters"
+ },
+ "context": {
+ "type": "string",
+ "description": "Sets what to look for in source of the segments, based on type of search, specified in sourceSearchMode(exact, concordance). If sourceSearchMode is not specified, returns an error."
+ },
+ "contextSearchMode": {
+ "type": "string",
+ "description": "String with required \nEXACT or CONCORDANCE \n(or CONTAINS, what's equal to CONCORDANCE)\nwords and some optional, like\nCASEINSENSETIVE for non case sensetive comparison,\nWHITESPACETOLERANT for\nmodifying whitespaces(result of this actions you can see in filters in responce)\nINVERTED for applying filter in inverted state, so to return false on match and true \nif no match. Logical NOT\n\nAttributes is not case sensetive, \nSeparator doen't matters"
+ },
+ "timestampSpanStart": {
+ "type": "string",
+ "description": "String with date in format\n \"20240121T115234Z\""
+ },
+ "timestampSpanEnd": {
+ "type": "string",
+ "description": "String with date in format\n \"20240121T115234Z\""
+ },
+ "onlyCountSegments": {
+ "type": "string",
+ "description": "Instead of returning segment, would go in search till the end of tm and return total number of segments, that returns true with selected filters",
+ "enum": [
+ "1",
+ "0"
+ ]
+ },
+ "searchPosition": {
+ "type": "string",
+ "description": "Point where to start search in tmd file",
+ "example": "8:1"
+ },
+ "logicalOr": {
+ "type": "integer",
+ "enum": [
+ 1,
+ 0
+ ],
+ "description": "By default source, target, document, author, context, addinfo, timestamp is combined in logical AND, but by sending here \"OR\" you can switch that to logical OR, any other value would left it in default AND state.\nDoesn't apply to sourceLang and targetLang filters, they are always in AND state"
+ },
+ "numResults": {
+ "type": "integer",
+ "description": "Points how many matches return in current request",
+ "minimum": 0,
+ "maximum": 200,
+ "default": 5
+ },
+ "sourceLang": {
+ "type": "string",
+ "description": "Filter segments on src/trg lang attribute, \n\nIf specified lang is preffered, matching is done based on lang family,\notherwise on exact match"
+ },
+ "targetLang": {
+ "type": "string",
+ "description": "Filter segments on src/trg lang attribute, \n\nIf specified lang is preffered, matching is done based on lang family,\notherwise on exact match"
+ },
+ "msSearchAfterNumResults": {
+ "type": "integer",
+ "default": 0,
+ "description": "sets how many ms should pass between first found segment and search stop, if it didn't reach the end yet. "
+ },
+ "loggingThreshold": {
+ "type": "integer",
+ "maximum": 6,
+ "description": "HACK.\nAdditional field to set log level on the run.\nSets log level for t5memory process in general and not this request only"
+ }
+ }
+ },
+ "example": {
+ "source": "First",
+ "sourceSearchMode": "contains, CASEINSENSETIVE",
+ "target": "",
+ "targetSearchMode": "contains, CASEINSENSETIVE",
+ "document": "",
+ "documentSearchMode": "contains, CASEINSENSETIVE",
+ "author": "",
+ "authorSearchMode": "contains, CASEINSENSETIVE",
+ "addInfo": "",
+ "addInfoSearchMode": "contains, CASEINSENSETIVE",
+ "context": "",
+ "contextSearchMode": "contains, CASEINSENSETIVE",
+ "timestampSpanStart": "19691231T230000Z",
+ "timestampSpanEnd": "20260628T220000Z",
+ "onlyCountSegments": "0",
+ "searchPosition": "",
+ "logicalOr": 0,
+ "numResults": 200
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "Filters": {
+ "type": "string"
+ },
+ "GlobalSearchOptions": {
+ "type": "string"
+ },
+ "ReturnValue": {
+ "type": "integer"
+ },
+ "ReturnMessage": {
+ "type": "string"
+ },
+ "NewSearchPosition": {
+ "type": "null"
+ },
+ "NumOfFoundSegments": {
+ "type": "integer"
+ },
+ "results": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "segmentId": {
+ "type": "integer"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "timestamp": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "additionalInfo": {
+ "type": "string"
+ },
+ "internalKey": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "source",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey"
+ ]
+ }
+ }
+ },
+ "required": [
+ "Filters",
+ "GlobalSearchOptions",
+ "ReturnValue",
+ "ReturnMessage",
+ "NewSearchPosition",
+ "NumOfFoundSegments",
+ "results"
+ ]
+ },
+ "example": {
+ "Filters": "Search filter, field: SOURCE FilterType::CONTAINS SearchStr: 'FIRST'; Options: SEARCH_CASEINSENSITIVE_OPT|;\nSearch filter, field: TARGET FilterType::CONTAINS SearchStr: ''; Options: SEARCH_CASEINSENSITIVE_OPT|;\nSearch filter, field: ADDINFO FilterType::CONTAINS SearchStr: ''; Options: SEARCH_CASEINSENSITIVE_OPT|;\nSearch filter, field: CONTEXT FilterType::CONTAINS SearchStr: ''; Options: SEARCH_CASEINSENSITIVE_OPT|;\nSearch filter, field: AUTHOR FilterType::CONTAINS SearchStr: ''; Options: SEARCH_CASEINSENSITIVE_OPT|;\nSearch filter, field: DOCUMENT FilterType::CONTAINS SearchStr: ''; Options: SEARCH_CASEINSENSITIVE_OPT|;\nSearch filter, field: TIMESTAMP FilterType::RANGE Range: 19691231T230000Z - 20260628T220000Z Options: ;\n",
+ "GlobalSearchOptions": "SEARCH_FILTERS_LOGICAL_AND",
+ "ReturnValue": 10010,
+ "ReturnMessage": "ENDREACHED_RC",
+ "NewSearchPosition": null,
+ "NumOfFoundSegments": 2,
+ "results": [
+ {
+ "source": "First segment with int ",
+ "target": "Перший сегмент з числом ",
+ "segmentId": 2,
+ "customId": "",
+ "documentName": "none",
+ "sourceLang": "en",
+ "targetLang": "UK",
+ "type": "Manual",
+ "author": "MANAGER",
+ "timestamp": "20250716T084347Z",
+ "markupTable": "OTMXUXLF",
+ "context": "",
+ "additionalInfo": "",
+ "internalKey": "7:1"
+ },
+ {
+ "source": "First segment with int 10",
+ "target": "Перший сегмент з числом 10",
+ "segmentId": 6,
+ "customId": "",
+ "documentName": "none",
+ "sourceLang": "en",
+ "targetLang": "UK",
+ "type": "Manual",
+ "author": "MANAGER",
+ "timestamp": "20250716T084347Z",
+ "markupTable": "OTMXUXLF",
+ "context": "",
+ "additionalInfo": "",
+ "internalKey": "11:1"
+ }
+ ]
+ }
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ },
+ "/t5memory/{memory}/concordancesearch": {
+ "post": {
+ "summary": "Concordance search (DEPRICATED)",
+ "deprecated": false,
+ "description": " SearchPosition / NewSearchPositionFormat: \"7:1\"\nFirst is segmeng\\record number, second is target number\nThe NextSearchposition is an internal key of the memory for the next position on sequential access. Since it is an internal key, maintained and understood by the underlying memory plug-in (for EqfMemoryPlugin is it the record number and the position in one record),\nno assumptions should be made regarding the content. It is just a string that, should be sent back to OpenTM2 on the next request, so that the search starts from there.\nSo is the implementation in Translate5: The first request to OpenTM2 contains SearchPosition with an empty string, OpenTM2 returns than a string in NewSearchPosition, which is just resent to OpenTM2 in the next request.\nhttps://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-Concordancesearch\n ",
+ "tags": [],
+ "parameters": [
+ {
+ "name": "Accept",
+ "in": "header",
+ "description": "",
+ "required": true,
+ "example": "application/json; charset=utf-8",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Accept-Charset",
+ "in": "header",
+ "description": "",
+ "required": true,
+ "example": "UTF-8",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "searchString": {
+ "type": "string"
+ },
+ "searchType": {
+ "type": "string",
+ "enum": [
+ "Source",
+ "Target",
+ "SourceAndTarget"
+ ],
+ "example": "Source"
+ },
+ "searchPosition": {
+ "type": "null"
+ },
+ "numResults": {
+ "type": "integer"
+ },
+ "msSearchAfterNumResults": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "searchString",
+ "searchType"
+ ]
+ },
+ "example": {
+ "searchString": "With nice text",
+ "searchType": "source",
+ "searchPosition": null,
+ "numResults": 20,
+ "msSearchAfterNumResults": 250
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "ReturnValue": {
+ "type": "integer"
+ },
+ "ReturnMessage": {
+ "type": "string"
+ },
+ "NewSearchPosition": {
+ "type": "string",
+ "nullable": true
+ },
+ "results": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "segmentId": {
+ "type": "integer"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "timestamp": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "additionalInfo": {
+ "type": "string"
+ },
+ "internalKey": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "source",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey"
+ ]
+ }
+ }
+ },
+ "required": [
+ "ReturnValue",
+ "ReturnMessage",
+ "NewSearchPosition",
+ "results"
+ ]
+ },
+ "example": {
+ "ReturnValue": 10010,
+ "ReturnMessage": "ENDREACHED_RC",
+ "NewSearchPosition": null,
+ "results": [
+ {
+ "source": "First segment with int ",
+ "target": "Перший сегмент з числом ",
+ "segmentId": 2,
+ "customId": "",
+ "documentName": "none",
+ "sourceLang": "en",
+ "targetLang": "UK",
+ "type": "Manual",
+ "author": "MANAGER",
+ "timestamp": "20250716T084347Z",
+ "markupTable": "OTMXUXLF",
+ "context": "",
+ "additionalInfo": "",
+ "internalKey": "7:1"
+ },
+ {
+ "source": "First segment with int 10",
+ "target": "Перший сегмент з числом 10",
+ "segmentId": 6,
+ "customId": "",
+ "documentName": "none",
+ "sourceLang": "en",
+ "targetLang": "UK",
+ "type": "Manual",
+ "author": "MANAGER",
+ "timestamp": "20250716T084347Z",
+ "markupTable": "OTMXUXLF",
+ "context": "",
+ "additionalInfo": "",
+ "internalKey": "11:1"
+ }
+ ]
+ }
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ },
+ "/t5memory/{memory}/fuzzysearch": {
+ "post": {
+ "summary": "Fuzzy search",
+ "deprecated": false,
+ "description": "https://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-Fuzzysearch",
+ "tags": [],
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "sourceLang": {
+ "type": "string",
+ "description": "rfc5646"
+ },
+ "targetLang": {
+ "type": "string",
+ "description": "rfc5646"
+ },
+ "source": {
+ "type": "string",
+ "description": "Search string to look for"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string",
+ "description": "If there is no markup, default OTMXUXLF would be used.\nMarkup tables should be located inside ~/.t5memory/TABLE/%markup$.TBL"
+ },
+ "context": {
+ "type": "string"
+ },
+ "forceFuzzy": {
+ "type": "integer",
+ "enum": [
+ 1,
+ 0
+ ],
+ "description": "If yes - will return all potential fuzzies\nNo - only first exact match or most relevant matches"
+ },
+ "numOfProposals": {
+ "type": "integer",
+ "description": "Num of expected segments in output. By default it's 5"
+ }
+ },
+ "required": [
+ "sourceLang",
+ "targetLang",
+ "source"
+ ]
+ },
+ "example": {
+ "sourceLang": "en",
+ "targetLang": "uk",
+ "source": "Second segment ",
+ "documentName": "",
+ "markupTable": "OTMXUXLF",
+ "context": ""
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "ReturnValue": {
+ "type": "integer"
+ },
+ "ErrorMsg": {
+ "type": "string"
+ },
+ "NumOfFoundProposals": {
+ "type": "integer"
+ },
+ "searchedSrc": {
+ "type": "string"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "forceFuzzy": {
+ "type": "integer"
+ },
+ "results": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "segmentId": {
+ "type": "integer"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "timestamp": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "additionalInfo": {
+ "type": "string"
+ },
+ "internalKey": {
+ "type": "string"
+ },
+ "matchType": {
+ "type": "string"
+ },
+ "matchRate": {
+ "type": "integer"
+ },
+ "fuzzyWords": {
+ "type": "integer"
+ },
+ "fuzzyDiffs": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "source",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey",
+ "matchType",
+ "matchRate",
+ "fuzzyWords",
+ "fuzzyDiffs"
+ ]
+ }
+ }
+ },
+ "required": [
+ "ReturnValue",
+ "ErrorMsg",
+ "NumOfFoundProposals",
+ "searchedSrc",
+ "customId",
+ "forceFuzzy"
+ ]
+ },
+ "example": {
+ "ReturnValue": 0,
+ "ErrorMsg": "",
+ "NumOfFoundProposals": 2,
+ "searchedSrc": "First segment with int ",
+ "customId": "",
+ "forceFuzzy": 0,
+ "results": [
+ {
+ "source": "First segment with int 10",
+ "target": "Перший сегмент з числом 10",
+ "segmentId": 6,
+ "customId": "",
+ "documentName": "none",
+ "sourceLang": "en",
+ "targetLang": "UK",
+ "type": "Manual",
+ "author": "MANAGER",
+ "timestamp": "20250716T084347Z",
+ "markupTable": "OTMXUXLF",
+ "context": "",
+ "additionalInfo": "",
+ "internalKey": "11:1",
+ "matchType": "Fuzzy",
+ "matchRate": 80,
+ "fuzzyWords": 5,
+ "fuzzyDiffs": 1
+ },
+ {
+ "source": "First segment with int 11",
+ "target": "Перший сегмент з числом 11",
+ "segmentId": 2,
+ "customId": "",
+ "documentName": "none",
+ "sourceLang": "en",
+ "targetLang": "UK",
+ "type": "Manual",
+ "author": "MANAGER",
+ "timestamp": "20250716T084347Z",
+ "markupTable": "OTMXUXLF",
+ "context": "",
+ "additionalInfo": "",
+ "internalKey": "7:1",
+ "matchType": "Fuzzy",
+ "matchRate": 80,
+ "fuzzyWords": 5,
+ "fuzzyDiffs": 1
+ }
+ ]
+ }
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ },
+ "/t5memory/{memory}/getentry": {
+ "post": {
+ "summary": "Get entry",
+ "deprecated": false,
+ "description": "Each segmnet entry in seach payloads has \"internalKey\": \"9:1\" like key-value.\nIn this example 9 is \"recordKey\" and 1 is \"targetKey\".",
+ "tags": [],
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "recordKey": {
+ "type": "string"
+ },
+ "targetKey": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "recordKey",
+ "targetKey"
+ ]
+ },
+ "example": {
+ "recordKey": "8",
+ "targetKey": "2"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "segmentId": {
+ "type": "integer"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "timestamp": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "additionalInfo": {
+ "type": "string"
+ },
+ "internalKey": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "source",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey"
+ ]
+ },
+ "example": {
+ "source": "Third segment",
+ "target": "третій сегмент",
+ "segmentId": 4,
+ "customId": "",
+ "documentName": "none",
+ "sourceLang": "en",
+ "targetLang": "UK",
+ "type": "Manual",
+ "author": "MANAGER",
+ "timestamp": "20250716T084347Z",
+ "markupTable": "OTMXUXLF",
+ "context": "",
+ "additionalInfo": "",
+ "internalKey": "9:1"
+ }
+ }
+ },
+ "headers": {}
+ },
+ "400": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "ReturnValue": {
+ "type": "integer"
+ },
+ "ErrorMsg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "ReturnValue",
+ "ErrorMsg"
+ ]
+ },
+ "example": {
+ "ReturnValue": 939,
+ "ErrorMsg": "Requested entry not found! Next internalKey after requested is : 10:1"
+ }
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ },
+ "/t5memory/{memory}/entry": {
+ "post": {
+ "summary": "Update entry",
+ "deprecated": false,
+ "description": "https://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-Updateentry",
+ "tags": [],
+ "parameters": [
+ {
+ "name": "Accept",
+ "in": "header",
+ "description": "",
+ "required": true,
+ "example": "application/json; charset=utf-8",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Accept-Charset",
+ "in": "header",
+ "description": "",
+ "required": true,
+ "example": "UTF-8",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string",
+ "description": "Segment source string"
+ },
+ "target": {
+ "type": "string",
+ "description": "Segment target string"
+ },
+ "type": {
+ "type": "string",
+ "const": "Manual",
+ "description": "Should be set to \"Manual\"",
+ "example": "Manual"
+ },
+ "markupTable": {
+ "type": "string",
+ "const": "OTMXUXLF",
+ "description": "Should be \"OTMXUXLF\"",
+ "example": "OTMXUXLF"
+ },
+ "sourceLang": {
+ "type": "string",
+ "description": "rfc5646"
+ },
+ "targetLang": {
+ "type": "string",
+ "description": "rfc5646"
+ },
+ "timeStamp": {
+ "type": "string",
+ "pattern": "^\\d{8}T\\d{6}Z$",
+ "format": "yyyyMMdd'T'HHmmss'Z'",
+ "description": "Time of segment creation",
+ "example": "20240111T111443Z"
+ },
+ "documentName": {
+ "type": "string",
+ "description": "Name of document where segmnet comes from"
+ },
+ "author": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string",
+ "description": "Field that will be considered in fuzzy searches. Plays a role of aditional search option"
+ },
+ "save2disk": {
+ "type": "integer",
+ "description": "If true - segment will be written to disk right away, else - only set in RAM and saved when all memory is flushed",
+ "enum": [
+ 1,
+ 0
+ ],
+ "default": 0,
+ "example": 1
+ },
+ "saveDifferentTargetsForSameSource": {
+ "type": "integer",
+ "enum": [
+ 1,
+ 0
+ ],
+ "description": "If param set to 1 - new entry will be saved and old preserved even if all fileds of segmnet except target are same."
+ }
+ },
+ "required": [
+ "source",
+ "target",
+ "sourceLang",
+ "targetLang",
+ "timeStamp",
+ "documentName",
+ "author",
+ "context",
+ "save2disk"
+ ]
+ },
+ "example": {
+ "source": "hello",
+ "target": "again good bye 1",
+ "type": "Manual",
+ "markupTable": "OTMXUXLF",
+ "sourceLang": "de",
+ "targetLang": "en",
+ "timeStamp": "20250112T111443Z",
+ "documentName": "translation.txt",
+ "author": "Project Manager",
+ "context": "",
+ "save2disk": 1,
+ "saveDifferentTargetsForSameSource": 1
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string"
+ },
+ "sourceNPRepl": {
+ "type": "string"
+ },
+ "sourceNorm": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "segmentId": {
+ "type": "integer"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "timestamp": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "additionalInfo": {
+ "type": "string"
+ },
+ "internalKey": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "source",
+ "sourceNPRepl",
+ "sourceNorm",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey"
+ ]
+ },
+ "example": {
+ "source": "Second segment",
+ "sourceNPRepl": "Second segment",
+ "sourceNorm": "Second segment",
+ "target": "Другий сегмент",
+ "segmentId": 14,
+ "customId": "",
+ "documentName": "translation.txt",
+ "sourceLang": "EN",
+ "targetLang": "UK",
+ "type": "Manual",
+ "author": "PROJECT MANAGER",
+ "timestamp": "20240111T111443Z",
+ "markupTable": "OTMXUXLF",
+ "context": "",
+ "additionalInfo": "",
+ "internalKey": "14:1"
+ }
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ },
+ "/t5memory/{memory}": {
+ "delete": {
+ "summary": "Delete TM",
+ "deprecated": false,
+ "description": "",
+ "tags": [],
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "text/plain": {
+ "schema": {
+ "type": "string"
+ },
+ "examples": {}
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Response will contain json with memory name as key and \"deleted\" as value.\nMay return 500 with \"not found(error 48)\" as value that is simply indicates absense of TM",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {}
+ },
+ "example": {
+ "test-tm": "deleted"
+ }
+ }
+ },
+ "headers": {}
+ },
+ "500": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {}
+ },
+ "example": {
+ "test-tm": "not found(error 48)"
+ }
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ },
+ "/t5memory/{memory}/entrydelete": {
+ "post": {
+ "summary": "Delete entry",
+ "deprecated": false,
+ "description": "Each segmnet entry in seach payloads has \"internalKey\": \"9:1\" like key-value.\nIn this example 9 is \"recordKey\" and 1 is \"targetKey\".\nThere is also \"segmentId\" value.\nFor delete entry request it should be provided to validate that current state of t5memory data is same as at the moment when you got internalKey as internal key value may be regenerated at any moment of data processing on import or update rrquest handling.\nSo if you try to delete entry and getting error - try to fetch entry internalKey nad segmentId again and then retry delete action.",
+ "tags": [],
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "recordKey": {
+ "type": "integer"
+ },
+ "targetKey": {
+ "type": "integer"
+ },
+ "segmentId": {
+ "type": "integer"
+ },
+ "save2disk": {
+ "type": "string",
+ "enum": [
+ "1",
+ "0"
+ ],
+ "default": "0",
+ "description": "Save memory to disk right away.\nSaves if not passed.",
+ "example": "1"
+ }
+ },
+ "required": [
+ "recordKey",
+ "targetKey",
+ "segmentId"
+ ]
+ },
+ "example": {
+ "recordKey": 8,
+ "targetKey": 4,
+ "segmentId": 12
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "fileFlushed": {
+ "type": "integer",
+ "description": "Indicates was TM flushed to disk or not. Depends on \"save2disk\" value."
+ },
+ "results": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "segmentId": {
+ "type": "integer"
+ },
+ "customId": {
+ "type": "string"
+ },
+ "documentName": {
+ "type": "string"
+ },
+ "sourceLang": {
+ "type": "string"
+ },
+ "targetLang": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "timestamp": {
+ "type": "string"
+ },
+ "markupTable": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "additionalInfo": {
+ "type": "string"
+ },
+ "internalKey": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "source",
+ "target",
+ "segmentId",
+ "customId",
+ "documentName",
+ "sourceLang",
+ "targetLang",
+ "type",
+ "author",
+ "timestamp",
+ "markupTable",
+ "context",
+ "additionalInfo",
+ "internalKey"
+ ]
+ }
+ },
+ "required": [
+ "fileFlushed",
+ "results"
+ ]
+ },
+ "example": {
+ "fileFlushed": 1,
+ "results": {
+ "source": "Second segment",
+ "target": "Другий сегмент",
+ "segmentId": 14,
+ "customId": "",
+ "documentName": "translation.txt",
+ "sourceLang": "en",
+ "targetLang": "UK",
+ "type": "Manual",
+ "author": "PROJECT MANAGER",
+ "timestamp": "20250811T101311Z",
+ "markupTable": "OTMXUXLF",
+ "context": "",
+ "additionalInfo": "",
+ "internalKey": "14:1"
+ }
+ }
+ }
+ },
+ "headers": {}
+ },
+ "400": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "ReturnValue": {
+ "type": "integer"
+ },
+ "ErrorMsg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "ReturnValue",
+ "ErrorMsg"
+ ]
+ },
+ "example": {
+ "ReturnValue": 14002,
+ "ErrorMsg": "Error: to delete entry by key you should provide all three fields: recordKey, targetKey and segmentId"
+ }
+ }
+ },
+ "headers": {}
+ },
+ "500": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "ReturnValue": {
+ "type": "integer"
+ },
+ "ErrorMsg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "ReturnValue",
+ "ErrorMsg"
+ ]
+ },
+ "example": {
+ "ReturnValue": 5005,
+ "ErrorMsg": ""
+ }
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ },
+ "/t5memory/{memory}/entriesdelete": {
+ "post": {
+ "summary": "Delete batch",
+ "deprecated": false,
+ "description": "Asynchronious operation.\nThis would start reorganize process which would remove like reorganize bad segments and also would remove segments that gives true when checking with provided filters combined with logical AND. So if you provide timestamps and addInfo, only segments within provided timestamp and with that addInfo would not be imported to new TM(check reorganize process). \nEvery parameter is optional, so empty json would just start reorganize async process.\nIf you provide one of timestamps you would get error - please provide both. \nTo add parameter you should set it's SearchMode to be EXACT|CONCORDANCE(non case sensetive)\nIf only searched string provided, but not search mode - you would get error.",
+ "tags": [],
+ "parameters": [],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "type": "string"
+ },
+ "sourceSearchMode": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ },
+ "targetSearchMode": {
+ "type": "string"
+ },
+ "document": {
+ "type": "string"
+ },
+ "documentSearchMode": {
+ "type": "string"
+ },
+ "author": {
+ "type": "string"
+ },
+ "authorSearchMode": {
+ "type": "string"
+ },
+ "addInfo": {
+ "type": "string"
+ },
+ "addInfoSearchMode": {
+ "type": "string"
+ },
+ "context": {
+ "type": "string"
+ },
+ "contextSearchMode": {
+ "type": "string"
+ },
+ "timestampSpanStart": {
+ "type": "string"
+ },
+ "timestampSpanEnd": {
+ "type": "string"
+ },
+ "searchPosition": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "timestampSpanStart",
+ "timestampSpanEnd"
+ ]
+ },
+ "example": {
+ "source": "123",
+ "sourceSearchMode": "contains, CASEINSENSETIVE",
+ "target": "234",
+ "targetSearchMode": "contains, CASEINSENSETIVE",
+ "document": "",
+ "documentSearchMode": "contains, CASEINSENSETIVE",
+ "author": "",
+ "authorSearchMode": "contains, CASEINSENSETIVE",
+ "addInfo": "",
+ "addInfoSearchMode": "contains, CASEINSENSETIVE",
+ "context": "",
+ "contextSearchMode": "contains, CASEINSENSETIVE",
+ "timestampSpanStart": "19691231T230000Z",
+ "timestampSpanEnd": "20240610T220000Z",
+ "searchPosition": ""
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {}
+ }
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ },
+ "/t5memory_service/shutdown": {
+ "post": {
+ "summary": "Shutdown",
+ "deprecated": false,
+ "description": "Safely shutting down the service with\\without saving all loaded tm files to the disk.",
+ "tags": [],
+ "parameters": [
+ {
+ "name": "dontsave",
+ "in": "query",
+ "description": "Skips saving tms, for now value doesn't matter, only presence.\nIf try to save tms before closing, would check if there is still import process going on\nIf there is some, would wait 1 second and check again. \nRepeats last step up to 10 min, then closes service anyway. ",
+ "required": false,
+ "schema": {
+ "type": "integer"
+ }
+ },
+ {
+ "name": "Accept",
+ "in": "header",
+ "description": "",
+ "required": true,
+ "example": "application/json; charset=utf-8",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Accept-Charset",
+ "in": "header",
+ "description": "",
+ "required": true,
+ "example": "UTF-8",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {}
+ }
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ },
+ "/t5memory_service/savetms": {
+ "get": {
+ "summary": "Save TMs",
+ "deprecated": false,
+ "description": "Flushes all filebuffers(TMD, TMI files) into the filesystem. Reset 'Modified' flags for file buffers. \n\nFilebuffer is a file instance of .TMD or .TMI loaded into RAM. It provides better speed and safety when working with files.",
+ "tags": [],
+ "parameters": [
+ {
+ "name": "Accept",
+ "in": "header",
+ "description": "",
+ "required": true,
+ "example": "application/json; charset=utf-8",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Accept-Charset",
+ "in": "header",
+ "description": "",
+ "required": true,
+ "example": "UTF-8",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {}
+ },
+ "example": {
+ "saved 3 tms": "ID9580-de-fr_next-2, ID9612-en-uk, test-memory",
+ "errMsg": ""
+ }
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ },
+ "/t5memory/{memory}/clone": {
+ "post": {
+ "summary": "Clone",
+ "deprecated": false,
+ "description": "Creates TM with the provided name and data cloned from provided memory",
+ "tags": [],
+ "parameters": [
+ {
+ "name": "Accept",
+ "in": "header",
+ "description": "",
+ "required": true,
+ "example": "application/json; charset=utf-8",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Accept-Charset",
+ "in": "header",
+ "description": "",
+ "required": true,
+ "example": "UTF-8",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "newName": {
+ "type": "string",
+ "description": "Name of memory to be crreated"
+ }
+ },
+ "required": [
+ "newName"
+ ]
+ },
+ "example": {
+ "newName": "clonned-tm-1"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "msg": {
+ "type": "string"
+ },
+ "time": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "msg",
+ "time"
+ ]
+ },
+ "example": {
+ "msg": "clonned-tm-1 was cloned successfully",
+ "time": "1 ms"
+ }
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ },
+ "/t5memory/{memory}/reorganize": {
+ "get": {
+ "summary": "Reorganize",
+ "deprecated": false,
+ "description": "Under the hood it creates new tm with $Org- prefix, then reimport all segments one-by-one, and then deletes original TM and rename reorganized TM to replace original. \nThis request should flush tm(from RAM to the disk) before reorganizing\n\nhttps://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-ReorganizeTM\nBoth newEntryIfOnlyContextAndTimestampDifferent and saveDifferentTargetsForSameSource impact how similar translation would be saved. In case if source and other field(doc, author, lang) are the same, but target different, and newEntryIfOnlyContextAndTimestampDifferent is set to true, you would have 2 translation, otherwise you would have 1 translation saved - with higher updateTime. but if you have different attributes, like document, you would have 2 translation anyway. \nnewEntryIfOnlyContextAndTimestampDifferent would also increase number of saved segments. If values was not provided, defaule values from flags would be used.",
+ "tags": [],
+ "parameters": [
+ {
+ "name": "Accept",
+ "in": "header",
+ "description": "",
+ "required": true,
+ "example": "application/json; charset=utf-8",
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "Accept-Charset",
+ "in": "header",
+ "description": "",
+ "required": true,
+ "example": "UTF-8",
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "newEntryIfOnlyContextAndTimestampDifferent": {
+ "type": "string",
+ "enum": [
+ "1",
+ "0"
+ ],
+ "example": "1"
+ },
+ "saveDifferentTargetsForSameSource": {
+ "type": "string",
+ "enum": [
+ "1",
+ "0"
+ ],
+ "example": "1"
+ }
+ }
+ },
+ "examples": {}
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {}
+ }
+ }
+ },
+ "headers": {}
+ }
+ },
+ "security": []
+ }
+ }
+ },
+ "components": {
+ "schemas": {},
+ "securitySchemes": {}
+ },
+ "servers": [],
+ "security": []
+}
\ No newline at end of file
diff --git a/docs/t5memory.openapi.yaml b/docs/t5memory.openapi.yaml
new file mode 100644
index 00000000..be96ee10
--- /dev/null
+++ b/docs/t5memory.openapi.yaml
@@ -0,0 +1,2981 @@
+openapi: 3.0.1
+info:
+ title: t5memory
+ description: ''
+ version: 0.7.36
+tags: []
+paths:
+ /t5memory/{memory}/flush:
+ get:
+ summary: Flush memory
+ deprecated: false
+ description: >-
+ Endpoint is sync(blocking)
+
+
+ If tm is not found on the disk - returns 404
+
+ If tm is not open - returns 400 with message
+
+ Then t5memory requests writes pointer to the tm (so it waits till other
+ requests that's working with the tm would finish) and then it flushes it
+ to the disk
+
+ Could also return an error if flushing got some issue.
+
+ Would not open the tm, if it's not opened yet, but instead would return
+ an error.
+ tags: []
+ parameters: []
+ responses:
+ '200':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ msg:
+ type: string
+ required:
+ - msg
+ example:
+ msg: Mem ID9612-en-uk was flushed to the disk successfully
+ headers: {}
+ security: []
+ /t5memory_service/tagreplacement:
+ post:
+ summary: Tag replacement
+ deprecated: false
+ description: Fuzzy search tag replacement and Import tag replacement test
+ tags: []
+ parameters:
+ - name: Accept
+ in: header
+ description: ''
+ required: true
+ example: application/json; charset=utf-8
+ schema:
+ type: string
+ - name: Accept-Charset
+ in: header
+ description: ''
+ required: true
+ example: UTF-8
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ src:
+ type: string
+ trg:
+ type: string
+ req:
+ type: string
+ description: Used to test Fuzzy search tag replacement
+ required:
+ - src
+ - trg
+ example:
+ src: >-
+ Tap View o get strongdisplayedView two strongUS patents.
+ trg: >-
+ View tap to got strongdosplaydVeiw two strongUS patents.
+ req: >-
+ Tap View o get strongdisplayedView two strongUS
+ patents.
+ responses:
+ '200':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties: {}
+ headers: {}
+ security: []
+ /t5memory_service/flags:
+ get:
+ summary: Flags
+ deprecated: false
+ description: >-
+ Return all available commandline flags. Do not spam too much because
+ gflags documentation says that that's slow. Useful to collect
+ configuration data about t5memory to do debugging.
+ tags: []
+ parameters: []
+ responses:
+ '200':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties: {}
+ example: "{\n {\n \"name\": \"alsologtoemail\",\n \"value\": \"\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"log messages go to these email addresses in addition to logfiles\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"alsologtostderr\",\n \"value\": \"true\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"log messages go to stderr in addition to logfiles\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"colorlogtostderr\",\n \"value\": \"true\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"color messages logged to stderr (if supported by terminal)\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"drop_log_memory\",\n \"value\": \"true\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Drop in-memory buffers of log contents. Logs can grow very quickly and they are rarely read before they need to be evicted from memory. Instead, drop them from memory as soon as they are flushed to disk.\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"log_backtrace_at\",\n \"value\": \"\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Emit a backtrace when logging at file:linenum.\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"log_dir\",\n \"value\": \"/root/.t5memory/LOG/\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"If specified, logfiles are written into this directory instead of the default logging directory.\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"log_link\",\n \"value\": \"\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Put additional links to the log files in this directory\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"log_prefix\",\n \"value\": \"true\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Prepend the log prefix to the start of each log line\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"logbuflevel\",\n \"value\": \"0\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Buffer log messages logged at this level or lower (-1 means don't buffer; 0 means buffer INFO only; ...)\",\n \"type\": \"int32\",\n \"default\": \"0\"\n },\n {\n \"name\": \"logbufsecs\",\n \"value\": \"30\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Buffer log messages for at most this many seconds\",\n \"type\": \"int32\",\n \"default\": \"30\"\n },\n {\n \"name\": \"logemaillevel\",\n \"value\": \"999\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Email log messages logged at this level or higher (0 means email all; 3 means email FATAL only; ...)\",\n \"type\": \"int32\",\n \"default\": \"999\"\n },\n {\n \"name\": \"logfile_mode\",\n \"value\": \"436\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Log file mode/permissions.\",\n \"type\": \"int32\",\n \"default\": \"436\"\n },\n {\n \"name\": \"logmailer\",\n \"value\": \"/bin/mail\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Mailer used to send logging email\",\n \"type\": \"string\",\n \"default\": \"/bin/mail\"\n },\n {\n \"name\": \"logtostderr\",\n \"value\": \"false\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"log messages go to stderr instead of logfiles\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"max_log_size\",\n \"value\": \"1800\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"approx. maximum log file size (in MB). A value of 0 will be silently overridden to 1.\",\n \"type\": \"int32\",\n \"default\": \"1800\"\n },\n {\n \"name\": \"minloglevel\",\n \"value\": \"0\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Messages logged at a lower level than this don't actually get logged anywhere\",\n \"type\": \"int32\",\n \"default\": \"0\"\n },\n {\n \"name\": \"stderrthreshold\",\n \"value\": \"2\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"log messages at or above this level are copied to stderr in addition to logfiles. This flag obsoletes --alsologtostderr.\",\n \"type\": \"int32\",\n \"default\": \"2\"\n },\n {\n \"name\": \"stop_logging_if_full_disk\",\n \"value\": \"false\"\t\",\tfrom\": \"./src/logging.cc\",\n \"description\": \"Stop attempting to log to disk if the disk is full.\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"symbolize_stacktrace\",\n \"value\": \"true\"\t\",\tfrom\": \"./src/utilities.cc\",\n \"description\": \"Symbolize the stack trace in the tombstone\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"v\",\n \"value\": \"2\"\t\",\tfrom\": \"./src/vlog_is_on.cc\",\n \"description\": \"Show all VLOG(m) messages for m <= this. Overridable by --vmodule.\",\n \"type\": \"int32\",\n \"default\": \"0\"\n },\n {\n \"name\": \"vmodule\",\n \"value\": \"\"\t\",\tfrom\": \"./src/vlog_is_on.cc\",\n \"description\": \"per-module verbose level. Argument is a comma-separated list of =. is a glob pattern, matched against the filename base (that is, name ignoring .cc/.h./-inl.h). overrides any value given by --v.\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"flagfile\",\n \"value\": \"\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags.cc\",\n \"description\": \"load flags from file\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"fromenv\",\n \"value\": \"\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags.cc\",\n \"description\": \"set flags from the environment [use 'export FLAGS_flag1=value']\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"tryfromenv\",\n \"value\": \"\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags.cc\",\n \"description\": \"set flags from the environment if present\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"undefok\",\n \"value\": \"\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags.cc\",\n \"description\": \"comma-separated list of flag names that it is okay to specify on the command line even if the program does not define a flag with that name. IMPORTANT: flags in this list that have arguments MUST use the flag=value format\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"tab_completion_columns\",\n \"value\": \"80\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_completions.cc\",\n \"description\": \"Number of columns to use in output for tab completion\",\n \"type\": \"int32\",\n \"default\": \"80\"\n },\n {\n \"name\": \"tab_completion_word\",\n \"value\": \"\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_completions.cc\",\n \"description\": \"If non-empty, HandleCommandLineCompletions() will hijack the process and attempt to do bash-style command line flag completion on this value.\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"help\",\n \"value\": \"false\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"show help on all flags [tip: all flags can have two dashes]\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"helpfull\",\n \"value\": \"false\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"show help on all flags -- same as -help\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"helpmatch\",\n \"value\": \"\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"show help on modules whose name contains the specified substr\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"helpon\",\n \"value\": \"\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"show help on the modules named by this flag value\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"helppackage\",\n \"value\": \"false\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"show help on all modules in the main package\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"helpshort\",\n \"value\": \"false\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"show help on only the main module for this program\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"helpxml\",\n \"value\": \"false\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"produce an xml version of help\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"version\",\n \"value\": \"false\"\t\",\tfrom\": \"/build/gflags-MeLouv/gflags-2.2.2/src/gflags_reporting.cc\",\n \"description\": \"show version and build info and exit\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"folly_memory_idler_madvise_stacks\",\n \"value\": \"true\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/folly/folly/detail/MemoryIdler.cpp\",\n \"description\": \"if enabled, folly memory-idler madvises dontneed stacks on thread idle\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"folly_memory_idler_purge_arenas\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/folly/folly/detail/MemoryIdler.cpp\",\n \"description\": \"if enabled, folly memory-idler purges jemalloc arenas on thread idle\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"dynamic_iothreadpoolexecutor\",\n \"value\": \"true\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/folly/folly/executors/IOThreadPoolExecutor.cpp\",\n \"description\": \"IOThreadPoolExecutor will dynamically create threads\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"folly_iothreadpoolexecutor_max_read_at_once\",\n \"value\": \"-1\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/folly/folly/executors/IOThreadPoolExecutor.cpp\",\n \"description\": \"IOThreadPoolExecutor will use this value as default for maxReadAtOnce in its event bases, valid values are [0, inf)\",\n \"type\": \"int32\",\n \"default\": \"-1\"\n },\n {\n \"name\": \"threadtimeout_ms\",\n \"value\": \"60000\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/folly/folly/executors/ThreadPoolExecutor.cpp\",\n \"description\": \"Idle time before ThreadPoolExecutor threads are joined\",\n \"type\": \"int64\",\n \"default\": \"60000\"\n },\n {\n \"name\": \"observer_manager_pool_size\",\n \"value\": \"4\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/folly/folly/observer/detail/ObserverManager.cpp\",\n \"description\": \"How many internal threads ObserverManager should use\",\n \"type\": \"int32\",\n \"default\": \"4\"\n },\n {\n \"name\": \"folly_hazptr_use_executor\",\n \"value\": \"true\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/folly/folly/synchronization/Hazptr.cpp\",\n \"description\": \"Use an executor for hazptr asynchronous reclamation\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"dcache_unit_test\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/libs/proxygen/_build/deps/wangle/wangle/ssl/SSLSessionCacheManager.cpp\",\n \"description\": \"All VIPs share one session cache\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"zlib_compressor_buffer_growth\",\n \"value\": \"2024\"\t\",\tfrom\": \"/home/libs/proxygen/lib/utils/ZlibStreamCompressor.cpp\",\n \"description\": \"The buffer growth size to use during IOBuf zlib deflation\",\n \"type\": \"int64\",\n \"default\": \"2024\"\n },\n {\n \"name\": \"request_number\",\n \"value\": \"true\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/RestAPI/ProxygenHandler.cpp\",\n \"description\": \"Include request sequence number in response\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"add_tokens_to_fuzzy\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \" If set to true, list of tokens would be returned in fuzzy responce. Could make execution a bit slower, could be usefull if you think that fuzzy match is wrong to check how tokens was parsed in sentence and what hashes they had(or track hash collisions)\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"allowLoadingMultipleTmsSimultaneously\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, multiple tms could be loaded from the disk at the same time. Loading multiple TMs at the same time was disabled because of I/0 disk operation limit at the server. Enable this if you don't care about num of IO operations and want some perfomance boost\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"allowedram\",\n \"value\": \"10000\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets amought RAM(in MB) allowed for service to use\",\n \"type\": \"int64\",\n \"default\": \"5000\"\n },\n {\n \"name\": \"allowedtmdsize\",\n \"value\": \"190\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets max size of tmd file(in MB) after which t5m would not allow to add new data to the tm. This helps fight btree and lookup table issues when tm gets bigger.\",\n \"type\": \"int64\",\n \"default\": \"190\"\n },\n {\n \"name\": \"debug_sleep_in_request_run\",\n \"value\": \"0\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set, provide artificial delay in every request handling execution equal to provided num of microseconds\",\n \"type\": \"int64\",\n \"default\": \"0\"\n },\n {\n \"name\": \"disable_aslr\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, process personality would be set to ADDR_NO_RANDOMIZE, affect memory layout, set to true if you have some linker or asan issue at the launch\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"enable_newlines_in_logs\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"(not working - instead of using function to remove newlines in runtime, logs was edited to have better perfomance)if set to true, would keep newline symbols in the logs, otherwise(by default) newlines would be removed and logs would be oneliners. This just calls function to remove newlines,\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"flush_tm_at_shutdown\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, flushes tm when shutting down the app not using shutdown request\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"flush_tm_to_disk_with_every_update\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, flushes tm to disk with every successfull update request\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"forbiddeletefiles\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Set to true to keep all files(including temporary and tm)\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"keep_tm_backups\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"if set to true, when saving tmd and tmi files, old copies would be saved with .old suffix\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"limit_num_of_active_requests\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, it would be possible to handle only up to servicethreads-1 requests at the same time, the last thread would respond with 503 to eliminate creating queue of requests waiting to be handled.\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"logMutexes\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"if set to true you would see mutex logs\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"log_every_request_end\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets log for every request end with it's url, method etc...\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"log_every_request_start\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets log for every request call with it's url, method etc...\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"log_file_locks\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, action about locking tmd and tmi file would be logged\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"log_hashes_in_hash_sentence\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \" If set to true, and --v=2 and --t5loglevel=4, tokens and their hashed would be logged, could be usefull if you think that fuzzy match is wrong to check how tokens was parsed in sentence and what hashes they had(or track hash collisions)\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"log_memmove_in_compareputdata\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"if set to true, when saving segment and causing memmove in compareputdata functions, just before memmove, data would be logged - use this to debug btree crashes. In that spot in come corrupted data, memmove could crash t5memory(or cause asan crash). Just to set low log level(v=2,t5logleve=0), reproduce the crash and check if the last log was one that started with \"memmove size = ...\"\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"log_tm_lifetime\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \" If set to true, and --v=2 and --t5loglevel=4, TMs ctor(when tm object was created-so before it started loading tm) and dctor(when tm object was destroyed - so after closing tm) would have transaction level logs\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"maxBadSegmentsIdsSaved\",\n \"value\": \"20\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Defines how many segments(it's id's) that failed during import or reorganize would be saved to the status response\",\n \"type\": \"int32\",\n \"default\": \"20\"\n },\n {\n \"name\": \"newEntryIfOnlyContextAndTimestampDifferent\",\n \"value\": \"true\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If it is set to true, the behavior should be: A new entry should be saved to the TM, if only timestamp and context are different and all other params the same;\t If it is set to false, the beahvior should be: if context is different and timestamp is different, the context and timestamp of the new to be saved segment should overwrite the context and segment of an entry, that already exists and where all other params are the same as in the new segment. This is basically the same behavior it would have, if context would not be set for both segments (the old and the new).\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"port\",\n \"value\": \"4040\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"What port to listen on\",\n \"type\": \"int32\",\n \"default\": \"4080\"\n },\n {\n \"name\": \"saveDifferentTargetsForSameSource\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If it is set to true, when saving new segment, and found matching source and attributes, to replace previous need to have matching targets(old target = new target), if false -> previous target would be replaced with new one. In other words, true would make t5memory save multiple translation to exactly same source and attributes(document, authors etc), false would still save multiple pairs of attributes, but translation could be replaced with newer.\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"servicename\",\n \"value\": \"t5memory\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets service name to use in url\",\n \"type\": \"string\",\n \"default\": \"t5memory\"\n },\n {\n \"name\": \"servicethreads\",\n \"value\": \"10\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets amought of worker threads for service\",\n \"type\": \"int32\",\n \"default\": \"5\"\n },\n {\n \"name\": \"skipStartupLogs\",\n \"value\": \"true\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"if set to true, values from --t5loglevel would be applied immediately, if set to false- you would see all startup logs and --v and --t5loglevel would be applied only after start of the service and it's init message. Set to false if you have issues at startup\",\n \"type\": \"bool\",\n \"default\": \"true\"\n },\n {\n \"name\": \"skip_default_flags_in_init_msg\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"if set to true, all default flags would be skipped in init msg\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"suppressTmVersionCheck\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If sets to true, allow to open tms, which was created in version, that's outside of supported versions scope. You can use this if you have version mismatch error\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"t5_ip\",\n \"value\": \"\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Which ip to use in t5memory(default is any). Should be in format '1.1.1.1', default is to listen to all available ip\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n {\n \"name\": \"t5globversion_max_supported\",\n \"value\": \"0\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"set max global version in which tm was created to be supported for open in current. it's the X(GLOB) in vX.Y.Z; by default it's current version\",\n \"type\": \"int32\",\n \"default\": \"0\"\n },\n {\n \"name\": \"t5globversion_min_supported\",\n \"value\": \"0\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"sets minimal global version in which tm was created to be supported for open in current. it's the X(GLOB) in vX.Y.Z\",\n \"type\": \"int32\",\n \"default\": \"0\"\n },\n {\n \"name\": \"t5loglevel\",\n \"value\": \"4\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets t5memory log level threshold from DEVELOP(0) to TRANSACTION(6)\",\n \"type\": \"int32\",\n \"default\": \"2\"\n },\n {\n \"name\": \"t5majversion_max_supported\",\n \"value\": \"7\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"set max major version in which tm was created to be supported for open in current. it's the Y(MAJ) in vX.Y.Z; by default it's current version\",\n \"type\": \"int32\",\n \"default\": \"7\"\n },\n {\n \"name\": \"t5majversion_min_supported\",\n \"value\": \"5\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"sets minimal major version in which tm was created to be supported for open in current. it's the Y(MAJ) in vX.Y.Z\",\n \"type\": \"int32\",\n \"default\": \"5\"\n },\n {\n \"name\": \"t5minversion_max_supported\",\n \"value\": \"14\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"(disabled)sets max minor version in which tm was created to be supported for open in current. it's the Z(MIN) in vX.Y.Z; by default it's current version\",\n \"type\": \"int32\",\n \"default\": \"14\"\n },\n {\n \"name\": \"t5minversion_min_supported\",\n \"value\": \"60\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"sets minimal minor version in which tm was created to be supported for open in current. it's the Z(MIN) in vX.Y.Z\",\n \"type\": \"int32\",\n \"default\": \"60\"\n },\n {\n \"name\": \"timeout\",\n \"value\": \"180000\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets timeout for service request handling\",\n \"type\": \"int32\",\n \"default\": \"180000\"\n },\n {\n \"name\": \"tmListLockDefaultTimeout\",\n \"value\": \"3000\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets tm mutex lock timeout(in ms) for TM list(which is used to open and close tms, and hold list of opened tms), after which operation would be canceled and mutex would return an error, if set to 0, mutex lock would be waited without timeout\",\n \"type\": \"int64\",\n \"default\": \"3000\"\n },\n {\n \"name\": \"tmLockDefaultTimeout\",\n \"value\": \"3000\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets tm mutex lock timeout(in ms) for TM after which operation would be canceled and mutex would return an error, if set to 0, mutex lock would be waited without timeout\",\n \"type\": \"int64\",\n \"default\": \"3000\"\n },\n {\n \"name\": \"tmMaxIdleTimeSec\",\n \"value\": \"7200\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set some value, except, 0, during request, tm list would bee cleaned up from tms that are longer inactive than this number\",\n \"type\": \"int64\",\n \"default\": \"7200\"\n },\n {\n \"name\": \"tmRequestLockDefaultTimeout\",\n \"value\": \"3000\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets tm mutex lock timeout(in ms) for part where request is requesting tm(which is used to open and close tms, and hold list of opened tms), after which operation would be canceled and mutex would return an error, if set to 0, mutex lock would be waited without timeout\",\n \"type\": \"int64\",\n \"default\": \"3000\"\n },\n {\n \"name\": \"triplesthreshold\",\n \"value\": \"5\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"Sets threshold to pre fuzzy filtering based on hashes of neibour tokens, range[0...100]. It's pre fuzzy filtering of the segments, when t5memory tries to predict how high fuzzy rate would be for some segment based on data that doesn't require as mych work as fuzzy calculations. When value is low, it can select more suggestions for fuzzy calculation, but if it set high, some best matches could be skipped. In opentm2 default value was 33, but that value seems like not working well with segments, where there are a lot of tags.\",\n \"type\": \"int32\",\n \"default\": \"5\"\n },\n {\n \"name\": \"useTimedMutexesForReorganizeAndImport\",\n \"value\": \"false\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, in reorganize or import thread would be used mutexes with timeouts, and reorganizee or import could be canceled, false(by default) - would be used non timed mutexes\",\n \"type\": \"bool\",\n \"default\": \"false\"\n },\n {\n \"name\": \"wait_for_import_and_reorganize_requests\",\n \"value\": \"true\"\t\",\tfrom\": \"/home/translate5-tm-service-source/source/otmd.cpp\",\n \"description\": \"If set to true, waiting for all import and reorganize processes to be done at shutdown when not using shutdown request\",\n \"type\": \"bool\",\n \"default\": \"true\"\n }\n}"
+ headers: {}
+ security: []
+ /t5memory/{memory}/multifuzzysearch:
+ post:
+ summary: Multifuzzy
+ deprecated: false
+ description: Sends multiple fuzzysearches in the same tm in a row
+ tags: []
+ parameters: []
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ requests:
+ type: array
+ items:
+ type: object
+ properties:
+ sourceLang:
+ type: string
+ targetLang:
+ type: string
+ source:
+ type: string
+ documentName:
+ type: string
+ context:
+ type: string
+ customId:
+ type: string
+ description: If provided will be ased as key in response block
+ required:
+ - sourceLang
+ - targetLang
+ - source
+ - documentName
+ - context
+ required:
+ - requests
+ example:
+ requests:
+ - sourceLang: en
+ targetLang: uk
+ source: First segment with int
+ documentName: ''
+ context: ''
+ customId: first
+ - sourceLang: en
+ targetLang: uk
+ source: Third segment with
+ documentName: ''
+ context: ''
+ customId: second
+ responses:
+ '200':
+ description: >-
+ Each response object in responses has a key and value of it contains
+ response of simple fuzzy search.
+
+ Name of a key comes from "customId" in request.
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ responses:
+ type: object
+ properties:
+ first:
+ type: object
+ properties:
+ ReturnValue:
+ type: integer
+ ErrorMsg:
+ type: string
+ NumOfFoundProposals:
+ type: integer
+ searchedSrc:
+ type: string
+ customId:
+ type: string
+ forceFuzzy:
+ type: integer
+ results:
+ type: array
+ items:
+ type: object
+ properties:
+ source:
+ type: string
+ target:
+ type: string
+ segmentId:
+ type: integer
+ customId:
+ type: string
+ documentName:
+ type: string
+ sourceLang:
+ type: string
+ targetLang:
+ type: string
+ type:
+ type: string
+ author:
+ type: string
+ timestamp:
+ type: string
+ markupTable:
+ type: string
+ context:
+ type: string
+ additionalInfo:
+ type: string
+ internalKey:
+ type: string
+ matchType:
+ type: string
+ matchRate:
+ type: integer
+ fuzzyWords:
+ type: integer
+ fuzzyDiffs:
+ type: integer
+ required:
+ - source
+ - target
+ - segmentId
+ - customId
+ - documentName
+ - sourceLang
+ - targetLang
+ - type
+ - author
+ - timestamp
+ - markupTable
+ - context
+ - additionalInfo
+ - internalKey
+ - matchType
+ - matchRate
+ - fuzzyWords
+ - fuzzyDiffs
+ required:
+ - ReturnValue
+ - ErrorMsg
+ - NumOfFoundProposals
+ - searchedSrc
+ - customId
+ - forceFuzzy
+ description: >-
+ key "first" is an exampe. it was set because request
+ has "customId": "first"
+ second:
+ type: object
+ properties:
+ ReturnValue:
+ type: integer
+ ErrorMsg:
+ type: string
+ NumOfFoundProposals:
+ type: integer
+ searchedSrc:
+ type: string
+ customId:
+ type: string
+ forceFuzzy:
+ type: integer
+ results:
+ type: array
+ items:
+ type: object
+ properties:
+ source:
+ type: string
+ target:
+ type: string
+ segmentId:
+ type: integer
+ customId:
+ type: string
+ documentName:
+ type: string
+ sourceLang:
+ type: string
+ targetLang:
+ type: string
+ type:
+ type: string
+ author:
+ type: string
+ timestamp:
+ type: string
+ markupTable:
+ type: string
+ context:
+ type: string
+ additionalInfo:
+ type: string
+ internalKey:
+ type: string
+ matchType:
+ type: string
+ matchRate:
+ type: integer
+ fuzzyWords:
+ type: integer
+ fuzzyDiffs:
+ type: integer
+ required:
+ - source
+ - target
+ - segmentId
+ - customId
+ - documentName
+ - sourceLang
+ - targetLang
+ - type
+ - author
+ - timestamp
+ - markupTable
+ - context
+ - additionalInfo
+ - internalKey
+ - matchType
+ - matchRate
+ - fuzzyWords
+ - fuzzyDiffs
+ required:
+ - ReturnValue
+ - ErrorMsg
+ - NumOfFoundProposals
+ - searchedSrc
+ - customId
+ - forceFuzzy
+ description: >-
+ key "second" is an exampe. it was set because request
+ has "customId": "second"
+ required:
+ - first
+ - second
+ required:
+ - responses
+ example:
+ responses:
+ first:
+ ReturnValue: 0
+ ErrorMsg: ''
+ NumOfFoundProposals: 2
+ searchedSrc: First segment with int
+ customId: first
+ forceFuzzy: 0
+ results:
+ - source: First segment with int 10
+ target: Перший сегмент з числом 10
+ segmentId: 6
+ customId: ''
+ documentName: none
+ sourceLang: en
+ targetLang: UK
+ type: Manual
+ author: MANAGER
+ timestamp: 20250716T084347Z
+ markupTable: OTMXUXLF
+ context: ''
+ additionalInfo: ''
+ internalKey: '10:1'
+ matchType: Fuzzy
+ matchRate: 80
+ fuzzyWords: 5
+ fuzzyDiffs: 1
+ - source: >-
+ First segment with int
+ target: >-
+ Перший сегмент з числом
+ segmentId: 2
+ customId: ''
+ documentName: none
+ sourceLang: en
+ targetLang: UK
+ type: Manual
+ author: MANAGER
+ timestamp: 20250716T084347Z
+ markupTable: OTMXUXLF
+ context: ''
+ additionalInfo: ''
+ internalKey: '7:1'
+ matchType: Fuzzy
+ matchRate: 80
+ fuzzyWords: 5
+ fuzzyDiffs: 1
+ second:
+ ReturnValue: 0
+ ErrorMsg: ''
+ NumOfFoundProposals: 2
+ searchedSrc: Third segment with
+ customId: second
+ forceFuzzy: 0
+ results:
+ - source: Third segment with int 10 and float 1.100
+ target: >-
+ третій сегмент з числом 10 і 1.100, друге захищене як
+ ціле з точкою
+ segmentId: 8
+ customId: ''
+ documentName: none
+ sourceLang: en
+ targetLang: UK
+ type: Manual
+ author: MANAGER
+ timestamp: 20250716T084347Z
+ markupTable: OTMXUXLF
+ context: ''
+ additionalInfo: ''
+ internalKey: '11:1'
+ matchType: Fuzzy
+ matchRate: 37
+ fuzzyWords: 8
+ fuzzyDiffs: 5
+ - source: >-
+ Third segment with int and float
+ target: >-
+ третій сегмент з числом і , друге захищене як ціле з точкою
+ segmentId: 4
+ customId: ''
+ documentName: none
+ sourceLang: en
+ targetLang: UK
+ type: Manual
+ author: MANAGER
+ timestamp: 20250716T084347Z
+ markupTable: OTMXUXLF
+ context: ''
+ additionalInfo: ''
+ internalKey: '8:1'
+ matchType: Fuzzy
+ matchRate: 37
+ fuzzyWords: 8
+ fuzzyDiffs: 5
+ headers: {}
+ security: []
+ /t5memory/{memory}/multiupdate:
+ post:
+ summary: Multi Update
+ deprecated: false
+ description: Send multiple updateEntry requests to the same tm with one call
+ tags: []
+ parameters: []
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ requests:
+ type: array
+ items:
+ type: object
+ properties:
+ customId:
+ type: string
+ description: >-
+ If provided will be used as field name for result in
+ response
+ source:
+ type: string
+ target:
+ type: string
+ type:
+ type: string
+ markupTable:
+ type: string
+ targetLang:
+ type: string
+ sourceLang:
+ type: string
+ documentName:
+ type: string
+ author:
+ type: string
+ context:
+ type: string
+ save2disk:
+ type: string
+ enum:
+ - '1'
+ - '0'
+ description: >-
+ If 1 provided will save new segmnet to disk right
+ away, else - only in RAM until flush happens
+ required:
+ - source
+ - target
+ - targetLang
+ - sourceLang
+ - documentName
+ - author
+ - context
+ required:
+ - requests
+ example:
+ requests:
+ - customId: fourth
+ source: Fourth segmnet
+ target: Четвертий сегмент
+ type: Manual
+ markupTable: OTMXUXLF
+ targetLang: en
+ sourceLang: uk
+ documentName: test.xlsx.sdlxliff
+ author: Project Manager
+ context: '390'
+ - customId: fifth
+ source: Fifth segment
+ target: Пʼятий сегмент
+ type: Manual
+ markupTable: OTMXUXLF
+ targetLang: en
+ sourceLang: uk
+ documentName: translation.docx
+ author: Editor
+ context: '200'
+ responses:
+ '200':
+ description: >-
+ Each response object in responses has a key and value of it contains
+ response of simple update.
+
+ Name of a key comes from "customId" in request.
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ responses:
+ type: object
+ properties:
+ fourth:
+ type: object
+ properties:
+ source:
+ type: string
+ sourceNPRepl:
+ type: string
+ sourceNorm:
+ type: string
+ target:
+ type: string
+ segmentId:
+ type: integer
+ customId:
+ type: string
+ documentName:
+ type: string
+ sourceLang:
+ type: string
+ targetLang:
+ type: string
+ type:
+ type: string
+ author:
+ type: string
+ timestamp:
+ type: string
+ markupTable:
+ type: string
+ context:
+ type: string
+ additionalInfo:
+ type: string
+ internalKey:
+ type: string
+ required:
+ - source
+ - sourceNPRepl
+ - sourceNorm
+ - target
+ - segmentId
+ - customId
+ - documentName
+ - sourceLang
+ - targetLang
+ - type
+ - author
+ - timestamp
+ - markupTable
+ - context
+ - additionalInfo
+ - internalKey
+ description: Key "fourth" comes from request "customId"
+ fifth:
+ type: object
+ properties:
+ source:
+ type: string
+ sourceNPRepl:
+ type: string
+ sourceNorm:
+ type: string
+ target:
+ type: string
+ segmentId:
+ type: integer
+ customId:
+ type: string
+ documentName:
+ type: string
+ sourceLang:
+ type: string
+ targetLang:
+ type: string
+ type:
+ type: string
+ author:
+ type: string
+ timestamp:
+ type: string
+ markupTable:
+ type: string
+ context:
+ type: string
+ additionalInfo:
+ type: string
+ internalKey:
+ type: string
+ required:
+ - source
+ - sourceNPRepl
+ - sourceNorm
+ - target
+ - segmentId
+ - customId
+ - documentName
+ - sourceLang
+ - targetLang
+ - type
+ - author
+ - timestamp
+ - markupTable
+ - context
+ - additionalInfo
+ - internalKey
+ required:
+ - fourth
+ - fifth
+ save2disk:
+ type: string
+ enum:
+ - '1'
+ - '0'
+ description: Represents if new segmnets are saved to disk right away
+ required:
+ - responses
+ - save2disk
+ example:
+ responses:
+ fourth:
+ source: Fourth segmnet
+ sourceNPRepl: Fourth segmnet
+ sourceNorm: Fourth segmnet
+ target: Четвертий сегмент
+ segmentId: 9
+ customId: fourth
+ documentName: test.xlsx.sdlxliff
+ sourceLang: UK
+ targetLang: EN
+ type: Manual
+ author: PROJECT MANAGER
+ timestamp: 20250812T125637Z
+ markupTable: OTMXUXLF
+ context: '390'
+ additionalInfo: ''
+ internalKey: '12:1'
+ fifth:
+ source: Fifth segment
+ sourceNPRepl: Fifth segment
+ sourceNorm: Fifth segment
+ target: Пʼятий сегмент
+ segmentId: 10
+ customId: fifth
+ documentName: translation.docx
+ sourceLang: UK
+ targetLang: EN
+ type: Manual
+ author: EDITOR
+ timestamp: 20250812T125637Z
+ markupTable: OTMXUXLF
+ context: '200'
+ additionalInfo: ''
+ internalKey: '13:1'
+ save2disk: '0'
+ headers: {}
+ security: []
+ /t5memory/{memory}/tables:
+ get:
+ summary: Tables
+ deprecated: false
+ description: >-
+ Get author, lang, langGroup(virtual- created in runtime and not saved on
+ the disk), tagtable(deprecated - only one record), document(long
+ filename, long filename caseignore-virtual, short filename- part
+ deprecated)
+
+
+ Tables are provided in format - name(internal key): "position)
+ idInTable:value;"
+
+
+ https://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-Tables
+
+ When adding new entry, for new Id t5memory uses basicaly size of the
+ table before adding+1, so Id should start from id=1.
+
+ When doing fuzzy search, some field could also be saved to the table, to
+ generate then id(or find matching) to compare with saved data.
+
+ There are 2 types of entries- older, fixed size, and long filename. For
+ older, every entry has the same size, 39 bytes+endOfLine. You can have
+ up to 389 entries saved in that way in each of the tables. Longname
+ table manage size dynamically, so it's not clear what's the maximum
+ size, but for filenames there are duplicates in old style docname table
+ and in longname(which are used only for this type of data). For filename
+ search, first used longname table, then generated on tm loading
+ caseignore longname table, then short name table. Usually entries in
+ tables are caseignore.
+
+
+ In the record t5memory saves only id to the table. Maybe it make sense
+ to implement endpoint to edit that table, if something is missing or
+ corrupted. Exception for saving id are context and additional info, some
+ data, that could be saved as int(segId, time), and source and target.
+
+ To clear or fix tag tables, you need to do reorganize, but if some entry
+ is missing from the table, you would not restore it on export or segment
+ exctraction via id. So tables could be used to check health of the tm.
+ And for some ways for concordance search or some other checks.
+ tags: []
+ parameters:
+ - name: Accept
+ in: header
+ description: ''
+ required: false
+ example: application/json
+ schema:
+ type: string
+ responses:
+ '200':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties: {}
+ example: "{\n \"tableName(additional info)(INTERNAL_KEY_OF_THE_TABLE)\": \"position)idInTable: value;\",\n \"tagTablesTable(4)\": \"0)0: \\\"\\\"; \",\n \"langTable(1)\": \"0)2: \\\"EN\\\"; 1)1: \\\"UK\\\"; 2)0: \\\"\\\"; \",\n \"langGroupTable(virtual)(8)\":\"0)1: \\\"E\\\"; 1)2: \\\"U\\\"; 2)0: \\\"\0\\\"; \",\n \"authors(3)\": \"0)3: \\\"EDITOR\\\"; 1)1: \\\"MANAGER\\\"; 2)2: \\\"PROJECT MANAGER\\\"; 3)0: \\\"\\\"; \",\n \"filenames(long)(5)\": \"0)1: \\\"none\\\"; 1)1: \\\"none\\\"; 2)1: \\\"none\\\"; 3)2: \\\"test.xlsx.sdlxliff\\\"; 4)5: \\\"test.xlsx.sdlxliff\\\"; 5)6: \\\"translation.docx\\\"; 6)0: \\\"\\\"; \",\n \"filenames(long, caseign, virtual)(5)\": \"0)1: \\\"NONE\\\"; 1)1: \\\"NONE\\\"; 2)1: \\\"NONE\\\"; 3)5: \\\"TEST.XLSX.SDLXLIFF\\\"; 4)6: \\\"TRANSLATION.DOCX\\\"; 5)2: \\\"TRANSLATION.TXT\\\"; 6)0: \\\"\\\"; \",\n \"filenames(short)(2)\": \"0)1: \\\"none\\\"; 1)5: \\\"test.xlsx.sdlxliff\\\"; 2)6: \\\"translation.docx\\\"; 3)0: \\\"\\\"; \"\n}"
+ headers: {}
+ security: []
+ /t5memory/{memory}/addtotable:
+ post:
+ summary: Add to table
+ deprecated: false
+ description: >-
+ You can add new entry to the tables but then it's better to reorganize
+ tm(in case if after adding new entry with missing id and there are other
+ entry with the same value but other id - which could be the case- in
+ binary search that could cause problems - so just reorganize it
+ afterwards). You can check table by just doing something like full
+ export(or concordance search for full tm), and check logs for that 2222
+ errors.
+
+
+ Values shouldn't be longer than 39 bytes(utf8), and 256 for
+ filename,it's tables limits, for that it also have checks.
+
+ In cases like with those tms, you can also check if x-1 and x+1 id is
+ present. Usually they are in those bug.
+
+ also you can check tables via tables request
+
+ Also logicaly FILE_KEY=2, but that was only for shortname, which was
+ also 39 bytes, but real key for long name table is 5. But for requests
+ and internal handling t5memory uses 2.
+
+ Id should be between 1 and 65k, request also checks for that
+ tags: []
+ parameters: []
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ value:
+ type: string
+ entryId:
+ type: integer
+ tableKey:
+ type: integer
+ required:
+ - value
+ - entryId
+ - tableKey
+ example:
+ value: MY new entry
+ entryId: 100
+ tableKey: 2
+ responses:
+ '200':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties: {}
+ examples:
+ '1':
+ summary: Invalid table key
+ value:
+ ReturnValue: 400
+ ErrorMsg: >-
+ Invalid table key(0); available keys = LANG_KEY(1),
+ FILE_KEY(2), AUTHOR_KEY(3)
+ '2':
+ summary: Table already have entry with matching id
+ value:
+ ReturnValue: 400
+ ErrorMsg: >-
+ Id match in Table 2 already have entry with matching id =
+ 100 and value = "Teaser Page.xlsx";
+ '3':
+ summary: Value field is empty
+ value:
+ ReturnValue: 400
+ ErrorMsg: Value field is empty
+ headers: {}
+ security: []
+ /t5memory/:
+ post:
+ summary: Create TM
+ deprecated: false
+ description: ''
+ tags: []
+ parameters: []
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ name:
+ type: string
+ description: New TM name
+ sourceLang:
+ type: string
+ description: rfc5646
+ data:
+ type: string
+ deprecated: true
+ description: |-
+ Binary TM file encode with base64.
+ Can be passed to create TM with data right away.
+ Use with cautios!
+ required:
+ - name
+ - sourceLang
+ examples:
+ '1':
+ value:
+ name: examle_tm2
+ sourceLang: de-DE
+ summary: Create TM
+ '2':
+ value:
+ name: test-memory
+ sourceLang: en-GB
+ data: >-
+ UEsDBBQACAgIAFJmeFYAAAAAAAAAAAAAAAAoAAQASUQ2MzItR0VPLUxlaWNhLUhlbHAtTWFjaGluZSBDb250cm9sLk1FTQEAAADtzssKQEAUgOFjoTwGWR+5lPW4TCjDxgtomqI0I3lzLyBvIEUW59v829+GrinTJMaK99iqWY5Yq2VFMcpp1sotjN43swSCC/gSzw551bHu7MGLlMYqh6d8xrpBhBFjPnhACCGE/MMJUEsHCKEIpyRnAAAAAAAAAAAIAAAAAAAAUEsDBBQACAgIAFJmeFYAAAAAAAAAAAAAAAAoAAQASUQ2MzItR0VPLUxlaWNhLUhlbHAtTWFjaGluZSBDb250cm9sLlRNRAEAAADt3bFKI0EYB/BvNzFaXCXH1Vdcc3h7xR14xXEsd5pTwRgIEWwlBBRCFPEFbKx9BJ/DJ7CyshYrCwsbX0A3GtykFQnE329ZZnb+u92wMMXMt9FupBFxlERxRVTi+mPwCrNjLe9b+nw/qcRqq77UbC0HwCSdR/3vfafozSVry4s/f2Qr9Wa23t3tbGer3d5+1tju7Oz2u5+X9vqHB3u97+3Gm/24uv1s5V8AAAAAAAAAAAAAAAAAABHzg13/hVqcRSuPOM7P8sv8NG/lvTwAAAAAAAAAAAAAAAAAAABgasxFEjOD3rAO+EwpqQ56Jx+eRmqlpBLlj5JSUhtJqqUkGUnSUhIjQ5UYG4jiLIA7O/4BAAAAAAAAAAAAAAAAAABgAqrPJwHMx2zcfvryNdKbP1e/Iy5+LS58W3h8BgAAAAAAAAAAAJgO6Wg7rK7UbDe2NrfW/5dfTYJp9VI7a1i/CwAAYGLGVqq8U+YBBfOAgnnAowdQSwcITWiheHEBAAAAAAAAAAABAAAAAABQSwMEFAAICAgAUmZ4VgAAAAAAAAAAAAAAACgABABJRDYzMi1HRU8tTGVpY2EtSGVscC1NYWNoaW5lIENvbnRyb2wuVE1JAQAAAO3dwWkCYRAG0NFTzlaQBv4cEsg1JLqokI0gNiDLQgRZQ7ABu7MaLxawKijqWWQPvjcMM1PEx/xM8nZErCJa++J2dV1fTR5b+9inazDOuqNxLwCatI7sc1sctqfWsPf+9pr62Sh9l7Nimgbl/C/l0+J3VpXP3UW1/F/MXyb5MO6krFL/KwAAAAAAAAAAAAAAAACAiM5F6r8Tm48AAAAAAAAAAAAAAAAAAAAAGnD+TS7/DwAAAAAAAAAAAAAAAAAAAM3YAVBLBwgGVIGewwAAAAAAAAAAwAAAAAAAAFBLAQIAABQACAgIALRlVFahCKckZwAAAAAIAAAoAAQAAAAAAAAAAACkgQAAAABJRDYzMi1HRU8tTGVpY2EtSGVscC1NYWNoaW5lIENvbnRyb2wuTUVNAQAAAFBLAQIAABQACAgIAGdralZNaKF4cQEAAAAAAQAoAAQAAAAAAAAAAACkgckAAABJRDYzMi1HRU8tTGVpY2EtSGVscC1NYWNoaW5lIENvbnRyb2wuVE1EAQAAAFBLAQIAABQACAgIAFJmeFYGVIGewwAAAADAAAAoAAQAAAAAAAAAAACkgZwCAABJRDYzMi1HRU8tTGVpY2EtSGVscC1NYWNoaW5lIENvbnRyb2wuVE1JAQAAAFBLBgYsAAAAAAAAAB4DLQAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAOAQAAAAAAAMEDAAAAAAAAUEsGBwAAAADPBAAAAAAAAAEAAABQSwUGAAAAAAMAAwAOAQAAwQMAAAAA
+ summary: Create with file for TM
+ responses:
+ '200':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ name:
+ type: string
+ description: Created TM name
+ required:
+ - name
+ example:
+ name: examle_tm2
+ headers: {}
+ x-200:Error:
+ description: ''
+ content:
+ application/json:
+ schema:
+ title: ''
+ type: object
+ properties:
+ ReturnValue:
+ type: integer
+ description: Error code
+ ErrorMsg:
+ type: string
+ description: Message to explain error
+ required:
+ - ReturnValue
+ - ErrorMsg
+ example:
+ ReturnValue: 7272
+ ErrorMsg: >-
+ ::ERROR_MEM_NAME_EXISTS:: TM with this name already exists:
+ test-memory; res = 0
+ headers: {}
+ security: []
+ get:
+ summary: Get TMs list
+ deprecated: false
+ description: ''
+ tags: []
+ parameters: []
+ responses:
+ '200':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ Open:
+ type: array
+ items:
+ type: object
+ properties:
+ name:
+ type: string
+ description: TM name
+ required:
+ - name
+ description: Memories loaded into RAM
+ Available on disk:
+ type: array
+ items:
+ type: object
+ properties:
+ name:
+ type: string
+ description: TM name
+ required:
+ - name
+ description: Memories available on disk
+ required:
+ - Open
+ - Available on disk
+ example:
+ Open:
+ - name: test-memory
+ Available on disk:
+ - name: test-memory-1
+ headers: {}
+ security: []
+ /t5memory_service/resources:
+ get:
+ summary: Resources
+ deprecated: false
+ description: ''
+ tags: []
+ parameters: []
+ responses:
+ '200':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties: {}
+ example:
+ filebuffers:
+ - name: /root/.t5memory/TABLE/OTMXUXLF.TBL
+ size: 3660
+ totalOccupiedByFilebuffersRAM: 3660
+ tms:
+ - name: test-memory
+ status: open
+ size: 134976
+ activeRequest: ''
+ expectedSize: 0
+ StatusInfo:
+ status: open
+ sizeInRAM: 134976
+ activeRequest: ''
+ tmxImportStatus: available
+ importProgress: 100
+ importTime: |
+ Overall import time is : 0:00:00
+ segmentsImported: 2
+ invalidSegments: 0
+ tmxSegmentCount: 2
+ importRuntimeSec: 0
+ importTimeoutSec: 0
+ newEntryIfOnlyContextAndTimestampDifferent: 1
+ saveDifferentTargetsForSameSource: 0
+ invalidSegmentsRCs: ''
+ firstInvalidSegments(num:segId:errCode): ''
+ invalidSymbolErrors: 0
+ errorMsg: ''
+ rc: 0
+ lastAccessTime: 20250801T153723Z
+ creationTime: 20250801T123723Z
+ tmCreatedInT5M_version: '0:7:14'
+ segmentIndex: 2
+ sourceLang: de
+ internalDescription: ''
+ tmd fbuffer was modified: 1
+ tmi fbuffer was modified: 1
+ totalOccupiedByTMsInRAM: 712165696
+ Run date: 'Wed Jul 30 16:08:09 2025 '
+ Build date: 2025/07/29 16:08:46
+ Git commit info: >-
+ dff40cb9 * updated to v0.7.14 + added skipStartupLogs
+ flags(default true) * fixed non-asan builds * fixed
+ nextInternalKey is empty log on failed export
+ Version: 0.7.14
+ Worker threads: 10
+ Timeout(ms): 180000
+ Resident set: 1448300000000
+ Virtual memory usage: 3743340000000000
+ Requests:
+ RequestCount: 6829
+ RequestExecutionSumTime(sec): 14.484
+ CreateMem:
+ ReqCount: 44
+ SumTime(sec): 0.065
+ AvrgReqTime: 0.00147727
+ DeleteMem:
+ ReqCount: 0
+ SumTime(sec): 0
+ AvrgReqTime: 0
+ ImportMem:
+ ReqCount: 29
+ SumTime(sec): 0.016
+ AvrgReqTime: 0.000551724
+ ExportMem:
+ ReqCount: 13
+ SumTime(sec): 0.09
+ AvrgReqTime: 0.00692308
+ CloneTmLocaly:
+ ReqCount: 0
+ SumTime(sec): 0
+ AvrgReqTime: 0
+ Reorganize:
+ ReqCount: 0
+ SumTime(sec): 0
+ AvrgReqTime: 0
+ StatusMem:
+ ReqCount: 109
+ SumTime(sec): 0.011
+ AvrgReqTime: 0.000100917
+ FlushMem:
+ ReqCount: 0
+ SumTime(sec): 0
+ AvrgReqTime: 0
+ Fuzzy:
+ ReqCount: 98
+ SumTime(sec): 1.034
+ AvrgReqTime: 0.010551
+ MultiFuzzy:
+ ReqCount: 0
+ SumTime(sec): 0
+ AvrgReqTime: 0
+ Concordance:
+ ReqCount: 0
+ SumTime(sec): 0
+ AvrgReqTime: 0
+ UpdateEntry:
+ ReqCount: 6
+ SumTime(sec): 0.013
+ AvrgReqTime: 0.00216667
+ MultiUpdate:
+ ReqCount: 0
+ SumTime(sec): 0
+ AvrgReqTime: 0
+ GetEntry:
+ ReqCount: 0
+ SumTime(sec): 0
+ AvrgReqTime: 0
+ DeleteEntry:
+ ReqCount: 0
+ SumTime(sec): 0
+ AvrgReqTime: 0
+ SaveAllTms:
+ ReqCount: 0
+ SumTime(sec): 0
+ AvrgReqTime: 0
+ ListOfMemories:
+ ReqCount: 6474
+ SumTime(sec): 13.221
+ AvrgReqTime: 0.00204217
+ Resources:
+ ReqCount: 22
+ SumTime(sec): 0.016
+ AvrgReqTime: 0.000727273
+ Flags:
+ ReqCount: 0
+ SumTime(sec): 0
+ AvrgReqTime: 0
+ Other:
+ ReqCount: 0
+ SumTime(sec): 0
+ AvrgReqTime: 0
+ Unrecognized:
+ ReqCount: 0
+ SumTime(sec): 0
+ AvrgReqTime: 0
+ RAM limit(MB): 10000
+ headers: {}
+ security: []
+ /t5memory/{memory}/status:
+ get:
+ summary: TM Status
+ deprecated: false
+ description: >-
+ https://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-GetthestatusofTM
+ tags: []
+ parameters: []
+ responses:
+ '200':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ status:
+ type: string
+ description: |-
+ Statuses:
+ open - memory already in RAM ready to use
+ available - not loaded but present on disk
+ loading - loading from disk to RAM
+ not found - error status of absent memory
+ reorganize running - Reorganizing in process
+ import running - Import in process
+ waiting for loading - loading requsted but not done yet
+ failed to open - corrupted TM file
+ sizeInRAM:
+ type: integer
+ activeRequest:
+ type: string
+ description: ' '
+ lastAccessTime:
+ type: string
+ creationTime:
+ type: string
+ tmCreatedInT5M_version:
+ type: string
+ description: version of t5memory on momemt of TM creation
+ segmentIndex:
+ type: integer
+ description: index of last inserted segment (not queriable)
+ sourceLang:
+ type: string
+ description: rfc5646
+ internalDescription:
+ type: string
+ tmd fbuffer was modified:
+ type: integer
+ tmi fbuffer was modified:
+ type: integer
+ required:
+ - status
+ - sizeInRAM
+ - activeRequest
+ - lastAccessTime
+ - creationTime
+ - tmCreatedInT5M_version
+ - segmentIndex
+ - sourceLang
+ - internalDescription
+ - tmd fbuffer was modified
+ - tmi fbuffer was modified
+ example:
+ status: open
+ sizeInRAM: 134976
+ activeRequest: ''
+ lastAccessTime: 20250801T160913Z
+ creationTime: 20250716T102923Z
+ tmCreatedInT5M_version: '0:7:7'
+ segmentIndex: 5
+ sourceLang: en
+ internalDescription: ''
+ tmd fbuffer was modified: 1
+ tmi fbuffer was modified: 1
+ headers: {}
+ x-200:Import processed status:
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ status:
+ type: string
+ sizeInRAM:
+ type: integer
+ activeRequest:
+ type: string
+ tmxImportStatus:
+ type: string
+ description: >-
+ Statuses of ongoing improt:
+
+ available - not tipical. If returned and "importTime" ==
+ "not finished" then import still ongoing
+
+ import - ongoing import
+ importProgress:
+ type: integer
+ description: Progress in persents
+ importTime:
+ type: string
+ segmentsImported:
+ type: integer
+ description: NUmber of successfully imported segments
+ invalidSegments:
+ type: integer
+ description: Number of invalid segments found in TMX
+ tmxSegmentCount:
+ type: integer
+ description: Number of found segmnets in import TMX file
+ importRuntimeSec:
+ type: integer
+ importTimeoutSec:
+ type: integer
+ newEntryIfOnlyContextAndTimestampDifferent:
+ type: integer
+ saveDifferentTargetsForSameSource:
+ type: integer
+ description: 0 or 1 - considered as bool value
+ invalidSegmentsRCs:
+ type: string
+ firstInvalidSegments(num:segId:errCode):
+ type: string
+ invalidSymbolErrors:
+ type: integer
+ errorMsg:
+ type: string
+ rc:
+ type: integer
+ lastAccessTime:
+ type: string
+ creationTime:
+ type: string
+ tmCreatedInT5M_version:
+ type: string
+ segmentIndex:
+ type: integer
+ sourceLang:
+ type: string
+ internalDescription:
+ type: string
+ tmd fbuffer was modified:
+ type: integer
+ tmi fbuffer was modified:
+ type: integer
+ required:
+ - status
+ - sizeInRAM
+ - activeRequest
+ - tmxImportStatus
+ - importProgress
+ - importTime
+ - segmentsImported
+ - invalidSegments
+ - tmxSegmentCount
+ - importRuntimeSec
+ - importTimeoutSec
+ - newEntryIfOnlyContextAndTimestampDifferent
+ - saveDifferentTargetsForSameSource
+ - invalidSegmentsRCs
+ - firstInvalidSegments(num:segId:errCode)
+ - invalidSymbolErrors
+ - errorMsg
+ - rc
+ - lastAccessTime
+ - creationTime
+ - tmCreatedInT5M_version
+ - segmentIndex
+ - sourceLang
+ - internalDescription
+ - tmd fbuffer was modified
+ - tmi fbuffer was modified
+ example:
+ status: open
+ sizeInRAM: 134976
+ activeRequest: ''
+ tmxImportStatus: available
+ importProgress: 100
+ importTime: |
+ Overall import time is : 0:00:00
+ segmentsImported: 4
+ invalidSegments: 0
+ tmxSegmentCount: 4
+ importRuntimeSec: 0
+ importTimeoutSec: 0
+ newEntryIfOnlyContextAndTimestampDifferent: 1
+ saveDifferentTargetsForSameSource: 0
+ invalidSegmentsRCs: ''
+ firstInvalidSegments(num:segId:errCode): ''
+ invalidSymbolErrors: 0
+ errorMsg: ''
+ rc: 0
+ lastAccessTime: 20250807T130822Z
+ creationTime: 20250716T102923Z
+ tmCreatedInT5M_version: '0:7:7'
+ segmentIndex: 9
+ sourceLang: en
+ internalDescription: ''
+ tmd fbuffer was modified: 1
+ tmi fbuffer was modified: 1
+ headers: {}
+ security: []
+ /t5memory/{memory}/importtmx:
+ post:
+ summary: IMPORT TMX
+ deprecated: false
+ description: >-
+ Rout is async. So when import is finished should be checked with status
+ call
+ tags: []
+ parameters: []
+ requestBody:
+ content:
+ multipart/form-data:
+ encoding:
+ json_data:
+ contentType: application/json
+ schema:
+ type: object
+ properties:
+ json_data:
+ type: string
+ description: "json pretty print string.\n\n\"framingTags\" key possible values:\n\"saveAll\" - default behaviour, do nothing\n\"skipAll\" - skip all enclosing tags, including standalone tags\n\"skipPaired\" - skip only paired enclosing tags\n\nBoth newEntryIfOnlyContextAndTimestampDifferent and saveDifferentTargetsForSameSource impact how similar translation would be saved. In case if source and other field(doc, author, lang) are the same, but target different, and newEntryIfOnlyContextAndTimestampDifferent is set to true, you would have 2 translation, otherwise you would have 1 translation saved - with higher updateTime. but if you have different attributes, like document, you would have 2 translation anyway.\_\nnewEntryIfOnlyContextAndTimestampDifferent would also increase number of saved segments. If values was not provided, default values from flags would be used."
+ example: |
+ {
+ "framingTags": "saveAll",
+ "newEntryIfOnlyContextAndTimestampDifferent": 0,
+ "saveDifferentTargetsForSameSource": 0,
+ "timeout": 100000
+ }
+ file:
+ format: binary
+ type: string
+ description: tmx file to import into TM
+ example: ''
+ required:
+ - json_data
+ - file
+ examples: {}
+ responses:
+ '200':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties: {}
+ example:
+ msg: success
+ headers: {}
+ security: []
+ /t5memory/{memory}/download.tmx:
+ get:
+ summary: EXPORT TMX
+ deprecated: false
+ description: >-
+ JSON pretty print string:
+
+ limit - number of segments to fetch at a time
+
+ startFromInternalKey - internal key to start export from
+
+
+ Works as cursor pagination.
+
+
+ If no body provided, export starts from the beginning (key 7:1) to the
+ end.
+ tags: []
+ parameters:
+ - name: Accept
+ in: header
+ description: ''
+ required: true
+ example: application/xml
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ limit:
+ type: string
+ startFromInternalKey:
+ type: string
+ required:
+ - limit
+ - startFromInternalKey
+ example:
+ limit: '100'
+ startFromInternalKey: '1:1'
+ responses:
+ '200':
+ description: >-
+ In response headers "NextInternalKey" will contain
+ "startFromInternalKey" for next call.
+
+ If "NextInternalKey" == "0:0" - then you reached end of TM
+ content:
+ application/xml:
+ schema:
+ type: object
+ properties: {}
+ example: |-
+
+
+
+
+
+
+ 2
+ 7: 1
+ OTMXUXLF
+ none
+
+ First segment
+
+
+ Перший сегмент
+
+
+
+
+ headers: {}
+ security: []
+ /t5memory/{memory}/search:
+ post:
+ summary: Concordance search
+ deprecated: false
+ description: >-
+ All fields is optional, but some depends on other, so error should be
+ returned in case of not providing required field.
+
+ https://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-NewConcordancesearch
+ tags: []
+ parameters:
+ - name: Accept
+ in: header
+ description: ''
+ required: true
+ example: application/json; charset=utf-8
+ schema:
+ type: string
+ - name: Accept-Charset
+ in: header
+ description: ''
+ required: true
+ example: UTF-8
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ source:
+ type: string
+ description: >-
+ Sets what to look for in source of the segments, based on
+ type of search, specified in sourceSearchMode(exact,
+ concordance). If sourceSearchMode is not specified, returns
+ an error.
+ sourceSearchMode:
+ type: string
+ description: "String with required\_\nEXACT or CONCORDANCE\_\n(or CONTAINS, what's equal to CONCORDANCE)\nwords and some optional, like\nCASEINSENSETIVE for non case sensetive comparison,\nWHITESPACETOLERANT for\nmodifying whitespaces(result of this actions you can see in filters in responce)\nINVERTED\_ for applying filter in inverted state, so to return false on match and true\_\nif no match. Logical NOT\n\nAttributes is not case sensetive,\_\nSeparator doen't matters"
+ target:
+ type: string
+ description: >-
+ Sets what to look for in source of the segments, based on
+ type of search, specified in sourceSearchMode(exact,
+ concordance). If sourceSearchMode is not specified, returns
+ an error.
+ targetSearchMode:
+ type: string
+ description: "String with required\_\nEXACT or CONCORDANCE\_\n(or CONTAINS, what's equal to CONCORDANCE)\nwords and some optional, like\nCASEINSENSETIVE for non case sensetive comparison,\nWHITESPACETOLERANT for\nmodifying whitespaces(result of this actions you can see in filters in responce)\nINVERTED\_ for applying filter in inverted state, so to return false on match and true\_\nif no match. Logical NOT\n\nAttributes is not case sensetive,\_\nSeparator doen't matters"
+ document:
+ type: string
+ description: >-
+ Sets what to look for in source of the segments, based on
+ type of search, specified in sourceSearchMode(exact,
+ concordance). If sourceSearchMode is not specified, returns
+ an error.
+ documentSearchMode:
+ type: string
+ description: "String with required\_\nEXACT or CONCORDANCE\_\n(or CONTAINS, what's equal to CONCORDANCE)\nwords and some optional, like\nCASEINSENSETIVE for non case sensetive comparison,\nWHITESPACETOLERANT for\nmodifying whitespaces(result of this actions you can see in filters in responce)\nINVERTED\_ for applying filter in inverted state, so to return false on match and true\_\nif no match. Logical NOT\n\nAttributes is not case sensetive,\_\nSeparator doen't matters"
+ author:
+ type: string
+ description: >-
+ Sets what to look for in source of the segments, based on
+ type of search, specified in sourceSearchMode(exact,
+ concordance). If sourceSearchMode is not specified, returns
+ an error.
+ authorSearchMode:
+ type: string
+ description: "String with required\_\nEXACT or CONCORDANCE\_\n(or CONTAINS, what's equal to CONCORDANCE)\nwords and some optional, like\nCASEINSENSETIVE for non case sensetive comparison,\nWHITESPACETOLERANT for\nmodifying whitespaces(result of this actions you can see in filters in responce)\nINVERTED\_ for applying filter in inverted state, so to return false on match and true\_\nif no match. Logical NOT\n\nAttributes is not case sensetive,\_\nSeparator doen't matters"
+ addInfo:
+ type: string
+ description: >-
+ Sets what to look for in source of the segments, based on
+ type of search, specified in sourceSearchMode(exact,
+ concordance). If sourceSearchMode is not specified, returns
+ an error.
+ addInfoSearchMode:
+ type: string
+ description: "String with required\_\nEXACT or CONCORDANCE\_\n(or CONTAINS, what's equal to CONCORDANCE)\nwords and some optional, like\nCASEINSENSETIVE for non case sensetive comparison,\nWHITESPACETOLERANT for\nmodifying whitespaces(result of this actions you can see in filters in responce)\nINVERTED\_ for applying filter in inverted state, so to return false on match and true\_\nif no match. Logical NOT\n\nAttributes is not case sensetive,\_\nSeparator doen't matters"
+ context:
+ type: string
+ description: >-
+ Sets what to look for in source of the segments, based on
+ type of search, specified in sourceSearchMode(exact,
+ concordance). If sourceSearchMode is not specified, returns
+ an error.
+ contextSearchMode:
+ type: string
+ description: "String with required\_\nEXACT or CONCORDANCE\_\n(or CONTAINS, what's equal to CONCORDANCE)\nwords and some optional, like\nCASEINSENSETIVE for non case sensetive comparison,\nWHITESPACETOLERANT for\nmodifying whitespaces(result of this actions you can see in filters in responce)\nINVERTED\_ for applying filter in inverted state, so to return false on match and true\_\nif no match. Logical NOT\n\nAttributes is not case sensetive,\_\nSeparator doen't matters"
+ timestampSpanStart:
+ type: string
+ description: "String with date in format\n\_\"20240121T115234Z\""
+ timestampSpanEnd:
+ type: string
+ description: "String with date in format\n\_\"20240121T115234Z\""
+ onlyCountSegments:
+ type: string
+ description: >-
+ Instead of returning segment, would go in search till the
+ end of tm and return total number of segments, that returns
+ true with selected filters
+ enum:
+ - '1'
+ - '0'
+ searchPosition:
+ type: string
+ description: Point where to start search in tmd file
+ example: '8:1'
+ logicalOr:
+ type: integer
+ enum:
+ - 1
+ - 0
+ description: >-
+ By default source, target, document, author, context,
+ addinfo, timestamp is combined in logical AND, but by
+ sending here "OR" you can switch that to logical OR, any
+ other value would left it in default AND state.
+
+ Doesn't apply to sourceLang and targetLang filters, they are
+ always in AND state
+ numResults:
+ type: integer
+ description: Points how many matches return in current request
+ minimum: 0
+ maximum: 200
+ default: 5
+ sourceLang:
+ type: string
+ description: "Filter segments on src/trg lang attribute,\_\n\nIf specified lang is preffered, matching is done based on lang family,\notherwise on exact match"
+ targetLang:
+ type: string
+ description: "Filter segments on src/trg lang attribute,\_\n\nIf specified lang is preffered, matching is done based on lang family,\notherwise on exact match"
+ msSearchAfterNumResults:
+ type: integer
+ default: 0
+ description: "sets how many ms should pass between first found segment and search stop, if it didn't reach the end yet.\_"
+ loggingThreshold:
+ type: integer
+ maximum: 6
+ description: >-
+ HACK.
+
+ Additional field to set log level on the run.
+
+ Sets log level for t5memory process in general and not this
+ request only
+ example:
+ source: First
+ sourceSearchMode: contains, CASEINSENSETIVE
+ target: ''
+ targetSearchMode: contains, CASEINSENSETIVE
+ document: ''
+ documentSearchMode: contains, CASEINSENSETIVE
+ author: ''
+ authorSearchMode: contains, CASEINSENSETIVE
+ addInfo: ''
+ addInfoSearchMode: contains, CASEINSENSETIVE
+ context: ''
+ contextSearchMode: contains, CASEINSENSETIVE
+ timestampSpanStart: 19691231T230000Z
+ timestampSpanEnd: 20260628T220000Z
+ onlyCountSegments: '0'
+ searchPosition: ''
+ logicalOr: 0
+ numResults: 200
+ responses:
+ '200':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ Filters:
+ type: string
+ GlobalSearchOptions:
+ type: string
+ ReturnValue:
+ type: integer
+ ReturnMessage:
+ type: string
+ NewSearchPosition:
+ type: 'null'
+ NumOfFoundSegments:
+ type: integer
+ results:
+ type: array
+ items:
+ type: object
+ properties:
+ source:
+ type: string
+ target:
+ type: string
+ segmentId:
+ type: integer
+ customId:
+ type: string
+ documentName:
+ type: string
+ sourceLang:
+ type: string
+ targetLang:
+ type: string
+ type:
+ type: string
+ author:
+ type: string
+ timestamp:
+ type: string
+ markupTable:
+ type: string
+ context:
+ type: string
+ additionalInfo:
+ type: string
+ internalKey:
+ type: string
+ required:
+ - source
+ - target
+ - segmentId
+ - customId
+ - documentName
+ - sourceLang
+ - targetLang
+ - type
+ - author
+ - timestamp
+ - markupTable
+ - context
+ - additionalInfo
+ - internalKey
+ required:
+ - Filters
+ - GlobalSearchOptions
+ - ReturnValue
+ - ReturnMessage
+ - NewSearchPosition
+ - NumOfFoundSegments
+ - results
+ example:
+ Filters: >
+ Search filter, field: SOURCE FilterType::CONTAINS SearchStr:
+ 'FIRST'; Options: SEARCH_CASEINSENSITIVE_OPT|;
+
+ Search filter, field: TARGET FilterType::CONTAINS SearchStr:
+ ''; Options: SEARCH_CASEINSENSITIVE_OPT|;
+
+ Search filter, field: ADDINFO FilterType::CONTAINS SearchStr:
+ ''; Options: SEARCH_CASEINSENSITIVE_OPT|;
+
+ Search filter, field: CONTEXT FilterType::CONTAINS SearchStr:
+ ''; Options: SEARCH_CASEINSENSITIVE_OPT|;
+
+ Search filter, field: AUTHOR FilterType::CONTAINS SearchStr:
+ ''; Options: SEARCH_CASEINSENSITIVE_OPT|;
+
+ Search filter, field: DOCUMENT FilterType::CONTAINS SearchStr:
+ ''; Options: SEARCH_CASEINSENSITIVE_OPT|;
+
+ Search filter, field: TIMESTAMP FilterType::RANGE Range:
+ 19691231T230000Z - 20260628T220000Z Options: ;
+ GlobalSearchOptions: SEARCH_FILTERS_LOGICAL_AND
+ ReturnValue: 10010
+ ReturnMessage: ENDREACHED_RC
+ NewSearchPosition: null
+ NumOfFoundSegments: 2
+ results:
+ - source: >-
+ First segment with int
+ target: >-
+ Перший сегмент з числом
+ segmentId: 2
+ customId: ''
+ documentName: none
+ sourceLang: en
+ targetLang: UK
+ type: Manual
+ author: MANAGER
+ timestamp: 20250716T084347Z
+ markupTable: OTMXUXLF
+ context: ''
+ additionalInfo: ''
+ internalKey: '7:1'
+ - source: First segment with int 10
+ target: Перший сегмент з числом 10
+ segmentId: 6
+ customId: ''
+ documentName: none
+ sourceLang: en
+ targetLang: UK
+ type: Manual
+ author: MANAGER
+ timestamp: 20250716T084347Z
+ markupTable: OTMXUXLF
+ context: ''
+ additionalInfo: ''
+ internalKey: '11:1'
+ headers: {}
+ security: []
+ /t5memory/{memory}/concordancesearch:
+ post:
+ summary: Concordance search (DEPRICATED)
+ deprecated: false
+ description: >2-
+ SearchPosition / NewSearchPositionFormat: "7:1"
+ First is segmeng\record number, second is target number
+
+ The NextSearchposition is an internal key of the memory for the next
+ position on sequential access. Since it is an internal key, maintained
+ and understood by the underlying memory plug-in (for EqfMemoryPlugin is
+ it the record number and the position in one record),
+
+ no assumptions should be made regarding the content. It is just a string
+ that, should be sent back to OpenTM2 on the next request, so that the
+ search starts from there.
+
+ So is the implementation in Translate5: The first request to OpenTM2
+ contains SearchPosition with an empty string, OpenTM2 returns than a
+ string in NewSearchPosition, which is just resent to OpenTM2 in the next
+ request.
+
+ https://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-Concordancesearch
+
+ tags: []
+ parameters:
+ - name: Accept
+ in: header
+ description: ''
+ required: true
+ example: application/json; charset=utf-8
+ schema:
+ type: string
+ - name: Accept-Charset
+ in: header
+ description: ''
+ required: true
+ example: UTF-8
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ searchString:
+ type: string
+ searchType:
+ type: string
+ enum:
+ - Source
+ - Target
+ - SourceAndTarget
+ example: Source
+ searchPosition:
+ type: 'null'
+ numResults:
+ type: integer
+ msSearchAfterNumResults:
+ type: integer
+ required:
+ - searchString
+ - searchType
+ example:
+ searchString: With nice text
+ searchType: source
+ searchPosition: null
+ numResults: 20
+ msSearchAfterNumResults: 250
+ responses:
+ '200':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ ReturnValue:
+ type: integer
+ ReturnMessage:
+ type: string
+ NewSearchPosition:
+ type: string
+ nullable: true
+ results:
+ type: array
+ items:
+ type: object
+ properties:
+ source:
+ type: string
+ target:
+ type: string
+ segmentId:
+ type: integer
+ customId:
+ type: string
+ documentName:
+ type: string
+ sourceLang:
+ type: string
+ targetLang:
+ type: string
+ type:
+ type: string
+ author:
+ type: string
+ timestamp:
+ type: string
+ markupTable:
+ type: string
+ context:
+ type: string
+ additionalInfo:
+ type: string
+ internalKey:
+ type: string
+ required:
+ - source
+ - target
+ - segmentId
+ - customId
+ - documentName
+ - sourceLang
+ - targetLang
+ - type
+ - author
+ - timestamp
+ - markupTable
+ - context
+ - additionalInfo
+ - internalKey
+ required:
+ - ReturnValue
+ - ReturnMessage
+ - NewSearchPosition
+ - results
+ example:
+ ReturnValue: 10010
+ ReturnMessage: ENDREACHED_RC
+ NewSearchPosition: null
+ results:
+ - source: >-
+ First segment with int
+ target: >-
+ Перший сегмент з числом
+ segmentId: 2
+ customId: ''
+ documentName: none
+ sourceLang: en
+ targetLang: UK
+ type: Manual
+ author: MANAGER
+ timestamp: 20250716T084347Z
+ markupTable: OTMXUXLF
+ context: ''
+ additionalInfo: ''
+ internalKey: '7:1'
+ - source: First segment with int 10
+ target: Перший сегмент з числом 10
+ segmentId: 6
+ customId: ''
+ documentName: none
+ sourceLang: en
+ targetLang: UK
+ type: Manual
+ author: MANAGER
+ timestamp: 20250716T084347Z
+ markupTable: OTMXUXLF
+ context: ''
+ additionalInfo: ''
+ internalKey: '11:1'
+ headers: {}
+ security: []
+ /t5memory/{memory}/fuzzysearch:
+ post:
+ summary: Fuzzy search
+ deprecated: false
+ description: >-
+ https://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-Fuzzysearch
+ tags: []
+ parameters: []
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ sourceLang:
+ type: string
+ description: rfc5646
+ targetLang:
+ type: string
+ description: rfc5646
+ source:
+ type: string
+ description: Search string to look for
+ documentName:
+ type: string
+ markupTable:
+ type: string
+ description: >-
+ If there is no markup, default OTMXUXLF would be used.
+
+ Markup tables should be located inside
+ ~/.t5memory/TABLE/%markup$.TBL
+ context:
+ type: string
+ forceFuzzy:
+ type: integer
+ enum:
+ - 1
+ - 0
+ description: |-
+ If yes - will return all potential fuzzies
+ No - only first exact match or most relevant matches
+ numOfProposals:
+ type: integer
+ description: Num of expected segments in output. By default it's 5
+ required:
+ - sourceLang
+ - targetLang
+ - source
+ example:
+ sourceLang: en
+ targetLang: uk
+ source: Second segment
+ documentName: ''
+ markupTable: OTMXUXLF
+ context: ''
+ responses:
+ '200':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ ReturnValue:
+ type: integer
+ ErrorMsg:
+ type: string
+ NumOfFoundProposals:
+ type: integer
+ searchedSrc:
+ type: string
+ customId:
+ type: string
+ forceFuzzy:
+ type: integer
+ results:
+ type: array
+ items:
+ type: object
+ properties:
+ source:
+ type: string
+ target:
+ type: string
+ segmentId:
+ type: integer
+ customId:
+ type: string
+ documentName:
+ type: string
+ sourceLang:
+ type: string
+ targetLang:
+ type: string
+ type:
+ type: string
+ author:
+ type: string
+ timestamp:
+ type: string
+ markupTable:
+ type: string
+ context:
+ type: string
+ additionalInfo:
+ type: string
+ internalKey:
+ type: string
+ matchType:
+ type: string
+ matchRate:
+ type: integer
+ fuzzyWords:
+ type: integer
+ fuzzyDiffs:
+ type: integer
+ required:
+ - source
+ - target
+ - segmentId
+ - customId
+ - documentName
+ - sourceLang
+ - targetLang
+ - type
+ - author
+ - timestamp
+ - markupTable
+ - context
+ - additionalInfo
+ - internalKey
+ - matchType
+ - matchRate
+ - fuzzyWords
+ - fuzzyDiffs
+ required:
+ - ReturnValue
+ - ErrorMsg
+ - NumOfFoundProposals
+ - searchedSrc
+ - customId
+ - forceFuzzy
+ example:
+ ReturnValue: 0
+ ErrorMsg: ''
+ NumOfFoundProposals: 2
+ searchedSrc: 'First segment with int '
+ customId: ''
+ forceFuzzy: 0
+ results:
+ - source: First segment with int 10
+ target: Перший сегмент з числом 10
+ segmentId: 6
+ customId: ''
+ documentName: none
+ sourceLang: en
+ targetLang: UK
+ type: Manual
+ author: MANAGER
+ timestamp: 20250716T084347Z
+ markupTable: OTMXUXLF
+ context: ''
+ additionalInfo: ''
+ internalKey: '11:1'
+ matchType: Fuzzy
+ matchRate: 80
+ fuzzyWords: 5
+ fuzzyDiffs: 1
+ - source: First segment with int 11
+ target: Перший сегмент з числом 11
+ segmentId: 2
+ customId: ''
+ documentName: none
+ sourceLang: en
+ targetLang: UK
+ type: Manual
+ author: MANAGER
+ timestamp: 20250716T084347Z
+ markupTable: OTMXUXLF
+ context: ''
+ additionalInfo: ''
+ internalKey: '7:1'
+ matchType: Fuzzy
+ matchRate: 80
+ fuzzyWords: 5
+ fuzzyDiffs: 1
+ headers: {}
+ security: []
+ /t5memory/{memory}/getentry:
+ post:
+ summary: Get entry
+ deprecated: false
+ description: >-
+ Each segmnet entry in seach payloads has "internalKey": "9:1" like
+ key-value.
+
+ In this example 9 is "recordKey" and 1 is "targetKey".
+ tags: []
+ parameters: []
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ recordKey:
+ type: string
+ targetKey:
+ type: string
+ required:
+ - recordKey
+ - targetKey
+ example:
+ recordKey: '8'
+ targetKey: '2'
+ responses:
+ '200':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ source:
+ type: string
+ target:
+ type: string
+ segmentId:
+ type: integer
+ customId:
+ type: string
+ documentName:
+ type: string
+ sourceLang:
+ type: string
+ targetLang:
+ type: string
+ type:
+ type: string
+ author:
+ type: string
+ timestamp:
+ type: string
+ markupTable:
+ type: string
+ context:
+ type: string
+ additionalInfo:
+ type: string
+ internalKey:
+ type: string
+ required:
+ - source
+ - target
+ - segmentId
+ - customId
+ - documentName
+ - sourceLang
+ - targetLang
+ - type
+ - author
+ - timestamp
+ - markupTable
+ - context
+ - additionalInfo
+ - internalKey
+ example:
+ source: Third segment
+ target: третій сегмент
+ segmentId: 4
+ customId: ''
+ documentName: none
+ sourceLang: en
+ targetLang: UK
+ type: Manual
+ author: MANAGER
+ timestamp: 20250716T084347Z
+ markupTable: OTMXUXLF
+ context: ''
+ additionalInfo: ''
+ internalKey: '9:1'
+ headers: {}
+ '400':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ ReturnValue:
+ type: integer
+ ErrorMsg:
+ type: string
+ required:
+ - ReturnValue
+ - ErrorMsg
+ example:
+ ReturnValue: 939
+ ErrorMsg: >-
+ Requested entry not found! Next internalKey after requested is
+ : 10:1
+ headers: {}
+ security: []
+ /t5memory/{memory}/entry:
+ post:
+ summary: Update entry
+ deprecated: false
+ description: >-
+ https://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-Updateentry
+ tags: []
+ parameters:
+ - name: Accept
+ in: header
+ description: ''
+ required: true
+ example: application/json; charset=utf-8
+ schema:
+ type: string
+ - name: Accept-Charset
+ in: header
+ description: ''
+ required: true
+ example: UTF-8
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ source:
+ type: string
+ description: Segment source string
+ target:
+ type: string
+ description: Segment target string
+ type:
+ type: string
+ const: Manual
+ description: Should be set to "Manual"
+ example: Manual
+ markupTable:
+ type: string
+ const: OTMXUXLF
+ description: Should be "OTMXUXLF"
+ example: OTMXUXLF
+ sourceLang:
+ type: string
+ description: rfc5646
+ targetLang:
+ type: string
+ description: rfc5646
+ timeStamp:
+ type: string
+ pattern: ^\d{8}T\d{6}Z$
+ format: yyyyMMdd'T'HHmmss'Z'
+ description: Time of segment creation
+ example: 20240111T111443Z
+ documentName:
+ type: string
+ description: Name of document where segmnet comes from
+ author:
+ type: string
+ context:
+ type: string
+ description: >-
+ Field that will be considered in fuzzy searches. Plays a
+ role of aditional search option
+ save2disk:
+ type: integer
+ description: >-
+ If true - segment will be written to disk right away, else -
+ only set in RAM and saved when all memory is flushed
+ enum:
+ - 1
+ - 0
+ default: 0
+ example: 1
+ saveDifferentTargetsForSameSource:
+ type: integer
+ enum:
+ - 1
+ - 0
+ description: >-
+ If param set to 1 - new entry will be saved and old
+ preserved even if all fileds of segmnet except target are
+ same.
+ required:
+ - source
+ - target
+ - sourceLang
+ - targetLang
+ - timeStamp
+ - documentName
+ - author
+ - context
+ - save2disk
+ example:
+ source: hello
+ target: again good bye 1
+ type: Manual
+ markupTable: OTMXUXLF
+ sourceLang: de
+ targetLang: en
+ timeStamp: 20250112T111443Z
+ documentName: translation.txt
+ author: Project Manager
+ context: ''
+ save2disk: 1
+ saveDifferentTargetsForSameSource: 1
+ responses:
+ '200':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ source:
+ type: string
+ sourceNPRepl:
+ type: string
+ sourceNorm:
+ type: string
+ target:
+ type: string
+ segmentId:
+ type: integer
+ customId:
+ type: string
+ documentName:
+ type: string
+ sourceLang:
+ type: string
+ targetLang:
+ type: string
+ type:
+ type: string
+ author:
+ type: string
+ timestamp:
+ type: string
+ markupTable:
+ type: string
+ context:
+ type: string
+ additionalInfo:
+ type: string
+ internalKey:
+ type: string
+ required:
+ - source
+ - sourceNPRepl
+ - sourceNorm
+ - target
+ - segmentId
+ - customId
+ - documentName
+ - sourceLang
+ - targetLang
+ - type
+ - author
+ - timestamp
+ - markupTable
+ - context
+ - additionalInfo
+ - internalKey
+ example:
+ source: Second segment
+ sourceNPRepl: Second segment
+ sourceNorm: Second segment
+ target: Другий сегмент
+ segmentId: 14
+ customId: ''
+ documentName: translation.txt
+ sourceLang: EN
+ targetLang: UK
+ type: Manual
+ author: PROJECT MANAGER
+ timestamp: 20240111T111443Z
+ markupTable: OTMXUXLF
+ context: ''
+ additionalInfo: ''
+ internalKey: '14:1'
+ headers: {}
+ security: []
+ /t5memory/{memory}:
+ delete:
+ summary: Delete TM
+ deprecated: false
+ description: ''
+ tags: []
+ parameters: []
+ requestBody:
+ content:
+ text/plain:
+ schema:
+ type: string
+ examples: {}
+ responses:
+ '200':
+ description: >-
+ Response will contain json with memory name as key and "deleted" as
+ value.
+
+ May return 500 with "not found(error 48)" as value that is simply
+ indicates absense of TM
+ content:
+ application/json:
+ schema:
+ type: object
+ properties: {}
+ example:
+ test-tm: deleted
+ headers: {}
+ '500':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties: {}
+ example:
+ test-tm: not found(error 48)
+ headers: {}
+ security: []
+ /t5memory/{memory}/entrydelete:
+ post:
+ summary: Delete entry
+ deprecated: false
+ description: >-
+ Each segmnet entry in seach payloads has "internalKey": "9:1" like
+ key-value.
+
+ In this example 9 is "recordKey" and 1 is "targetKey".
+
+ There is also "segmentId" value.
+
+ For delete entry request it should be provided to validate that current
+ state of t5memory data is same as at the moment when you got internalKey
+ as internal key value may be regenerated at any moment of data
+ processing on import or update rrquest handling.
+
+ So if you try to delete entry and getting error - try to fetch entry
+ internalKey nad segmentId again and then retry delete action.
+ tags: []
+ parameters: []
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ recordKey:
+ type: integer
+ targetKey:
+ type: integer
+ segmentId:
+ type: integer
+ save2disk:
+ type: string
+ enum:
+ - '1'
+ - '0'
+ default: '0'
+ description: |-
+ Save memory to disk right away.
+ Saves if not passed.
+ example: '1'
+ required:
+ - recordKey
+ - targetKey
+ - segmentId
+ example:
+ recordKey: 8
+ targetKey: 4
+ segmentId: 12
+ responses:
+ '200':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ fileFlushed:
+ type: integer
+ description: >-
+ Indicates was TM flushed to disk or not. Depends on
+ "save2disk" value.
+ results:
+ type: object
+ properties:
+ source:
+ type: string
+ target:
+ type: string
+ segmentId:
+ type: integer
+ customId:
+ type: string
+ documentName:
+ type: string
+ sourceLang:
+ type: string
+ targetLang:
+ type: string
+ type:
+ type: string
+ author:
+ type: string
+ timestamp:
+ type: string
+ markupTable:
+ type: string
+ context:
+ type: string
+ additionalInfo:
+ type: string
+ internalKey:
+ type: string
+ required:
+ - source
+ - target
+ - segmentId
+ - customId
+ - documentName
+ - sourceLang
+ - targetLang
+ - type
+ - author
+ - timestamp
+ - markupTable
+ - context
+ - additionalInfo
+ - internalKey
+ required:
+ - fileFlushed
+ - results
+ example:
+ fileFlushed: 1
+ results:
+ source: Second segment
+ target: Другий сегмент
+ segmentId: 14
+ customId: ''
+ documentName: translation.txt
+ sourceLang: en
+ targetLang: UK
+ type: Manual
+ author: PROJECT MANAGER
+ timestamp: 20250811T101311Z
+ markupTable: OTMXUXLF
+ context: ''
+ additionalInfo: ''
+ internalKey: '14:1'
+ headers: {}
+ '400':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ ReturnValue:
+ type: integer
+ ErrorMsg:
+ type: string
+ required:
+ - ReturnValue
+ - ErrorMsg
+ example:
+ ReturnValue: 14002
+ ErrorMsg: >-
+ Error: to delete entry by key you should provide all three
+ fields: recordKey, targetKey and segmentId
+ headers: {}
+ '500':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ ReturnValue:
+ type: integer
+ ErrorMsg:
+ type: string
+ required:
+ - ReturnValue
+ - ErrorMsg
+ example:
+ ReturnValue: 5005
+ ErrorMsg: ''
+ headers: {}
+ security: []
+ /t5memory/{memory}/entriesdelete:
+ post:
+ summary: Delete batch
+ deprecated: false
+ description: >-
+ Asynchronious operation.
+
+ This would start reorganize process which would remove like reorganize
+ bad segments and also would remove segments that gives true when
+ checking with provided filters combined with logical AND. So if you
+ provide timestamps and addInfo, only segments within provided timestamp
+ and with that addInfo would not be imported to new TM(check reorganize
+ process).
+
+ Every parameter is optional, so empty json would just start reorganize
+ async process.
+
+ If you provide one of timestamps you would get error - please provide
+ both.
+
+ To add parameter you should set it's SearchMode to be
+ EXACT|CONCORDANCE(non case sensetive)
+
+ If only searched string provided, but not search mode - you would get
+ error.
+ tags: []
+ parameters: []
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ source:
+ type: string
+ sourceSearchMode:
+ type: string
+ target:
+ type: string
+ targetSearchMode:
+ type: string
+ document:
+ type: string
+ documentSearchMode:
+ type: string
+ author:
+ type: string
+ authorSearchMode:
+ type: string
+ addInfo:
+ type: string
+ addInfoSearchMode:
+ type: string
+ context:
+ type: string
+ contextSearchMode:
+ type: string
+ timestampSpanStart:
+ type: string
+ timestampSpanEnd:
+ type: string
+ searchPosition:
+ type: string
+ required:
+ - timestampSpanStart
+ - timestampSpanEnd
+ example:
+ source: '123'
+ sourceSearchMode: contains, CASEINSENSETIVE
+ target: '234'
+ targetSearchMode: contains, CASEINSENSETIVE
+ document: ''
+ documentSearchMode: contains, CASEINSENSETIVE
+ author: ''
+ authorSearchMode: contains, CASEINSENSETIVE
+ addInfo: ''
+ addInfoSearchMode: contains, CASEINSENSETIVE
+ context: ''
+ contextSearchMode: contains, CASEINSENSETIVE
+ timestampSpanStart: 19691231T230000Z
+ timestampSpanEnd: 20240610T220000Z
+ searchPosition: ''
+ responses:
+ '200':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties: {}
+ headers: {}
+ security: []
+ /t5memory_service/shutdown:
+ post:
+ summary: Shutdown
+ deprecated: false
+ description: >-
+ Safely shutting down the service with\without saving all loaded tm files
+ to the disk.
+ tags: []
+ parameters:
+ - name: dontsave
+ in: query
+ description: >-
+ Skips saving tms, for now value doesn't matter, only presence.
+
+ If try to save tms before closing, would check if there is still
+ import process going on
+
+ If there is some, would wait 1 second and check again.
+
+ Repeats last step up to 10 min, then closes service anyway.
+ required: false
+ schema:
+ type: integer
+ - name: Accept
+ in: header
+ description: ''
+ required: true
+ example: application/json; charset=utf-8
+ schema:
+ type: string
+ - name: Accept-Charset
+ in: header
+ description: ''
+ required: true
+ example: UTF-8
+ schema:
+ type: string
+ responses:
+ '200':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties: {}
+ headers: {}
+ security: []
+ /t5memory_service/savetms:
+ get:
+ summary: Save TMs
+ deprecated: false
+ description: >-
+ Flushes all filebuffers(TMD, TMI files) into the filesystem. Reset
+ 'Modified' flags for file buffers.
+
+
+ Filebuffer is a file instance of .TMD or .TMI loaded into RAM. It
+ provides better speed and safety when working with files.
+ tags: []
+ parameters:
+ - name: Accept
+ in: header
+ description: ''
+ required: true
+ example: application/json; charset=utf-8
+ schema:
+ type: string
+ - name: Accept-Charset
+ in: header
+ description: ''
+ required: true
+ example: UTF-8
+ schema:
+ type: string
+ responses:
+ '200':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties: {}
+ example:
+ saved 3 tms: ID9580-de-fr_next-2, ID9612-en-uk, test-memory
+ errMsg: ''
+ headers: {}
+ security: []
+ /t5memory/{memory}/clone:
+ post:
+ summary: Clone
+ deprecated: false
+ description: Creates TM with the provided name and data cloned from provided memory
+ tags: []
+ parameters:
+ - name: Accept
+ in: header
+ description: ''
+ required: true
+ example: application/json; charset=utf-8
+ schema:
+ type: string
+ - name: Accept-Charset
+ in: header
+ description: ''
+ required: true
+ example: UTF-8
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ newName:
+ type: string
+ description: Name of memory to be crreated
+ required:
+ - newName
+ example:
+ newName: clonned-tm-1
+ responses:
+ '200':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ msg:
+ type: string
+ time:
+ type: string
+ required:
+ - msg
+ - time
+ example:
+ msg: clonned-tm-1 was cloned successfully
+ time: 1 ms
+ headers: {}
+ security: []
+ /t5memory/{memory}/reorganize:
+ get:
+ summary: Reorganize
+ deprecated: false
+ description: >-
+ Under the hood it creates new tm with $Org- prefix, then reimport all
+ segments one-by-one, and then deletes original TM and rename reorganized
+ TM to replace original.
+
+ This request should flush tm(from RAM to the disk) before reorganizing
+
+
+ https://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-ReorganizeTM
+
+ Both newEntryIfOnlyContextAndTimestampDifferent and
+ saveDifferentTargetsForSameSource impact how similar translation would
+ be saved. In case if source and other field(doc, author, lang) are the
+ same, but target different, and
+ newEntryIfOnlyContextAndTimestampDifferent is set to true, you would
+ have 2 translation, otherwise you would have 1 translation saved - with
+ higher updateTime. but if you have different attributes, like document,
+ you would have 2 translation anyway.
+
+ newEntryIfOnlyContextAndTimestampDifferent would also increase number of
+ saved segments. If values was not provided, defaule values from flags
+ would be used.
+ tags: []
+ parameters:
+ - name: Accept
+ in: header
+ description: ''
+ required: true
+ example: application/json; charset=utf-8
+ schema:
+ type: string
+ - name: Accept-Charset
+ in: header
+ description: ''
+ required: true
+ example: UTF-8
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ newEntryIfOnlyContextAndTimestampDifferent:
+ type: string
+ enum:
+ - '1'
+ - '0'
+ example: '1'
+ saveDifferentTargetsForSameSource:
+ type: string
+ enum:
+ - '1'
+ - '0'
+ example: '1'
+ examples: {}
+ responses:
+ '200':
+ description: ''
+ content:
+ application/json:
+ schema:
+ type: object
+ properties: {}
+ headers: {}
+ security: []
+components:
+ schemas: {}
+ securitySchemes: {}
+servers: []
+security: []
diff --git a/docs/t5memory.postman.json b/docs/t5memory.postman.json
new file mode 100644
index 00000000..d3e2f6a8
--- /dev/null
+++ b/docs/t5memory.postman.json
@@ -0,0 +1,1056 @@
+{
+ "info": {
+ "name": "t5memory",
+ "description": "",
+ "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
+ },
+ "item": [
+ {
+ "name": "Flush memory",
+ "description": "Endpoint is sync(blocking)\n\nIf tm is not found on the disk - returns 404\nIf tm is not open - returns 400 with message\nThen t5memory requests writes pointer to the tm (so it waits till other requests that's working with the tm would finish) and then it flushes it to the disk\nCould also return an error if flushing got some issue.\nWould not open the tm, if it's not opened yet, but instead would return an error.",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "GET",
+ "body": {},
+ "header": [],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory/{{memory}}/flush",
+ "path": [
+ "t5memory",
+ "{{memory}}",
+ "flush"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "Tag replacement",
+ "description": "Fuzzy search tag replacement and Import tag replacement test",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "POST",
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"src\": \"Tap View o get strongdisplayedView two strongUS patents.\",\n \"trg\": \"View tap to got strongdosplaydVeiw two strongUS patents.\",\n \"req\": \"Tap View o get strongdisplayedView two strongUS patents.\"\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "header": [
+ {
+ "key": "Accept",
+ "value": "application/json; charset=utf-8",
+ "description": "",
+ "type": "string"
+ },
+ {
+ "key": "Accept-Charset",
+ "value": "UTF-8",
+ "description": "",
+ "type": "string"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory_service/tagreplacement",
+ "path": [
+ "t5memory_service",
+ "tagreplacement"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "Flags",
+ "description": "Return all available commandline flags. Do not spam too much because gflags documentation says that that's slow. Useful to collect configuration data about t5memory to do debugging.",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "GET",
+ "body": {},
+ "header": [],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory_service/flags",
+ "path": [
+ "t5memory_service",
+ "flags"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "Multifuzzy",
+ "description": "Sends multiple fuzzysearches in the same tm in a row",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "POST",
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"requests\": [\n {\n \"sourceLang\": \"en\",\n \"targetLang\": \"uk\",\n \"source\": \"First segment with int\",\n \"documentName\": \"\",\n \"context\": \"\",\n \"customId\": \"first\"\n },\n {\n \"sourceLang\": \"en\",\n \"targetLang\": \"uk\",\n \"source\": \"Third segment with\",\n \"documentName\": \"\",\n \"context\": \"\",\n \"customId\": \"second\"\n }\n ]\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "header": [],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory/{{memory}}/multifuzzysearch",
+ "path": [
+ "t5memory",
+ "{{memory}}",
+ "multifuzzysearch"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "Multi Update",
+ "description": "Send multiple updateEntry requests to the same tm with one call",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "POST",
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"requests\": [\n {\n \"customId\": \"fourth\",\n \"source\": \"Fourth segmnet\",\n \"target\": \"Четвертий сегмент\",\n \"type\": \"Manual\",\n \"markupTable\": \"OTMXUXLF\",\n \"targetLang\": \"en\",\n \"sourceLang\": \"uk\",\n \"documentName\": \"test.xlsx.sdlxliff\",\n \"author\": \"Project Manager\",\n \"context\": \"390\"\n },\n {\n \"customId\": \"fifth\",\n \"source\": \"Fifth segment\",\n \"target\": \"Пʼятий сегмент\",\n \"type\": \"Manual\",\n \"markupTable\": \"OTMXUXLF\",\n \"targetLang\": \"en\",\n \"sourceLang\": \"uk\",\n \"documentName\": \"translation.docx\",\n \"author\": \"Editor\",\n \"context\": \"200\"\n }\n ]\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "header": [],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory/{{memory}}/multiupdate",
+ "path": [
+ "t5memory",
+ "{{memory}}",
+ "multiupdate"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "Tables",
+ "description": "Get author, lang, langGroup(virtual- created in runtime and not saved on the disk), tagtable(deprecated - only one record), document(long filename, long filename caseignore-virtual, short filename- part deprecated)\n\nTables are provided in format - name(internal key): \"position) idInTable:value;\"\n\nhttps://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-Tables\nWhen adding new entry, for new Id t5memory uses basicaly size of the table before adding+1, so Id should start from id=1. \nWhen doing fuzzy search, some field could also be saved to the table, to generate then id(or find matching) to compare with saved data.\nThere are 2 types of entries- older, fixed size, and long filename. For older, every entry has the same size, 39 bytes+endOfLine. You can have up to 389 entries saved in that way in each of the tables. Longname table manage size dynamically, so it's not clear what's the maximum size, but for filenames there are duplicates in old style docname table and in longname(which are used only for this type of data). For filename search, first used longname table, then generated on tm loading caseignore longname table, then short name table. Usually entries in tables are caseignore. \n\nIn the record t5memory saves only id to the table. Maybe it make sense to implement endpoint to edit that table, if something is missing or corrupted. Exception for saving id are context and additional info, some data, that could be saved as int(segId, time), and source and target.\nTo clear or fix tag tables, you need to do reorganize, but if some entry is missing from the table, you would not restore it on export or segment exctraction via id. So tables could be used to check health of the tm. And for some ways for concordance search or some other checks.",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "GET",
+ "body": {},
+ "header": [
+ {
+ "key": "Accept",
+ "value": "application/json",
+ "description": "",
+ "type": "string"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory/{{memory}}/tables",
+ "path": [
+ "t5memory",
+ "{{memory}}",
+ "tables"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "Add to table",
+ "description": "You can add new entry to the tables but then it's better to reorganize tm(in case if after adding new entry with missing id and there are other entry with the same value but other id - which could be the case- in binary search that could cause problems - so just reorganize it afterwards). You can check table by just doing something like full export(or concordance search for full tm), and check logs for that 2222 errors.\n\nValues shouldn't be longer than 39 bytes(utf8), and 256 for filename,it's tables limits, for that it also have checks.\nIn cases like with those tms, you can also check if x-1 and x+1 id is present. Usually they are in those bug.\nalso you can check tables via tables request\nAlso logicaly FILE_KEY=2, but that was only for shortname, which was also 39 bytes, but real key for long name table is 5. But for requests and internal handling t5memory uses 2.\nId should be between 1 and 65k, request also checks for that",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "POST",
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"value\": \"MY new entry\",\n \"entryId\": 100,\n \"tableKey\": 2\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "header": [],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory/{{memory}}/addtotable",
+ "path": [
+ "t5memory",
+ "{{memory}}",
+ "addtotable"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "Create",
+ "description": "",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "POST",
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"name\": \"examle_tm2\",\n \"sourceLang\": \"de-DE\"\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "header": [],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory/",
+ "path": [
+ "t5memory"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "Create and import TM",
+ "description": "",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "POST",
+ "body": {
+ "mode": "raw",
+ "raw": "{ \n \"name\": \"test-memory\",\n \"sourceLang\": \"en-GB\",\n \"data\": \"UEsDBBQACAgIAFJmeFYAAAAAAAAAAAAAAAAoAAQASUQ2MzItR0VPLUxlaWNhLUhlbHAtTWFjaGluZSBDb250cm9sLk1FTQEAAADtzssKQEAUgOFjoTwGWR+5lPW4TCjDxgtomqI0I3lzLyBvIEUW59v829+GrinTJMaK99iqWY5Yq2VFMcpp1sotjN43swSCC/gSzw551bHu7MGLlMYqh6d8xrpBhBFjPnhACCGE/MMJUEsHCKEIpyRnAAAAAAAAAAAIAAAAAAAAUEsDBBQACAgIAFJmeFYAAAAAAAAAAAAAAAAoAAQASUQ2MzItR0VPLUxlaWNhLUhlbHAtTWFjaGluZSBDb250cm9sLlRNRAEAAADt3bFKI0EYB/BvNzFaXCXH1Vdcc3h7xR14xXEsd5pTwRgIEWwlBBRCFPEFbKx9BJ/DJ7CyshYrCwsbX0A3GtykFQnE329ZZnb+u92wMMXMt9FupBFxlERxRVTi+mPwCrNjLe9b+nw/qcRqq77UbC0HwCSdR/3vfafozSVry4s/f2Qr9Wa23t3tbGer3d5+1tju7Oz2u5+X9vqHB3u97+3Gm/24uv1s5V8AAAAAAAAAAAAAAAAAABHzg13/hVqcRSuPOM7P8sv8NG/lvTwAAAAAAAAAAAAAAAAAAABgasxFEjOD3rAO+EwpqQ56Jx+eRmqlpBLlj5JSUhtJqqUkGUnSUhIjQ5UYG4jiLIA7O/4BAAAAAAAAAAAAAAAAAABgAqrPJwHMx2zcfvryNdKbP1e/Iy5+LS58W3h8BgAAAAAAAAAAAJgO6Wg7rK7UbDe2NrfW/5dfTYJp9VI7a1i/CwAAYGLGVqq8U+YBBfOAgnnAowdQSwcITWiheHEBAAAAAAAAAAABAAAAAABQSwMEFAAICAgAUmZ4VgAAAAAAAAAAAAAAACgABABJRDYzMi1HRU8tTGVpY2EtSGVscC1NYWNoaW5lIENvbnRyb2wuVE1JAQAAAO3dwWkCYRAG0NFTzlaQBv4cEsg1JLqokI0gNiDLQgRZQ7ABu7MaLxawKijqWWQPvjcMM1PEx/xM8nZErCJa++J2dV1fTR5b+9inazDOuqNxLwCatI7sc1sctqfWsPf+9pr62Sh9l7Nimgbl/C/l0+J3VpXP3UW1/F/MXyb5MO6krFL/KwAAAAAAAAAAAAAAAACAiM5F6r8Tm48AAAAAAAAAAAAAAAAAAAAAGnD+TS7/DwAAAAAAAAAAAAAAAAAAAM3YAVBLBwgGVIGewwAAAAAAAAAAwAAAAAAAAFBLAQIAABQACAgIALRlVFahCKckZwAAAAAIAAAoAAQAAAAAAAAAAACkgQAAAABJRDYzMi1HRU8tTGVpY2EtSGVscC1NYWNoaW5lIENvbnRyb2wuTUVNAQAAAFBLAQIAABQACAgIAGdralZNaKF4cQEAAAAAAQAoAAQAAAAAAAAAAACkgckAAABJRDYzMi1HRU8tTGVpY2EtSGVscC1NYWNoaW5lIENvbnRyb2wuVE1EAQAAAFBLAQIAABQACAgIAFJmeFYGVIGewwAAAADAAAAoAAQAAAAAAAAAAACkgZwCAABJRDYzMi1HRU8tTGVpY2EtSGVscC1NYWNoaW5lIENvbnRyb2wuVE1JAQAAAFBLBgYsAAAAAAAAAB4DLQAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAOAQAAAAAAAMEDAAAAAAAAUEsGBwAAAADPBAAAAAAAAAEAAABQSwUGAAAAAAMAAwAOAQAAwQMAAAAA\"\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "header": [],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory/",
+ "path": [
+ "t5memory"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "Get",
+ "description": "",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "GET",
+ "body": {},
+ "header": [],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory/",
+ "path": [
+ "t5memory"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "Resources",
+ "description": "",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "GET",
+ "body": {},
+ "header": [],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory_service/resources",
+ "path": [
+ "t5memory_service",
+ "resources"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "Status",
+ "description": "https://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-GetthestatusofTM",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "GET",
+ "body": {},
+ "header": [],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory/{{memory}}/status",
+ "path": [
+ "t5memory",
+ "{{memory}}",
+ "status"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "IMPORT TMX",
+ "description": "Rout is async. So when import is finished should be checked with status call",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "POST",
+ "body": {
+ "mode": "formdata",
+ "formdata": [
+ {
+ "key": "json_data",
+ "value": "{\n \"framingTags\": \"saveAll\",\n \"newEntryIfOnlyContextAndTimestampDifferent\": 0,\n \"saveDifferentTargetsForSameSource\": 0,\n \"timeout\": 100000\n}\n",
+ "description": "json pretty print string.\n\n\"framingTags\" key possible values:\n\"saveAll\" - default behaviour, do nothing\n\"skipAll\" - skip all enclosing tags, including standalone tags\n\"skipPaired\" - skip only paired enclosing tags\n\nBoth newEntryIfOnlyContextAndTimestampDifferent and saveDifferentTargetsForSameSource impact how similar translation would be saved. In case if source and other field(doc, author, lang) are the same, but target different, and newEntryIfOnlyContextAndTimestampDifferent is set to true, you would have 2 translation, otherwise you would have 1 translation saved - with higher updateTime. but if you have different attributes, like document, you would have 2 translation anyway. \nnewEntryIfOnlyContextAndTimestampDifferent would also increase number of saved segments. If values was not provided, default values from flags would be used.",
+ "type": "text",
+ "contentType": "application/json",
+ "disabled": false
+ },
+ {
+ "key": "file",
+ "description": "tmx file to import into TM",
+ "type": "file",
+ "disabled": false
+ }
+ ]
+ },
+ "header": [],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory/{{memory}}/importtmx",
+ "path": [
+ "t5memory",
+ "{{memory}}",
+ "importtmx"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "EXPORT TMX",
+ "description": "JSON pretty print string:\nlimit - number of segments to fetch at a time\nstartFromInternalKey - internal key to start export from\n\nWorks as cursor pagination.\n\nIf no body provided, export starts from the beginning (key 7:1) to the end.",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "GET",
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"limit\": \"100\",\n \"startFromInternalKey\": \"1:1\"\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "header": [
+ {
+ "key": "Accept",
+ "value": "application/xml",
+ "description": "",
+ "type": "string"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory/{{memory}}/download.tmx",
+ "path": [
+ "t5memory",
+ "{{memory}}",
+ "download.tmx"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "Concordance search",
+ "description": "All fields is optional, but some depends on other, so error should be returned in case of not providing required field.\nhttps://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-NewConcordancesearch",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "POST",
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"source\": \"First\",\n \"sourceSearchMode\": \"contains, CASEINSENSETIVE\",\n \"target\": \"\",\n \"targetSearchMode\": \"contains, CASEINSENSETIVE\",\n \"document\": \"\",\n \"documentSearchMode\": \"contains, CASEINSENSETIVE\",\n \"author\": \"\",\n \"authorSearchMode\": \"contains, CASEINSENSETIVE\",\n \"addInfo\": \"\",\n \"addInfoSearchMode\": \"contains, CASEINSENSETIVE\",\n \"context\": \"\",\n \"contextSearchMode\": \"contains, CASEINSENSETIVE\",\n \"timestampSpanStart\": \"19691231T230000Z\",\n \"timestampSpanEnd\": \"20260628T220000Z\",\n \"onlyCountSegments\": \"0\",\n \"searchPosition\": \"\",\n \"logicalOr\": 0,\n \"numResults\": 200\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "header": [
+ {
+ "key": "Accept",
+ "value": "application/json; charset=utf-8",
+ "description": "",
+ "type": "string"
+ },
+ {
+ "key": "Accept-Charset",
+ "value": "UTF-8",
+ "description": "",
+ "type": "string"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory/{{memory}}/search",
+ "path": [
+ "t5memory",
+ "{{memory}}",
+ "search"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "Concordance search (DEPRICATED)",
+ "description": " SearchPosition / NewSearchPositionFormat: \"7:1\"\nFirst is segmeng\\record number, second is target number\nThe NextSearchposition is an internal key of the memory for the next position on sequential access. Since it is an internal key, maintained and understood by the underlying memory plug-in (for EqfMemoryPlugin is it the record number and the position in one record),\nno assumptions should be made regarding the content. It is just a string that, should be sent back to OpenTM2 on the next request, so that the search starts from there.\nSo is the implementation in Translate5: The first request to OpenTM2 contains SearchPosition with an empty string, OpenTM2 returns than a string in NewSearchPosition, which is just resent to OpenTM2 in the next request.\nhttps://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-Concordancesearch\n ",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "POST",
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"searchString\": \"With nice text\",\n \"searchType\": \"source\",\n \"searchPosition\": null,\n \"numResults\": 20,\n \"msSearchAfterNumResults\": 250\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "header": [
+ {
+ "key": "Accept",
+ "value": "application/json; charset=utf-8",
+ "description": "",
+ "type": "string"
+ },
+ {
+ "key": "Accept-Charset",
+ "value": "UTF-8",
+ "description": "",
+ "type": "string"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory/{{memory}}/concordancesearch",
+ "path": [
+ "t5memory",
+ "{{memory}}",
+ "concordancesearch"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "Fuzzy search",
+ "description": "https://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-Fuzzysearch",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "POST",
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"sourceLang\": \"en\",\n \"targetLang\": \"uk\",\n \"source\": \"Second segment \",\n \"documentName\": \"\",\n \"markupTable\": \"OTMXUXLF\",\n \"context\": \"\"\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "header": [],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory/{{memory}}/fuzzysearch",
+ "path": [
+ "t5memory",
+ "{{memory}}",
+ "fuzzysearch"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "Get entry",
+ "description": "Each segmnet entry in seach payloads has \"internalKey\": \"9:1\" like key-value.\nIn this example 9 is \"recordKey\" and 1 is \"targetKey\".",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "POST",
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"recordKey\": \"8\",\n \"targetKey\": \"2\"\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "header": [],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory/{{memory}}/getentry",
+ "path": [
+ "t5memory",
+ "{{memory}}",
+ "getentry"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "Update",
+ "description": "https://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-Updateentry",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "POST",
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"source\": \" ... \",\n \"target\": \" ... \",\n \"type\": \"Manual\",\n \"markupTable\": \"OTMXUXLF\",\n \"sourceLang\": \"de-DE\",\n \"targetLang\": \"en-GB\",\n \"timeStamp\": \"20240111T111443Z\",\n \"documentName\": \"translation.txt\",\n \"author\": \"Project Manager\",\n \"context\": \"\",\n \"save2disk\": 1\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "header": [
+ {
+ "key": "Accept",
+ "value": "application/json; charset=utf-8",
+ "description": "",
+ "type": "string"
+ },
+ {
+ "key": "Accept-Charset",
+ "value": "UTF-8",
+ "description": "",
+ "type": "string"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory/{{memory}}/entry",
+ "path": [
+ "t5memory",
+ "{{memory}}",
+ "entry"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "Delete TM",
+ "description": "",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "DELETE",
+ "body": {
+ "mode": "raw",
+ "options": {
+ "raw": {
+ "language": "text"
+ }
+ }
+ },
+ "header": [],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory/{{memory}}",
+ "path": [
+ "t5memory",
+ "{{memory}}"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "Delete entry",
+ "description": "Each segmnet entry in seach payloads has \"internalKey\": \"9:1\" like key-value.\nIn this example 9 is \"recordKey\" and 1 is \"targetKey\".\nThere is also \"segmentId\" value.\nFor delete entry request it should be provided to validate that current state of t5memory data is same as at the moment when you got internalKey as internal key value may be regenerated at any moment of data processing on import or update rrquest handling.\nSo if you try to delete entry and getting error - try to fetch entry internalKey nad segmentId again and then retry delete action.",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "POST",
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"recordKey\": 8,\n \"targetKey\": 4,\n \"segmentId\": 12\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "header": [],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory/{{memory}}/entrydelete",
+ "path": [
+ "t5memory",
+ "{{memory}}",
+ "entrydelete"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "Delete batch",
+ "description": "Asynchronious operation.\nThis would start reorganize process which would remove like reorganize bad segments and also would remove segments that gives true when checking with provided filters combined with logical AND. So if you provide timestamps and addInfo, only segments within provided timestamp and with that addInfo would not be imported to new TM(check reorganize process). \nEvery parameter is optional, so empty json would just start reorganize async process.\nIf you provide one of timestamps you would get error - please provide both. \nTo add parameter you should set it's SearchMode to be EXACT|CONCORDANCE(non case sensetive)\nIf only searched string provided, but not search mode - you would get error.",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "POST",
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"source\": \"123\",\n \"sourceSearchMode\": \"contains, CASEINSENSETIVE\",\n \"target\": \"234\",\n \"targetSearchMode\": \"contains, CASEINSENSETIVE\",\n \"document\": \"\",\n \"documentSearchMode\": \"contains, CASEINSENSETIVE\",\n \"author\": \"\",\n \"authorSearchMode\": \"contains, CASEINSENSETIVE\",\n \"addInfo\": \"\",\n \"addInfoSearchMode\": \"contains, CASEINSENSETIVE\",\n \"context\": \"\",\n \"contextSearchMode\": \"contains, CASEINSENSETIVE\",\n \"timestampSpanStart\": \"19691231T230000Z\",\n \"timestampSpanEnd\": \"20240610T220000Z\",\n \"searchPosition\": \"\"\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "header": [],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory/{{memory}}/entriesdelete",
+ "path": [
+ "t5memory",
+ "{{memory}}",
+ "entriesdelete"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "Shutdown",
+ "description": "Safely shutting down the service with\\without saving all loaded tm files to the disk.",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "POST",
+ "body": {},
+ "header": [
+ {
+ "key": "Accept",
+ "value": "application/json; charset=utf-8",
+ "description": "",
+ "type": "string"
+ },
+ {
+ "key": "Accept-Charset",
+ "value": "UTF-8",
+ "description": "",
+ "type": "string"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory_service/shutdown",
+ "path": [
+ "t5memory_service",
+ "shutdown"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [
+ {
+ "key": "dontsave",
+ "description": "Skips saving tms, for now value doesn't matter, only presence.\nIf try to save tms before closing, would check if there is still import process going on\nIf there is some, would wait 1 second and check again. \nRepeats last step up to 10 min, then closes service anyway. ",
+ "type": "string"
+ }
+ ],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "Save TMs",
+ "description": "Flushes all filebuffers(TMD, TMI files) into the filesystem. Reset 'Modified' flags for file buffers. \n\nFilebuffer is a file instance of .TMD or .TMI loaded into RAM. It provides better speed and safety when working with files.",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "GET",
+ "body": {},
+ "header": [
+ {
+ "key": "Accept",
+ "value": "application/json; charset=utf-8",
+ "description": "",
+ "type": "string"
+ },
+ {
+ "key": "Accept-Charset",
+ "value": "UTF-8",
+ "description": "",
+ "type": "string"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory_service/savetms",
+ "path": [
+ "t5memory_service",
+ "savetms"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "Clone",
+ "description": "Creates TM with the provided name and data cloned from provided memory",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "POST",
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"newName\": \"clonned-tm-1\"\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "header": [
+ {
+ "key": "Accept",
+ "value": "application/json; charset=utf-8",
+ "description": "",
+ "type": "string"
+ },
+ {
+ "key": "Accept-Charset",
+ "value": "UTF-8",
+ "description": "",
+ "type": "string"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory/{{memory}}/clone",
+ "path": [
+ "t5memory",
+ "{{memory}}",
+ "clone"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ },
+ {
+ "name": "Reorganize",
+ "description": "Under the hood it creates new tm with $Org- prefix, then reimport all segments one-by-one, and then deletes original TM and rename reorganized TM to replace original. \nThis request should flush tm(from RAM to the disk) before reorganizing\n\nhttps://confluence.translate5.net/display/TAD/t5memory+-+translate5+TM+service+-+REST+API#t5memorytranslate5TMserviceRESTAPI-ReorganizeTM\nBoth newEntryIfOnlyContextAndTimestampDifferent and saveDifferentTargetsForSameSource impact how similar translation would be saved. In case if source and other field(doc, author, lang) are the same, but target different, and newEntryIfOnlyContextAndTimestampDifferent is set to true, you would have 2 translation, otherwise you would have 1 translation saved - with higher updateTime. but if you have different attributes, like document, you would have 2 translation anyway. \nnewEntryIfOnlyContextAndTimestampDifferent would also increase number of saved segments. If values was not provided, defaule values from flags would be used.",
+ "event": [],
+ "auth": {},
+ "request": {
+ "auth": {},
+ "method": "GET",
+ "body": {
+ "mode": "raw",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "header": [
+ {
+ "key": "Accept",
+ "value": "application/json; charset=utf-8",
+ "description": "",
+ "type": "string"
+ },
+ {
+ "key": "Accept-Charset",
+ "value": "UTF-8",
+ "description": "",
+ "type": "string"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/t5memory/{{memory}}/reorganize",
+ "path": [
+ "t5memory",
+ "{{memory}}",
+ "reorganize"
+ ],
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "query": [],
+ "variable": []
+ }
+ },
+ "response": [],
+ "protocolProfileBehavior": {
+ "strictSSL": false,
+ "followRedirects": true
+ }
+ }
+ ],
+ "variable": [],
+ "event": [],
+ "auth": {}
+}
\ No newline at end of file
diff --git a/include/EQF.H b/include/EQF.H
index cd60ebeb..7d23aa69 100755
--- a/include/EQF.H
+++ b/include/EQF.H
@@ -555,22 +555,6 @@
}
-#ifdef TEMPORARY_COMMENTED
-#define CBQUERYSELECTEDITEMTEXT( sItem, hwnd, id, szBuffer ) \
- { \
- sItem = (SHORT)SendDlgItemMessage( hwnd, id, CB_GETCURSEL, 0, 0L ); \
- if( sItem != CB_ERR ) \
- { \
- SendDlgItemMessage( hwnd, id, CB_GETLBTEXT, MP1FROMSHORT( sItem ), \
- MP2FROMP( szBuffer ) ); \
- } \
- else \
- { \
- szBuffer [0] = EOS; \
- } /* endif */ \
- }
-#endif
-
#define CBQUERYSELECTEDITEMTEXTHWND( sItem, hwnd, szBuffer ) \
{ \
sItem = (SHORT)CPLUSPLUS SendMessage( hwnd, CB_GETCURSEL, 0, 0L ); \
@@ -3642,9 +3626,9 @@ typedef ULONG HPRINT, *PHPRINT;
ULONG UtlLongToDateString( LONG, PSZ, ULONG );
ULONG UtlLongToTimeStringW( LONG, PSZ_W, ULONG );
ULONG UtlLongToDateStringW( LONG, PSZ_W, ULONG );
- BOOL UtlLoadFile( PSZ, PVOID *, USHORT *, BOOL, BOOL );
- BOOL UtlLoadFileL( PSZ, PVOID *, ULONG *, BOOL, BOOL );
- BOOL UtlLoadFileHwnd( PSZ, PVOID *, ULONG *, BOOL, BOOL, HWND );
+ BOOL UtlLoadFile( PSZ, BytesRef , USHORT *, BOOL, BOOL );
+ BOOL UtlLoadFileL( PSZ, BytesRef , ULONG *, BOOL, BOOL );
+ BOOL UtlLoadFileHwnd( PSZ, BytesRef , ULONG *, BOOL, BOOL, HWND );
USHORT UtlCheckSpaceForFile( PSZ, USHORT, LONG, PSZ *, LONG *, BOOL );
USHORT UtlCheckSpaceForFileEx( PSZ, USHORT, LONG, PSZ *, LONG *, BOOL, PUSHORT );
ULONG64 UtlQueryFreeSpace( CHAR, BOOL );
@@ -3669,7 +3653,6 @@ typedef ULONG HPRINT, *PHPRINT;
PSZ UtlMakeFullPath ( PSZ, PSZ, PSZ, PSZ, PSZ );
USHORT UtlWriteFile( PSZ pszFile, ULONG ulDataLength, PVOID pData);
BOOL UtlIsEqfDrive( CHAR chDrive );
- BOOL UtlGetCheckedEqfDrives( PSZ pszDrives );
char* UtlGetFnameFromPath( const char* path);
PSZ UtlMakeObjName( PSZ p, PSZ drive, PSZ path, PSZ fname, PSZ ext);
VOID UtlMakeFNameAndPath( PSZ, PSZ, PSZ );
@@ -3707,14 +3690,11 @@ SHORT UtlDriveType( CHAR chDrive );
VOID UtlSetHorzScrollingForLB(HWND hLB);
VOID UtlSaveWindowPos( HWND hFrame, EQF_PSWP pSwp);
-BOOL UtlAllocHwnd ( PVOID *, LONG, LONG, USHORT, HWND );
BOOL UtlInitUtils( HAB );
BOOL UtlRegisterEqfHelp( HAB );
BOOL UtlTerminateUtils( VOID );
USHORT UtlError ( SHORT, USHORT, USHORT, PSZ *, ERRTYPE );
USHORT UtlErrorHwnd ( SHORT, USHORT, USHORT, PSZ *, ERRTYPE, HWND );
-USHORT UtlErrorW ( SHORT, USHORT, USHORT, PSZ_W *, ERRTYPE, BOOL );
-USHORT UtlErrorHwndW ( SHORT, USHORT, USHORT, PSZ_W *, ERRTYPE, HWND, BOOL );
VOID UtlGetMsgTxt( SHORT, PSZ, USHORT, PSZ *);
VOID UtlInitError ( HAB, HWND, HWND, PSZ );
@@ -3907,13 +3887,7 @@ USHORT UtlFillTableLB( HWND, USHORT ); // get languages
USHORT SetSystemLanguage( PSZ pLanguage );
USHORT UtlSetFHandState( HFILE hf, USHORT fsState, BOOL fMsg );
USHORT UtlSetFHandStateHwnd( HFILE hf, USHORT fsState, BOOL fMsg, HWND hwnd );
-BOOL UtlAllocTrace ( PVOID *, LONG, LONG, USHORT, PSZ, USHORT );
-BOOL UtlAllocTraceHwnd ( PVOID *, LONG, LONG, USHORT, HWND, PSZ, USHORT );
#ifdef UTLFFST
- #define UtlAlloc( par1, par2, par3, par4 ) \
- UtlAllocTrace(par1, par2, par3, par4, __FILE__, __LINE__ )
- #define UtlAllocHwnd( par1, par2, par3, par4, par5 ) \
- UtlAllocTraceHwnd(par1, par2, par3, par4, par5, __FILE__, __LINE__ )
#endif
USHORT EqfDriveType(USHORT iDrive);
@@ -3945,11 +3919,6 @@ BOOL UtlKeepInTWB( PSWP pswpWin );
USHORT UtlCheckDlgPos( HWND hwndDlg, BOOL fShow );
LONG UtlTime( PLONG plTime );
-#ifdef UTLFFST
-#define UtlAlloc( par1, par2, par3, par4 ) \
- UtlAllocTrace(par1, par2, par3, par4, __FILE__, __LINE__ )
-
-#endif
VOID UtlWait( SHORT sWaitTime ); // wait the given time
USHORT UtlLoadWidth( HAB, HMODULE, SHORT, PUSHORT );
@@ -5383,8 +5352,6 @@ ULONG GetOrgLangCP( PSZ pLanguage, BOOL fASCII );
//------------------------------------------------------------------------------
struct TERMLENOFFS
{
- // int iLength; // length of term
- // int iOffset; // offset of term data in buffer
USHORT iLength; // length of term
USHORT iOffset; // offset of term data in buffer
TERMLENOFFS(){iLength = iOffset = 0;}
@@ -5428,7 +5395,6 @@ void LogSysInfo( VOID );
PSZ_W UTF16strcpy( PSZ_W pszTarget, PSZ_W pszSource );
PSZ_W UTF16strcat( PSZ_W pszTarget, PSZ_W pszSource );
PSZ_W UTF16strncpy(PSZ_W pusTarget, PSZ_W pusSource, LONG lLen);
-int UTF16strcmp( PSZ_W pszString1, PSZ_W pszString2 );
int UTF16strncmpL( PSZ_W pszString1, PSZ_W pszString2, LONG lLen );
int UTF16strnicmpL( PSZ_W pszString1, PSZ_W pszString2, LONG lLen );
int UTF16strncmp( PSZ_W pszString1, PSZ_W pszString2, USHORT usLen );
@@ -5657,19 +5623,6 @@ BOOL DicGetCheckPassword( PSZ pszPassword, PULONG pulPassword, BOOL fCheckPasswo
#define XLATEOS2_MARKUP "XLATEOS2"
#define XLATEWIN_MARKUP "XLATEWIN"
-// support additional pages in document import/export
-typedef struct _EXTRAIDA
-{
- CHAR szFileName[ MAX_PATH144 ]; // filename to be used
- HWND hwndExpListbox; // handle of listbox containing selected docs
- OBJNAME szFolderObjName; // folder object name
- PVOID pIda; // product specifics
- USHORT usExtraPage; // number of extra page
- HWND hwnd; // handle of parent dialog
- OBJNAME szParentObjName; // parent (sub)folder object name
-} EXTRAIDA, *PEXTRAIDA;
-
-
// defines for SGML Formats
#define SGMLFORMAT_ANSI 1
@@ -5745,7 +5698,6 @@ NTMCompareBetweenTokens
PSZ_W pD2,
PSZ pszMarkup,
SHORT sLangID,
- ULONG ulSrcCP,
PBOOL pfStringEqual
);
diff --git a/include/EQFDASD.H b/include/EQFDASD.H
index 23f8e683..cc50b09e 100755
--- a/include/EQFDASD.H
+++ b/include/EQFDASD.H
@@ -212,15 +212,7 @@ typedef enum _TERMTYPE
#define STYLEPREFIX_UNDEFINED 0x2715 //
-#define ASD_GUARDED 0x01 // Open dictionary in guarded mode
-#define ASD_LOCKED 0x10 // Open dictionary and lock it
-#define ASD_FORCE_WRITE 0x40 // force imm.write of any changed record
-#define ASD_NOINDEX 0x80 // Do not process index dictionary
- // Caution: this define should be used
- // only for dictionary organize!!!
#define ASD_ORGANIZE 0x100 // work in organize mode
-#define ASD_NOOPENCHECK 0x200 // do not check QDAM header open flag
-#define ASD_READONLY 0x400 // open in read only mode
// AsdTranslate mode: return terms only
diff --git a/include/EQFDDE.H b/include/EQFDDE.H
index c05efd28..a2bf3ae2 100755
--- a/include/EQFDDE.H
+++ b/include/EQFDDE.H
@@ -587,10 +587,10 @@ typedef struct _BATCHIMPORTPARMS
HGLOBAL MakeDDEDataSeg(USHORT, PSZ, PVOID, USHORT, USHORT );
-static BOOL EQFFunctionCmdLine (PDDECLIENT );
-static BATCHCMD ValidateToken ( PSZ *ppToken, PBATCHLIST pBatchList );
-static BOOL CheckBatchOccurrence (PDDECLIENT, PUSHORT);
-static DDETASK ValidateTask ( PDDECLIENT pDDEClient );
+BOOL EQFFunctionCmdLine (PDDECLIENT );
+BATCHCMD ValidateToken ( PSZ *ppToken, PBATCHLIST pBatchList );
+BOOL CheckBatchOccurrence (PDDECLIENT, PUSHORT);
+DDETASK ValidateTask ( PDDECLIENT pDDEClient );
BOOL DDEDocUnLoad( PDOCIMPEXP pDocExpIda );
BOOL DDEDocLoad( PDOCIMPEXP pDocImpIda );
diff --git a/include/EQFFUZZ.H b/include/EQFFUZZ.H
index 75d5f9b2..6aad5807 100755
--- a/include/EQFFUZZ.H
+++ b/include/EQFFUZZ.H
@@ -1,4 +1,4 @@
-
+#include "lowlevelotmdatastructs.h"
#ifndef _EQFFUZZ_H_
#define _EQFFUZZ_H_
@@ -31,9 +31,6 @@ typedef struct _LCSTOKEN
SHORT sTotalLen;
} LCSTOKEN, *PLSCTOKEN;
-
-
-
//static
SHORT CompFuzzyTok ( PFUZZYTOK , PFUZZYTOK, BOOL );
@@ -43,10 +40,8 @@ SHORT CompFuzzyTok ( PFUZZYTOK , PFUZZYTOK, BOOL );
//static
VOID MakeHashValue ( PULONG, USHORT, PSZ_W, PULONG );
-
-
//static
-BOOL PrepareTokens ( PLOADEDTABLE, PBYTE, PBYTE, PSZ_W, SHORT, PFUZZYTOK *, ULONG );
+BOOL PrepareTokens ( PLOADEDTABLE, PSZ_W, SHORT, std::vector & );
//static
BOOL FuzzyReplace ( PSZ_W, PSZ_W, PSZ_W, PREPLLIST, PREPLLIST );
//static
@@ -54,7 +49,7 @@ VOID TransferSource( PSZ_W, PSZ_W, PSZ_W );
//static
SHORT TokStrCompare ( PFUZZYTOK, PFUZZYTOK);
//static
-PFUZZYTOK SplitTokens (PFUZZYTOK, USHORT, SHORT, int, PSZ_W);
+void SplitTokens (std::vector&, USHORT, SHORT, int, PSZ_W);
//static
//static
SHORT Snake ( PFUZZYTOK, PFUZZYTOK, SHORT, SHORT, SHORT, SHORT, BOOL);
@@ -64,13 +59,11 @@ SHORT FindMiddleSnake( PFUZZYTOK, PFUZZYTOK, PFUZZYTOK, PFUZZYTOK,
//static
VOID LCS( LCSTOKEN, LCSTOKEN , BOOL);
//static
-BOOL EQFBTokCountDiff(PFUZZYTOK, PFUZZYTOK,
- USHORT, USHORT, PUSHORT);
//static
- BOOL EQFBMarkModDelIns( PFUZZYTOK, PFUZZYTOK, PFUZZYTOK*, PFUZZYTOK *,
+ BOOL EQFBMarkModDelIns( std::vector&, std::vector&, std::vector&, std::vector&,
USHORT, USHORT);
//static
-void EQFBSimplifyAndCountMarks (PFUZZYTOK, PUSHORT, PUSHORT);
+void EQFBSimplifyAndCountMarks (std::vector&, PUSHORT, PUSHORT);
/**********************************************************************/
/* macro to calculate the number of tokens in the list ... */
diff --git a/include/EQFMORPH.H b/include/EQFMORPH.H
index 97319b4c..c03a501e 100755
--- a/include/EQFMORPH.H
+++ b/include/EQFMORPH.H
@@ -98,15 +98,7 @@
#include "LogWrapper.h"
-/**********************************************************************/
-/* Structure to access MORPH_FLAG_OFFSLIST type term lists */
-/**********************************************************************/
-typedef struct _FLAGOFFSLIST
-{
- LONG lFlags; // flags of term
- USHORT usLen; // length of term
- USHORT usOffs; // offset of term
-} FLAGOFFSLIST, *PFLAGOFFSLIST;
+
//+----------------------------------------------------------------------------+
// Flags for flagged term lists
@@ -190,12 +182,7 @@ USHORT MorphTokenizeW
(
SHORT sLanguageID, // language ID
PSZ_W pszInData, // pointer to input segment
- PUSHORT pusBufferSize, // address of variable containing size of
- // term list buffer
- TERMLENOFFS** ppTermList, // address of caller's term list pointer
- USHORT usListType, // type of term list MORPH_ZTERMLIST or
- // MORPH_OFFSLIST
- ULONG ulOemCP
+ std::vector& ppTermList// address of caller's term list pointer
);
@@ -330,26 +317,9 @@ USHORT MorphAddTermToList2
USHORT MorphAddTermToList2W
(
- PSZ_W *ppList, // ptr to term list pointer
- PULONG pulSize, // ptr to allocated size of term list
- PULONG pulUsed, // ptr to used bytes in term list
- PSZ_W pszTerm, // ptr to new term being added to list
- USHORT usLength, // length of term
- USHORT usOffs, // offset of term
- ULONG ulFlags, // flags for the term
- USHORT usListType // type of list MORPH_ZTERMLIST or
-);
-
-
-USHORT MorphCopyTermListASCII2Unicode
-(
- PSZ pList, // ptr to ASCII termlist
- USHORT usBufferSize, // size of allocated buffer
- PSZ_W *ppListW, // ptr to term list pointer
- PULONG pulSize, // ptr to allocated size of term list
- PULONG pulUsed, // ptr to used bytes in term list
- USHORT usListType, // type of list
- ULONG ulOemCP
+ std::vector& pList, // ptr to term list pointer
+ int iLength, // length of term in # of w's
+ int iOffs // offset of term in # of w's???
);
diff --git a/include/EQFOSWIN.H b/include/EQFOSWIN.H
index e54dfe3a..3f2cf910 100755
--- a/include/EQFOSWIN.H
+++ b/include/EQFOSWIN.H
@@ -130,7 +130,6 @@ HWND WinQueryWindow ( HWND, SHORT, BOOL );
/* one might probably use NULL as default, but we use our UTL-function*/
/* which stores the anchor block for PM - we store the instead instead*/
/**********************************************************************/
-#define WinQueryAnchorBlock( a ) ((HAB) UtlQueryULong( QL_HAB ))
/**********************************************************************/
/* resource strings */
/**********************************************************************/
@@ -1048,12 +1047,7 @@ USHORT DosGetDateTime( PDATETIME pDateTime );
/**********************************************************************/
SHORT GetNextSelection( HWND hwndLB, SHORT sPos );
-/**********************************************************************/
-/* force use of GetOEMCP- needed for 32-bit */
-/* GetKBCodePage returns 437 for TChin/SChin/Korean under Win95! */
-/* which causes that no DBCS chars are detected!! */
-/**********************************************************************/
-#define GetKBCodePage() GetOEMCP()
+
/**********************************************************************/
/* allow to fill the rectangle in the selected color */
diff --git a/include/EQFQDAMI.H b/include/EQFQDAMI.H
index a2ab3533..8e6de758 100755
--- a/include/EQFQDAMI.H
+++ b/include/EQFQDAMI.H
@@ -347,7 +347,7 @@ typedef struct _DICTSIGN
SHORT QDAMDictInsert
(
PBTREE pBT, // pointer to binary tree struct
- PWCHAR pKey, // pointer to key data
+ LONG lKey, // pointer to key data
PBYTE pData, // pointer to user data
ULONG ulLen // length of user data
);
@@ -392,7 +392,7 @@ typedef struct _DICTINSERT
SHORT QDAMDictExact
(
PBTREE pBT, // pointer to btree struct
- PWCHAR pKey, // key to be searched for
+ LONG lKey, // key to be searched for
PBYTE pchBuffer, // space for user data
PULONG pulLength, // in/out length of returned user data
USHORT usSeachSubType
@@ -438,7 +438,7 @@ SHORT QDAMDictExact
SHORT QDAMDictSubStr
(
PBTREE pBT, // pointer to btree struct
- PWCHAR pKey, // key to be searched for
+ LONG lKey, // key to be searched for
PBYTE pchBuffer, // space for key data
PULONG pulLength, // in/out length of returned key data
PBYTE pchUserData, // space for user data
@@ -484,7 +484,7 @@ SHORT QDAMDictSubStr
SHORT QDAMDictEquiv
(
PBTREE pBT, // pointer to btree struct
- PWCHAR pKey, // key to be searched for
+ LONG lKey, // key to be searched for
PBYTE pchBuffer, // space for key data
PULONG pulLength, // in/out length of returned key data
PBYTE pchUserData, // space for user data
@@ -573,7 +573,7 @@ SHORT QDAMDictLockEntry
SHORT QDAMDictFirst
(
PBTREE pBT,
- PWCHAR pKeyData, // pointer to space for key data
+ ULONG ulKeyData, // pointer to space for key data
PULONG pulKeyLen, // length of space for key data
PBYTE pUserData, // pointer to space for user data
PULONG pulUserLen // length of space for user data
@@ -781,7 +781,7 @@ SHORT QDAMDictNumber
(
PBTREE pBT, // pointer to generic structure
ULONG ulTermNum, // term number
- PWCHAR pKey, // pointer to space for term
+ LONG lKey, // pointer to space for term
PULONG pulKeyLen, // length of key
PBYTE pData, // pointer to data
PULONG pulLen // length of data
@@ -894,46 +894,46 @@ typedef struct _DICTTIME
SHORT QDAMDictNumEntriesLocal ( PBTREE, PULONG );
- SHORT QDAMDictFirstLocal ( PBTREE, PWCHAR, PULONG, PBYTE, PULONG );
+ SHORT QDAMDictFirstLocal ( PBTREE, LONG&, BytesRef );
+
+ SHORT QDAMInsertKey_V3( PBTREE, std::shared_ptr&, PWCHAR, RECPARAM, RECPARAM );
+ SHORT QDAMFindParent_V3(PBTREE, std::shared_ptr&, PUSHORT );
- SHORT QDAMInsertKey_V3( PBTREE, PBTREEBUFFER_V3, PWCHAR, RECPARAM, RECPARAM );
- SHORT QDAMFindParent_V3(PBTREE, PBTREEBUFFER_V3, PUSHORT );
+ SHORT QDAMFindChild_V3 ( PBTREE, PWCHAR, USHORT, std::shared_ptr& );
- SHORT QDAMFindChild_V3 ( PBTREE, PWCHAR, USHORT, PBTREEBUFFER_V3 * );
+ SHORT QDAMChangeKey_V3(PBTREE, USHORT, LONG&, LONG& );
+ SHORT QDAMNewRecord_V3( PBTREE, std::shared_ptr&, RECTYPE, bool fSuppressTmdSizeCheck = false );
- SHORT QDAMChangeKey_V3(PBTREE, USHORT, PWCHAR, PWCHAR );
- SHORT QDAMNewRecord_V3( PBTREE, PBTREEBUFFER_V3 *, RECTYPE, bool fSuppressTmdSizeCheck = false );
SHORT QDAMDeleteDataFromBuffer ( PBTREE, RECPARAM );
- SHORT QDAMSplitNode_V3( PBTREE, PBTREEBUFFER_V3 *, PWCHAR );
+ SHORT QDAMSplitNode_V3( PBTREE, std::shared_ptr&, LONG& );
- SHORT QDAMGetszKeyParam_V3( PBTREE, RECPARAM, PWCHAR, PULONG );
- SHORT QDAMGetszData_V3 ( PBTREE, RECPARAM, PBYTE, PULONG, CHAR );
+ SHORT QDAMGetszKeyParam_V3( PBTREE, RECPARAM, LONG& );
- BOOL QDAMDeleteKey_V3( PBTREE, PBTREEBUFFER_V3, PCHAR);
+ BOOL QDAMDeleteKey_V3( PBTREE, std::shared_ptr&, PCHAR);
SHORT QDAMDestroy ( PBTREE );
SHORT QDAMKeyCompare ( PVOID, PVOID, PVOID );
SHORT QDAMKeyCompareNonUnicode ( PVOID, PVOID, PVOID );
SHORT QDAMFirst_V3( PBTREE, PRECPARAM, PRECPARAM, PRECPARAM );
- SHORT QDAMUnTerseData ( PBTREE, PUCHAR, ULONG, PULONG );
+ SHORT QDAMUnTerseData ( PBTREE, BytesRef , ULONG );
+ SHORT QDAMValidateIndex_V3( PBTREE, std::shared_ptr& );
+
+ LONG QDAMGetszKey_V3 ( std::shared_ptr&, USHORT );
+ RECPARAM QDAMGetrecData_V3 ( std::shared_ptr&, SHORT );
+ VOID QDAMSetrecData_V3 ( std::shared_ptr&, SHORT, RECPARAM );
+ RECPARAM QDAMGetrecKey_V3 ( std::shared_ptr&, SHORT );
+ VOID QDAMReArrangeKRec_V3 ( PBTREE, std::shared_ptr& );
+ VOID QDAMCopyKeyTo_V3( std::shared_ptr&, SHORT, std::shared_ptr&, SHORT );
+ VOID QDAMCopyDataTo_V3( std::shared_ptr&, SHORT, std::shared_ptr&, SHORT );
+ SHORT QDAMLastEntry_V3( PBTREE, std::shared_ptr& );
+ SHORT QDAMFirstEntry_V3( PBTREE, std::shared_ptr& );
- PSZ_W QDAMGetszKey_V3 ( PBTREEBUFFER_V3, USHORT, USHORT );
- RECPARAM QDAMGetrecData_V3 ( PBTREEBUFFER_V3, SHORT, USHORT );
- VOID QDAMSetrecData_V3 ( PBTREEBUFFER_V3, SHORT, RECPARAM, USHORT );
- RECPARAM QDAMGetrecKey_V3 ( PBTREEBUFFER_V3, SHORT );
- VOID QDAMReArrangeKRec_V3 ( PBTREE, PBTREEBUFFER_V3 );
- VOID QDAMCopyKeyTo_V3( PBTREEBUFFER_V3, SHORT, PBTREEBUFFER_V3, SHORT, USHORT );
- VOID QDAMCopyDataTo_V3( PBTREEBUFFER_V3, SHORT, PBTREEBUFFER_V3, SHORT, USHORT );
- SHORT QDAMLastEntry_V3( PBTREE, PBTREEBUFFER_V3 * );
- SHORT QDAMFirstEntry_V3( PBTREE, PBTREEBUFFER_V3 * );
- BOOL QDAMFetchFromIndexList_V3( PBTREE, PBTREEBUFFER_V3, USHORT );
- VOID QDAMAddToIndexList_V3( PBTREE, PBTREEBUFFER_V3 );
SHORT QDAMAllocKeyRecords ( PBTREE, USHORT );
- SHORT QDAMLocSubstr_V3( PBTREE, PBTREEBUFFER_V3, PWCHAR, PBYTE, PULONG, PBYTE, PULONG );
+ SHORT QDAMLocSubstr_V3( PBTREE, std::shared_ptr&, PWCHAR, PBYTE, PULONG, PBYTE, PULONG );
@@ -1240,13 +1240,6 @@ void DAMLINK
// <> keys are unequal
//+----------------------------------------------------------------------------+
-SHORT NTMKeyCompare
-(
- PVOID pBTIda, // pointer to tree structure
- PVOID pulKey1, // pointer to first key
- PVOID pulKey2 // pointer to second key
-);
-
/**********************************************************************/
/* validate the passed BTree pointer */
/**********************************************************************/
@@ -1305,29 +1298,9 @@ USHORT QDamWildCardList
ULONG // in - size of buffer
);
-SHORT QDAMDictNextWildLocal
-(
- PBTREE pBTIda,
- PSZ_W pPattern, // search pattern or compound
- BOOL fCompound, // compound search flag
- PBYTE pKeyData, // pointer to space for key data
- PULONG pulKeyLen // length of space for key data
-);
-
-BOOL QDAMMatchCompound
-(
- PSZ_W pKey,
- PSZ_W pCompound
-);
-
-BOOL QDAMMatchWild
-(
- PUCHAR pKey,
- PUCHAR pPattern
-);
-ULONG QDAMComputeCheckSum_V3 (PBTREEBUFFER_V3 pRecord );
-BOOL QDAMCheckCheckSum_V3( PBTREEBUFFER_V3 pRecord, SHORT sLocation );
+ULONG QDAMComputeCheckSum_V3 (std::shared_ptr& pRecord );
+BOOL QDAMCheckCheckSum_V3( std::shared_ptr& pRecord, SHORT sLocation );
// get nect dictionary of an association list
diff --git a/include/EQFSETUP.H b/include/EQFSETUP.H
index 3fb8b6df..979bb9e5 100755
--- a/include/EQFSETUP.H
+++ b/include/EQFSETUP.H
@@ -79,34 +79,20 @@ typedef enum _UPDPROPTYPE
VOID BuildPath( PSZ pszBuffer, CHAR chEqfDrive, PSZ pszFolder, USHORT usPathID );
-static VOID DeleteFiles( PSZ, USHORT );
-static USHORT ErrorMessage( USHORT, PSZ, USHORT );
-static BOOL FileExists ( PSZ );
-static BOOL InstCheckAndAdd( PSZ *, PSZ, USHORT );
PSZ InstLocateString ( PSZ, PSZ );
PSZ InstMatch ( PSZ, PSZ );
-static USHORT ReadAndPrepareConfigSys ( VOID );
USHORT UpdateConfigSys ( VOID );
int SetupMAT();
USHORT SetupMAT( HAB hab, CHAR chPrimaryDrive, PSZ pszSecondaryDrives, CHAR chLanDrive );
-static USHORT CreateDictProperties( CHAR chPrimaryDrive );
USHORT SetupTmCom (CHAR chPrimaryDrive, PSZ pszSecondaryDrives);
USHORT SetupDemo (HAB hab, CHAR chPrimaryDrive, PSZ pszSecondaryDrives, CHAR chLanDrive);
USHORT SetupDocu (HAB hab, CHAR chPrimaryDrive, PSZ pszSecondaryDrives);
-static VOID DeleteDictCacheFiles( CHAR chPrimaryDrive, USHORT usPathId );
-static BOOL UtlPropFileExist( CHAR chDrive, PSZ pszFile );
-
USHORT UpdatePropFile( USHORT usPropType ,CHAR chDrive,
PSZ pszFileName, PSZ pszDocName );
-static USHORT UpdateFolderProp( PSZ pszFullFileName, CHAR chDrive );
-static USHORT UpdateDocumentProp( PSZ pszFullFileName, CHAR chDrive );
-static USHORT UpdateDictProp( PSZ pszFullFileName, CHAR chDrive );
-static USHORT UpdateTMProp( PSZ pszFullFileName, CHAR chDrive );
-static USHORT UpdateSystemProp( PSZ pszFullFileName, PSZ pszFolderName );
BOOL SetupUtils( HAB, PSZ );
BOOL TWBInit( HAB );
diff --git a/include/EQFTA.H b/include/EQFTA.H
index 5ead7267..71859037 100755
--- a/include/EQFTA.H
+++ b/include/EQFTA.H
@@ -21,12 +21,14 @@
/**********************************************************************/
/* Structure for start/stop tables as used by TACreateStartStopTable */
/**********************************************************************/
-typedef struct _STARTSTOP
+struct STARTSTOP
{
- USHORT usStart; // start offset
- USHORT usStop; // stop offset
- USHORT usType; // type of entry
-} STARTSTOP, *PSTARTSTOP;
+ USHORT usStart = 0; // start offset
+ USHORT usStop = 0; // stop offset
+ USHORT usType = 0; // type of entry
+ void reset(){*this=STARTSTOP{};}
+};
+using PSTARTSTOP = STARTSTOP*;
// structure for commincation between analysis and MT functions
@@ -94,30 +96,8 @@ BOOL EQFUnSegRevMark2
USHORT usTrackDocNum, // not 0, TVT tracking document num
PSZ pszConversion // ptr to conversion name or NULL
);
-USHORT TACreateProtectTable
-(
- PSZ pszSegment, // ptr to text of segment being processed
- PVOID pVoidTable, // ptr to tag table (PLOADEDTABLE)
- USHORT usColPos, // column position of first char in segment
- PTOKENENTRY pTokBuffer, // buffer used temporarly for tokens
- USHORT usTokBufferSize, // size of token buffer in bytes
- PSTARTSTOP *ppStartStop, // ptr to caller's start/stop table ptr
- PFN pfnUserExit, // ptr to user exit function
- ULONG ulCP
-);
-USHORT TACreateProtectTableW
-(
- PSZ_W pszSegmentW, // ptr to text of segment being processed
- PVOID pVoidTable, // ptr to tag table
- USHORT usColPos, // column position of first char in segment
- PTOKENENTRY pTokBuffer, // buffer used temporarly for tokens
- USHORT usTokBufferSize, // size of token buffer in bytes
- PSTARTSTOP *ppStartStop, // ptr to caller's start/stop table ptr
- PFN pvUserExit, // ptr to user exit function
- PFN pvUserExitW,
- ULONG ulCP
-);
+
#define CREATEPROTTABLE_MARKATTR 0x02
#define CREATEPROTTABLE_NOTRANSLVAR 0x04
@@ -128,10 +108,10 @@ USHORT TACreateProtectTableWEx
PSZ_W pszSegment, // ptr to text of segment being processed
PVOID pVoidTable, // ptr to tag table
USHORT usColPos, // column position of first char in segment
- PTOKENENTRY pTokBuffer, // buffer used temporarly for tokens
+ std::vector& pTokBuffer, // buffer used temporarly for tokens
USHORT usTokBufferSize, // size of token buffer in bytes
- PSTARTSTOP *ppStartStop, // ptr to caller's start/stop table ptr
- PFN pvUserExit, // ptr to user exit function
+ BytesRef pStartStop, // ptr to caller's start/stop table ptr
+ //PFN pvUserExit, // ptr to user exit function
PFN pvUserExitW,
ULONG ulCP, // ASCII cp fitting to Segmenttext
int iMode // mode for function
@@ -139,16 +119,6 @@ USHORT TACreateProtectTableWEx
-USHORT TAPrepProtectTable
-(
- PVOID pVoidTable, // ptr to tag table (PLOADEDTABLE)
- HMODULE *phModule, // address of user exit module handle
- PFN *ppfnUserExit, // address of ptr to user exit function
- PFN *ppfnCheckSegExit, // ptr to segment check function
- PFN *ppfnShowTrans, // ptr to Show transl. function
- PFN *ppfnTocGoto // ptr to TOC goto function
-);
-
USHORT TAEndProtectTable
(
HMODULE *phModule, // address of user exit module handle
@@ -218,19 +188,6 @@ void TAFillWSList
PSZ_W *ppWSList
);
-
-BOOL TAAdjustWhiteSpace
-(
- PSZ_W pszSourceSeg, // ptr to source segment data
- PSZ_W pszTargetSeg, // ptr to target segment
- PSZ_W *ppszNewTargetSeg, // ptr to ptr of output buffer
- BOOL fLeadingWS, // process leading whitespace
- BOOL fTrailingWS, // process trailing whitespace
- PBOOL pfChanged, // TRUE if target has been changed
- PSZ_W pWSList // list of whitespace chars (TBX-CLS_WHITESPACEs)
-);
-
-
VOID TABuildArchTM( HWND hwnd, PSZ pSelFolderName );
VOID ExportSegs( HWND hwnd, PSZ pSelFolderName );
diff --git a/include/EQFTAG.H b/include/EQFTAG.H
index 9980fd97..8b2aee8f 100755
--- a/include/EQFTAG.H
+++ b/include/EQFTAG.H
@@ -223,8 +223,8 @@ BOOL ContainsClassID( PLOADEDTABLE pLoadedTable, USHORT usClassID );
VOID EQFTagTokenize(PSZ, TAGTABLE *, BOOL, PSZ *, USHORT *, TOKENENTRY *, USHORT);
-BOOL TATagTokenize (PSZ, PLOADEDTABLE, BOOL, PSZ *, USHORT *, TOKENENTRY *, USHORT, ULONG);
-BOOL TATagTokenizeW(PSZ_W, PLOADEDTABLE, BOOL, PSZ_W *, USHORT *, TOKENENTRY *, USHORT);
+//BOOL TATagTokenize (PSZ, PLOADEDTABLE, BOOL, PSZ *, USHORT *, TOKENENTRY *, USHORT, ULONG);
+BOOL TATagTokenizeW(PSZ_W, PLOADEDTABLE, PSZ_W *, USHORT *, std::vector&);
/**********************************************************************/
diff --git a/include/EQFTAG00.H b/include/EQFTAG00.H
index 5d3362dd..90f56d34 100755
--- a/include/EQFTAG00.H
+++ b/include/EQFTAG00.H
@@ -168,7 +168,6 @@ typedef enum { MUFILL_NAMES, MUFILL_CLBITEMS } MUFILLTYPES;
BOOL MUGetMarkupTableFileName( char *pszMarkup, char *pszPlugin, char *pszBuffer, int iBufSize );
BOOL MUGetMarkupTableFilePath( char *pszMarkup, char *pszPlugin, char *pszBuffer, int iBufSize );
BOOL MUGetUserExitFileName( char *pszMarkup, char *pszPlugin, char *pszBuffer, int iBufSize );
- BOOL MUUpdateMarkupTableFiles( char *pszMarkup, char *pszPlugin, char *pszShortDescription, char *pszLongDescription, char *pszVersion, char *pszTableFile, char *pszUserExitFile, char *pszMarkupFiles );
BOOL MUDeleteMarkupTable( char *pszMarkup, char *pszPlugin );
#endif
diff --git a/include/EQFTP.H b/include/EQFTP.H
index 705461ee..bb6623de 100755
--- a/include/EQFTP.H
+++ b/include/EQFTP.H
@@ -982,9 +982,10 @@ VOID EQFBVioSetNewDocSize ( PTBDOCUMENT ); // refresh doc size
VOID ImeSetFont( PTBDOCUMENT, HWND, PLOGFONT );
-BOOL EQFBFindDiffEx( PVOID, PBYTE, PBYTE, PSZ_W, PSZ_W, SHORT , PVOID * , PVOID *, ULONG);
+BOOL EQFBFindDiffEx( PLOADEDTABLE, PSZ_W, PSZ_W, SHORT ,
+ std::vector&, std::vector&);
-BOOL EQFBCountDiff( PVOID pvFuzzyTok, PUSHORT pusTokens, PUSHORT pusDiffs );
+BOOL EQFBCountDiff( std::vector& pvFuzzyTok, PUSHORT pusTokens, PUSHORT pusDiffs );
BOOL EQFBDoEmptySegCheck( PTBDOCUMENT ); // do empty segment handling
@@ -1017,28 +1018,12 @@ int BiDitransform
-typedef struct _FUZZYTOK
-{
- PSZ_W pData; // pointer to data..
- ULONG ulHash; // hash value
- USHORT usStart; // start offset
- USHORT usStop; // end offset
- SHORT sType; // type of entry /* KIT0857M */
- EQF_BOOL fConnected; // true if connected to pPropTokList
- EQF_BOOL fNoTagSubst; // true = do not use for tag substitution
-} FUZZYTOK, *PFUZZYTOK;
-
typedef struct _REPLLIST
{
PFUZZYTOK pSrcTok; // ptr to source token
PFUZZYTOK pTgtTok; // ptr to target token
} REPLLIST, *PREPLLIST;
-
-
-USHORT FuzzyLCSReplList ( PFUZZYTOK, PFUZZYTOK, PREPLLIST *,
- USHORT, USHORT, PUSHORT, BOOL);
-
SHORT StrNLFCmp ( PSZ_W, PSZ_W );
@@ -1169,7 +1154,6 @@ USHORT TAIteratedCreateProtectTableW( PTBDOCUMENT pDoc, PTBSEGMENT pSeg, int iM
USHORT EQFBPrepareFuzzyPropEx ( PTBDOCUMENT, PSZ_W, PSZ_W, PSZ_W, SHORT, SHORT, PUSHORT, ULONG, ULONG);
USHORT EQFBPrepareFuzzyPropEx2( PSZ_W, PSZ_W, PSZ_W, SHORT, SHORT, PUSHORT, PVOID, PVOID, PBYTE, PBYTE, ULONG, ULONG );
USHORT EQFBPrepareFuzzyPropEx3( PSZ_W, PSZ_W, PSZ_W, SHORT, SHORT, PUSHORT, PVOID, PVOID, PBYTE, PBYTE, ULONG, ULONG, PUSHORT );
- BOOL EQFBFindDiff ( PTBDOCUMENT, PSZ_W, PSZ_W, SHORT , PFUZZYTOK * , PUSHORT, PUSHORT, ULONG);
BOOL EQFBFindWord ( PSZ_W ,SHORT, USHORT, PUSHORT, PUSHORT, ULONG, BOOL );
#endif //_EQFTP_H_INCLUDED_
diff --git a/include/EQFTPI.H b/include/EQFTPI.H
index 7e5ff5df..ac0ed078 100755
--- a/include/EQFTPI.H
+++ b/include/EQFTPI.H
@@ -1482,20 +1482,6 @@ typedef struct _USERSET
} USERSET, *PUSERSET;
-// Profile ONE Dialog IDA (initial values)
-typedef struct _PROFONEIDA
-{
- USERSET LBItemArray [MAXLBITEMS]; // text of listbox
- CHAR szBuffer [60]; // get choice from listbox
- PTBDOCUMENT pDoc;
- HBITMAP hbm; // menucheck bitmap
- CHAR szStyleArray [MAXSTYLES][40]; // text for prop.wnd.styles
- CHAR szMarginBuffer[RMARGIN_LENGTH + 1]; // text for rmargin cbs
- HWND hwndPages[10]; // support up to 10 prop pages
-#ifdef R004422_BACKSAVE
- CHAR szMinute[5]; // text for minutes CBS
-#endif
-} PROFONEIDA, *PPROFONEIDA;
// TOC goto diealog IDA
typedef struct _TOCGOTOIDA
@@ -2301,12 +2287,10 @@ BOOL EQFBDoCopyData ( PTBDOCUMENT,PSZ_W );
( (c == LF) || \
( (c == SOFTLF_CHAR) && (c2 != SOFTLF_CHAR) && (c0 != SOFTLF_CHAR)) )
-BOOL EQFBCallLCS(PFUZZYTOK, PFUZZYTOK, USHORT, USHORT, BOOL);
-
+BOOL EQFBCallLCS(std::vector&, std::vector&, USHORT, USHORT, BOOL);
USHORT EQFBMisspelledHLType ( PTBDOCUMENT, PTBSEGMENT, PSZ_W );
-
/**********************************************************************/
/* worker thread defines */
/**********************************************************************/
diff --git a/include/EQFUTPRI.H b/include/EQFUTPRI.H
index bb5bc61b..3925f036 100755
--- a/include/EQFUTPRI.H
+++ b/include/EQFUTPRI.H
@@ -187,8 +187,6 @@ INT_PTR CALLBACK UTLYESTOALLDLG
LPARAM mp2 // second message parameter
);
-VOID UtlReplString( SHORT sID, PSZ pszString );
-
/**********************************************************************/
/* Private data for the rename object dialog */
/**********************************************************************/
diff --git a/include/Filebuffer.h b/include/Filebuffer.h
index 83ad6391..56dd03fb 100644
--- a/include/Filebuffer.h
+++ b/include/Filebuffer.h
@@ -16,28 +16,115 @@ enum FilebufferType{
TMI_FILEBUFFER,
};
+#include
+#include
+#include
+#include
+#include
+#include
+
+class LockedFile {
+public:
+ enum class Mode { Unknown,
+ Read, // read-only with shared lock
+ Write, // read-write with exclusive lock + truncate
+ Append, // read-write with exclusive lock + append
+ ReadWrite // read-write with exclusive lock, no truncate
+ };
+
+ enum class CalledFrom{
+ Unknown,
+ Create,
+ Read,
+ Write
+ };
+
+ static constexpr std::string_view CalledFromToString(CalledFrom from) {
+ switch (from) {
+ case CalledFrom::Unknown: return "Unknown";
+ case CalledFrom::Create: return "Create";
+ case CalledFrom::Read: return "Read";
+ case CalledFrom::Write: return "Write";
+ }
+ return "Invalid"; // fallback for safety
+ }
+
+ LockedFile() = default;
+
+ LockedFile(const std::string& path
+ , CalledFrom location
+ //, Mode mode = Mode::ReadWrite
+ )
+ : path_(path),
+ location_(location)//, mode_(mode)
+ {
+ openAndLock();
+ }
+
+ ~LockedFile() {
+ closeFile(); // Ensures cleanup
+ }
+
+ // Delete copy
+ LockedFile(const LockedFile&) = delete;
+ LockedFile& operator=(const LockedFile&) = delete;
+
+ // Move constructor
+ LockedFile(LockedFile&& other) noexcept {
+ *this = std::move(other);
+ }
+
+ // Move assignment
+ LockedFile& operator=(LockedFile&& other) noexcept {
+ if (this != &other) {
+ closeFile(); // Close current file if open
+ location_ = other.location_;
+ path_ = std::move(other.path_);
+ std::swap(file_, other.file_);
+ std::swap(fd_, other.fd_);
+ std::swap(fl_, other.fl_ ); // Swap the flock
+ //mode_ = other.mode_;
+ }
+ return *this;
+ }
+
+ FILE* handle() const { return file_; }
+ const std::string& path() const { return path_; }
+ size_t GetFileSize() const;
+ std::string fileName;
+
+private:
+ std::string path_;
+ FILE* file_ = nullptr;
+ int fd_ = -1;
+ struct flock fl_; // Add flock as a member
+ CalledFrom location_ = CalledFrom::Unknown;
+ //Mode mode_{};mode is disabled since we would always open file in r+b mode
+
+ void openAndLock();
+ void closeFile();
+};
+
struct FileBuffer{
int status ;//FILEBUFFERSTATUS
std::vector data;
size_t offset = 0;
- FILE* file = nullptr;
- std::string fileName;
+ LockedFile file;
FilebufferType filebufferType;
long long originalFileSize = 0;
int ReadFromFile();
- //int WriteToFile();
int Flush(bool forced = false);
- int atomicWriteWithBackup();
- int SetOffset(size_t newOffset, int fileAnchor);
+ //Methods below applied only to filebuffer(file in RAM)
+ int SetOffset(size_t newOffset, int fileAnchor=FILE_BEGIN);
int Write(const void* buff, size_t buffSize, size_t startingPosition, bool fSuppressTmdSizeCheck = false);
- int Write(const void* buff, size_t buffSize);
- int Read(void* buff, size_t buffSize, size_t startingPosition);
- int Read(void* buff, size_t buffSize);
- bool wasModified() const;
+ int Read(void* buff, size_t buffSize, ssize_t startingPosition=-1);
+ bool WasModified() const;
+ bool isTMDFilebuffer()const;
- bool isTMDFilebuffer();
+private:
+ int atomicWriteWithBackup();
} ;
diff --git a/include/OTMAPI.H b/include/OTMAPI.H
index 5f2d4ae3..b60447fb 100755
--- a/include/OTMAPI.H
+++ b/include/OTMAPI.H
@@ -308,24 +308,6 @@
* EQF Typedefs
*-----------------------------------------------------------------------------*/
-typedef struct _STEQFPCMD // Pipe Command/Response
-{
- USHORT usCmd; // command code
- ULONG ulParm1; // parameter 1
- USHORT usParm2; // parameter 2
- USHORT usParm3; // parameter 3
- USHORT usLen1; // length of buffer 1
- USHORT usLen2; // length of buffer 2
- USHORT usLen3; // length of buffer 3
- USHORT usLen4; // length of buffer 4
- UCHAR ucbBuffer [EQF_SEGLEN*8]; // buffer1/2/3/4
- PVOID pvMetaData; // ptr to segment meta data
-} STEQFPCMD;
-
-typedef STEQFPCMD *PSTEQFPCMD;
-
-
-
typedef struct _STEQFGEN // generic EQF structure
{
HWND hwndTWBS; // handle of parent window
@@ -361,7 +343,6 @@ typedef struct _STEQFGEN // generic EQF structure
USHORT usRC; // return code
CHAR_W szMsgBuffer[EQF_NAMELEN]; // message buffer
PVOID pDoc; // reserved
- PSTEQFPCMD pstEQFPCmd; // reserved pipe command struct
ULONG flPropStyle; // window style of prop Window
ULONG flDictStyle; // window style of dict.window
ULONG flSrcStyle; // window style of prop.src.wnd.
@@ -1483,17 +1464,6 @@ EQF_BOOL EQFCHECKSEGW (
);
-EQF_BOOL EQFCHECKSEGEXW (
- PSZ_W pszPrevSrc, // previous source segment
- PSZ_W pszSrc, // current source segment
- PSZ_W pszTgt, // current translation
- PEQF_BOOL pfChanged, // segment changed
- LONG lInfo, // info handle to use with EQFGETPREVSEG(W),EQFGETNEXTSEG(W)
- ULONG ulSegNum, // segment number to use with EQFGETPREVSEG(W),EQFGETNEXTSEG(W)
- EQF_BOOL fMsg // message display requested
-);
-
-
/*******************************************************************************
*
* function: EQFCHECKSEGTYPE
diff --git a/include/Proposal.h b/include/Proposal.h
index 81f60047..427c13bc 100644
--- a/include/Proposal.h
+++ b/include/Proposal.h
@@ -72,8 +72,8 @@ class OtmProposal
int SetProposalKey
(
- unsigned long ulKey,
- unsigned short usTargetNum
+ const long& lKey,
+ const unsigned short& usTargetNum
);
/* \brief set the proposal key
@@ -227,7 +227,7 @@ class OtmProposal
/* \brief get proposal fuzziness
\returns proposal fuzziness
*/
- int getFuzziness();
+ int getFuzziness()const;
/* \brief set the proposal fuzziness
\param lFuzzinessTime new fuzziness of proposal
@@ -281,7 +281,7 @@ class OtmProposal
/* \brief set the proposal context
\param pszBuffer Pointer to buffer containing the proposal context
*/
- void setContext( wchar_t *pszBuffer );
+ void setContext(const wchar_t *pszBuffer );
/* \brief get proposal context ranking
\returns proposal context ranking
@@ -308,7 +308,7 @@ class OtmProposal
/* \brief set the proposal additional information
\param pszBuffer Pointer to buffer containing the additional info
*/
- void setAddInfo( wchar_t *pszBuffer );
+ void setAddInfo(const wchar_t *pszBuffer );
/* \brief set the proposal memory index
\param iIndex new value for the memory index
@@ -377,94 +377,99 @@ class OtmProposal
//protected:
/*! \brief ID of this proposal */
- char szId[OTMPROPOSAL_MAXNAMELEN];
+ char szId[OTMPROPOSAL_MAXNAMELEN]{};
/*! \brief Source string of memory proposal (UTF-16) */
- wchar_t szSource[OTMPROPOSAL_MAXSEGLEN];
+ wchar_t szSource[OTMPROPOSAL_MAXSEGLEN]{};
//std::wstring strSource;
/*! \brief Target string of memory proposal (UTF-16). */
//std::wstring strTarget;
- wchar_t szTarget[OTMPROPOSAL_MAXSEGLEN];
+ wchar_t szTarget[OTMPROPOSAL_MAXSEGLEN]{};
/*! \brief Name of document from which the proposal comes from. */
//std::string strDocName;
- char szDocName[OTMPROPOSAL_MAXNAMELEN];
+ char szDocName[OTMPROPOSAL_MAXNAMELEN]{};
/*! \briefCustom Id provided for the segment in request to track segments in response in multifuzzy*/
- char szCustomId[OTMPROPOSAL_MAXNAMELEN];
+ char szCustomId[OTMPROPOSAL_MAXNAMELEN]{};
/*! \brief Segment number within the document from which the proposal comes from. */
- long lSegmentId;
+ long lSegmentId{};
+ bool fSegmentIdWasGenerated{};//if true, for import, reorganize, update, means that id wasn't provided.
/*! \brief source language. */
//std::string strSourceLanguage;
- char szSourceLanguage[OTMPROPOSAL_MAXNAMELEN];
- char szOriginalSourceLanguage[OTMPROPOSAL_MAXNAMELEN];
+ char szSourceLanguage[OTMPROPOSAL_MAXNAMELEN]{};
+ char szOriginalSourceLanguage[OTMPROPOSAL_MAXNAMELEN]{};
/*! \brief target language. */
//std::string strTargetLanguage;
- char szTargetLanguage[OTMPROPOSAL_MAXNAMELEN];
+ char szTargetLanguage[OTMPROPOSAL_MAXNAMELEN]{};
/*! \brief origin or type of the proposal. */
- eProposalType eType;
+ eProposalType eType{};
/*! \brief match type of the proposal. */
- eMatchType eMatch;
+ eMatchType eMatch{};
/*! \brief Author of the proposal. */
// std::string strTargetAuthor;
- char szTargetAuthor[OTMPROPOSAL_MAXNAMELEN];
+ char szTargetAuthor[OTMPROPOSAL_MAXNAMELEN]{};
/*! \brief Update time stamp of the proposal. */
- long lTargetTime;
+ long lTargetTime{};
/*! \brief Fuzziness of the proposal. */
- int iFuzziness, iDiffs, iWords;
+ int iFuzziness{}, iDiffs{}, iWords{};
/*! \brief Markup table (format) of the proposal. */
- char szMarkup[OTMPROPOSAL_MAXNAMELEN];
+ char szMarkup[OTMPROPOSAL_MAXNAMELEN]{};
/*! \brief Context information of the proposal */
//std::wstring strContext;
- wchar_t szContext[OTMPROPOSAL_MAXSEGLEN+1];
+ wchar_t szContext[OTMPROPOSAL_MAXSEGLEN+1]{};
/*! \brief Additional information of the proposal */
//std::wstring strAddInfo;
- wchar_t szAddInfo[OTMPROPOSAL_MAXSEGLEN+1];
+ wchar_t szAddInfo[OTMPROPOSAL_MAXSEGLEN+1]{};
/*! \brief Proposal data has been filled flag */
- bool fFilled;
+ bool fFilled{};
+
+ /*! \brief when saving request, if set to true, save segment with differen context as new(as was), otherwise if only context differs, replace previous segment */
+ //bool fCheckContextWhenReplacingSegment{};
+ bool fNewEntryIfOnlyContextAndTimestampDifferent{};
+ bool fSaveDifferentTargetsForSameSource{};
+ bool fIgnoreSegIdOnUpdate{};
/*! \brief Index of memory when looking up in a list of memories */
- int iMemoryIndex;
+ int iMemoryIndex{};
/*! \brief ranking of the context information (0..100) */
- int iContextRanking;
+ int iContextRanking{};
/*! \brief list of replacement values */
- long pvReplacementList;
+ long pvReplacementList{};
//searchproposal
std::unique_ptr pInputSentence = nullptr;
- char szMemory[260];
- char szIsoSourceLang[MAX_LANG_LENGTH];
- char szIsoTargetLang[MAX_LANG_LENGTH];
- wchar_t szError[512];
- //char szType[256];
- //char szDateTime[40];
- char szSearchMode[40];
- char szSearchPos[80];
- int iNumOfProposals;
- int iSearchTime;
- wchar_t szSearchString[2050];
+ char szMemory[260]{};
+ char szIsoSourceLang[MAX_LANG_LENGTH]{};
+ char szIsoTargetLang[MAX_LANG_LENGTH]{};
+ wchar_t szError[512]{};
+ char szSearchMode[40]{};
+ char szSearchPos[80]{};
+ int iNumOfProposals{};
+ int iSearchTime{};
+ wchar_t szSearchString[2050]{};
-
//
- TMCursor currentInternalKey;
- TMCursor nextInternalKey;
+ TMCursor currentInternalKey{};
+ TMCursor nextInternalKey{};
+
int moveInternalKeyToTheNextPosition() {
currentInternalKey = nextInternalKey;
@@ -478,26 +483,73 @@ class OtmProposal
int setSequentialAccessKey( char *pszKey);
-//otm_put
- //USHORT usTranslationFlag; /* type of translation, 0 = human, 1 = machine, 2 = GobalMemory */
- //ULONG ulSourceSegmentId; //seg. num. of source sentence from analysis
- //TIME_L lTime; //time stamp
- BOOL fMarkupChanged; // Markup does not exist, changed to OTMUTF8 during import
-//otm_put end
-
-
+ BOOL fMarkupChanged{}; // Markup does not exist, changed to OTMUTF8 during import
+
/*! \brief is source lang is marked as prefered in languages.xml */
bool fIsoSourceLangIsPrefered = false;
/*! \brief is target lang is marked as prefered in languages.xml */
bool fIsoTargetLangIsPrefered = false;
- //searchproposal
-
- //char errorStr[1000];
};
#include "tm.h"
+#include // for std::swap, std::swap_ranges
+
+/*
+void swap(OtmProposal& a, OtmProposal& b) noexcept {
+ using std::swap;
+ // Swap raw arrays
+ swap_ranges(std::begin(a.szId), std::end(a.szId), std::begin(b.szId));
+ swap_ranges(std::begin(a.szSource), std::end(a.szSource), std::begin(b.szSource));
+ swap_ranges(std::begin(a.szTarget), std::end(a.szTarget), std::begin(b.szTarget));
+ swap_ranges(std::begin(a.szDocName), std::end(a.szDocName), std::begin(b.szDocName));
+ swap_ranges(std::begin(a.szCustomId), std::end(a.szCustomId), std::begin(b.szCustomId));
+ swap_ranges(std::begin(a.szSourceLanguage), std::end(a.szSourceLanguage), std::begin(b.szSourceLanguage));
+ swap_ranges(std::begin(a.szOriginalSourceLanguage), std::end(a.szOriginalSourceLanguage), std::begin(b.szOriginalSourceLanguage));
+ swap_ranges(std::begin(a.szTargetLanguage), std::end(a.szTargetLanguage), std::begin(b.szTargetLanguage));
+ swap_ranges(std::begin(a.szTargetAuthor), std::end(a.szTargetAuthor), std::begin(b.szTargetAuthor));
+ swap_ranges(std::begin(a.szMarkup), std::end(a.szMarkup), std::begin(b.szMarkup));
+ swap_ranges(std::begin(a.szContext), std::end(a.szContext), std::begin(b.szContext));
+ swap_ranges(std::begin(a.szAddInfo), std::end(a.szAddInfo), std::begin(b.szAddInfo));
+ swap_ranges(std::begin(a.szMemory), std::end(a.szMemory), std::begin(b.szMemory));
+ swap_ranges(std::begin(a.szIsoSourceLang), std::end(a.szIsoSourceLang), std::begin(b.szIsoSourceLang));
+ swap_ranges(std::begin(a.szIsoTargetLang), std::end(a.szIsoTargetLang), std::begin(b.szIsoTargetLang));
+ swap_ranges(std::begin(a.szError), std::end(a.szError), std::begin(b.szError));
+ swap_ranges(std::begin(a.szSearchMode), std::end(a.szSearchMode), std::begin(b.szSearchMode));
+ swap_ranges(std::begin(a.szSearchPos), std::end(a.szSearchPos), std::begin(b.szSearchPos));
+ swap_ranges(std::begin(a.szSearchString), std::end(a.szSearchString), std::begin(b.szSearchString));
+
+ // Swap primitive types
+ swap(a.lSegmentId, b.lSegmentId);
+ swap(a.fSegmentIdWasGenerated, b.fSegmentIdWasGenerated);
+ swap(a.eType, b.eType);
+ swap(a.eMatch, b.eMatch);
+ swap(a.lTargetTime, b.lTargetTime);
+ swap(a.iFuzziness, b.iFuzziness);
+ swap(a.iDiffs, b.iDiffs);
+ swap(a.iWords, b.iWords);
+ swap(a.fFilled, b.fFilled);
+ swap(a.fNewEntryIfOnlyContextAndTimestampDifferent, b.fNewEntryIfOnlyContextAndTimestampDifferent);
+ swap(a.fSaveDifferentTargetsForSameSource, b.fSaveDifferentTargetsForSameSource);
+ swap(a.fIgnoreSegIdOnUpdate, b.fIgnoreSegIdOnUpdate);
+ swap(a.iMemoryIndex, b.iMemoryIndex);
+ swap(a.iContextRanking, b.iContextRanking);
+ swap(a.pvReplacementList, b.pvReplacementList);
+ swap(a.iNumOfProposals, b.iNumOfProposals);
+ swap(a.iSearchTime, b.iSearchTime);
+ swap(a.fMarkupChanged, b.fMarkupChanged);
+ swap(a.fIsoSourceLangIsPrefered, b.fIsoSourceLangIsPrefered);
+ swap(a.fIsoTargetLangIsPrefered, b.fIsoTargetLangIsPrefered);
+
+ // Swap unique_ptr
+ swap(a.pInputSentence, b.pInputSentence);
+
+ // Swap TMCursor members
+ swap(a.currentInternalKey, b.currentInternalKey);
+ swap(a.nextInternalKey, b.nextInternalKey);
+}//*/
+
OtmProposal::eProposalType getMemProposalType( char *pszType );
diff --git a/include/lowlevelotmdatastructs.h b/include/lowlevelotmdatastructs.h
index 38fc6a18..3c2f6c91 100644
--- a/include/lowlevelotmdatastructs.h
+++ b/include/lowlevelotmdatastructs.h
@@ -16,6 +16,19 @@
#include "ThreadingWrapper.h"
+using BytesRef = std::vector&;
+template
+inline void pushBytes(std::vector& buffer, const T& value) {
+ const BYTE* dataPtr = reinterpret_cast(&value);
+ buffer.insert(buffer.end(), dataPtr, dataPtr + sizeof(T));
+}
+
+inline void pushBytes(std::vector& buffer, const void* start, const void* end) {
+ const BYTE* beginPtr = static_cast(start);
+ const BYTE* endPtr = static_cast(end);
+
+ buffer.insert(buffer.end(), beginPtr, endPtr);
+}
bool isAsanEnabled();
bool isUbsanEnabled();
@@ -34,7 +47,7 @@ class ChunkBuffer{
void setResponseHandler(proxygen::ResponseHandler* responseHandler){m_responseHandler = responseHandler;}
bool isActive()const {return m_responseHandler != 0; }
- ChunkBuffer(){//m_buff.reserve(chunkSize_+1);
+ ChunkBuffer(){//m_buff.resize(chunkSize_+1);
}
~ChunkBuffer(){
//T5LOG(T5INFO)<< "called dctor of chunk buffer- sending last chunk";
@@ -79,6 +92,7 @@ typedef char* PSZ;
SHUTDOWN,
DELETE_MEM,
EXPORT_MEM_TMX,
+ GET_TABLES,
EXPORT_MEM_INTERNAL_FORMAT,
EXPORT_MEM_INTERNAL_FORMAT_STREAM,
REORGANIZE_MEM,
@@ -94,6 +108,7 @@ typedef char* PSZ;
MULTIFUZZY,
MULTIUPDATE,
CONCORDANCE,
+ ADD_TO_TABLE,
DELETE_ENTRY,
GET_ENTRY,
DELETE_ENTRIES_REORGANIZE,
@@ -122,6 +137,8 @@ constexpr std::initializer_list> CommandT
{ EXPORT_MEM_TMX_STREAM, "EXPORT_MEM_TMX_STREAM" },
{ EXPORT_MEM_INTERNAL_FORMAT_STREAM, "EXPORT_MEM_INTERNAL_FORMAT_STREAM" },
{ STATUS_MEM, "STATUS_MEM" },
+ { GET_TABLES, "GET_TABLES"},
+ { ADD_TO_TABLE, "ADD_TO_TABLE"},
{ RESOURCE_INFO, "RESOURCE_INFO" },
{ FLAGS_INFO, "FLAGS_INFO" },
@@ -282,15 +299,16 @@ typedef char * PSZ;
typedef LONG TIME_L; // new typedef to avoid conflicts with Lotus
-typedef struct _RECPARAM
+struct RECPARAM
{
USHORT usNum = 0; // record number
USHORT usOffset = 0; // record offset
ULONG ulLen = 0; // record length
void reset(){
- memset(this, 0 ,sizeof(*this));
+ *this = RECPARAM{};
}
-} RECPARAM, * PRECPARAM;
+};
+using PRECPARAM = RECPARAM*;
/**********************************************************************/
/* typedef used for all vital information on our new approach... */
@@ -298,10 +316,11 @@ typedef struct _RECPARAM
/**********************************************************************/
typedef struct _TMVITALINFO
{
- ULONG ulStartKey = 0; // key to start with
- ULONG ulNextKey = 0; // currently active key
+ LONG lStartKey = 0; // key to start with
+ LONG lNextKey = 0; // currently active key
} NTMVITALINFO, * PNTMVITALINFO;
+const long LASTALLOWEDKEY = 0xFFFFFF;
#define MAX_MEM_DESCRIPTION 41 // length of a memory description field
@@ -318,9 +337,9 @@ typedef struct _TMX_SIGN
BYTE bGlobVersion=0;
BYTE bMajorVersion=0;
BYTE bMinorVersion=0;
- CHAR szName[_TMX_SIGN_SZ_NAME];
- CHAR szSourceLanguage[MAX_LANG_LENGTH];
- CHAR szDescription[MAX_MEM_DESCRIPTION];
+ CHAR szName[_TMX_SIGN_SZ_NAME]{};
+ CHAR szSourceLanguage[MAX_LANG_LENGTH]{};
+ CHAR szDescription[MAX_MEM_DESCRIPTION]{};
LONG segmentIndex = 0;//highest generated segment id, used for generating new id's
} TMX_SIGN, * PTMX_SIGN;
@@ -352,7 +371,7 @@ typedef struct _BTREEHEADER
/*****************************************************************************/
typedef struct _BTREEHEADRECORD
{
- CHAR chEQF[7]; // The type of file
+ CHAR chEQF[7]{}; // The type of file
// BYTE bVersion; // version flag
struct
{
@@ -363,19 +382,19 @@ typedef struct _BTREEHEADRECORD
unsigned char f16kRec : 1; // TRUE = BTREE uses 16k Recs (V3 record size)
} Flags;
- bool fOpen; // open flag/corruption flag
- USHORT usFirstNode; // first node record
- USHORT usFirstLeaf; // first leaf record
- RECPARAM DataRecList[ MAX_LIST ]; // last used data records
- bool fTerse; // tersing requested
- BYTE chCollate[COLLATE_SIZE]; // collating sequence to use
- BYTE chCaseMap[COLLATE_SIZE]; // case mapping to be used
- BYTE chEntryEncode[ ENTRYENCODE_LEN ]; // significant characters
- USHORT usFreeKeyBuffer; // index of buffer to use
- USHORT usFreeDataBuffer; // first data buffer chain
- USHORT usFirstDataBuffer; // first data buffer
- ULONG ulUpdCount; // last update counter
- USHORT usNextFreeRecord; // Next record to expand to
+ bool fOpen=false; // open flag/corruption flag
+ USHORT usFirstNode=0; // first node record
+ USHORT usFirstLeaf=0; // first leaf record
+ RECPARAM DataRecList[ MAX_LIST ]{}; // last used data records
+ bool fTerse = false; // tersing requested
+ BYTE chCollate[COLLATE_SIZE]{}; // collating sequence to use
+ BYTE chCaseMap[COLLATE_SIZE]{}; // case mapping to be used
+ BYTE chEntryEncode[ ENTRYENCODE_LEN ]{}; // significant characters
+ USHORT usFreeKeyBuffer=0; // index of buffer to use
+ USHORT usFreeDataBuffer=0; // first data buffer chain
+ USHORT usFirstDataBuffer=0; // first data buffer
+ ULONG ulUpdCount=0; // last update counter
+ USHORT usNextFreeRecord=0; // Next record to expand to
} BTREEHEADRECORD, PBTREEHEADRECORD ;
@@ -397,28 +416,29 @@ typedef enum _RECTYPE
#define FREE_SIZE_V3 (BTREE_REC_SIZE_V3 - sizeof(BTREEHEADER))
typedef struct _BTREERECORD_V3
{
- BTREEHEADER header; // 16 bytes header
- UCHAR uchData[ FREE_SIZE_V3 ] ; // free size to be used
+ BTREEHEADER header{}; // 16 bytes header
+ UCHAR uchData[ FREE_SIZE_V3 ]{} ; // free size to be used
} BTREERECORD_V3, *PBTREERECORD_V3, **PPBTREERECORD_V3;
/*****************************************************************************/
/* BTREEBUFFER is the format of the buffers when read in to the buffer */
/* cache. It maps a record number and its properties to its contents */
/*****************************************************************************/
-typedef struct _BTREEBUFFER_V3
+struct BTREEBUFFER
{
USHORT usRecordNumber=0; // index of rec in buffer
BOOL fLocked=0; // Is the record locked ?
- //BOOL fNeedToWrite; // Commit before reuse
SHORT sUsed=0; // buffer used count
ULONG ulCheckSum=0; // CheckSum of contents data
- BTREERECORD_V3 contents; // data from disk
-} BTREEBUFFER_V3, *PBTREEBUFFER_V3;
+ BTREERECORD_V3 contents{}; // data from disk
+
+ //BTREEBUFFER(){memset(this, 0, sizeof(*this));}
+};
typedef struct _BTREEINDEX_V3
{
struct _BTREEINDEX_V3 * pNext; // point to next index buffer
- BTREEBUFFER_V3 btreeBuffer; // data from disk
+ BTREEBUFFER btreeBuffer; // data from disk
} BTREEINDEX_V3, * PBTREEINDEX_V3;
@@ -434,12 +454,6 @@ typedef struct _BTREEINDEX_V3
typedef SHORT _PFN_QDAMCOMPARE( PVOID, PVOID, PVOID );
typedef _PFN_QDAMCOMPARE *PFN_QDAMCOMPARE;
-typedef struct _LOOKUPENTRY_V3
-{
- PBTREEBUFFER_V3 pBuffer; // Pointer to BTREEBUFFER
- ULONG ulAccessCounter;
-} LOOKUPENTRY_V3, *PLOOKUPENTRY_V3;
-
typedef LHANDLE HTM;
@@ -466,65 +480,61 @@ typedef LHANDLE HTM;
//table entry structure
-typedef struct _TMX_TABLE_ENTRY
+struct TMX_TABLE_ENTRY
{
- CHAR szName[MAX_LANG_LENGTH];
+ CHAR szName[MAX_LANG_LENGTH]{};
USHORT usId = 0;
-} TMX_TABLE_ENTRY, * PTMX_TABLE_ENTRY;
+};
+typedef TMX_TABLE_ENTRY * PTMX_TABLE_ENTRY;
+
// name table structure (TM version 5 and up)
constexpr int NUM_OF_TMX_TABLE_ENTRIES = (BTREE_REC_SIZE_V3 - sizeof(ULONG)) / sizeof(TMX_TABLE_ENTRY);
-typedef struct TMX_TABLE_OLD{
+struct TMX_TABLE_OLD{
ULONG ulMaxEntries = 0;
- TMX_TABLE_ENTRY stTmTableEntry[NUM_OF_TMX_TABLE_ENTRIES];
+ TMX_TABLE_ENTRY table[NUM_OF_TMX_TABLE_ENTRIES];
};
typedef TMX_TABLE_OLD * PTMX_TABLE_OLD;
-typedef struct TMX_TABLE
+
+struct TMX_TABLE
{
- //ULONG ulAllocSize = 0;
- ULONG ulMaxEntries = 0;
- //std::vector stTmTableEntry;//[NUM_OF_TMX_TABLE_ENTRIES];
- std::vector stTmTableEntry;
+ std::vector table;
TMX_TABLE(){
- stTmTableEntry.resize(NUM_OF_TMX_TABLE_ENTRIES);
- for(int i=0;i pszBuffer; // buffer for names and IDs
+ std::vector stTableEntry; // dyn. array of table entries
+ void restoreStrPointersAfterRealloc(){
+ for(auto& entry: stTableEntry){//during insertion to the pszBuffer, it could be reallocated, so we need to update poiners
+ if(entry.longNameStartOffset)
+ entry.pszLongName = (PSZ) &(pszBuffer[entry.longNameStartOffset]);
+ };
+ }
+};
BOOL UtlAlloc ( void **, long, long, unsigned short );
-BOOL UtlAllocHwnd ( void**, long, long, unsigned short, void * );
#include "Filebuffer.h"
#include
@@ -558,41 +568,33 @@ typedef enum _SEARCHTYPE
struct BTREE
{
-
bool fGuard =false; // write every record
- //BOOL fOpen=false; // open flag
bool fTerse =false; // tersing requested
ushort usFirstNode=0; // file pointer of record
ushort usFirstLeaf=0; // file pointer of record
ushort usNextFreeRecord = 0; // Next record to expand to
- RECPARAM DataRecList[ MAX_LIST ]; // last used data records
- unsigned char chEntryEncode[ ENTRYENCODE_LEN]; // significant characters
- unsigned char bEncodeLen[COLLATE_SIZE]; // encoding table length
- unsigned char chEncodeVal[COLLATE_SIZE]; // encoding table
- unsigned char chDecode[ENTRYDECODE_LEN]; // decoding table
+ RECPARAM DataRecList[ MAX_LIST ]{}; // last used data records
+ unsigned char chEntryEncode[ ENTRYENCODE_LEN]{}; // significant characters
+ unsigned char bEncodeLen[COLLATE_SIZE]{}; // encoding table length
+ unsigned char chEncodeVal[COLLATE_SIZE]{}; // encoding table
+ unsigned char chDecode[ENTRYDECODE_LEN]{}; // decoding table
NTMVITALINFO chCollate;
- unsigned char chCaseMap[COLLATE_SIZE]; // case mapping to be used
ushort usFreeKeyBuffer=0; // index of buffer to use
ushort usFreeDataBuffer=0; // first data buffer chain
ushort usFirstDataBuffer=0; // first data buffer
- BTREEBUFFER_V3 BTreeTempBuffer_V3; // temporary V3 buffer
+ std::shared_ptr BTreeTempBuffer_V3; // temporary V3 buffer
long lTime=0; // time of last update/open
- ushort usVersion=0; // version identification...
- char chEQF[7]; // The type of file
+ char chEQF[7]{}; // The type of file
char bVersion=0; // version flag
ushort usOpenFlags=0; // settings used for open
- HFILE fpDummy=nullptr; // dummy/lock semaphore file handle
- //USHORT usNumberOfLookupEntries=0; // Number of allocated lookup-table-entries
ushort usNumberOfAllocatedBuffers=0; // Number of allocated buffers
unsigned long ulReadRecCalls=0; // Number of calls to QDAMReadRecord
char bRecSizeVersion=0; // record size version flag
char sCurrentIndex=0; // current sequence array
ushort usCurrentRecord=0; // current sequence record
- ushort usDictNum=0; // index in global structure
- //wchar_t chHeadTerm[HEADTERM_SIZE]; // last active head term
bool fLock =false; // head term is locked
unsigned long ulNum=0;
bool fDictLock =false;
@@ -600,332 +602,70 @@ struct BTREE
//new fields
FileBuffer fb;
std::vector TempRecord;
- std::vector LookupTable_V3; // Pointer to lookup-table
+ std::map> LookupTable; // Pointer to lookup-table
+ //methods
BTREE(){
TempRecord = std::vector(MAXDATASIZE, 0);
// Ensure proper initialization for arrays and complex types
- std::fill(std::begin(chEntryEncode), std::end(chEntryEncode), 0);
- std::fill(std::begin(bEncodeLen), std::end(bEncodeLen), 0);
- std::fill(std::begin(chEncodeVal), std::end(chEncodeVal), 0);
- std::fill(std::begin(chDecode), std::end(chDecode), 0);
- std::fill(std::begin(chCaseMap), std::end(chCaseMap), 0);
- //std::fill(std::begin(chCollate), std::end(chCollate), 0);
- std::fill(std::begin(chEQF), std::end(chEQF), '\0');
- memset(&BTreeTempBuffer_V3, 0, sizeof(BTreeTempBuffer_V3));
- //std::fill(std::begin(chHeadTerm), std::end(chHeadTerm), L'\0');
+ BTreeTempBuffer_V3 = std::make_shared();
}
-
void freeMem(){
freeLookupTable();
}
-
- bool wasModified() const{ return fb.wasModified(); }
+ bool wasModified() const{ return fb.WasModified(); }
int initLookupTable();
int resetLookupTable();
- void freeLookupTable();
- int checkLookupTableAndRealocate(int number);
- int allocateNewLookupTableBuffer(int number, PLOOKUPENTRY_V3& pLEntry, PBTREEBUFFER_V3& pBuffer);
-
- //+----------------------------------------------------------------------------+
- // Internal function
- //+----------------------------------------------------------------------------+
- // Function name: EQFNTMUpdSign Write User Data
- //+----------------------------------------------------------------------------+
- // Function call: QDAMDictUpdSignLocal( PBTREE, PCHAR, USHORT );
- //
- //+----------------------------------------------------------------------------+
- // Description: Writes the second part of the first record (user data)
- // This is done using the original QDAMDictUpdSignLocal
- // function
- //+----------------------------------------------------------------------------+
- // Parameters: PBTREE pointer to btree structure
- // PCHAR pointer to user data
- // USHORT length of user data
- //
- //+----------------------------------------------------------------------------+
- // Returncode type: SHORT
- //+----------------------------------------------------------------------------+
- // Returncodes: 0 no error happened
- // BTREE_DISK_FULL disk full condition encountered
- // BTREE_WRITE_ERROR write error to disk
- // BTREE_INVALID pointer invalid
- // BTREE_USERDATA user data too long
- // BTREE_CORRUPTED dictionary is corrupted
- //+----------------------------------------------------------------------------+
- // NOTE: This function could be implemented as MACRO too, but
- // for consistency reasons, the little overhead was used...
- //+----------------------------------------------------------------------------+
+ void freeLookupTable();
+ int allocateNewLookupTableBuffer(int number,std::shared_ptr& pBuffer);
+ int deallocateLookupTableBuffer(int number);
ULONG GetNumOfSavedRecords()const;
-
SHORT QDAMDictFlushLocal();
-
- //+----------------------------------------------------------------------------+
- // Internal function
- //+----------------------------------------------------------------------------+
- // Function name: EQFNTMSign Read signature record
- //+----------------------------------------------------------------------------+
- // Function call: QDAMDictSignLocal( PBTREE, PCHAR, PUSHORT );
- //+----------------------------------------------------------------------------+
- // Description: Gets the second part of the first record ( user data )
- // This is done using the original QDAMDictSignLocal func.
- //+----------------------------------------------------------------------------+
- // Parameters: PBTREE pointer to btree structure
- // PCHAR pointer to user data
- // PUSHORT length of user data area (input)
- // filled length (output)
- //+----------------------------------------------------------------------------+
- // Returncode type: SHORT
- //+----------------------------------------------------------------------------+
- // Returncodes: 0 no error happened
- // BTREE_INVALID pointer invalid
- // BTREE_USERDATA user data too long
- // BTREE_NO_BUFFER no buffer free
- // BTREE_READ_ERROR read error from disk
- //
- //+----------------------------------------------------------------------------+
- // Side effects: return signature record even if dictionary is corrupted
- //+----------------------------------------------------------------------------+
- // NOTE: This function could be implemented as MACRO too, but
- // for consistency reasons, the little overhead was used...
- //+----------------------------------------------------------------------------+
-
- SHORT EQFNTMSign
- (
- PCHAR pUserData, // pointer to user data
- PUSHORT pusLen // length of user data
- );
-
-
- VOID QDAMTerseInit (unsigned char* );
-
- //SHORT
- //EQFNTMInsert
- //(
- // PULONG pulKey, // pointer to key
- // PBYTE pData, // pointer to user data
- // ULONG ulLen // length of user data
- //);
-
-
- //+----------------------------------------------------------------------------+
- // External function
- //+----------------------------------------------------------------------------+
- // Function name: EQFNTMInsert
- //+----------------------------------------------------------------------------+
- // Function call: sRc = EQFNTMInsert( pBTIda, &ulKey, pData, usLen );
- //+----------------------------------------------------------------------------+
- // Description: insert a new key (ULONG) with data
- //+----------------------------------------------------------------------------+
- // Parameters: PBTREE pBTIda, pointer to binary tree struct
- // PULONG pulKey, pointer to key
- // PBYTE pData, pointer to user data
- // ULONG ulLen length of user data
- //+----------------------------------------------------------------------------+
- // Returncode type: SHORT
- //+----------------------------------------------------------------------------+
- // Returncodes: BTREE_NUMBER_RANGE requested key not in allowed range
- // BTREE_READONLY file is opened read only - no write
- // BTREE_CORRUPTED file is corrupted
- // errors returned by QDAMDictInsertLocal
- // 0 success indicator
- //+----------------------------------------------------------------------------+
+ SHORT EQFNTMSign(TMX_SIGN& );
+ VOID QDAMTerseInit (unsigned char* );
SHORT
EQFNTMInsert
(
- PULONG pulKey, // pointer to key
- PBYTE pData, // pointer to user data
- ULONG ulLen // length of user data
+ LONG& lKey, // pointer to key
+ BytesRef pData // pointer to user data
);
- //+----------------------------------------------------------------------------+
- // External function
- //+----------------------------------------------------------------------------+
- // Function name: EQFNTMUpdate
- //+----------------------------------------------------------------------------+
- // Function call: sRc = EQFNTMUpdate( pBTIda, ulKey, pData, usLen );
- //+----------------------------------------------------------------------------+
- // Description: update the data of an already inserted key
- //+----------------------------------------------------------------------------+
- // Parameters: PBTREE pBTIda, pointer to binary tree struct
- // ULONG ulKey, key value
- // PBYTE pData, pointer to user data
- // ULONG ulLen length of user data
- //+----------------------------------------------------------------------------+
- // Returncode type: SHORT
- //+----------------------------------------------------------------------------+
- // Returncodes: BTREE_NUMBER_RANGE requested key not in allowed range
- // BTREE_READONLY file is opened read only - no write
- // BTREE_CORRUPTED file is corrupted
- // errors returned by QDAMDictInsertLocal
- // 0 success indicator
- //+----------------------------------------------------------------------------+
SHORT
EQFNTMUpdate
(
- ULONG ulKey, // key value
- PBYTE pData, // pointer to user data
- ULONG ulLen, // length of user data
+ LONG lKey, // key value
+ BytesRef pData, // pointer to user data
bool fSuppressTmdSizeCheck = false //for deletion there no need to check if size is bigger than allowed
);
-
- //+----------------------------------------------------------------------------+
- // External function
- //+----------------------------------------------------------------------------+
- // Function name: EQFNTMGet
- //+----------------------------------------------------------------------------+
- // Function call: sRc = EQFNTMGet( pBTIda, ulKey, chData, &usLen );
- //+----------------------------------------------------------------------------+
- // Description: get the data string for the passed key
- //+----------------------------------------------------------------------------+
- // Parameters: PBTREE pBTIda, pointer to btree struct
- // ULONG ulKey, key to be searched for
- // PCHAR pchBuffer, space for user data
- // PULONG pulLength in/out length of returned user data
- //+----------------------------------------------------------------------------+
- // Returncode type: SHORT
- //+----------------------------------------------------------------------------+
- // Returncodes: same as for QDAMDictExactLocal...
- //+----------------------------------------------------------------------------+
- SHORT
- EQFNTMGet
- (
- ULONG ulKey, // key to be searched for
- PCHAR pchBuffer, // space for user data
- PULONG pulLength // in/out length of returned user data
- );
-
-
-
- //+----------------------------------------------------------------------------+
- // External function
- //+----------------------------------------------------------------------------+
- // Function name: EQFNTMGetMaxNumber
- //+----------------------------------------------------------------------------+
- // Function call: sRc = EQFNTMGetNextNumber( pBTIda, &ulKey, &ulNextFree );
- //+----------------------------------------------------------------------------+
- // Description: get the start key and the next free key ...
- //+----------------------------------------------------------------------------+
- // Parameters: PBTREE pBTIda, pointer to btree struct
- // PULONG pulStartKey first key
- // PULONG pulNextKey next key to be assigned
- //+----------------------------------------------------------------------------+
- // Returncode type: SHORT
- //+----------------------------------------------------------------------------+
- // Returncodes: 0 always
- //+----------------------------------------------------------------------------+
- // Function flow: access data from internal structure
- //+----------------------------------------------------------------------------+
- SHORT
- EQFNTMGetNextNumber
- (
- PULONG pulStartKey, // return start key number
- PULONG pulNextKey // return next key data
- );
-
-
- //+----------------------------------------------------------------------------+
- // External function
- //+----------------------------------------------------------------------------+
- // Function name: EQFNTMPhysLock
- //+----------------------------------------------------------------------------+
- // Function call: sRc = EQFNTMPhysLock( pBTIda );
- //+----------------------------------------------------------------------------+
- // Description: Physicall lock or unlock database.
- //+----------------------------------------------------------------------------+
- // Parameters: PBTREE The database to be locked
- // BOOL TRUE = LOCK, FALSE = Unlock
- // PBOOL ptr to locked flag (set to TRUE if
- // locking was successful
- //+----------------------------------------------------------------------------+
- // Returncode type: SHORT
- //+----------------------------------------------------------------------------+
SHORT EQFNTMPhysLock
(
- BOOL fLock,
- PBOOL pfLocked
- );
-
- //+----------------------------------------------------------------------------+
- // Internal function
- //+----------------------------------------------------------------------------+
- // Function name: QDAMIncrUpdCounter Inrement database update counter
- //+----------------------------------------------------------------------------+
- // Function call: QDAMIncrUpdCounter( PBTREE, SHORT sIndex )
- //
- //+----------------------------------------------------------------------------+
- // Description: Update one of the update counter field in the dummy
- // /locked terms file
- //
- //+----------------------------------------------------------------------------+
- // Parameters: PBTREE pointer to btree structure
- // SHORT index of counter field
- // PLONG ptr to buffer for new counte value
- //+----------------------------------------------------------------------------+
- // Returncode type: SHORT
- //+----------------------------------------------------------------------------+
- // Returncodes: 0 no error happened
- // BTREE_DISK_FULL disk full condition encountered
- // BTREE_WRITE_ERROR write error to disk
- //
- //+----------------------------------------------------------------------------+
- // Function flow: read update counter from dummy file
- // increment update counter
- // position ptr to begin of file
- // write update counter to disk
- //+----------------------------------------------------------------------------+
-
-
- //+----------------------------------------------------------------------------+
- // Internal function
- //+----------------------------------------------------------------------------+
- // Function name: EQFNTMGetUpdCounter Get database update counter
- //+----------------------------------------------------------------------------+
- // Function call: EQFNTMGetUpdCounter( PBTREE, PLONG, SHORT, SHORT );
- //+----------------------------------------------------------------------------+
- // Description: Get one or more of the the database update counters
- // from the dummy/locked terms file
- //+----------------------------------------------------------------------------+
- // Parameters: PBTREE pointer to btree structure
- // PLONG ptr to buffer for update counter
- // SHORT index of requested update counter
- // SHORT number of counters requested
- //+----------------------------------------------------------------------------+
- // Returncode type: SHORT
- //+----------------------------------------------------------------------------+
- SHORT EQFNTMGetUpdCounter
- (
- PLONG plUpdCount, // ptr to buffer for update counter
- SHORT sIndex, // index of requested update counter
- SHORT sNumCounters // number of counters requested
+ BOOL fLock,
+ PBOOL pfLocked
);
-
- VOID QDAMUpdateList_V3( PBTREEBUFFER_V3 );
+ VOID QDAMUpdateList_V3( std::shared_ptr& );
- VOID QDAMFreeFromList_V3(PRECPARAM ,PBTREEBUFFER_V3 );
- SHORT QDAMFreeRecord_V3( PBTREEBUFFER_V3 pRecord, RECTYPE recType/* data or key record*/);
+ VOID QDAMFreeFromList_V3(PRECPARAM ,std::shared_ptr& );
+ SHORT QDAMFreeRecord_V3( std::shared_ptr& pRecord, RECTYPE recType/* data or key record*/);
- ULONG QDAMGetrecDataLen_V3 ( PBTREEBUFFER_V3, SHORT );
+ ULONG QDAMGetrecDataLen_V3 ( std::shared_ptr&, SHORT );
SHORT QDAMDeleteDataFromBuffer_V3( RECPARAM recParam);
- SHORT QDAMDictUpdateLocal ( PWCHAR, PBYTE, ULONG, bool );
+ SHORT QDAMDictUpdateLocal ( PWCHAR, BytesRef, bool );
- SHORT QDAMDictExactLocal ( PWCHAR, PBYTE, PULONG, USHORT );
-
+ SHORT EQFNTMGet ( LONG&, BytesRef );
- SHORT QDAMDictCreateLocal ( TMX_SIGN*, ULONG, bool keepInRamOnly = false);
+ SHORT QDAMDictCreateLocal ( TMX_SIGN*, LONG, bool keepInRamOnly = false);
- SHORT QDAMDictInsertLocal ( PWCHAR, PBYTE, ULONG );
- BOOL QDAMDictLockStatus ( PWCHAR );
+ SHORT QDAMDictInsertLocal ( LONG&, BytesRef pData );
+ BOOL QDAMDictLockStatus ( const LONG& );
VOID QDAMDictUpdStatus ();
- SHORT QDAMFindRecord_V3( PWCHAR, PBTREEBUFFER_V3 * );
-
+ SHORT QDAMFindRecord_V3( LONG&, std::shared_ptr&);
//------------------------------------------------------------------------------
// Internal function
@@ -1032,146 +772,108 @@ struct BTREE
SHORT QDAMReadRecord_V3
(
- USHORT usNumber,
- PBTREEBUFFER_V3 * ppReadBuffer,
- BOOL fNewRec,
- bool fSuppressTmdSizeCheck = false //for deletion there no need to check if size is bigger than allowed
+ USHORT usNumber,
+ std::shared_ptr& pReadBuffer,
+ BOOL fNewRec,
+ bool fSuppressTmdSizeCheck = false //for deletion there no need to check if size is bigger than allowed
);
- SHORT QDAMAddToBuffer_V3( PBYTE, ULONG, PRECPARAM, bool);
+ SHORT QDAMAddToBuffer_V3( BytesRef, PRECPARAM, bool);
SHORT QDAMWriteHeader ();
SHORT QDAMDictUpdSignLocal
(
- PTMX_SIGN pSign // pointer to user data
+ PTMX_SIGN pSign // pointer to user data
);
- SHORT QDAMReadRecordFromDisk_V3( USHORT, PBTREEBUFFER_V3 *, BOOL , bool);
+ SHORT QDAMReadRecordFromDisk_V3( USHORT, std::shared_ptr&, BOOL, bool );
- SHORT QDAMWRecordToDisk_V3( PBTREEBUFFER_V3,
- bool fSuppressTmdSizeCheck = false //for deletion there no need to check if size is bigger than allowed
- );
- SHORT QDAMWriteRecord_V3( PBTREEBUFFER_V3 pBuffer,
- bool fSuppressTmdSizeCheck = false //for deletion there no need to check if size is bigger than allowed
- );
+ SHORT QDAMWRecordToDisk_V3( std::shared_ptr&,
+ bool fSuppressTmdSizeCheck = false //for deletion there no need to check if size is bigger than allowed
+ );
+ SHORT QDAMWriteRecord_V3( std::shared_ptr& pBuffer,
+ bool fSuppressTmdSizeCheck = false //for deletion there no need to check if size is bigger than allowed
+ );
SHORT QDAMAllocKeyRecords( USHORT usNum);
- SHORT QDAMDictOpenLocal(
- SHORT sNumberOfBuffers, // number of buffers
- USHORT usOpenFlags // Read Only or Read/Write
+ SHORT EQFNTMOpen(
+ USHORT usOpenFlags, // Read Only or Read/Write
+ SHORT sNumberOfBuffers=20 // number of buffers
);
-
- SHORT EQFNTMOpen( USHORT usOpenFlags); // Read Only or Read/Write
SHORT QDAMCheckDict( PSZ pName); // name of dictionary
+ SHORT QDAMDictClose();
- //SHORT QDAMDictCloseLocal ();
- //+----------------------------------------------------------------------------+
-// External function
-//+----------------------------------------------------------------------------+
-// Function name: QDAMDictClose close the dictionary
-//+----------------------------------------------------------------------------+
-// Function call: QDAMDictClose( PPBTREE );
-//
-//+----------------------------------------------------------------------------+
-// Description: Close the file
-//
-//+----------------------------------------------------------------------------+
-// Parameters: PPBTREE pointer to btree structure
-//+----------------------------------------------------------------------------+
-// Returncode type: SHORT
-//+----------------------------------------------------------------------------+
-// Returncodes: 0 no error happened
-// BTREE_INVALID incorrect pointer
-// BTREE_DISK_FULL disk full condition encountered
-// BTREE_WRITE_ERROR write error to disk
-// BTREE_CORRUPTED dictionary is corrupted
-// BTREE_CLOSE_ERROR error closing dictionary
-//+----------------------------------------------------------------------------+
-SHORT QDAMDictClose();
-
-
-SHORT QDAMDictSignLocal
-(
- PCHAR pUserData, // pointer to user data
- PUSHORT pusLen // length of user data
-);
-
-//+----------------------------------------------------------------------------+
-// Internal function
-//+----------------------------------------------------------------------------+
-// Function name: EQFNTMClose close the TM file
-//+----------------------------------------------------------------------------+
-// Function call: EQFNTMClose( PPBTREE );
-//+----------------------------------------------------------------------------+
-// Description: Close the file
-//+----------------------------------------------------------------------------+
-// Parameters: PPBTREE pointer to btree structure
-//+----------------------------------------------------------------------------+
-// Returncode type: SHORT
-//+----------------------------------------------------------------------------+
-// Returncodes: 0 no error happened
-// BTREE_INVALID incorrect pointer
-// BTREE_DISK_FULL disk full condition encountered
-// BTREE_WRITE_ERROR write error to disk
-// BTREE_CORRUPTED dictionary is corrupted
-// BTREE_CLOSE_ERROR error closing dictionary
-//+----------------------------------------------------------------------------+
-
-SHORT EQFNTMClose();
-
-SHORT QDAMNewRecord_V3
-(
- PBTREEBUFFER_V3 * ppRecord,
- RECTYPE recType, // data or key record
- bool fSuppressTmdSizeCheck = false
-);
-
-SHORT QDAMInsertKey_V3
-(
- PBTREEBUFFER_V3 pRecord, // record where key is to be inserted
- PWCHAR pKey,
- RECPARAM recKey, // position/offset for key
- RECPARAM recData // position/offset for data
-);
-
-size_t GetFileSize()const;
+ SHORT QDAMDictSignLocal
+ (
+ PCHAR pUserData, // pointer to user data
+ PUSHORT pusLen // length of user data
+ );
+ //+----------------------------------------------------------------------------+
+ // Internal function
+ //+----------------------------------------------------------------------------+
+ // Function name: EQFNTMClose close the TM file
+ //+----------------------------------------------------------------------------+
+ // Function call: EQFNTMClose( PPBTREE );
+ //+----------------------------------------------------------------------------+
+ // Description: Close the file
+ //+----------------------------------------------------------------------------+
+ // Parameters: PPBTREE pointer to btree structure
+ //+----------------------------------------------------------------------------+
+ // Returncode type: SHORT
+ //+----------------------------------------------------------------------------+
+ // Returncodes: 0 no error happened
+ // BTREE_INVALID incorrect pointer
+ // BTREE_DISK_FULL disk full condition encountered
+ // BTREE_WRITE_ERROR write error to disk
+ // BTREE_CORRUPTED dictionary is corrupted
+ // BTREE_CLOSE_ERROR error closing dictionary
+ //+----------------------------------------------------------------------------+
-BOOL QDAMTerseData
-(
- PUCHAR pData, // pointer to data
- PULONG pulLen // length of the string
-);
+ SHORT EQFNTMClose();
+ SHORT QDAMNewRecord_V3
+ (
+ std::shared_ptr& pRecord,
+ RECTYPE recType, // data or key record
+ bool fSuppressTmdSizeCheck = false
+ );
- SHORT QDAMLocateKey_V3(
- PBTREEBUFFER_V3, PWCHAR, PSHORT, SEARCHTYPE, PSHORT);
+ SHORT QDAMInsertKey_V3
+ (
+ std::shared_ptr& pRecord, // record where key is to be inserted
+ LONG& ulKey,
+ RECPARAM recKey, // position/offset for key
+ RECPARAM recData // position/offset for data
+ );
+
+ size_t GetFileSize()const;
+
+ BOOL QDAMTerseData
+ (
+ BytesRef ,
+ PULONG pulLen // length of the string
+ );
+ SHORT QDAMLocateKey_V3(
+ std::shared_ptr&, LONG&, PSHORT, SEARCHTYPE, PSHORT);
+
+ SHORT QDAMGetszData_V3 ( RECPARAM, BytesRef );
};//BTREE
typedef BTREE * PBTREE;
typedef BTREE ** PPBTREE;
-
-
-#define NTMNEXTKEY( pBT ) pBT->chCollate.ulNextKey
-#define NTMSTARTKEY( pBT ) pBT->chCollate.ulStartKey
-
-
-
-
-
//typedef TMX_CLB* PTMX_CLB;
//prefix for each output structures
typedef struct _TMX_PREFIX_OUT
{
- USHORT usLengthOutput; //length of complete output structure
- USHORT usTmtXRc; //function returncode
+ USHORT usLengthOutput = 0; //length of complete output structure
+ USHORT usTmtXRc = 0; //function returncode
} TMX_PREFIX_OUT, * PTMX_PREFIX_OUT, XOUT, * PXOUT;
-
#define MEM_EXPORT_OUT_BUFFER 8200 // Output buffer for export
#define MAX_HANDLER_NAME 40
@@ -1416,19 +1118,22 @@ class TMXParseHandler;
//class SAXParser;
struct LOADEDTABLE;
-typedef struct _TOKENENTRY // entry in tokenlist :
+struct TOKENENTRY // entry in tokenlist :
{
// !!!! Attention: below has to match TOKENENTRYSEG definition .... !!!!
- SHORT sTokenid; // Tokenid
- int iLength; // Length of data string
- SHORT sAddInfo; // additional information from tag table
- CHAR * pDataString; // pointer to data string
- USHORT usOrgId; // original id
- USHORT ClassId; // class id of token
- CHAR_W * pDataStringW; // pointer to data string - Unicode
+ SHORT sTokenid{}; // Tokenid
+ int iLength{}; // Length of data string
+ SHORT sAddInfo{}; // additional information from tag table
+ CHAR * pDataString{}; // pointer to data string
+ USHORT usOrgId{}; // original id
+ USHORT ClassId{}; // class id of token
+ CHAR_W * pDataStringW{}; // pointer to data string - Unicode
// !!!! Attention: above has to match TOKENENTRYSEG definition .... !!!!
+
+ void reset(){ *this = TOKENENTRY{};}
-} TOKENENTRY, *PTOKENENTRY;
+};
+using PTOKENENTRY = TOKENENTRY*;
class ImportStatusDetails;
@@ -1517,7 +1222,6 @@ typedef struct _MEM_EXPORT_IDA
USHORT usRC; // error code in non-DDE batch mode
USHORT usExpMode; // mode for export
CHAR szConvArea[MEM_EXPORT_WORK_AREA]; // Work area for extract
- PSZ pszNameList; // pointer to list of TMs being organized
PSZ pszActiveName; // points to current name in pszNameList
USHORT usYesToAllMode; // yes-to-all mode for replace existing files
ULONG ulOemCP; // ASCII cp of system preferences language
@@ -1525,8 +1229,8 @@ typedef struct _MEM_EXPORT_IDA
// fields for external memory export methods
CTMXExportImport* lExternalExportHandle; // handle of external memory export functions
//HMODULE hmodMemExtExport; // handle of external export module/DLL
- MEMEXPIMPINFO* pstMemInfo; // buffer for memory information
- MEMEXPIMPSEG* pstSegment; // buffer for segment data
+ MEMEXPIMPINFO pstMemInfo; // buffer for memory information
+ MEMEXPIMPSEG pstSegment; // buffer for segment data
BOOL fDataCorrupted; // TRUE = data has been corrupted during export
CHAR_W szBackConvArea[MEM_EXPORT_WORK_AREA]; // Work area for conversion check
@@ -1535,7 +1239,6 @@ typedef struct _MEM_EXPORT_IDA
CHAR_W szSegmentBuffer[MAX_SEGMENT_SIZE]; // Buffer for segment data
CHAR_W szSegmentBuffer2[MAX_SEGMENT_SIZE]; // Buffer for preprocessed segment data
int iComplete; // completion rate
- CHAR szPlugin[MAX_LONGFILESPEC]; // name of memory plugin handling the current memory database
int invalidXmlSegments=0;
long numOfRequestedSegmentsForExport = 0;
@@ -1591,6 +1294,7 @@ typedef enum _PROCWINSTYLE
#define Err_Prop 2000 // property handler rc
#define Err_ObjM 2100 // object manager rc
#define Err_Nfol 2200 // new folder messages
+#define ERR_SERVICE_BASE 3000
#define ERR_BTREE_BASE 5000
#define ERR_BTREE_END 5999
#define ERR_MEM_BASE 6000
@@ -1651,6 +1355,9 @@ typedef enum _PROCWINSTYLE
#define ErrProp_InvalidHandle (Err_Prop+23) // invalid handle to properties
+#define ERR_WRITE_REQUESTS_NOT_ALLOWED ERR_SERVICE_BASE + 1 //3000
+#define ERR_LOADING_TM_ARE_NOT_ALLOWED ERR_SERVICE_BASE + 2 //3000
+
#define BTREE_BASE ERR_BTREE_BASE //5000
#define BTREE_NO_ROOM BTREE_BASE+1 // Insufficent memory
#define BTREE_ILLEGAL_FILE BTREE_BASE+2 // Not an index file
@@ -1701,8 +1408,9 @@ typedef enum _PROCWINSTYLE
/**********************************************************************/
/* Return Codes */
/**********************************************************************/
-#define TMERR_BASE ERR_MEM_BASE /* Base for errors */
+#define TMERR_BASE ERR_MEM_BASE /* Base for errors 6000 */
+#define TMERR_LANG_TOO_SMALL_FOR_REORGANIZE TMERR_BASE + 11
#define TMERR_EOF TMERR_BASE + 12
#define DISK_FULL TMERR_BASE + 13 // for Add /Replace / Create
@@ -2258,14 +1966,14 @@ struct LOADEDTABLE
{
CHAR szName[MAX_FNAME]; // tag table name (w/o path and ext.)
SHORT sUseCount; // number of active table users
- PTAGTABLE pTagTable; // pointer to tag table in memory
- PNODE pTagTree; // Tag tree of table
- PNODE pAttrTree; // attribute tree of table
- PNODEAREA pNodeArea; // area for node trees
- PNODEAREA pAttrNodeArea; // area for attribute node tree
+ PTAGTABLE pTagTable = nullptr; // pointer to tag table in memory
+ PNODE pTagTree = nullptr; // Tag tree of table
+ PNODE pAttrTree = nullptr; // attribute tree of table
+ PNODEAREA pNodeArea = nullptr; ; // area for node trees
+ PNODEAREA pAttrNodeArea = nullptr; ; // area for attribute node tree
HMODULE hmodUserExit; // user exit (if any)
BOOL fUserExitLoadFailed; // TRUE = load of user exit failed
- PFN pfnProtTable; // creat eprotect table function
+ PFN pfnProtTable = nullptr; ; // creat eprotect table function
BOOL fProtTableLoadFailed; // TRUE = ProtTable function load failed
// new fields contained in tagtables TAGTABLE_VERSION3 and above
// these fields are copied from the TAGTABLE structure (if available) or filled
@@ -2276,13 +1984,13 @@ struct LOADEDTABLE
CHAR szDescription[MAX_DESCRIPTION]; // format description
USHORT usCharacterSet; // characterset to use for import/export
BOOL fUseUnicodeForSegFile; // TRUE = store segmented files in Unicode format
- PSZ_W pTagNamesW;
- PSZ_W pAttributesW;
- PVOID pTagTableW;
- PFN pfnCompareContext; // compare context info function
+ std::wstring pTagNamesW;
+ std::wstring pAttributesW;
+ PVOID pTagTableW = nullptr; ;
+ PFN pfnCompareContext = nullptr; ; // compare context info function
BOOL fCompareContextLoadFailed; // TRUE = CompareContext function load failed
- PFN pfnProtTableW; // create protect table function (Unicode)
- PFNGETSEGCONTTEXT pfnGetSegContext; // get segment context function (Unicode)
+ PFN pfnProtTableW = nullptr; ; // create protect table function (Unicode)
+ PFNGETSEGCONTTEXT pfnGetSegContext = nullptr; ; // get segment context function (Unicode)
BOOL fGetSegContextLoadFailed; // TRUE = GetSegContext function load failed
BOOL fReflow; // 0=notspec. 1= Reflow allowed, 2= no Reflow
PFN pfnQueryExitInfo; // query exit info function
@@ -2318,7 +2026,7 @@ class ChunkBufferOld{
void setResponseHandler(proxygen::ResponseHandler* responseHandler){m_responseHandler = responseHandler;}
bool isActive()const {return m_responseHandler != 0; }
- ChunkBufferOld(){m_buff.reserve(chunkSize_+1);}
+ ChunkBufferOld(){m_buff.resize(chunkSize_+1);}
~ChunkBufferOld(){
T5LOG(T5INFO)<< "called dctor of chunk buffer- sending last chunk";
triggerChunkSend();
@@ -2377,12 +2085,12 @@ class CTMXExportImportOld
unsigned int m_iSourceSize; // size of source file
PTOKENENTRY m_pTokBuf; // buffer for TaTagTokenize tokens
CHAR m_szActiveTagTable[50]; // buffer for name of currently loaded markup table
- PLOADEDTABLE m_pLoadedTable; // pointer to currently loaded markup table
- PLOADEDTABLE m_pLoadedRTFTable; // pointer to loaded RTF tag table
+ PLOADEDTABLE m_pLoadedTable = nullptr; // pointer to currently loaded markup table
+ PLOADEDTABLE m_pLoadedRTFTable = nullptr; // pointer to loaded RTF tag table
CHAR m_szInFile[512]; // buffer for input file
CHAR m_TempFile[540]; // buffer for temporary file name
BYTE m_bBuffer[TMX_BUFFER_SIZE+1];
- PMEMEXPIMPINFO m_pMemInfo;
+ PMEMEXPIMPINFO m_pMemInfo = nullptr;
CHAR_W m_szSegBuffer[MAX_SEGMENT_SIZE+1]; // buffer for the processing of segment data
int m_currentTu; // export: number of currently processed tu
};
@@ -2439,25 +2147,23 @@ struct MEM_LOAD_DLG_IDA
PTOKENENTRY pTokenEntry; // A pointer to token entries
PTOKENENTRY pTokenEntryWork; // A work pointer to token entries
- MEMEXPIMPINFO* pstMemInfo; // buffer for memory information
+ MEMEXPIMPINFO pstMemInfo; // buffer for memory information
CTMXExportImport TMXImport; // handle of external memory import functions
PLOADEDTABLE pFormatTable; // Pointer to Format Table
- MEMEXPIMPSEG* pstSegment; // buffer for segment data
+ MEMEXPIMPSEG pstSegment; // buffer for segment data
BOOL fEOF; // Indicates end of file
};
class TMCursor
{
- ulong _recordKey;
- ushort _targetKey;
+ long _recordKey{};
+ ushort _targetKey{};
public:
-
-
- int SplitProposalKeyIntoRecordAndTarget(const char *pszKey, ulong *pulKey, ushort *pusTargetNum);
+ int SplitProposalKeyIntoRecordAndTarget(const char *pszKey, long *pulKey, ushort *pusTargetNum);
int parseAndSetInternalKey(const char* pszKey){
return SplitProposalKeyIntoRecordAndTarget(pszKey, &_recordKey, &_targetKey);
}
@@ -2474,7 +2180,7 @@ class TMCursor
return setInternalKey(_recordKey+1, 1);
}
- int setInternalKey(ulong recordKey, ushort targetKey){
+ int setInternalKey(const ulong recordKey, const ushort targetKey){
_recordKey = recordKey;
_targetKey = targetKey;
return 0;
@@ -2489,7 +2195,7 @@ class TMCursor
return std::to_string(_recordKey) + ":" + std::to_string(_targetKey) ;
}
- ulong getRecordKey()const { return _recordKey; }
+ long getRecordKey()const { return _recordKey; }
ushort getTargetKey()const { return _targetKey; }
};
@@ -2500,38 +2206,37 @@ class TMCursor
typedef struct _FCTDATA
{
std::string fileData;
- ULONG lMagicWord; // FUNCDATA area identifier
- LONG lCheckSum; // checksum of FUNCDATA area
- SHORT sLastFunction; // last function performed
+ ULONG lMagicWord{}; // FUNCDATA area identifier
+ LONG lCheckSum{}; // checksum of FUNCDATA area
+ SHORT sLastFunction{}; // last function performed
// area for session data
- std::atomic fComplete; // current process is complete flag
- CHAR szEqfResFile[MAX_EQF_PATH];// name of resource file
- CHAR szSystemPropPath[MAX_EQF_PATH]; // system properties path
- CHAR szMsgFile[MAX_EQF_PATH]; // message file for error messages
- CHAR szError[256]; // text buffer for error messages
- DDEMSGBUFFER LastMessage; // buffer for last error message
- HWND hwndErrMsg; // handle for error mesages (HWND_FUNCIF)
+ //std::atomic
+ BOOL fComplete{}; // current process is complete flag
+ CHAR szEqfResFile[MAX_EQF_PATH]{};// name of resource file
+ CHAR szSystemPropPath[MAX_EQF_PATH]{}; // system properties path
+ CHAR szMsgFile[MAX_EQF_PATH]{}; // message file for error messages
+ CHAR szError[256]{}; // text buffer for error messages
+ DDEMSGBUFFER LastMessage{}; // buffer for last error message
+ HWND hwndErrMsg{}; // handle for error mesages (HWND_FUNCIF)
// area used by mem import
- MEM_LOAD_DLG_IDA MemLoadIda; // pointer to analysis input data
- USHORT usMemLoadPhase; // current/next phase of TM import
- USHORT usMemLoadRC; // return code
+ MEM_LOAD_DLG_IDA MemLoadIda{}; // pointer to analysis input data
+ USHORT usMemLoadPhase{}; // current/next phase of TM import
+ USHORT usMemLoadRC{}; // return code
// area used by mem organize
- PVOID pvMemOrganizeCommArea; // pointer to organize CommArea
+ PVOID pvMemOrganizeCommArea{}; // pointer to organize CommArea
// area used by mem export
- PVOID pvMemExportCommArea;
+ PVOID pvMemExportCommArea{};
// general use buffer area
- OBJNAME szObjName; // buffer for object names
+ OBJNAME szObjName{}; // buffer for object names
// current progress of some nonDDE functions
//USHORT usProgress;
- USHORT usExportProgress;
-
-
+ USHORT usExportProgress{};
USHORT MemFuncExportProcess();
USHORT MemFuncPrepExport
(
@@ -2543,13 +2248,13 @@ typedef struct _FCTDATA
std::shared_ptr mem;
proxygen::ResponseHandler* responseHandler = nullptr;
- TMCursor startingInternalKey;
- TMCursor nextInternalKey;
+ TMCursor startingInternalKey{};
+ TMCursor nextInternalKey{};
ulong numOfProposalsRequested = 0;
- folly::IOBufQueue bufQueue;
- MutexTimeout tmLockTimeout;
- MutexTimeout tmListTimeout;
+ folly::IOBufQueue bufQueue{};
+ MutexTimeout tmLockTimeout{};
+ MutexTimeout tmListTimeout{};
} FCTDATA, *PFCTDATA;
@@ -2815,4 +2520,15 @@ enum FilterField{
*/
int convertTimeToUTC( long lTime, char *pszDateTime );
+typedef struct _FUZZYTOK
+{
+ PSZ_W pData = nullptr; // pointer to data..
+ ULONG ulHash = 0; // hash value
+ USHORT usStart = 0; // start offset
+ USHORT usStop = 0; // end offset
+ SHORT sType = 0; // type of entry /* KIT0857M */
+ EQF_BOOL fConnected = 0; // true if connected to pPropTokList
+ EQF_BOOL fNoTagSubst = 0; // true = do not use for tag substitution
+} FUZZYTOK, *PFUZZYTOK;
+
#endif //_LOW_LEVEL_OTM_DATA_STRUCTS_INCLUDED_
diff --git a/include/otm.h b/include/otm.h
index d8aa03bc..9ef240b3 100644
--- a/include/otm.h
+++ b/include/otm.h
@@ -16,6 +16,11 @@
/**********************************************************************/
#define NTMREQUESTNEWKEY 0xFFFFFFFF
+DECLARE_bool(newEntryIfOnlyContextAndTimestampDifferent);
+DECLARE_bool(saveDifferentTargetsForSameSource);
+//DECLARE_bool(ignoreSegIdOnUpdate);
+
+constexpr bool FLAGS_ignoreSegIdOnUpdate = true;//not used flag
//+----------------------------------------------------------------------------+
// Internal function
@@ -60,32 +65,46 @@ class JSONFactory;
#include "lowlevelotmdatastructs.h"
struct ImportStatusDetails{
- std::atomic_short usProgress{0};
- std::atomic_int segmentsCount{0};
- std::atomic_int segmentsImported{0};
- std::atomic_int invalidSegments{0};
- std::atomic_int invalidSymbolErrors{0};
- std::atomic_int resSegments {0};
- //std::atomic_long lActiveSegment{0};
+ std::mutex importDetailsMutex;
+ short usProgress{0};
+ int segmentsCount{0};
+ int segmentsImported{0};
+ int invalidSegments{0};
+ int invalidSymbolErrors{0};
+ int resSegments {0};
int importRc{0};
long filteredSegments{0};
+
+ //std::mutex invalidSegmentsRCsMutex;
std::map invalidSegmentsRCs;
+
+ //std::mutex importTimestampMutex;
std::string importTimestamp;
+
+ //std::mutex firstInvalidSegmentsSegNumsMutex;
std::vector> firstInvalidSegmentsSegNums;
long lImportStartTime;
long lImportTimeoutSec = 0;
- std::atomic_long lImportRunTimeSec;
+ long lImportRunTimeSec;
+
+ //std::mutex importMsgMutex;
std::stringstream importMsg;
bool fReorganize{0}; // true for reorganize call, false for import
- size_t activeSegment{0};
InclosingTagsBehaviour inclosingTagsBehaviour{InclosingTagsBehaviour::saveAll};
+ BOOL fNewEntryIfOnlyContextAndTimestampDifferent{};
+ BOOL fSaveDifferentTargetsForSameSource{};
+ BOOL fIgnoreSegIdOnUpdate{};
void reset(){
+ std::scoped_lock l(importDetailsMutex);
+ fNewEntryIfOnlyContextAndTimestampDifferent = FLAGS_newEntryIfOnlyContextAndTimestampDifferent;
+ fSaveDifferentTargetsForSameSource = FLAGS_saveDifferentTargetsForSameSource;
+ //fIgnoreSegIdOnUpdate = FLAGS_ignoreSegIdOnUpdate;
+ //std::lock_guard l(firstInvalidSegmentsSegNumsMutex);
firstInvalidSegmentsSegNums.clear();
firstInvalidSegmentsSegNums.reserve(100);
importMsg.str("");
usProgress = 0;
- //lActiveSegment = 0;
importRc = 0;
segmentsCount = 0;
segmentsImported = 0;
@@ -96,12 +115,14 @@ struct ImportStatusDetails{
lImportStartTime = 0;
lImportTimeoutSec = 0;
lImportRunTimeSec = 0;
- importTimestamp = "not finished";
+ //std::lock_guard lk2(importTimestampMutex);
+ importTimestamp = "not finished";
+ //std::lock_guard lk(invalidSegmentsRCsMutex);
invalidSegmentsRCs.clear();
- activeSegment = 0;
}
std::string toString(){
+ std::scoped_lock l(importDetailsMutex);
std::string res = "progress = " + std::to_string(usProgress);
if(fReorganize){
res += "; segmentsReorganized = ";
diff --git a/include/requestdata.h b/include/requestdata.h
index 65e470a1..7cbd9600 100644
--- a/include/requestdata.h
+++ b/include/requestdata.h
@@ -1,3 +1,4 @@
+#pragma once
#ifndef _REQUEST_DATA_H_INCLUDED_
#define _REQUEST_DATA_H_INCLUDED_
@@ -27,6 +28,7 @@ class RequestData{
int requestType = 0;
std::string strTempFile;
+ bool fSuppressBuildErrorLog{};
//RequestData(); // json was parsed in sub class
public:
//std::recursive_timed_mutex request_mutex;
@@ -144,6 +146,31 @@ class CreateMemRequestData: public RequestData{
+class GetTablesMemRequestData: public RequestData{
+public:
+ GetTablesMemRequestData(): RequestData(COMMAND::GET_TABLES, "", "") {};
+protected:
+ int parseJSON() override{return 0;};
+ int checkData() override{return 0;};
+ int execute() override ;
+};
+
+
+class AddToTableMemRequestData: public RequestData{
+public:
+ AddToTableMemRequestData(): RequestData(COMMAND::ADD_TO_TABLE, "", "") {};
+protected:
+ int tableKey{};
+ int entryId{};
+ BOOL fOverwrite = false;
+ char value[256]{};
+ int parseJSON() override;
+ int checkData() override;
+ int execute() override ;
+};
+
+
+
class ListTMRequestData:public RequestData{
public:
ListTMRequestData(): RequestData(COMMAND::LIST_OF_MEMORIES) {};
@@ -159,25 +186,17 @@ class ListTMRequestData:public RequestData{
//class ProxygenService::ProxygenStats;
/*! \brief Data area for the processing of the importMemory function
*/
-class IMPORTMEMORYDATA
+struct IMPORTMEMORYDATA
{
-public:
- //HSESSION hSession;
- //OtmMemoryServiceWorker *pMemoryServiceWorker;
- char szMemory[260];
- char szInFile[260];
- char szError[512];
+ char szMemory[260]{};
+ char szInFile[260]{};
+ char szError[512]{};
std::shared_ptr mem;
BOOL fDeleteTmx = false;
- //BOOL fImpoortFromFile = 0;
- //folly::IOBuf fileData;
- std::string fileData;
+ std::string fileData{};
InclosingTagsBehaviour inclosingTagsBehaviour = InclosingTagsBehaviour::saveAll;
- MutexTimeout tmLockTimeout;
- MutexTimeout tmListTimeout;
- //ushort * pusImportPersent = nullptr;
- //ImportStatusDetails* importDetails = nullptr;
- //OtmMemoryServiceWorker::std::shared_ptr pMem = nullptr;
+ MutexTimeout tmLockTimeout{};
+ MutexTimeout tmListTimeout{};
};
class FlushMemRequestData:public RequestData{
@@ -195,22 +214,23 @@ class ImportRequestData:public RequestData{
std::string strTmxData;
bool isBase64;
-
-
protected:
int parseJSON() override ;
int checkData() override ;
int execute() override ;
BOOL fClose = false;
- //MEMORY_STATUS lastImportStatus = AVAILABLE_STATUS; // to restore in case we would break import before calling closemem
- //MEMORY_STATUS lastStatus = AVAILABLE_STATUS;
+ BOOL fNewEntryIfOnlyContextAndTimestampDifferent{};
+ BOOL fSaveDifferentTargetsForSameSource{};
+ BOOL fIgnoreSegIdOnUpdate{};
InclosingTagsBehaviour inclosingTagsBehaviour;
IMPORTMEMORYDATA* pData = nullptr;
- long timeout = 0;
+ int64_t timeout = 0;
};
#include
+
+#ifdef TO_BE_REMOVED
class ImportStreamRequestData:public RequestData{
public:
ImportStreamRequestData(): RequestData(COMMAND::IMPORT_MEM_STREAM) { };
@@ -227,7 +247,7 @@ class ImportStreamRequestData:public RequestData{
IMPORTMEMORYDATA* pData = nullptr;
long timeout = 0;
};
-
+#endif
class ImportLocalRequestData:public RequestData{
public:
ImportLocalRequestData(): RequestData(COMMAND::IMPORT_LOCAL_MEM) {};
@@ -365,7 +385,10 @@ class ReorganizeRequestData:public RequestData{
public:
ReorganizeRequestData(): RequestData(COMMAND::REORGANIZE_MEM) {};
protected:
- int parseJSON() override {return 0;};
+ BOOL fNewEntryIfOnlyContextAndTimestampDifferent{};
+ BOOL fSaveDifferentTargetsForSameSource{};
+ BOOL fIgnoreSegIdOnUpdate{};
+ int parseJSON() override;
int checkData() override;
int execute () override;
};
@@ -375,12 +398,14 @@ class UnknownRequestData: public RequestData{
public:
UnknownRequestData(): RequestData(UNKNOWN_COMMAND){};
+ std::string methodStr,srcAddress;
+
protected:
int parseJSON() override {return 0;};
int checkData() override {return 0;};
int execute() override {
_rest_rc_ = 404;
- std::string msg = "Url \"" + strUrl + "\" was not parsed correctly";
+ std::string msg = "Called from " + srcAddress + "; Method str:\"" + methodStr +"\"; Url:\"" + strUrl + "\" was not parsed correctly";
return buildErrorReturn(404, msg.c_str(), 404);
};
};
@@ -409,7 +434,7 @@ class StatusMemRequestData: public RequestData{
int checkData() override ;
int execute() override ;
- static std::string prepareStatusString(std::shared_ptr mem);
+ static std::string prepareStatusString(std::shared_ptr& mem);
};
class FlagsRequestData: public RequestData{
@@ -478,6 +503,7 @@ class FuzzySearchRequestData: public RequestData{
protected:
char szDateTime[100];
char szType[100];
+ BOOL fForceFuzzy = 0;
int parseJSON() override ;
int checkData() override ;
@@ -545,6 +571,9 @@ class DeleteEntriesReorganizeRequestData: public RequestData{
protected:
SearchFilterFactory searchFilterFactory;
+ BOOL fNewEntryIfOnlyContextAndTimestampDifferent{};
+ BOOL fSaveDifferentTargetsForSameSource{};
+ BOOL fIgnoreSegIdOnUpdate{};
int parseJSON() override ;
int checkData() override ;
@@ -559,7 +588,7 @@ class UpdateEntryRequestData: public RequestData{
int reset();
BOOL fSave2Disk = 1;
- OtmProposal Data ;
+ OtmProposal Data{};
protected:
int parseJSON() override;
int checkData() override;
diff --git a/include/tm.h b/include/tm.h
index 0595e0f9..60be0444 100644
--- a/include/tm.h
+++ b/include/tm.h
@@ -17,7 +17,7 @@
#include "ThreadingWrapper.h"
-#define INCL_EQF_TAGTABLE // tag table and format functions
+#define INCL_EQF_TAGTABLE // tag table and format functions
#define INCL_EQF_TP
#define INCL_EQF_TM
#define INCL_EQF_DAM
@@ -29,134 +29,126 @@
#include "../source/opentm2/core/pluginmanager/OtmPlugin.h"
#include "../source/opentm2/core/utilities/Stopwatch.hpp"
-#define MEM_START_ORGANIZE USER_TASK + 1
-#define MEM_ORGANIZE_TASK USER_TASK + 2
-#define MEM_END_ORGANIZE USER_TASK + 3
-
-
-
-#define KEY_DIR_SIZE 4096 // key directory size
-#define TM_PREFIX_SIZE 8 // length of prefix bytes in TMT db
-#define MAX_SEC_LENGTH 30 // max length of secondary key
-#define MAX_LINE_LENGTH 80 // max length of each line in lang file
-#define FN_LENGTH 13 // length of input filename
-#define PRIM_KEY_LENGTH 4 // number of characters in primary key
-#define DATA_IN_SIZE 3900 // buffer size for input
-#define DATA_OUT_SIZE 3900 // buffer size for output
-#define CODEPAGE_SIZE 256 // size of codepage of the language
-#define SEG_MARKER_LENGTH 3 // length of segment marker
-#define MAX_TGT_LENGTH 2047 // max length of each target.
-#define MAX_MATCH_TAB_ENTRIES 5 // number of entries in match table
-#define CREATE_BUFFER_SIZE 40000 // buffer size for create_in
-#define MAX_TM_LIST_NUMBER 500 // max. number of TMs that can be listed
- // by the TMC_GET_SERVER_TM_LIST command
-#define GETPART_BUFFER_SIZE 16384 // read a 16 KB block at a time
-#define MEM_PROP_SIZE 2048 // Global size of all memory database properties
-#define _MAX_DIR 256
-
-typedef CHAR SHORT_FN [FN_LENGTH];
-typedef CHAR BUFFERIN [DATA_IN_SIZE];
-typedef UCHAR BUFFEROUT [DATA_OUT_SIZE],
- ACHPRIMKEY [PRIM_KEY_LENGTH],
- SZSECKEY [MAX_SEC_LENGTH + 1];
-
-typedef CHAR LANG_LINE [MAX_LINE_LENGTH + 1];
-typedef CHAR LONG_FN [MAX_LONGFILESPEC];
-
-
+#define MEM_START_ORGANIZE USER_TASK + 1
+#define MEM_ORGANIZE_TASK USER_TASK + 2
+#define MEM_END_ORGANIZE USER_TASK + 3
+
+#define KEY_DIR_SIZE 4096 // key directory size
+#define TM_PREFIX_SIZE 8 // length of prefix bytes in TMT db
+#define MAX_SEC_LENGTH 30 // max length of secondary key
+#define MAX_LINE_LENGTH 80 // max length of each line in lang file
+#define FN_LENGTH 13 // length of input filename
+#define PRIM_KEY_LENGTH 4 // number of characters in primary key
+#define DATA_IN_SIZE 3900 // buffer size for input
+#define DATA_OUT_SIZE 3900 // buffer size for output
+#define CODEPAGE_SIZE 256 // size of codepage of the language
+#define SEG_MARKER_LENGTH 3 // length of segment marker
+#define MAX_TGT_LENGTH 2047 // max length of each target.
+#define MAX_MATCH_TAB_ENTRIES 5 // number of entries in match table
+#define CREATE_BUFFER_SIZE 40000 // buffer size for create_in
+#define MAX_TM_LIST_NUMBER 500 // max. number of TMs that can be listed
+ // by the TMC_GET_SERVER_TM_LIST command
+#define GETPART_BUFFER_SIZE 16384 // read a 16 KB block at a time
+#define MEM_PROP_SIZE 2048 // Global size of all memory database properties
+#define _MAX_DIR 256
+
+typedef CHAR SHORT_FN[FN_LENGTH];
+typedef CHAR BUFFERIN[DATA_IN_SIZE];
+typedef UCHAR BUFFEROUT[DATA_OUT_SIZE],
+ ACHPRIMKEY[PRIM_KEY_LENGTH],
+ SZSECKEY[MAX_SEC_LENGTH + 1];
+
+typedef CHAR LANG_LINE[MAX_LINE_LENGTH + 1];
+typedef CHAR LONG_FN[MAX_LONGFILESPEC];
struct TMX_EXT_OUT_W
{
- TMX_PREFIX_OUT stPrefixOut; //prefix of output buffer
-
- CHAR_W szSource[MAX_SEGMENT_SIZE]; //source sentence
- CHAR_W szTarget[MAX_SEGMENT_SIZE]; //target sentence
- CHAR szOriginalSourceLanguage[MAX_LANG_LENGTH]; //language name of the source
- CHAR szTagTable[MAX_FNAME]; //tag table name
- CHAR szTargetLanguage[MAX_LANG_LENGTH]; //language name of target
- CHAR szAuthorName[MAX_FILESPEC]; //author name of target
- USHORT usTranslationFlag; /* type of translation, 0 = human, 1 = machine, 2 = Global Memory */
- CHAR szFileName[MAX_FILESPEC]; //where source comes from name+ext
- LONG_FN szLongName; // name of source file (long name or EOS)
- ULONG ulSourceSegmentId; //seg. num. of source sentence from analysis
- TIME_L lTargetTime; //time stamp of target
- CHAR_W szContext[MAX_SEGMENT_SIZE]; //segment context
- CHAR_W szAddInfo[MAX_SEGMENT_SIZE]; // additional segment information
- ULONG ulRecKey;
- USHORT usTargetKey;
-
- ULONG ulTmKey; //tm record key
- USHORT usNextTarget; //which target record to address next
- ULONG ulMaxEntries; //number of entries in tm data file
+ TMX_PREFIX_OUT stPrefixOut{}; // prefix of output buffer
+
+ CHAR_W szSource[MAX_SEGMENT_SIZE]{}; // source sentence
+ CHAR_W szTarget[MAX_SEGMENT_SIZE]{}; // target sentence
+ CHAR szOriginalSourceLanguage[MAX_LANG_LENGTH]{}; // language name of the source
+ CHAR szTagTable[MAX_FNAME]{}; // tag table name
+ CHAR szTargetLanguage[MAX_LANG_LENGTH]{}; // language name of target
+ CHAR szAuthorName[MAX_FILESPEC]{}; // author name of target
+ USHORT usTranslationFlag = 0; /* type of translation, 0 = human, 1 = machine, 2 = Global Memory */
+ LONG_FN szLongName{}; // name of source file (long name or EOS)
+ ULONG ulSourceSegmentId = 0; // seg. num. of source sentence from analysis
+ TIME_L lTargetTime = 0; // time stamp of target
+ std::wstring szContext, szAddInfo;
+ ULONG ulRecKey = 0;
+ USHORT usTargetKey = 0;
+
+ LONG lTmKey = 0; // tm record key
+ USHORT usNextTarget = 0; // which target record to address next
+ LONG lMaxEntries = 0; // number of entries in tm data file
+ TMX_EXT_OUT_W(){};
};
using PTMX_EXT_OUT_W = TMX_EXT_OUT_W *;
-
-
-//#include "../pluginmanager/PluginManager.h"
+// #include "../pluginmanager/PluginManager.h"
#include "EQF.H"
// ************ Translation memory flags ********************************
#define far
-#define MEM_OUTPUT_ASIS 0 // Do not convert translation memory output
-#define MEM_OUTPUT_CRLF 1 // Convert translation memory output to CRLF
-#define MEM_OUTPUT_LF 2 // Convert translation memory output to LF
+#define MEM_OUTPUT_ASIS 0 // Do not convert translation memory output
+#define MEM_OUTPUT_CRLF 1 // Convert translation memory output to CRLF
+#define MEM_OUTPUT_LF 2 // Convert translation memory output to LF
// defines for special names mode of TMExtract (only valid with TMExtract!)
-#define MEM_OUTPUT_TAGTABLES 3 // return list of tag tables of TM
-#define MEM_OUTPUT_AUTHORS 4 // return list of authors of TM
-#define MEM_OUTPUT_DOCUMENTS 5 // return list of documents of TM
-#define MEM_OUTPUT_LANGUAGES 6 // return list of languages of TM
-#define MEM_OUTPUT_LONGNAMES 7 // return list of document long names of TM
-#define MEM_OUTPUT_ALLDOCS 8 // return list of all documensts (long
- // names and short names for docs w/o long name)
-
-#define EXCLUSIVE 0
-#define NONEXCLUSIVE 1
-#define EXCLUSIVE_FOR_GET_PART 2
-#define FOR_ORGANIZE 3
-#define READONLYACCESS 4
+#define MEM_OUTPUT_TAGTABLES 3 // return list of tag tables of TM
+#define MEM_OUTPUT_AUTHORS 4 // return list of authors of TM
+#define MEM_OUTPUT_DOCUMENTS 5 // return list of documents of TM
+#define MEM_OUTPUT_LANGUAGES 6 // return list of languages of TM
+#define MEM_OUTPUT_LONGNAMES 7 // return list of document long names of TM
+#define MEM_OUTPUT_ALLDOCS 8 // return list of all documensts (long
+ // names and short names for docs w/o long name)
+
+#define EXCLUSIVE 0
+#define NONEXCLUSIVE 1
+#define EXCLUSIVE_FOR_GET_PART 2
+#define FOR_ORGANIZE 3
+#define READONLYACCESS 4
// defines used in TmOpen and MemCreateDlg
-#define TM_LOCAL 0 // TM resides local
-#define TM_REMOTE 1 // TM resides remote on a server
-#define TM_LOCALREMOTE 2 // TM may be local or remote
-#define TM_SHARED 3 // TM resides on a shared drive
+#define TM_LOCAL 0 // TM resides local
+#define TM_REMOTE 1 // TM resides remote on a server
+#define TM_LOCALREMOTE 2 // TM may be local or remote
+#define TM_SHARED 3 // TM resides on a shared drive
// Match value constants: the similarity level classes (lSimLevel)
-#define BASE_SIMILAR 0L
-#define BASE_EXACT_DATE 200L
-#define BASE_EXACT_IND 300L
-#define BASE_EXACT_SEG_NUM 400L
-
-#define MAX_SIMILAR_VAL 100L
-#define MAX_EXACT_DATE_VAL (BASE_EXACT_IND - 1L)
-#define MAX_EXACT_IND_VAL (BASE_EXACT_SEG_NUM - 1L)
+#define BASE_SIMILAR 0L
+#define BASE_EXACT_DATE 200L
+#define BASE_EXACT_IND 300L
+#define BASE_EXACT_SEG_NUM 400L
+
+#define MAX_SIMILAR_VAL 100L
+#define MAX_EXACT_DATE_VAL (BASE_EXACT_IND - 1L)
+#define MAX_EXACT_IND_VAL (BASE_EXACT_SEG_NUM - 1L)
#define MAX_EXACT_SEG_NUM_VAL (500L - 1L)
-#define EXTENT_SIMILAR (MAX_SIMILAR_VAL - BASE_SIMILAR)
-#define EXTENT_EXACT_DATE (MAX_EXACT_DATE_VAL - BASE_EXACT_DATE)
-#define EXTENT_EXACT_IND (MAX_EXACT_IND_VAL - BASE_EXACT_IND)
-#define EXTENT_EXACT_SEG_NUM (MAX_EXACT_SEG_NUM_VAL - BASE_EXACT_SEG_NUM)
+#define EXTENT_SIMILAR (MAX_SIMILAR_VAL - BASE_SIMILAR)
+#define EXTENT_EXACT_DATE (MAX_EXACT_DATE_VAL - BASE_EXACT_DATE)
+#define EXTENT_EXACT_IND (MAX_EXACT_IND_VAL - BASE_EXACT_IND)
+#define EXTENT_EXACT_SEG_NUM (MAX_EXACT_SEG_NUM_VAL - BASE_EXACT_SEG_NUM)
// translation flag values
-#define TRANSLFLAG_NORMAL 0
-#define TRANSLFLAG_MACHINE 1
-#define TRANSLFLAG_GLOBMEM 2
+#define TRANSLFLAG_NORMAL 0
+#define TRANSLFLAG_MACHINE 1
+#define TRANSLFLAG_GLOBMEM 2
#define TRANSLFLAG_GLOBMEMSTAR 3
-
/*----------------------------------------------------------------------------*\
System wide threshold values
\*----------------------------------------------------------------------------*/
-#define LENGTH_THR 50L // Length threshold value
-#define MAX_LENGTH_THR 100L // maximal Length threshold value
-#define INIT_MATCH_THR 59L // Initial match threshold value
-#define SHORTER_MATCH_THR 50L // match threshold value for shorter
- // segments, defined thru LENGTH_SHORTER_VALUE
-#define WORDS_MATCH_THR 0L // Not used yet
+#define LENGTH_THR 50L // Length threshold value
+#define MAX_LENGTH_THR 100L // maximal Length threshold value
+#define INIT_MATCH_THR 59L // Initial match threshold value
+#define SHORTER_MATCH_THR 50L // match threshold value for shorter
+ // segments, defined thru LENGTH_SHORTER_VALUE
+#define WORDS_MATCH_THR 0L // Not used yet
//--- Used in GET_IN structure to specify kind of matches.
//--- This defines should be bitwise 'ored' with the number of required matches.
@@ -167,61 +159,56 @@ using PTMX_EXT_OUT_W = TMX_EXT_OUT_W *;
//--- If you want to retrieve translation memory hits with exact context only,
//--- use GET_EXACT_CONTEXT.
//--- If Generic replace should be disabled, you have to or with GET_NO_GENERICREPLACE
-#define GET_MOREPROP_INDIC 0x00000200
-#define GET_ALL_EXACT_MATCHES 0x00000400
-#define GET_RESPECTCRLF 0x00000800
-#define GET_IGNORE_PATH 0x00001000
-#define GET_NO_GENERICREPLACE 0x00002000
-#define GET_EXACT_AND_CONTEXT 0x00004000
-#define GET_EXACT_AND_FUZZY 0x00008000
-#define GET_ALWAYS_WITH_TAGS 0x00010000
-#define GET_IGNORE_COMMENT 0x00020000
-#define GET_EXACT 0x00040000
-
-#define EQUAL_EQUAL 100
-#define TAGS_EQUAL 98
-#define TAGS_UNEQUAL 95
-
-#define NON_EXCLUSIVE 1
-#define EXCLUSIVE 0
-
-#define LANG_KEY 1L
-#define FILE_KEY 2L
-#define AUTHOR_KEY 3L
-#define TAGTABLE_KEY 4L
-//#define RESERVED_KEY 5L
-#define LONGNAME_KEY 5L
-#define COMPACT_KEY 6L
-#define FIRST_KEY 7L
+#define GET_MOREPROP_INDIC 0x00000200
+#define GET_ALL_EXACT_MATCHES 0x00000400
+#define GET_RESPECTCRLF 0x00000800
+#define GET_IGNORE_PATH 0x00001000
+#define GET_NO_GENERICREPLACE 0x00002000
+#define GET_EXACT_AND_CONTEXT 0x00004000
+#define GET_EXACT_AND_FUZZY 0x00008000
+#define GET_ALWAYS_WITH_TAGS 0x00010000
+#define GET_IGNORE_COMMENT 0x00020000
+#define GET_EXACT 0x00040000
+
+#define EQUAL_EQUAL 100
+#define TAGS_EQUAL 98
+#define TAGS_UNEQUAL 95
+
+#define NON_EXCLUSIVE 1
+#define EXCLUSIVE 0
+
+#define LANG_KEY 1L
+#define FILE_KEY 2L
+#define AUTHOR_KEY 3L
+#define TAGTABLE_KEY 4L
+// #define RESERVED_KEY 5L
+#define LONGNAME_KEY 5L
+#define COMPACT_KEY 6L
+#define FIRST_KEY 7L
// Note: the following key is NOT used as the key of a QDAM record
// it is only a symbolic value used in the Name-to-ID functions
-#define LANGGROUP_KEY 8L
-
+#define LANGGROUP_KEY 8L
// used in GET_OUT structure
-#define GET_MORE_EXACTS_AVAIL 0x8000
+#define GET_MORE_EXACTS_AVAIL 0x8000
#define GET_ADDITIONAL_FUZZY_AVAIL 0x4000
-
-
/* The segment marker */
-#define SEGMARKER "###"
-
+#define SEGMARKER "###"
/**********************************************************************/
/* indicatos for old or new TM */
/**********************************************************************/
-#define OLD_TM 0
-#define NEW_TM 1
+#define OLD_TM 0
+#define NEW_TM 1
/**********************************************************************/
/* indicator for organize */
/* TM_CONVERT - convert an ols TM to an new one */
/* TM_ORGANIZE - organize a new TM */
/**********************************************************************/
-#define TM_CONVERT 0
-#define TM_ORGANIZE 1
-
+#define TM_CONVERT 0
+#define TM_ORGANIZE 1
/**********************************************************************/
/* default threshold value for get */
@@ -230,91 +217,92 @@ using PTMX_EXT_OUT_W = TMX_EXT_OUT_W *;
// against the new computed fuzziness, the old value is used
// for the triple threshold checking
/**********************************************************************/
-#define TM_DEFAULT_THRESHOLD 33 // prior: 40
-#define TM_FUZZINESS_THRESHOLD 10
-
+#define TM_DEFAULT_THRESHOLD 33 // prior: 40
+#define TM_FUZZINESS_THRESHOLD 10
#include "win_types.h"
-
-
-typedef BYTE ABGROUP [CODEPAGE_SIZE];
-typedef ABGROUP * PABGROUP;
-
-typedef struct _TM_ADDRSS { /* addr */
- USHORT usEntryInDir, /* >= 0, entry# of the cluster in KeyDir */
- /* <= 4095 */
- usBlockNumber, /* > 0, indicates block number in TM */
- /* 0 used for chaining purposes as null */
- usDispBlockPtr; /* size(block header) <= BLOCK_SIZE */
- /* indicates location within a block */
-} TM_ADDRESS, * PTM_ADDRESS ;
-
-typedef struct _SEGMENT { /* seg */
- UCHAR achSegMarker[SEG_MARKER_LENGTH] ;
- /* marker to beginning of segment */
- USHORT usLenSegment, /* total length of segment */
- usDispIndustry, /* industry codes location in bufData */
- usLenIndustry, /* length of indus. codes list(BYTES) */
- usDispSource, /* source location relative to bufData */
- usLenSource, /* source length in bytes */
- usDispTarget, /* target location relative to bufData */
- usLenTarget, /* target length in bytes */
- usDispReserved, /* Reserved area location in bufData */
- usLenReserved, /* length of reserved area */
- usDispSecKey, /* secondary key location in bufData */
- usLenSecKey, /* length of secondary key */
- usDispContext, /* Context area location in bufData */
- usLenContext; /* length of context area */
- SHORT_FN szFileName; /* name of source file (short name) */
- LONG_FN szLongName; /* name of source file (long name or EOS)*/
- USHORT usSegNumber; /* segment number in file */
- EQF_BOOL fLogicalDel, /* set when logically deleted segment */
- fAscii; /* */
- USHORT usTranslationFlag; /* type of translation, 0 = human, 1 = machine, 2 = Global Memory */
- TIME_L tStamp; /* time taken from c function */
- BUFFERIN bufData; /* fields with variable lengths */
-} SEGMENT, * PSEGMENT;
-
-typedef struct _OLDSEGMENT { /* seg */
- UCHAR achSegMarker[SEG_MARKER_LENGTH] ;
- /* marker to beginning of segment */
- USHORT usLenSegment, /* total length of segment */
- usDispIndustry, /* industry codes location in bufData */
- usLenIndustry, /* length of indus. codes list(BYTES) */
- usDispSource, /* source location relative to bufData */
- usLenSource, /* source length in bytes */
- usDispTarget, /* target location relative to bufData */
- usLenTarget, /* target length in bytes */
- usDispReserved, /* Reserved area location in bufData */
- usLenReserved, /* length of reserved area */
- usDispSecKey, /* secondary key location in bufData */
- usLenSecKey; /* length of secondary key */
- SHORT_FN szFileName; /* name of source file (short name) */
- USHORT usSegNumber; /* segment number in file */
- EQF_BOOL fLogicalDel, /* set when logically deleted segment */
- fAscii; /* */
- USHORT usTranslationFlag; /* type of translation, 0 = human, 1 = machine, 2 = Global Memory */
- TIME_L tStamp; /* time taken from c function */
- BUFFERIN bufData; /* fields with variable lengths */
-} OLDSEGMENT, * POLDSEGMENT;
-
-typedef struct _MATCH { /* mtch */
- TM_ADDRESS addr; /* address of the matching segment */
- USHORT usTranslationFlag; /* type of translation, 0 = human, 1 = machine, 2 = Global Memory */
- USHORT usNumExactBytes;/* no. of exact bytes in the */
- /* input and matched sentence */
- TIME_L tStamp; /* time stamp of segment */
- LONG lSimLevel, /* <= 100 indicates similar */
- /* >= 200 indicate exact */
- /* >= 300 indicate exact+same ind code */
- /* >= 400 indicate exact+same filename */
- lLengthTest, /* value of lengths test */
- lInitMatchTest, /* value of initials test */
- lWordsTest; /* value of words test */
- /* last 3 values are meaningless for exact matches*/
- UCHAR szTarget[MAX_TGT_LENGTH + 1]; /* The target */
-} MATCH , * PMATCH;
+typedef BYTE ABGROUP[CODEPAGE_SIZE];
+typedef ABGROUP *PABGROUP;
+
+typedef struct _TM_ADDRSS
+{ /* addr */
+ USHORT usEntryInDir, /* >= 0, entry# of the cluster in KeyDir */
+ /* <= 4095 */
+ usBlockNumber, /* > 0, indicates block number in TM */
+ /* 0 used for chaining purposes as null */
+ usDispBlockPtr; /* size(block header) <= BLOCK_SIZE */
+ /* indicates location within a block */
+} TM_ADDRESS, *PTM_ADDRESS;
+
+typedef struct _SEGMENT
+{ /* seg */
+ UCHAR achSegMarker[SEG_MARKER_LENGTH];
+ /* marker to beginning of segment */
+ USHORT usLenSegment, /* total length of segment */
+ usDispIndustry, /* industry codes location in bufData */
+ usLenIndustry, /* length of indus. codes list(BYTES) */
+ usDispSource, /* source location relative to bufData */
+ usLenSource, /* source length in bytes */
+ usDispTarget, /* target location relative to bufData */
+ usLenTarget, /* target length in bytes */
+ usDispReserved, /* Reserved area location in bufData */
+ usLenReserved, /* length of reserved area */
+ usDispSecKey, /* secondary key location in bufData */
+ usLenSecKey, /* length of secondary key */
+ usDispContext, /* Context area location in bufData */
+ usLenContext; /* length of context area */
+ SHORT_FN szFileName; /* name of source file (short name) */
+ LONG_FN szLongName; /* name of source file (long name or EOS)*/
+ USHORT usSegNumber; /* segment number in file */
+ EQF_BOOL fLogicalDel, /* set when logically deleted segment */
+ fAscii; /* */
+ USHORT usTranslationFlag; /* type of translation, 0 = human, 1 = machine, 2 = Global Memory */
+ TIME_L tStamp; /* time taken from c function */
+ BUFFERIN bufData; /* fields with variable lengths */
+} SEGMENT, *PSEGMENT;
+
+typedef struct _OLDSEGMENT
+{ /* seg */
+ UCHAR achSegMarker[SEG_MARKER_LENGTH];
+ /* marker to beginning of segment */
+ USHORT usLenSegment, /* total length of segment */
+ usDispIndustry, /* industry codes location in bufData */
+ usLenIndustry, /* length of indus. codes list(BYTES) */
+ usDispSource, /* source location relative to bufData */
+ usLenSource, /* source length in bytes */
+ usDispTarget, /* target location relative to bufData */
+ usLenTarget, /* target length in bytes */
+ usDispReserved, /* Reserved area location in bufData */
+ usLenReserved, /* length of reserved area */
+ usDispSecKey, /* secondary key location in bufData */
+ usLenSecKey; /* length of secondary key */
+ SHORT_FN szFileName; /* name of source file (short name) */
+ USHORT usSegNumber; /* segment number in file */
+ EQF_BOOL fLogicalDel, /* set when logically deleted segment */
+ fAscii; /* */
+ USHORT usTranslationFlag; /* type of translation, 0 = human, 1 = machine, 2 = Global Memory */
+ TIME_L tStamp; /* time taken from c function */
+ BUFFERIN bufData; /* fields with variable lengths */
+} OLDSEGMENT, *POLDSEGMENT;
+
+typedef struct _MATCH
+{ /* mtch */
+ TM_ADDRESS addr; /* address of the matching segment */
+ USHORT usTranslationFlag; /* type of translation, 0 = human, 1 = machine, 2 = Global Memory */
+ USHORT usNumExactBytes; /* no. of exact bytes in the */
+ /* input and matched sentence */
+ TIME_L tStamp; /* time stamp of segment */
+ LONG lSimLevel, /* <= 100 indicates similar */
+ /* >= 200 indicate exact */
+ /* >= 300 indicate exact+same ind code */
+ /* >= 400 indicate exact+same filename */
+ lLengthTest, /* value of lengths test */
+ lInitMatchTest, /* value of initials test */
+ lWordsTest; /* value of words test */
+ /* last 3 values are meaningless for exact matches*/
+ UCHAR szTarget[MAX_TGT_LENGTH + 1]; /* The target */
+} MATCH, *PMATCH;
/*
More details about the match ranking method.
@@ -351,106 +339,117 @@ typedef struct _MATCH { /* mtch */
described both in the LLD document and in code comments.
*/
-typedef struct _PREFIX_IN {
- USHORT usLenIn, /* total length of input buffer */
- idCommand ; /* command id, previously defined. */
-// } PREFIX_IN, * PPREFIX_IN, IN, * PIN;
-} PREFIX_IN, * PPREFIX_IN, * PIN;
+typedef struct _PREFIX_IN
+{
+ USHORT usLenIn, /* total length of input buffer */
+ idCommand; /* command id, previously defined. */
+ // } PREFIX_IN, * PPREFIX_IN, IN, * PIN;
+} PREFIX_IN, *PPREFIX_IN, *PIN;
-typedef struct _PREFIX_OUT {
- USHORT usLenOut; /* total length of output buffer */
- BOOL fDiskFull, /* for Add /Replace / Create when number*/
- fDBfull; /* of blocks is a cluster exceeds */
- /* 2**16 - 1. Filled by FormatMore */
- USHORT rcTmt; /* returned by TMT function */
+typedef struct _PREFIX_OUT
+{
+ USHORT usLenOut; /* total length of output buffer */
+ BOOL fDiskFull, /* for Add /Replace / Create when number*/
+ fDBfull; /* of blocks is a cluster exceeds */
+ /* 2**16 - 1. Filled by FormatMore */
+ USHORT rcTmt; /* returned by TMT function */
-//} PREFIX_OUT, * PPREFIX_OUT, OUT, * POUT;
-} PREFIX_OUT, * PPREFIX_OUT, * POUT;
+ //} PREFIX_OUT, * PPREFIX_OUT, OUT, * POUT;
+} PREFIX_OUT, *PPREFIX_OUT, *POUT;
-typedef struct _UPDATE_IN {
- PREFIX_IN prefin; /* prefix of each command */
- SEGMENT segIn; /* the rest of this type is a SEGMENT */
-} UPDATE_IN, * PUPDATE_IN;
+typedef struct _UPDATE_IN
+{
+ PREFIX_IN prefin; /* prefix of each command */
+ SEGMENT segIn; /* the rest of this type is a SEGMENT */
+} UPDATE_IN, *PUPDATE_IN;
-typedef UPDATE_IN ADD_IN, DEL_IN, REP_IN;
+typedef UPDATE_IN ADD_IN, DEL_IN, REP_IN;
typedef PUPDATE_IN PADD_IN, PDEL_IN, PREP_IN;
-typedef struct _ADD_OUT {
- PREFIX_OUT prefout; /* prefix of Output buffer */
- TM_ADDRESS addr; /* address of added segment */
-} ADD_OUT, * PADD_OUT;
-
-typedef struct _DEL_OUT {
- PREFIX_OUT prefout; /* prefix of Output buffer */
- TM_ADDRESS addr; /* address of deleted segment */
-} DEL_OUT , * PDEL_OUT ;
-
-typedef struct _REP_OUT {
- PREFIX_OUT prefout; /* prefix of Output buffer */
- SERVERNAME szServer; /* server name */
- TM_ADDRESS addrDel, /* address to delete */
- addrAdd; /* address to add */
-} REP_OUT , * PREP_OUT;
-
-typedef struct _CLOSE_IN {
- PREFIX_IN prefin ; /* prefix of each command */
-} CLOSE_IN, * PCLOSE_IN;
-
-typedef struct _CLOSE_OUT {
- PREFIX_OUT prefout; /* prefix of Output buffer */
-} CLOSE_OUT, * PCLOSE_OUT;
-
-typedef struct _EXT_IN {
- PREFIX_IN prefin; /* prefix of each command */
- TM_ADDRESS addr; /* address of extracted segment */
- USHORT usConvert; // Indicates how the output should be converted
-} EXT_IN , * PEXT_IN ;
-
-typedef struct _EXT_OUT {
- PREFIX_OUT prefout; /* prefix of Output buffer */
- SERVERNAME szServer; /* server name */
- TM_ADDRESS addr, /* address of current segment */
- addrNext; /* address of next segment */
- SEGMENT segOut; /* fields with variable lengths */
-} EXT_OUT , * PEXT_OUT;
-
-typedef struct _GET_IN {
- PREFIX_IN prefin; /* prefix of each command */
- SHORT_FN szFileName; /* name of source file (short name) */
- LONG_FN szLongName; /* name of source file (long name or EOS) */
- USHORT usConvert; // Indicates how the output should be converted
- USHORT usSegNumber, /* */
- usNumMatchesReq,/* number of matches required */
- usDispIndustry,/* industry codes location in bufData */
- usLenIndustry, /* length of indus. codes list(BYTES) */
- usDispSource, /* source location relative to bufData */
- usLenSource; /* source length in bytes */
- LONG lLengthThr, /* needed to filter out sentences */
- /* with different lengths */
- lInitMatchThr, /* needed to filter out sentences */
- /* with non matching initials */
- lWordsMatchThr;/* needed to filter out sentences */
- /* with non matching words */
- BOOL fAscii; /* */
- BUFFERIN bufData; /* fields with variable lengths */
-} GET_IN, * PGET_IN;
+typedef struct _ADD_OUT
+{
+ PREFIX_OUT prefout; /* prefix of Output buffer */
+ TM_ADDRESS addr; /* address of added segment */
+} ADD_OUT, *PADD_OUT;
+
+typedef struct _DEL_OUT
+{
+ PREFIX_OUT prefout; /* prefix of Output buffer */
+ TM_ADDRESS addr; /* address of deleted segment */
+} DEL_OUT, *PDEL_OUT;
+
+typedef struct _REP_OUT
+{
+ PREFIX_OUT prefout; /* prefix of Output buffer */
+ SERVERNAME szServer; /* server name */
+ TM_ADDRESS addrDel, /* address to delete */
+ addrAdd; /* address to add */
+} REP_OUT, *PREP_OUT;
+
+typedef struct _CLOSE_IN
+{
+ PREFIX_IN prefin; /* prefix of each command */
+} CLOSE_IN, *PCLOSE_IN;
+
+typedef struct _CLOSE_OUT
+{
+ PREFIX_OUT prefout; /* prefix of Output buffer */
+} CLOSE_OUT, *PCLOSE_OUT;
+
+typedef struct _EXT_IN
+{
+ PREFIX_IN prefin; /* prefix of each command */
+ TM_ADDRESS addr; /* address of extracted segment */
+ USHORT usConvert; // Indicates how the output should be converted
+} EXT_IN, *PEXT_IN;
+
+typedef struct _EXT_OUT
+{
+ PREFIX_OUT prefout; /* prefix of Output buffer */
+ SERVERNAME szServer; /* server name */
+ TM_ADDRESS addr, /* address of current segment */
+ addrNext; /* address of next segment */
+ SEGMENT segOut; /* fields with variable lengths */
+} EXT_OUT, *PEXT_OUT;
+
+typedef struct _GET_IN
+{
+ PREFIX_IN prefin; /* prefix of each command */
+ SHORT_FN szFileName; /* name of source file (short name) */
+ LONG_FN szLongName; /* name of source file (long name or EOS) */
+ USHORT usConvert; // Indicates how the output should be converted
+ USHORT usSegNumber, /* */
+ usNumMatchesReq, /* number of matches required */
+ usDispIndustry, /* industry codes location in bufData */
+ usLenIndustry, /* length of indus. codes list(BYTES) */
+ usDispSource, /* source location relative to bufData */
+ usLenSource; /* source length in bytes */
+ LONG lLengthThr, /* needed to filter out sentences */
+ /* with different lengths */
+ lInitMatchThr, /* needed to filter out sentences */
+ /* with non matching initials */
+ lWordsMatchThr; /* needed to filter out sentences */
+ /* with non matching words */
+ BOOL fAscii; /* */
+ BUFFERIN bufData; /* fields with variable lengths */
+} GET_IN, *PGET_IN;
/**********************************************************************/
/* structure passed in case of rename a file ... */
/**********************************************************************/
typedef struct _RENFILE_IN
{
- PREFIX_IN prefin; /* prefix of each command */
- SERVERNAME szServer; // server name
- CHAR szOldFile[ MAX_EQF_PATH ]; // old file name
- CHAR szNewFile[ MAX_EQF_PATH ]; // new file name
- CHAR szUserId [MAX_USERID]; // userId logged on to requester
-} RENFILE_IN, * PRENFILE_IN;
+ PREFIX_IN prefin; /* prefix of each command */
+ SERVERNAME szServer; // server name
+ CHAR szOldFile[MAX_EQF_PATH]; // old file name
+ CHAR szNewFile[MAX_EQF_PATH]; // new file name
+ CHAR szUserId[MAX_USERID]; // userId logged on to requester
+} RENFILE_IN, *PRENFILE_IN;
typedef struct _RENFILE_OUT
{
- PREFIX_OUT prefout; /* prefix of each command */
-} RENFILE_OUT, * PRENFILE_OUT;
+ PREFIX_OUT prefout; /* prefix of each command */
+} RENFILE_OUT, *PRENFILE_OUT;
/* More details about lLengthThr and lInitMatchThr:
@@ -505,78 +504,84 @@ typedef struct _RENFILE_OUT
*/
-typedef struct _GET_OUT {
- PREFIX_OUT prefout; /* prefix of Output buffer */
-
- USHORT usNumMatchesFound,/* number of matches found */
- usNumMatchesValid,/* number of matches valid */
- ausSortedMatches[MAX_MATCH_TAB_ENTRIES];
- MATCH amtchBest[MAX_MATCH_TAB_ENTRIES]; /* Matches array */
-} GET_OUT, * PGET_OUT;
-
-typedef struct _OPEN_IN {
- PREFIX_IN prefin; /* prefix of each command */
- SERVERNAME szServer; /* servername */
- CHAR szUserId [MAX_USERID]; /* userId logged on to requester */
- FILENAME szTmFileName; /* name of Tm database to open */
- BOOL fExclusive; /* indicate the mode for opening the file */
- BOOL fOpenGetPart; /* indicate if Open was due to a get part */
-} OPEN_IN , * POPEN_IN;
-
-
-typedef struct _OPEN_OUT {
- PREFIX_OUT prefout; /* prefix of Output buffer */
- HTM htm; /* handle to the TM */
-} OPEN_OUT , * POPEN_OUT;
-
-typedef struct _BLOCK_HEADER { /* bh */
- USHORT usBlockNum, /* >= 1, points to previous block */
- usPrevBlock, /* >= 1, points to previous block */
- usNextBlock, /* > 1, points to next block. */
- /* 0 indicates no chaining */
- usFirstAvailByte; /* >= size of block header, */
- /* <= block size */
- /* points to first available byte in block */
- /* If block is full it sets to BlockSize */
-} BLOCK_HEADER , * PBLOCK_HEADER;
-
-typedef struct _CREATE_TMH { /* ctmh */
- FILENAME szTmFileName; /* Tm database name */
- USHORT usBlockSize;
- LANGUAGE szSourceLang, /* source language */
- szTargetLang; /* target language */
- EQF_BOOL fDbcs; /* double byte char support 0/1 */
+typedef struct _GET_OUT
+{
+ PREFIX_OUT prefout; /* prefix of Output buffer */
+
+ USHORT usNumMatchesFound, /* number of matches found */
+ usNumMatchesValid, /* number of matches valid */
+ ausSortedMatches[MAX_MATCH_TAB_ENTRIES];
+ MATCH amtchBest[MAX_MATCH_TAB_ENTRIES]; /* Matches array */
+} GET_OUT, *PGET_OUT;
+
+typedef struct _OPEN_IN
+{
+ PREFIX_IN prefin; /* prefix of each command */
+ SERVERNAME szServer; /* servername */
+ CHAR szUserId[MAX_USERID]; /* userId logged on to requester */
+ FILENAME szTmFileName; /* name of Tm database to open */
+ BOOL fExclusive; /* indicate the mode for opening the file */
+ BOOL fOpenGetPart; /* indicate if Open was due to a get part */
+} OPEN_IN, *POPEN_IN;
+
+typedef struct _OPEN_OUT
+{
+ PREFIX_OUT prefout; /* prefix of Output buffer */
+ HTM htm; /* handle to the TM */
+} OPEN_OUT, *POPEN_OUT;
+
+typedef struct _BLOCK_HEADER
+{ /* bh */
+ USHORT usBlockNum, /* >= 1, points to previous block */
+ usPrevBlock, /* >= 1, points to previous block */
+ usNextBlock, /* > 1, points to next block. */
+ /* 0 indicates no chaining */
+ usFirstAvailByte; /* >= size of block header, */
+ /* <= block size */
+ /* points to first available byte in block */
+ /* If block is full it sets to BlockSize */
+} BLOCK_HEADER, *PBLOCK_HEADER;
+
+typedef struct _CREATE_TMH
+{ /* ctmh */
+ FILENAME szTmFileName; /* Tm database name */
+ USHORT usBlockSize;
+ LANGUAGE szSourceLang, /* source language */
+ szTargetLang; /* target language */
+ EQF_BOOL fDbcs; /* double byte char support 0/1 */
} CREATE_TMH;
-typedef struct _CREATE_IN { /* crei */
- PREFIX_IN prefin; /* prefix of each command */
- SERVERNAME szServer;
- CREATE_TMH ctmh; /* parameters that copied into Tm header */
- TIME_L tCreate; /* creation time stamp */
- ABGROUP abABGrouping;
- USHORT usDispExclTagList, /* offset of tag list */
- usLenExclTagList, /* length of tag list */
- usDispExclWordList,/* offset of word list */
- usLenExclWordList; /* length of word list */
- CHAR bufData[CREATE_BUFFER_SIZE];
- CHAR szUserId [MAX_USERID]; /* userId logged on to requester */
-} CREATE_IN , * PCREATE_IN;
+typedef struct _CREATE_IN
+{ /* crei */
+ PREFIX_IN prefin; /* prefix of each command */
+ SERVERNAME szServer;
+ CREATE_TMH ctmh; /* parameters that copied into Tm header */
+ TIME_L tCreate; /* creation time stamp */
+ ABGROUP abABGrouping;
+ USHORT usDispExclTagList, /* offset of tag list */
+ usLenExclTagList, /* length of tag list */
+ usDispExclWordList, /* offset of word list */
+ usLenExclWordList; /* length of word list */
+ CHAR bufData[CREATE_BUFFER_SIZE];
+ CHAR szUserId[MAX_USERID]; /* userId logged on to requester */
+} CREATE_IN, *PCREATE_IN;
typedef OPEN_OUT CREATE_OUT, *PCREATE_OUT;
-typedef CLOSE_IN INFO_IN, * PINFO_IN;
-
-typedef struct _INFO_OUT { /* infi */
- PREFIX_OUT prefout; /* prefix of each command */
- CREATE_TMH ctmh; /* parameters that copied into Tm header */
- TIME_L tCreate; /* creation time stamp */
- ABGROUP abABGrouping;
- USHORT usDispExclTagList, /* offset of tag list */
- usLenExclTagList, /* length of tag list */
- usDispExclWordList,/* offset of word list */
- usLenExclWordList; /* length of word list */
- CHAR bufData[CREATE_BUFFER_SIZE];
-} INFO_OUT , * PINFO_OUT;
+typedef CLOSE_IN INFO_IN, *PINFO_IN;
+
+typedef struct _INFO_OUT
+{ /* infi */
+ PREFIX_OUT prefout; /* prefix of each command */
+ CREATE_TMH ctmh; /* parameters that copied into Tm header */
+ TIME_L tCreate; /* creation time stamp */
+ ABGROUP abABGrouping;
+ USHORT usDispExclTagList, /* offset of tag list */
+ usLenExclTagList, /* length of tag list */
+ usDispExclWordList, /* offset of word list */
+ usLenExclWordList; /* length of word list */
+ CHAR bufData[CREATE_BUFFER_SIZE];
+} INFO_OUT, *PINFO_OUT;
// ----------------------------------------------------------------------------
// structures needed for the TMC_GET_SERVER_DRIVES command which lists all
@@ -586,49 +591,52 @@ typedef struct _INFO_OUT { /* infi */
// any of the secondary drives)
// ----------------------------------------------------------------------------
-typedef struct _DRIVES_IN { /* indr */
- PREFIX_IN prefin; /* prefix of each command */
- SERVERNAME szServer; /* which server ? */
- CHAR szUserId [MAX_USERID]; /* userId logged on to requester */
-} DRIVES_IN, * PDRIVES_IN;
-
-typedef struct _DRIVE_INFO { /* drin */
- CHAR cDriveLetter; /* drive letter of disk drive */
- ULONG ulFreeSpace; /* number of bytes left on this disk drive */
-} DRIVE_INFO, * PDRIVE_INFO;
-
-typedef struct _DRIVES_OUT { /* outdr */
- PREFIX_OUT prefout; /* prefix of each command */
- USHORT usValidDrives; /* how much drives have been */
- /* found on the server ? */
- DRIVE_INFO adrinDrives [MAX_DRIVELIST]; /* info for each valid */
- /* server drive */
-} DRIVES_OUT, * PDRIVES_OUT;
-
+typedef struct _DRIVES_IN
+{ /* indr */
+ PREFIX_IN prefin; /* prefix of each command */
+ SERVERNAME szServer; /* which server ? */
+ CHAR szUserId[MAX_USERID]; /* userId logged on to requester */
+} DRIVES_IN, *PDRIVES_IN;
+
+typedef struct _DRIVE_INFO
+{ /* drin */
+ CHAR cDriveLetter; /* drive letter of disk drive */
+ ULONG ulFreeSpace; /* number of bytes left on this disk drive */
+} DRIVE_INFO, *PDRIVE_INFO;
+
+typedef struct _DRIVES_OUT
+{ /* outdr */
+ PREFIX_OUT prefout; /* prefix of each command */
+ USHORT usValidDrives; /* how much drives have been */
+ /* found on the server ? */
+ DRIVE_INFO adrinDrives[MAX_DRIVELIST]; /* info for each valid */
+ /* server drive */
+} DRIVES_OUT, *PDRIVES_OUT;
// ----------------------------------------------------------------------------
// structures needed for the TMC_GET_SERVER_TM_LIST command which lists all
// translation memories that have been found on the selected server; for each
// TM its full path name and its current file size is returned
// ----------------------------------------------------------------------------
-typedef struct _FILE_LIST_IN { /* intl !!! CHM */
- PREFIX_IN prefin; /* prefix of each command */
- SERVERNAME szServer; /* which server ? */
- CHAR szUserId [MAX_USERID]; /* userId logged on to requester */
-} FILE_LIST_IN, * PFILE_LIST_IN; // !!! CHM
-
-typedef struct _FILE_INFO { /* tmin !!! CHM */
- CHAR szPathFileName [MAX_EQF_PATH]; /* full filename of file */
- ULONG ulFileSize; /* filesize in bytes */
-} FILE_INFO, * PFILE_INFO; // !!! CHM
-
-
-typedef struct _FILE_LIST_OUT { /* outtl !!! CHM */
- PREFIX_OUT prefout; /* prefix of each command */
- USHORT usValidFiles; /* valid entries in array */
- FILE_INFO aflinFileList [MAX_TM_LIST_NUMBER]; /* info for avail. files */
-} FILE_LIST_OUT, * PFILE_LIST_OUT; // !!! CHM
-
+typedef struct _FILE_LIST_IN
+{ /* intl !!! CHM */
+ PREFIX_IN prefin; /* prefix of each command */
+ SERVERNAME szServer; /* which server ? */
+ CHAR szUserId[MAX_USERID]; /* userId logged on to requester */
+} FILE_LIST_IN, *PFILE_LIST_IN; // !!! CHM
+
+typedef struct _FILE_INFO
+{ /* tmin !!! CHM */
+ CHAR szPathFileName[MAX_EQF_PATH]; /* full filename of file */
+ ULONG ulFileSize; /* filesize in bytes */
+} FILE_INFO, *PFILE_INFO; // !!! CHM
+
+typedef struct _FILE_LIST_OUT
+{ /* outtl !!! CHM */
+ PREFIX_OUT prefout; /* prefix of each command */
+ USHORT usValidFiles; /* valid entries in array */
+ FILE_INFO aflinFileList[MAX_TM_LIST_NUMBER]; /* info for avail. files */
+} FILE_LIST_OUT, *PFILE_LIST_OUT; // !!! CHM
// ----------------------------------------------------------------------------
// structures needed for the TMC_GET_PART_OF_TM_FILE command that transfers
@@ -639,64 +647,64 @@ typedef struct _FILE_LIST_OUT { /* outtl !!! CHM */
// maximum size to transfer at a time is GETPART_BUFFER_SIZE
// ----------------------------------------------------------------------------
-
-typedef struct _GETPART_IN { /* ingp */
- PREFIX_IN prefin; /* prefix of each command */
- ULONG ulFilePos; /* file position of first byte to transfer */
- ULONG ulBytesToRead; /* number of bytes to transfer */
-} GETPART_IN, * PGETPART_IN;
-
-typedef struct _GETPART_OUT { /* outgp */
- PREFIX_OUT prefout; /* prefix of each command */
- ULONG ulBytesRead; /* number of bytes actually read */
- ULONG ulNextFilePos; /* file position of next byte to read */
- UCHAR aucOutBuffer [GETPART_BUFFER_SIZE]; /* output buffer */
-} GETPART_OUT, * PGETPART_OUT;
-
-typedef struct _GETDICTPART_IN {
- PREFIX_IN prefin; /* prefix of each command */
- SERVERNAME szServer; /* which server ? */
- PVOID pBTree ; // ptr to dict file handles
- ULONG ulFilePos; /* file position of first byte to transfer */
- ULONG ulBytesToRead; /* number of bytes to transfer */
-} GETDICTPART_IN, * PGETDICTPART_IN;
-
-
-#define MAX_DICT_DESCR 40 // max length of a dictionary description
+typedef struct _GETPART_IN
+{ /* ingp */
+ PREFIX_IN prefin; /* prefix of each command */
+ ULONG ulFilePos; /* file position of first byte to transfer */
+ ULONG ulBytesToRead; /* number of bytes to transfer */
+} GETPART_IN, *PGETPART_IN;
+
+typedef struct _GETPART_OUT
+{ /* outgp */
+ PREFIX_OUT prefout; /* prefix of each command */
+ ULONG ulBytesRead; /* number of bytes actually read */
+ ULONG ulNextFilePos; /* file position of next byte to read */
+ UCHAR aucOutBuffer[GETPART_BUFFER_SIZE]; /* output buffer */
+} GETPART_OUT, *PGETPART_OUT;
+
+typedef struct _GETDICTPART_IN
+{
+ PREFIX_IN prefin; /* prefix of each command */
+ SERVERNAME szServer; /* which server ? */
+ PVOID pBTree; // ptr to dict file handles
+ ULONG ulFilePos; /* file position of first byte to transfer */
+ ULONG ulBytesToRead; /* number of bytes to transfer */
+} GETDICTPART_IN, *PGETDICTPART_IN;
+
+#define MAX_DICT_DESCR 40 // max length of a dictionary description
// Structure of EQF dictionary properties
typedef struct _PROPDICTIONARY
{
- //--- common property part ---
- PROPHEAD PropHead; // header of properties
- //--- general dictionary information ---
- CHAR szDescription[MAX_DICT_DESCR]; // dictionary description
- CHAR szSourceLang[MAX_LANG_LENGTH]; // dictionary source language
- // dictionary target language(s)
- CHAR szTargetLang[MAX_TGT_LANG][MAX_LANG_LENGTH];
- EQF_BOOL fCopyRight; // dictionary-is-copyrighted flag
- CHAR szDictPath[MAX_EQF_PATH]; // fully qualified dict file name
- CHAR szIndexPath[MAX_EQF_PATH]; // fully qualified index file name
- //--- dictionary profile ---
- USHORT usLength; // number of user profile entries
- USHORT usUserNameCount; // number of user created dict names
- COLFONT ColFontDictEntry; // colour/font for dict entry
- COLFONT ColFontEntryVal; // colour/font for dict entry value
- PROFENTRY ProfEntry[MAX_PROF_ENTRIES]; // user profile entries
- EQF_BOOL fProtected; // dictionary-is-protected flag
- ULONG ulPassWord;
- CHAR szServer[MAX_SERVER_NAME]; // Server Name of TM or \0 if TM is local
- CHAR szUserid[MAX_USERID]; // LAN Userid of TM: if local '\0'
- CHAR chRemPrimDrive; // LAN primary drive
- USHORT usLocation; // location of dictionary
- CHAR szLongName[MAX_LONGFILESPEC]; // dictionary long (descriptive) name
- CHAR szLongDesc[MAX_LONG_DESCRIPTION]; // dictionary long (descriptive) name
- USHORT usVersion; // Version of dictionary - used for
- // comparison during organize if copyrighted
- //--- reserved space ---
- CHAR chReserve[3402]; // reserve space / filler
+ //--- common property part ---
+ PROPHEAD PropHead; // header of properties
+ //--- general dictionary information ---
+ CHAR szDescription[MAX_DICT_DESCR]; // dictionary description
+ CHAR szSourceLang[MAX_LANG_LENGTH]; // dictionary source language
+ // dictionary target language(s)
+ CHAR szTargetLang[MAX_TGT_LANG][MAX_LANG_LENGTH];
+ EQF_BOOL fCopyRight; // dictionary-is-copyrighted flag
+ CHAR szDictPath[MAX_EQF_PATH]; // fully qualified dict file name
+ CHAR szIndexPath[MAX_EQF_PATH]; // fully qualified index file name
+ //--- dictionary profile ---
+ USHORT usLength; // number of user profile entries
+ USHORT usUserNameCount; // number of user created dict names
+ COLFONT ColFontDictEntry; // colour/font for dict entry
+ COLFONT ColFontEntryVal; // colour/font for dict entry value
+ PROFENTRY ProfEntry[MAX_PROF_ENTRIES]; // user profile entries
+ EQF_BOOL fProtected; // dictionary-is-protected flag
+ ULONG ulPassWord;
+ CHAR szServer[MAX_SERVER_NAME]; // Server Name of TM or \0 if TM is local
+ CHAR szUserid[MAX_USERID]; // LAN Userid of TM: if local '\0'
+ CHAR chRemPrimDrive; // LAN primary drive
+ USHORT usLocation; // location of dictionary
+ CHAR szLongName[MAX_LONGFILESPEC]; // dictionary long (descriptive) name
+ CHAR szLongDesc[MAX_LONG_DESCRIPTION]; // dictionary long (descriptive) name
+ USHORT usVersion; // Version of dictionary - used for
+ // comparison during organize if copyrighted
+ //--- reserved space ---
+ CHAR chReserve[3402]; // reserve space / filler
} PROPDICTIONARY, *PPROPDICTIONARY;
-
// ----------------------------------------------------------------------------
// structures needed for the TMC_PUT_TM_PROPERTIES command which is used to
// copy a property file for a remote TM to the server (during TM creation
@@ -707,37 +715,39 @@ typedef struct _PROPDICTIONARY
// the drive and path) which is then used to create a filename for the property
// file (same drive and path but new extension (will be .PRP)
// ----------------------------------------------------------------------------
-typedef struct _PUTPROP_IN { /* inpp */
- PREFIX_IN prefin; /* prefix of each command */
- SERVERNAME szServer; /* which server ? */
- CHAR szPathFileName [MAX_EQF_PATH]; /* full filename */
- ULONG ulPropLength; /* length of property file */
- UCHAR aucInBuffer [MEM_PROP_SIZE]; /* buffer for file data */
- CHAR szUserId [MAX_USERID]; /* userId logged on to requester */
-} PUTPROP_IN, * PPUTPROP_IN;
+typedef struct _PUTPROP_IN
+{ /* inpp */
+ PREFIX_IN prefin; /* prefix of each command */
+ SERVERNAME szServer; /* which server ? */
+ CHAR szPathFileName[MAX_EQF_PATH]; /* full filename */
+ ULONG ulPropLength; /* length of property file */
+ UCHAR aucInBuffer[MEM_PROP_SIZE]; /* buffer for file data */
+ CHAR szUserId[MAX_USERID]; /* userId logged on to requester */
+} PUTPROP_IN, *PPUTPROP_IN;
// !!! CHM Start
-typedef struct _PUTDICTPROP_IN { /* inpp */
- PREFIX_IN prefin; /* prefix of each command */
- SERVERNAME szServer; /* which server ? */
- CHAR szPathFileName [MAX_EQF_PATH]; /* full filename */
- ULONG ulPropLength; /* length of property file */
- CHAR szUserId [MAX_USERID]; /* userId logged on to requester */
- PROPDICTIONARY DictProp; /* dictionary property buffer */
-} PUTDICTPROP_IN, * PPUTDICTPROP_IN;
+typedef struct _PUTDICTPROP_IN
+{ /* inpp */
+ PREFIX_IN prefin; /* prefix of each command */
+ SERVERNAME szServer; /* which server ? */
+ CHAR szPathFileName[MAX_EQF_PATH]; /* full filename */
+ ULONG ulPropLength; /* length of property file */
+ CHAR szUserId[MAX_USERID]; /* userId logged on to requester */
+ PROPDICTIONARY DictProp; /* dictionary property buffer */
+} PUTDICTPROP_IN, *PPUTDICTPROP_IN;
/* define union to allow combined processing in server code */
typedef union _PUTPROPCOMBINEDIN
{
- PUTPROP_IN TmPropIn;
- PUTDICTPROP_IN DictPropIn;
-} PUTPROPCOMBINED_IN, * PPUTPROPCOMBINED_IN;
+ PUTPROP_IN TmPropIn;
+ PUTDICTPROP_IN DictPropIn;
+} PUTPROPCOMBINED_IN, *PPUTPROPCOMBINED_IN;
// !!! CHM End
-typedef struct _PUTPROP_OUT { /* outpp */
- PREFIX_OUT prefout; /* prefix of each command */
-} PUTPROP_OUT, * PPUTPROP_OUT;
-
+typedef struct _PUTPROP_OUT
+{ /* outpp */
+ PREFIX_OUT prefout; /* prefix of each command */
+} PUTPROP_OUT, *PPUTPROP_OUT;
// ----------------------------------------------------------------------------
// structures needed for the TMC_GET_TM_PROPERTIES command which is used to
@@ -750,29 +760,31 @@ typedef struct _PUTPROP_OUT { /* outpp
// property file which is stored on the same disk in the same path with the
// extension .PRP
// ----------------------------------------------------------------------------
-typedef struct _GETPROP_IN { /* ingp */
- PREFIX_IN prefin; /* prefix of each command */
- SERVERNAME szServer; /* which server ? */
- CHAR szPathFileName [MAX_EQF_PATH]; /* full filename */
- CHAR szUserId [MAX_USERID]; /* userId logged on to requester */
-} GETPROP_IN, * PGETPROP_IN;
-
-typedef struct _GETPROP_OUT { /* outgp */
- PREFIX_OUT prefout; /* prefix of each command */
- ULONG ulPropLength; /* length of property file */
- UCHAR aucOutBuffer [MEM_PROP_SIZE]; /* buffer for file data */
-} GETPROP_OUT, * PGETPROP_OUT;
+typedef struct _GETPROP_IN
+{ /* ingp */
+ PREFIX_IN prefin; /* prefix of each command */
+ SERVERNAME szServer; /* which server ? */
+ CHAR szPathFileName[MAX_EQF_PATH]; /* full filename */
+ CHAR szUserId[MAX_USERID]; /* userId logged on to requester */
+} GETPROP_IN, *PGETPROP_IN;
+
+typedef struct _GETPROP_OUT
+{ /* outgp */
+ PREFIX_OUT prefout; /* prefix of each command */
+ ULONG ulPropLength; /* length of property file */
+ UCHAR aucOutBuffer[MEM_PROP_SIZE]; /* buffer for file data */
+} GETPROP_OUT, *PGETPROP_OUT;
// !!! CHM Start
-typedef struct _GETDICTPROP_OUT { /* outgp */
- PREFIX_OUT prefout; /* prefix of each command */
- ULONG ulPropLength; /* length of property file */
- PROPDICTIONARY DictProp; /* dictionary property buffer*/
-} GETDICTPROP_OUT, * PGETDICTPROP_OUT;
+typedef struct _GETDICTPROP_OUT
+{ /* outgp */
+ PREFIX_OUT prefout; /* prefix of each command */
+ ULONG ulPropLength; /* length of property file */
+ PROPDICTIONARY DictProp; /* dictionary property buffer*/
+} GETDICTPROP_OUT, *PGETDICTPROP_OUT;
/* define union to allow combined processing in server code */
-
// ----------------------------------------------------------------------------
// structures needed for the TMC_END_ORGANIZE command which is used to end a
// running 'Organize' process; this command is sent to the original TM instead
@@ -782,16 +794,17 @@ typedef struct _GETDICTPROP_OUT { /* outgp *
// original TM file to be deleted and the temporary file to be renamed to the
// original TM filename;
// ----------------------------------------------------------------------------
-typedef struct _ENDORG_IN { /* ineo */
- PREFIX_IN prefin; /* prefix of each command */
- CHAR szOrgTM [MAX_EQF_PATH];/* full filename of original TM file */
- CHAR szTmpTM [MAX_EQF_PATH];/* full filename of temporary TM file */
-} ENDORG_IN, * PENDORG_IN;
-
-typedef struct _ENDORG_OUT { /* outeo */
- PREFIX_OUT prefout; /* prefix of each command */
-} ENDORG_OUT, * PENDORG_OUT;
-
+typedef struct _ENDORG_IN
+{ /* ineo */
+ PREFIX_IN prefin; /* prefix of each command */
+ CHAR szOrgTM[MAX_EQF_PATH]; /* full filename of original TM file */
+ CHAR szTmpTM[MAX_EQF_PATH]; /* full filename of temporary TM file */
+} ENDORG_IN, *PENDORG_IN;
+
+typedef struct _ENDORG_OUT
+{ /* outeo */
+ PREFIX_OUT prefout; /* prefix of each command */
+} ENDORG_OUT, *PENDORG_OUT;
// ----------------------------------------------------------------------------
// structures needed for the TMC_DELETE_TM command which is used to physical
@@ -799,16 +812,17 @@ typedef struct _ENDORG_OUT { /* outeo */
// before this command can be submitted, the file has to opened exclusively;
// the supplied filename must contain the full drive and path information;
// ----------------------------------------------------------------------------
-typedef struct _DELTM_IN { /* indt */
- PREFIX_IN prefin; /* prefix of each command */
- CHAR szTMPathFileName [MAX_EQF_PATH]; /* full filename of TM file */
- CHAR szPropPathFileName[MAX_EQF_PATH]; /* full filename of Prop file */
-} DELTM_IN, * PDELTM_IN;
-
-typedef struct _DELTM_OUT { /* outdt */
- PREFIX_OUT prefout; /* prefix of each command */
-} DELTM_OUT, * PDELTM_OUT;
-
+typedef struct _DELTM_IN
+{ /* indt */
+ PREFIX_IN prefin; /* prefix of each command */
+ CHAR szTMPathFileName[MAX_EQF_PATH]; /* full filename of TM file */
+ CHAR szPropPathFileName[MAX_EQF_PATH]; /* full filename of Prop file */
+} DELTM_IN, *PDELTM_IN;
+
+typedef struct _DELTM_OUT
+{ /* outdt */
+ PREFIX_OUT prefout; /* prefix of each command */
+} DELTM_OUT, *PDELTM_OUT;
// ----------------------------------------------------------------------------
// structures needed for the TMC_DELETE_FILE command which is used to physical
@@ -817,32 +831,34 @@ typedef struct _DELTM_OUT { /* outdt */
// a previous organize process that died during execution);
// the supplied filename must contain the full drive and path information;
// ----------------------------------------------------------------------------
-typedef struct _DELFILE_IN { /* indf */
- PREFIX_IN prefin; /* prefix of each command */
- SERVERNAME szServer; /* which server ? */
- CHAR szFileName [MAX_EQF_PATH]; /* full filename of file to delete*/
- CHAR szUserId [MAX_USERID]; /* userId logged on to requester */
-} DELFILE_IN, * PDELFILE_IN;
-
-typedef struct _DELFILE_OUT { /* outdf */
- PREFIX_OUT prefout; /* prefix of each command */
-} DELFILE_OUT, * PDELFILE_OUT;
-
-typedef struct _CLOSEHANDLER_IN
+typedef struct _DELFILE_IN
+{ /* indf */
+ PREFIX_IN prefin; /* prefix of each command */
+ SERVERNAME szServer; /* which server ? */
+ CHAR szFileName[MAX_EQF_PATH]; /* full filename of file to delete*/
+ CHAR szUserId[MAX_USERID]; /* userId logged on to requester */
+} DELFILE_IN, *PDELFILE_IN;
+
+typedef struct _DELFILE_OUT
+{ /* outdf */
+ PREFIX_OUT prefout; /* prefix of each command */
+} DELFILE_OUT, *PDELFILE_OUT;
+
+typedef struct _CLOSEHANDLER_IN
{
- PREFIX_IN prefin;
- USHORT hth;
-} CLOSEHANDLER_IN, * PCLOSEHANDLER_IN;
+ PREFIX_IN prefin;
+ USHORT hth;
+} CLOSEHANDLER_IN, *PCLOSEHANDLER_IN;
-typedef struct _EXIT_IN
+typedef struct _EXIT_IN
{
- PREFIX_IN prefin;
-} EXIT_IN, * PEXIT_IN;
+ PREFIX_IN prefin;
+} EXIT_IN, *PEXIT_IN;
-typedef struct _EXIT_OUT
+typedef struct _EXIT_OUT
{
- PREFIX_OUT prefout;
-} EXIT_OUT, * PEXIT_OUT;
+ PREFIX_OUT prefout;
+} EXIT_OUT, *PEXIT_OUT;
// ----------------------------------------------------------------------------
// data structure used for the TMC_QUERY_FILE_INFO which returns the file info
@@ -850,70 +866,67 @@ typedef struct _EXIT_OUT
// server
// ----------------------------------------------------------------------------
-typedef struct _FILEINFO_IN { /* infi */
- PREFIX_IN prefin; /* prefix of each command */
- CHAR szFileName [MAX_EQF_PATH]; /* full filename of file to query */
- SERVERNAME szServer; /* which server ? */
- CHAR szUserId [MAX_USERID]; /* userId logged on to requester !!!! CHM */
-} FILEINFO_IN, * PFILEINFO_IN;
-
-typedef struct _FILEINFO_OUT { /* outfi */
- PREFIX_OUT prefout; /* prefix of each command */
- FILEFINDBUF stFile; /* info about file */
-} FILEINFO_OUT, * PFILEINFO_OUT;
-
-
-typedef struct _TM_HEADER { /* tmh */
-/* fixed part */
- UCHAR achTmPrefix[TM_PREFIX_SIZE];
- /* should be initiated to EQFTMT$$ 8 */
- USHORT usTmHeaderSize, /* actual length of tm header */
- usDbVersion;
- LONG ldispFirstBlock; /* disp of first block from */
- /* beginning of TM */
- CREATE_TMH ctmh; /* parameters provided by the create */
- TIME_L tCreate; /* creation time stamp */
- ABGROUP abABGrouping;
-
-/* updated part */
- EQF_BOOL fCorruption;
- USHORT usNumTMBlocks, /* number of blocks in the TM */
- usNumFreeBlocks, /* # of free, pre-formatted blocks */
- usFirstAvailBlock,/* points to first available block */
- ausKeyDirectory[KEY_DIR_SIZE], /* key directory */
-
- usDispExclTagList, /* offset of tag list */
- usLenExclTagList, /* length of tag list */
- usDispExclWordList,/* offset of word list */
- usLenExclWordList; /* length of word list */
-
-} TM_HEADER, * PTM_HEADER, ** PPTM_HEADER;
-
-#define TAG_LEN 35
-#define MAX_NAME 8
-#define MAX_RANDOM 20
-//#define MAX_VOTES 20 // 30
-#define MAX_VOTES 30 // change 27.2.2000
-#define ABS_VOTES 400
-#define MAX_MATCHES 15
-#define TOK_SIZE 4000
-#define TMX_REC_SIZE 32760
-#define TMX_TABLE_SIZE 512
-#define MAX_INDEX_LEN 8150 // 2048
-
-
-
-
- // name table structure (TM Version 1 - 4)
+typedef struct _FILEINFO_IN
+{ /* infi */
+ PREFIX_IN prefin; /* prefix of each command */
+ CHAR szFileName[MAX_EQF_PATH]; /* full filename of file to query */
+ SERVERNAME szServer; /* which server ? */
+ CHAR szUserId[MAX_USERID]; /* userId logged on to requester !!!! CHM */
+} FILEINFO_IN, *PFILEINFO_IN;
+
+typedef struct _FILEINFO_OUT
+{ /* outfi */
+ PREFIX_OUT prefout; /* prefix of each command */
+ FILEFINDBUF stFile; /* info about file */
+} FILEINFO_OUT, *PFILEINFO_OUT;
+
+typedef struct _TM_HEADER
+{ /* tmh */
+ /* fixed part */
+ UCHAR achTmPrefix[TM_PREFIX_SIZE];
+ /* should be initiated to EQFTMT$$ 8 */
+ USHORT usTmHeaderSize, /* actual length of tm header */
+ usDbVersion;
+ LONG ldispFirstBlock; /* disp of first block from */
+ /* beginning of TM */
+ CREATE_TMH ctmh; /* parameters provided by the create */
+ TIME_L tCreate; /* creation time stamp */
+ ABGROUP abABGrouping;
+
+ /* updated part */
+ EQF_BOOL fCorruption;
+ USHORT usNumTMBlocks, /* number of blocks in the TM */
+ usNumFreeBlocks, /* # of free, pre-formatted blocks */
+ usFirstAvailBlock, /* points to first available block */
+ ausKeyDirectory[KEY_DIR_SIZE], /* key directory */
+
+ usDispExclTagList, /* offset of tag list */
+ usLenExclTagList, /* length of tag list */
+ usDispExclWordList, /* offset of word list */
+ usLenExclWordList; /* length of word list */
+
+} TM_HEADER, *PTM_HEADER, **PPTM_HEADER;
+
+#define TAG_LEN 35
+#define MAX_NAME 8
+#define MAX_RANDOM 20
+// #define MAX_VOTES 20 // 30
+#define MAX_VOTES 30 // change 27.2.2000
+#define ABS_VOTES 400
+#define MAX_MATCHES 15
+#define TOK_SIZE 4000
+#define TMX_REC_SIZE 32760
+#define TMX_TABLE_SIZE 512
+#define MAX_INDEX_LEN 8150 // 2048
+
+// name table structure (TM Version 1 - 4)
// typedef struct _TMX_VER1_TABLE
// {
// USHORT usAllocSize;
// USHORT usMaxEntries;
-// TMX_TABLE_ENTRY stTmTableEntry;
+// TMX_TABLE_ENTRY table;
// } TMX_VER1_TABLE, * PTMX_VER1_TABLE;
-
-
/**********************************************************************/
/* Defines and structures for the long document name support */
/**********************************************************************/
@@ -925,67 +938,67 @@ typedef struct _TM_HEADER { /* tmh */
// and increment for table enlargements
#define LONGNAMETABLE_ENTRIES 32
-
-
-
-//complete entry id tm data file
+// complete entry id tm data file
typedef struct _TMX_RECORD
{
- LONG lRecordLen;
- USHORT usSourceRecord;
- USHORT usFirstTargetRecord;
-} TMX_RECORD, * PTMX_RECORD;
+ LONG lRecordLen;
+ USHORT usSourceRecord;
+ USHORT usFirstTargetRecord;
+} TMX_RECORD, *PTMX_RECORD;
+
-//structure of the source segment
-typedef struct _TMX_SOURCE_RECORD
+
+// structure of the source segment
+struct TMX_SOURCE_RECORD
{
- LONG lRecordLen;
- USHORT usSource;
- USHORT usLangId;
- void reset(){
- memset(this, 0, sizeof(*this));
+ LONG lRecordLen{};
+ USHORT usSource{};
+ USHORT usLangId{};
+ void reset()
+ {
+ *this = TMX_SOURCE_RECORD{};
}
-} TMX_SOURCE_RECORD, * PTMX_SOURCE_RECORD;
+};
+using PTMX_SOURCE_RECORD = TMX_SOURCE_RECORD*;
-//structure of the target segment
-typedef struct _TMX_TARGET_RECORD
+// structure of the target segment
+struct TMX_TARGET_RECORD
{
- LONG lRecordLen = 0;
- //USHORT usSourceTagTable;
- //USHORT usTargetTagTable;
- USHORT usTarget = 0;
- USHORT usClb = 0;
- void reset(){
- memset(this, 0, sizeof(*this));
+ LONG lRecordLen = 0;
+ USHORT usTarget = 0;
+ USHORT usClb = 0;
+ void reset()
+ {
+ *this = TMX_TARGET_RECORD{};
}
-} TMX_TARGET_RECORD, * PTMX_TARGET_RECORD;
-
+};
+using PTMX_TARGET_RECORD = TMX_TARGET_RECORD*;
-//control block structure in target record
+// control block structure in target record
typedef struct _TMX_TARGET_CLB
-{
- TIME_L lTime;
- TIME_L lUpdateTime;
- ULONG ulSegmId;
- USHORT usLangId;
- USHORT usFileId;
- USHORT usAuthorId;
- USHORT usAddDataLen; // new for Major_version6: Length of following context and additional info data
- BYTE bMultiple;
- BYTE bTranslationFlag;
-} TMX_TARGET_CLB, * PTMX_TARGET_CLB;
+{
+ TIME_L lTime{};
+ TIME_L lUpdateTime{};
+ ULONG ulSegmId{};
+ USHORT usLangId{};
+ USHORT usFileId{};
+ USHORT usAuthorId{};
+ USHORT usAddDataLen{}; // new for Major_version6: Length of following context and additional info data
+ BYTE bMultiple{};
+ BYTE bTranslationFlag{};
+} TMX_TARGET_CLB, *PTMX_TARGET_CLB;
// helper macros for working with TMX_TARGET_CLBs
-#define TARGETCLBLEN( pClb ) (sizeof(TMX_TARGET_CLB) + pClb->usAddDataLen)
+#define TARGETCLBLEN(pClb) (sizeof(TMX_TARGET_CLB) + pClb->usAddDataLen)
-#define NEXTTARGETCLB( pClb ) ((PTMX_TARGET_CLB)(((PBYTE)pClb) + TARGETCLBLEN(pClb)))
+#define NEXTTARGETCLB(pClb) ((PTMX_TARGET_CLB)(((PBYTE)pClb) + TARGETCLBLEN(pClb)))
-#define PCONTEXTFROMCLB( pClb ) ((PSZ_W)(((PBYTE)pClb)+sizeof(TMX_TARGET_CLB)))
+#define PCONTEXTFROMCLB(pClb) ((PSZ_W)(((PBYTE)pClb) + sizeof(TMX_TARGET_CLB)))
// max size of additional data area
// (currently 2 * MAX_SEGMENT_SIZE for context and additional info
// plus size of three identifierrs (USHORT) and two size fields (USHORT) )
-#define MAX_ADD_DATA_LEN ((2 * MAX_SEGMENT_SIZE)*sizeof(WCHAR) + (5 * sizeof(USHORT)))
+#define MAX_ADD_DATA_LEN ((2 * MAX_SEGMENT_SIZE) * sizeof(WCHAR) + (5 * sizeof(USHORT)))
// identifier for additional info data in additional data area
#define ADDDATA_ADDINFO_ID 1
@@ -997,73 +1010,124 @@ typedef struct _TMX_TARGET_CLB
#define ADDDATA_ENDOFDATA_ID 9
// compute the size of the additional data for the given input
-USHORT NTMComputeAddDataSize( PSZ_W pszContext, PSZ_W pszAddInfo );
+USHORT NTMComputeAddDataSize(PSZ_W pszContext, PSZ_W pszAddInfo);
// get length of specific data in the combined data area, returns length of data area
-USHORT NtmGetAddDataLen( PTMX_TARGET_CLB pCLB, USHORT usDataID );
+USHORT NtmGetAddDataLen(PTMX_TARGET_CLB pCLB, USHORT usDataID);
// store/combine additional data in the combined area, returns new size of combined data area or 0 in case of errors
-USHORT NtmStoreAddData( PTMX_TARGET_CLB pCLB, USHORT usDataID, PSZ_W pszAddData );
+USHORT NtmStoreAddData(PTMX_TARGET_CLB pCLB, USHORT usDataID, PSZ_W pszAddData);
// retrieve specific data from the combined data area, returns length of retrieved data (incl. string end delimiter)
-USHORT NtmGetAddData( PTMX_TARGET_CLB pCLB, USHORT usDataID, PSZ_W pszBuffer, USHORT usBufSize );
+USHORT NtmGetAddData(PTMX_TARGET_CLB pCLB, USHORT usDataID, wchar_t* pszBuffer, PBYTE endOfMemRegion = 0);
// find a string in a specific data area
-BOOL NtmFindInAddData( PTMX_TARGET_CLB pCLB, USHORT usDataID, PSZ_W pszSearch );
+BOOL NtmFindInAddData(PTMX_TARGET_CLB pCLB, USHORT usDataID, PSZ_W pszSearch);
-//tag table structure for both source and target
+// tag table structure for both source and target
typedef struct _TMX_TAGTABLE_RECORD
{
- LONG lRecordLen;
- USHORT usTagTableId;
- USHORT usFirstTagEntry;
-} TMX_TAGTABLE_RECORD, * PTMX_TAGTABLE_RECORD;
+ LONG lRecordLen;
+ USHORT usTagTableId;
+ USHORT usFirstTagEntry;
+} TMX_TAGTABLE_RECORD, *PTMX_TAGTABLE_RECORD;
-
-//individual tag entry in tag table record
+// individual tag entry in tag table record
typedef struct _TMX_TAGENTRY
{
- USHORT usOffset;
- USHORT usTagLen;
- BYTE bData;
-} TMX_TAGENTRY, * PTMX_TAGENTRY;
+ USHORT usOffset;
+ USHORT usTagLen;
+ BYTE bData;
+} TMX_TAGENTRY, *PTMX_TAGENTRY;
// macros to access certain TM records fields
- #define RECLEN(pRec) pRec->lRecordLen
-
+#define RECLEN(pRec) pRec->lRecordLen
+#define RECLENB(pRec) toTmxRecord(pRec)->lRecordLen
-#define NTMVOTES(l) ((BYTE)(((ULONG)(l) >> 24) & 0xFF))
-#define NTMKEY(l) ((ULONG)(l) & 0xFFFFFF)
-#define NTMINDEX(b,l) ((ULONG)(((l) & 0xFFFFFF) | (((ULONG)(b)) << 24 )))
+#define NTMVOTES(l) ((BYTE)(((ULONG)(l) >> 24) & 0xFF))
+#define NTMKEY(l) ((ULONG)(l) & 0xFFFFFF)
+#define NTMINDEX(b, l) ((ULONG)(((l) & 0xFFFFFF) | (((ULONG)(b)) << 24)))
-typedef ULONG TMX_INDEX_ENTRY, *PTMX_INDEX_ENTRY;
+typedef ULONG TMX_INDEX_ENTRY, *PTMX_INDEX_ENTRY;
typedef struct _TMX_INDEX_RECORD
{
- USHORT usRecordLen;
- TMX_INDEX_ENTRY stIndexEntry;
-} TMX_INDEX_RECORD, * PTMX_INDEX_RECORD;
+ USHORT usRecordLen;
+ TMX_INDEX_ENTRY stIndexEntry;
+} TMX_INDEX_RECORD, *PTMX_INDEX_RECORD;
-typedef struct _TMX_TERM_TOKEN
+#define SAFE_CAST
+
+inline TMX_RECORD *toTmxRecord(BytesRef buffer)
+{
+ #ifdef SAFE_CAST
+ if(buffer.empty())
+ return nullptr;
+ #endif
+ return reinterpret_cast(buffer.data());
+}
+
+inline TMX_TAGTABLE_RECORD* toTmxTagtableRecord(BytesRef buffer){
+ #ifdef SAFE_CAST
+ if(buffer.empty())
+ return nullptr;
+ #endif
+ return reinterpret_cast(buffer.data());
+}
+
+inline TMX_INDEX_RECORD *toIndexRecord(BytesRef buffer)
{
- USHORT usOffset;
- USHORT usLength;
- USHORT usHash;
-} TMX_TERM_TOKEN, *PTMX_TERM_TOKEN;
+ #ifdef SAFE_CAST
+ if(buffer.empty())
+ return nullptr;
+ #endif
+ return reinterpret_cast(buffer.data());
+}
+
+inline TMX_TARGET_CLB *toTmxTargetClb(BytesRef buffer)
+{
+ #ifdef SAFE_CAST
+ if(buffer.empty())
+ return nullptr;
+ #endif
+ return reinterpret_cast(buffer.data());
+}
+
+struct TMX_TERM_TOKEN
+{
+ USHORT usOffset{};
+ USHORT usLength{};
+ USHORT usHash{};
+ void reset() { *this = TMX_TERM_TOKEN{}; }
+};
+using PTMX_TERM_TOKEN = TMX_TERM_TOKEN*;
-typedef struct _TMX_MATCHENTRY
+struct TMX_MATCHENTRY
{
- ULONG ulKey;
- USHORT usMaxVotes;
- USHORT usMatchVotes;
- BYTE cCount;
-} TMX_MATCHENTRY, * PTMX_MATCHENTRY;
+ LONG lKey = 0;
+ USHORT usMaxVotes = 0;
+ USHORT usMatchVotes = 0;
+ BYTE cCount = 0;
+};
+using PTMX_MATCHENTRY = TMX_MATCHENTRY*;
+
-//#pragma pack(show)
-//#pragma pack(push, 8)
-//#pragma pack(8)
+inline bool operator==(const TMX_MATCHENTRY& lhs, const TMX_MATCHENTRY& rhs) {
+ return lhs.lKey == rhs.lKey
+ && lhs.usMaxVotes == rhs.usMaxVotes
+ && lhs.usMatchVotes == rhs.usMatchVotes
+ && lhs.cCount == rhs.cCount;
+}
-#include
+inline bool operator!=(const TMX_MATCHENTRY& lhs, const TMX_MATCHENTRY& rhs) {
+ return !(lhs == rhs);
+}
+
+// #pragma pack(show)
+// #pragma pack(push, 8)
+// #pragma pack(8)
+
+#include
#include
#include
@@ -1073,141 +1137,160 @@ typedef struct _TMX_MATCHENTRY
#include
#include
-
class ImportStatusDetails;
-
// IDs of TMX elelements
typedef enum
{
- UNKNOWN_ELEMENT =-1,
- TMX_ELEMENT = 1,
- PROP_ELEMENT = 2,
- HEADER_ELEMENT = 3,
- TU_ELEMENT = 4,
- TUV_ELEMENT = 5,
- BODY_ELEMENT = 6,
- SEG_ELEMENT = 7,
- SEGMENT_TAGS = 8,
+ UNKNOWN_ELEMENT = -1,
+ TMX_ELEMENT = 1,
+ PROP_ELEMENT = 2,
+ HEADER_ELEMENT = 3,
+ TU_ELEMENT = 4,
+ TUV_ELEMENT = 5,
+ BODY_ELEMENT = 6,
+ SEG_ELEMENT = 7,
+ SEGMENT_TAGS = 8,
BEGIN_INLINE_TAGS = 10,
- //pair tags
+ // pair tags
BEGIN_PAIR_TAGS = 10,
- BPT_ELEMENT = 10,
- EPT_ELEMENT = 11,
- G_ELEMENT = 12,
- HI_ELEMENT = 13,
- SUB_ELEMENT = 14,
- BX_ELEMENT = 15,
- EX_ELEMENT = 16,
- END_PAIR_TAGS = 16,
-
- //standalone tags
+ BPT_ELEMENT = 10,
+ EPT_ELEMENT = 11,
+ G_ELEMENT = 12,
+ HI_ELEMENT = 13,
+ SUB_ELEMENT = 14,
+ BX_ELEMENT = 15,
+ EX_ELEMENT = 16,
+ END_PAIR_TAGS = 16,
+
+ // standalone tags
BEGIN_STANDALONE_TAGS = 20,
- PH_ELEMENT = 20,
- X_ELEMENT = 21,
- IT_ELEMENT = 22,
- UT_ELEMENT = 23,
- T5_N_ELEMENT = 24,
- END_STANDALONE_TAGS = 25,
+ PH_ELEMENT = 20,
+ X_ELEMENT = 21,
+ IT_ELEMENT = 22,
+ UT_ELEMENT = 23,
+ T5_N_ELEMENT = 24,
+ END_STANDALONE_TAGS = 25,
- END_INLINE_TAGS = 29,
+ END_INLINE_TAGS = 29,
- TMX_SENTENCE_ELEMENT = 30,
- INVCHAR_ELEMENT = 31
+ TMX_SENTENCE_ELEMENT = 30,
+ INVCHAR_ELEMENT = 31
} ELEMENTID;
-
-enum ACTIVE_SEGMENT{
- SOURCE_SEGMENT = 0,
- TARGET_SEGMENT = 1,
- REQUEST_SEGMENT = 2 //from fuzzy search request
+enum ACTIVE_SEGMENT
+{
+ SOURCE_SEGMENT = 0,
+ TARGET_SEGMENT = 1,
+ REQUEST_SEGMENT = 2 // from fuzzy search request
};
-
typedef ACTIVE_SEGMENT TagLocation;
struct TagInfo
{
TagLocation tagLocation = SOURCE_SEGMENT;
- //bool fPairedTag; // is tag is paired tag (bpt, ept, )
- bool fPairedTagClosed = false; // false for bpt/ept tag - waiting for matching ept/bpt tag
+ // bool fPairedTag; // is tag is paired tag (bpt, ept, )
+ bool fPairedTagClosed = false; // false for bpt/ept tag - waiting for matching ept/bpt tag
bool fTagAlreadyUsedInTarget = false; // we save tags only from source segment and then try to match\bind them in target
- int generated_i = 0; // for pair tags - generated identifier to find matching tag. the same as in original_i if it's not binded to other tag in segment
- int generated_x = 0; // id of tag. should match original_x, if it's not occupied by other tags
- ELEMENTID generated_tagType = UNKNOWN_ELEMENT; // replaced tagType, could be PH_ELEMENT, BPT_ELEMENT, EPT_ELEMENT
+ int generated_i = 0; // for pair tags - generated identifier to find matching tag. the same as in original_i if it's not binded to other tag in segment
+ int generated_x = 0; // id of tag. should match original_x, if it's not occupied by other tags
+ ELEMENTID generated_tagType = UNKNOWN_ELEMENT; // replaced tagType, could be PH_ELEMENT, BPT_ELEMENT, EPT_ELEMENT
- int original_i = 0; // original paired tags i
- int original_x = 0; // original id of tag
- ELEMENTID original_tagType; // original tagType
- //if targetTag -> matching tag from source tags
- //if sourceTag -> matching tag from target tags
- //TagInfo* matchingTag;
- //int matchingTagIndex = -1;
+ int original_i = 0; // original paired tags i
+ int original_x = 0; // original id of tag
+ ELEMENTID original_tagType; // original tagType
+ // if targetTag -> matching tag from source tags
+ // if sourceTag -> matching tag from target tags
+ // TagInfo* matchingTag;
+ // int matchingTagIndex = -1;
bool fDeleted = false;
-
- //t5n
+
+ // t5n
std::string t5n_key;
std::string t5n_value;
};
-
class TagReplacer{
public:
bool fUseOriginalTagAndAttributes = false;
-
+
std::vector sourceTagList;
std::vector targetTagList;
std::vector requestTagList;
ACTIVE_SEGMENT activeSegment = SOURCE_SEGMENT;
- int iHighestPTI = 0; // increments with each opening pair tags
- int iHighestPTId = 500; // increments with pair tag
- int iHighestPHId = 100; // increments with ph tag
- bool fFuzzyRequest = false; // if re are dealing with import or fuzzy request
- bool fReplaceNumberProtectionTagsWithHashes = false;//
+ int iHighestPTI = 0; // increments with each opening pair tags
+ int iHighestPTId = 500; // increments with pair tag
+ int iHighestPHId = 100; // increments with ph tag
+ bool fFuzzyRequest = false; // if re are dealing with import or fuzzy request
+ bool fReplaceNumberProtectionTagsWithHashes = false; //
bool fSkipTags = false;
- //to track id and i attributes in request and then generate new values for tags in srt and trg that is not matching
- int iHighestRequestsOriginalI = 0;
+ // to track id and i attributes in request and then generate new values for tags in srt and trg that is not matching
+ int iHighestRequestsOriginalI = 0;
int iHighestRequestsOriginalId = 0;
-
- //idAttr==0 -> look for id in attributes
- //iAttr==0 ->i attribute not used
- //tag should be only "ph", "bpt", or "ept"
- TagInfo GenerateReplacingTag(ELEMENTID tagType, xercesc::AttributeList* attributes, bool saveTagToTagList = true);
- std::wstring PrintTag(TagInfo& tag);
+ // idAttr==0 -> look for id in attributes
+ // iAttr==0 ->i attribute not used
+ // tag should be only "ph", "bpt", or "ept"
+ TagInfo GenerateReplacingTag(ELEMENTID tagType, xercesc::AttributeList *attributes, bool saveTagToTagList = true);
+ std::wstring PrintTag(TagInfo &tag);
void reset();
- std::string static LogTag(TagInfo& tag);
- std::wstring PrintReplaceTagWithKey(TagInfo& tag);
+ std::string static LogTag(TagInfo &tag);
+ std::wstring PrintReplaceTagWithKey(TagInfo &tag);
- TagReplacer(){
+ TagReplacer()
+ {
sourceTagList.reserve(50);
targetTagList.reserve(50);
requestTagList.reserve(50);
- reset();
- }
+ reset();
+ }
};
// PROP types
-typedef enum { TMLANGUAGE_PROP, TMMARKUP_PROP, TMDOCNAME_PROP, TMCONTEXT_PROP, TMADDINFO_PROP, TMAUTHOR_PROP, MACHINEFLAG_PROP, SEG_PROP, TMDESCRIPTION_PROP, TMNOTE_PROP, TMNOTESTYLE_PROP,
- TRANSLATIONFLAG_PROP, TMTMMATCHTYPE_PROP, TMMTSERVICE_PROP, TMMTMETRICNAME_PROP, TMMTMETRICVALUE_PROP, TMPEEDITDISTANCECHARS_PROP, TMPEEDITDISTANCEWORDS_PROP,
- TMMTFIELDS_PROP, TMWORDS_PROP, TMMATCHSEGID_PROP, UNKNOWN_PROP } TMXPROPID, PROPID;
+typedef enum
+{
+ TMLANGUAGE_PROP,
+ TMMARKUP_PROP,
+ TMDOCNAME_PROP,
+ TMCONTEXT_PROP,
+ TMADDINFO_PROP,
+ TMAUTHOR_PROP,
+ MACHINEFLAG_PROP,
+ SEG_PROP,
+ TMDESCRIPTION_PROP,
+ TMNOTE_PROP,
+ TMNOTESTYLE_PROP,
+ TRANSLATIONFLAG_PROP,
+ TMTMMATCHTYPE_PROP,
+ TMMTSERVICE_PROP,
+ TMMTMETRICNAME_PROP,
+ TMMTMETRICVALUE_PROP,
+ TMPEEDITDISTANCECHARS_PROP,
+ TMPEEDITDISTANCEWORDS_PROP,
+ TMMTFIELDS_PROP,
+ TMWORDS_PROP,
+ TMMATCHSEGID_PROP,
+ UNKNOWN_PROP
+} TMXPROPID,
+ PROPID;
// stack elements
typedef struct _TMXELEMENT
{
- ELEMENTID ID; // ID of element
- BOOL fInlineTagging; // TRUE = we are processing inline tagging
- BOOL fInsideTagging; // TRUE = we are currently inside inline tagging
- TMXPROPID PropID; // ID of prop element (only used for props)
- CHAR szDataType[50]; // data type of current element
- CHAR szTMXLanguage[50]; // TMX language of element
- CHAR szTMLanguage[50]; // TM language of element
- CHAR szTMMarkup[50]; // TM markup of element
- LONG lSegNum; // TM segment number
+ ELEMENTID ID; // ID of element
+ BOOL fInlineTagging; // TRUE = we are processing inline tagging
+ BOOL fInsideTagging; // TRUE = we are currently inside inline tagging
+ TMXPROPID PropID; // ID of prop element (only used for props)
+ CHAR szDataType[50]; // data type of current element
+ CHAR szTMXLanguage[50]; // TMX language of element
+ CHAR szTMLanguage[50]; // TM language of element
+ CHAR szTMMarkup[50]; // TM markup of element
+ LONG lSegNum; // TM segment number
} TMXELEMENT, *PTMXELEMENT;
//
@@ -1219,25 +1302,25 @@ class TMXParseHandler : public xercesc::HandlerBase
// -----------------------------------------------------------------------
// Constructors and Destructor
// -----------------------------------------------------------------------
- TMXParseHandler(InclosingTagsBehaviour InclosingTagsBehaviour = InclosingTagsBehaviour::saveAll);
+ TMXParseHandler(InclosingTagsBehaviour InclosingTagsBehaviour = InclosingTagsBehaviour::saveAll);
virtual ~TMXParseHandler();
// setter functions for import info
- void SetMemInfo( PMEMEXPIMPINFO m_pMemInfo );
- void SetImportData(ImportStatusDetails * _pImportDetails) { pImportDetails = _pImportDetails;}
- void SetMemInterface( PFN_MEMINSERTSEGMENT pfnInsertSegment, LONG lMemHandle, //LOADEDTABLE* pTable,
- PTOKENENTRY pTokBuf, int iTokBufSize );
- void SetSourceLanguage( char *pszSourceLang );
-
- // getter functions
- void GetDescription( char *pszDescription, int iBufSize );
- void GetSourceLanguage( char *pszSourceLang, int iBufSize );
- BOOL IsHeaderDone( void );
- BOOL ErrorOccured( void );
- void GetErrorText( char *pszTextBuffer, int iBufSize );
+ void SetMemInfo(PMEMEXPIMPINFO m_pMemInfo);
+ void SetImportData(ImportStatusDetails *_pImportDetails) { pImportDetails = _pImportDetails; }
+ void SetMemInterface(PFN_MEMINSERTSEGMENT pfnInsertSegment, LONG lMemHandle, // LOADEDTABLE* pTable,
+ PTOKENENTRY pTokBuf, int iTokBufSize);
+ void SetSourceLanguage(char *pszSourceLang);
+
+ // getter functions
+ void GetDescription(char *pszDescription, int iBufSize);
+ void GetSourceLanguage(char *pszSourceLang, int iBufSize);
+ BOOL IsHeaderDone(void);
+ BOOL ErrorOccured(void);
+ void GetErrorText(char *pszTextBuffer, int iBufSize);
std::wstring GetParsedData() const;
- std::wstring GetParsedDataWithReplacedNpTags()const;
- std::wstring GetParsedNormalizedData()const;
+ std::wstring GetParsedDataWithReplacedNpTags() const;
+ std::wstring GetParsedNormalizedData() const;
int iStopImportWRc = 0;
bool fReplaceWithTagsWithoutAttributes;
@@ -1246,125 +1329,123 @@ class TMXParseHandler : public xercesc::HandlerBase
// -----------------------------------------------------------------------
// Handlers for the SAX DocumentHandler interface
// -----------------------------------------------------------------------
- void startElement(const XMLCh* const name, xercesc::AttributeList& attributes);
- void endElement(const XMLCh* const name );
- void characters(const XMLCh* const chars, const XMLSize_t length);
- //void ignorableWhitespace(const XMLCh* const chars, const unsigned int length);
- //void resetDocument();
-
+ void startElement(const XMLCh *const name, xercesc::AttributeList &attributes);
+ void endElement(const XMLCh *const name);
+ void characters(const XMLCh *const chars, const XMLSize_t length);
+ // void ignorableWhitespace(const XMLCh* const chars, const unsigned int length);
+ // void resetDocument();
// -----------------------------------------------------------------------
// Handlers for the SAX ErrorHandler interface
// -----------------------------------------------------------------------
- void warning(const xercesc::SAXParseException& exc);
- void error(const xercesc::SAXParseException& exc );
- void fatalError(const xercesc::SAXParseException& exc);
- void fatalInternalError(const xercesc::SAXException& exc);
+ void warning(const xercesc::SAXParseException &exc);
+ void error(const xercesc::SAXParseException &exc);
+ void fatalError(const xercesc::SAXParseException &exc);
+ void fatalInternalError(const xercesc::SAXException &exc);
- bool tmxEndReached()const {return fBodyDone;}
- //void resetErrors();
+ bool tmxEndReached() const { return fBodyDone; }
+ // void resetErrors();
-
TagReplacer tagReplacer;
BOOL fInitialized = false;
BOOL fCreateNormalizedStr = false;
USHORT insertSegUsRC{0};
- void setDocumentLocator(const xercesc::Locator* const locator) override;
+ void setDocumentLocator(const xercesc::Locator *const locator) override;
private:
- const xercesc::Locator* m_locator = nullptr;
- ImportStatusDetails* pImportDetails = nullptr;
- ELEMENTID GetElementID( PSZ pszName );
- void Push( PTMXELEMENT pElement );
- void Pop( PTMXELEMENT pElement );
- BOOL GetValue( PSZ pszString, int iLen, int *piResult );
- BOOL TMXLanguage2TMLanguage( PSZ pszTMLanguage, PSZ pszTMXLanguage, PSZ pszResultingLanguage );
- USHORT RemoveRTFTags( PSZ_W pszString, BOOL fTagsInCurlyBracesOnly );
+ const xercesc::Locator *m_locator = nullptr;
+ ImportStatusDetails *pImportDetails = nullptr;
+ ELEMENTID GetElementID(PSZ pszName);
+ void Push(PTMXELEMENT pElement);
+ void Pop(PTMXELEMENT pElement);
+ BOOL GetValue(PSZ pszString, int iLen, int *piResult);
+ BOOL TMXLanguage2TMLanguage(PSZ pszTMLanguage, PSZ pszTMXLanguage, PSZ pszResultingLanguage);
+ USHORT RemoveRTFTags(PSZ_W pszString, BOOL fTagsInCurlyBracesOnly);
// date conversion help functions
- BOOL IsLeapYear( const int iYear );
- int GetDaysOfMonth( const int iMonth, const int iYear );
- int GetDaysOfYear( const int iYear );
- int GetYearDay( const int iDay, const int iMonth, const int iYear );
+ BOOL IsLeapYear(const int iYear);
+ int GetDaysOfMonth(const int iMonth, const int iYear);
+ int GetDaysOfYear(const int iYear);
+ int GetYearDay(const int iDay, const int iMonth, const int iYear);
// mem import interface data
PMEMEXPIMPINFO m_pMemInfo;
PFN_MEMINSERTSEGMENT pfnInsertSegment;
- LONG lMemHandle;
+ LONG lMemHandle;
// processing flags
- BOOL fSource; // TRUE = source data collected
- BOOL fTarget; // TRUE = target data collected
- BOOL fCatchData; // TRUE = catch data
- BOOL fWithTagging; // TRUE = add tagging to data
- BOOL fWithTMXTags; // TRUE = segment contains TMX tags
- BOOL fTMXTagStarted; // TRUE = TMX inline tag started
- BOOL fHeaderDone; // TRUE = header has been processed
- BOOL fError; // TRUE = parsing ended with error
+ BOOL fSource; // TRUE = source data collected
+ BOOL fTarget; // TRUE = target data collected
+ BOOL fCatchData; // TRUE = catch data
+ BOOL fWithTagging; // TRUE = add tagging to data
+ BOOL fWithTMXTags; // TRUE = segment contains TMX tags
+ BOOL fTMXTagStarted; // TRUE = TMX inline tag started
+ BOOL fHeaderDone; // TRUE = header has been processed
+ BOOL fError; // TRUE = parsing ended with error
bool fBodyDone = false;
-
+
// segment data
- ULONG ulSegNo; // segmet number
- LONG lTime; // segment date/time
- USHORT usTranslationFlag; // type of translation flag
- int iNumOfTu;
+ ULONG ulSegNo; // segmet number
+ LONG lTime; // segment date/time
+ USHORT usTranslationFlag; // type of translation flag
+ int iNumOfTu;
size_t _invalidCharacterErrorCount{0};
- // buffers
- #define DATABUFFERSIZE 4098
+// buffers
+#define DATABUFFERSIZE 4098
typedef struct _BUFFERAREAS
{
- CHAR_W szData[DATABUFFERSIZE]; // buffer for collected data
- CHAR_W szReplacedNpData[DATABUFFERSIZE];
- CHAR_W szNormalizedData[DATABUFFERSIZE];
- CHAR_W szPropW[DATABUFFERSIZE]; // buffer for collected prop values
- CHAR_W szContext[DATABUFFERSIZE]; // buffer for collected prop values
- CHAR_W szAddInfo[DATABUFFERSIZE]; // buffer for collected prop values
- CHAR szLang[50]; // buffer for language
- CHAR szDocument[EQF_DOCNAMELEN];// buffer for document name
-
- CHAR szAuthor[EQF_DOCNAMELEN];// buffer for author name
- CHAR szChangeId[EQF_DOCNAMELEN];// buffer for author/changeId name
- CHAR szCreationId[EQF_DOCNAMELEN];// buffer for author/creationId name
-
- MEMEXPIMPSEG SegmentData; // buffer for segment data
- CHAR szDescription[1024]; // buffer for memory descripion
- CHAR szMemSourceLang[50]; // buffer for memory source language
- CHAR szMemSourceIsoLang[50];
- CHAR szErrorMessage[1024]; // buffer for error message text
- CHAR_W szNote[MAX_SEGMENT_SIZE];// buffer for note text
- CHAR_W szNoteStyle[100]; // buffer for note style
- CHAR_W szMTMetrics[MAX_SEGMENT_SIZE]; // buffer for MT metrics data
- ULONG ulWords; // number of words in the segment text
- CHAR_W szMatchSegID[MAX_SEGMENT_SIZE];// buffer for match segment ID
-
- //for inclosing tags skipping. If pFirstBptTag is nullptr->segments don't start from bpt tag-> inclosing tags skipping should be ignored
- int inclosingTagsAtTheStartOfSegment = 0;
- int inclosingTagsAtTheEndOfSegment = 0;
-
+ CHAR_W szData[DATABUFFERSIZE]; // buffer for collected data
+ CHAR_W szReplacedNpData[DATABUFFERSIZE];
+ CHAR_W szNormalizedData[DATABUFFERSIZE];
+ CHAR_W szPropW[DATABUFFERSIZE]; // buffer for collected prop values
+ CHAR_W szContext[DATABUFFERSIZE]; // buffer for collected prop values
+ CHAR_W szAddInfo[DATABUFFERSIZE]; // buffer for collected prop values
+ CHAR szLang[50]; // buffer for language
+ CHAR szDocument[EQF_DOCNAMELEN]; // buffer for document name
+
+ CHAR szAuthor[EQF_DOCNAMELEN]; // buffer for author name
+ CHAR szChangeId[EQF_DOCNAMELEN]; // buffer for author/changeId name
+ CHAR szCreationId[EQF_DOCNAMELEN]; // buffer for author/creationId name
+
+ MEMEXPIMPSEG SegmentData; // buffer for segment data
+ CHAR szDescription[1024]; // buffer for memory descripion
+ CHAR szMemSourceLang[50]; // buffer for memory source language
+ CHAR szMemSourceIsoLang[50];
+ CHAR szErrorMessage[1024]; // buffer for error message text
+ CHAR_W szNote[MAX_SEGMENT_SIZE]; // buffer for note text
+ CHAR_W szNoteStyle[100]; // buffer for note style
+ CHAR_W szMTMetrics[MAX_SEGMENT_SIZE]; // buffer for MT metrics data
+ ULONG ulWords; // number of words in the segment text
+ CHAR_W szMatchSegID[MAX_SEGMENT_SIZE]; // buffer for match segment ID
+
+ // for inclosing tags skipping. If pFirstBptTag is nullptr->segments don't start from bpt tag-> inclosing tags skipping should be ignored
+ int inclosingTagsAtTheStartOfSegment = 0;
+ int inclosingTagsAtTheEndOfSegment = 0;
+
InclosingTagsBehaviour inclosingTagsBehaviour = saveAll;
-
- bool fUseMajorLanguage;
+
+ bool fUseMajorLanguage;
} BUFFERAREAS, *PBUFFERAREAS;
- PBUFFERAREAS pBuf;
+ PBUFFERAREAS pBuf;
// TUV data area
typedef struct _TMXTUV
{
- CHAR_W szText[DATABUFFERSIZE]; // buffer for TUV text
- CHAR szLang[50]; // buffer for TUV language (converted to Tmgr language name) or original language in case of fInvalidLang
- CHAR szIsoLang[10];
- BOOL fInvalidChars; // TRUE = contains invalid characters
- BOOL fInlineTags; // TRUE = contains inline tagging
- BOOL fInvalidLang; // TRUE = the language of the TUV is invalid
+ CHAR_W szText[DATABUFFERSIZE]; // buffer for TUV text
+ CHAR szLang[50]; // buffer for TUV language (converted to Tmgr language name) or original language in case of fInvalidLang
+ CHAR szIsoLang[10];
+ BOOL fInvalidChars; // TRUE = contains invalid characters
+ BOOL fInlineTags; // TRUE = contains inline tagging
+ BOOL fInvalidLang; // TRUE = the language of the TUV is invalid
} TMXTUV, *PTMXTUV;
PTMXTUV pTuvArray;
- int iCurTuv; // current TUV index
- int iTuvArraySize; // current size of TUV array
+ int iCurTuv; // current TUV index
+ int iTuvArraySize; // current size of TUV array
// element stack
int iStackSize;
@@ -1372,49 +1453,47 @@ class TMXParseHandler : public xercesc::HandlerBase
TMXELEMENT CurElement;
PTMXELEMENT pStack;
- bool fSawErrors;
- BOOL fInvalidChars; // TRUE = current TUV contains invalid characters
- BOOL fInlineTags; // TRUE = current TUV contains inline tagging
+ bool fSawErrors;
+ BOOL fInvalidChars; // TRUE = current TUV contains invalid characters
+ BOOL fInlineTags; // TRUE = current TUV contains inline tagging
// data for remove tag function
PTOKENENTRY pTokBuf;
int iTokBufSize;
- //ULONG ulCP;
-
- void fillSegmentInfo( PTMXTUV pSource, PTMXTUV pTarget, PMEMEXPIMPSEG pSegment );
+ // ULONG ulCP;
+ void fillSegmentInfo(PTMXTUV pSource, PTMXTUV pTarget, PMEMEXPIMPSEG pSegment);
};
-
-class StringVariants{
+class StringVariants
+{
protected:
std::wstring original; // full original str
std::wstring originalTarget;
- bool fSuccess = false;
+ bool fSuccess = false;
-
xercesc::SAXParser parser;
TMXParseHandler handler;
xercesc::XMLPScanToken saxToken;
+
public:
- StringVariants(std::wstring&& w_src, std::wstring&& w_trg){
- original = std::move(w_src);
- originalTarget = std::move(w_trg);
- }
- bool isParsed() const{ return fSuccess; }
- std::wstring& getOriginalSrcStr(){ return original; }
- std::wstring& getOriginalTrgStr(){ return original; }
- wchar_t* getOriginalStrC() { return &original[0]; }
- wchar_t* getOriginalTrgStrC() {return &originalTarget[0];}
+ StringVariants(std::wstring &&w_src, std::wstring &&w_trg):
+ original(std::move(w_src)), originalTarget(std::move(w_trg)) { }
+ bool isParsed() const { return fSuccess; }
+ std::wstring &getOriginalSrcStr() { return original; }
+ std::wstring &getOriginalTrgStr() { return original; }
+ wchar_t *getOriginalStrC() { return &original[0]; }
+ wchar_t *getOriginalTrgStrC() { return &originalTarget[0]; }
};
-class StringTagVariants: public StringVariants{
+class StringTagVariants : public StringVariants
+{
protected:
- std::wstring norm; // without any tags
- std::wstring npReplaced; // with generic(generated) tags but np tags is replaced with their keys(r attr)
+ std::wstring norm; // without any tags
+ std::wstring npReplaced; // with generic(generated) tags but np tags is replaced with their keys(r attr)
std::wstring genericTags; // generated tags so there could be only ph or bpt/ept with id and r attributes that would map input str to common tag format
- std::wstring genericTarget;
+ std::wstring genericTarget;
std::wstring normTarget;
void initParser();
@@ -1425,272 +1504,238 @@ class StringTagVariants: public StringVariants{
std::string trg;
public:
- StringTagVariants(std::wstring&& w_src): StringTagVariants(std::move(w_src), L""){}
- StringTagVariants(std::wstring&& w_src, std::wstring&& w_trg): StringVariants(std::move(w_src), std::move(w_trg)){
+ StringTagVariants(std::wstring &&w_src) : StringTagVariants(std::move(w_src), L"") {}
+ StringTagVariants(std::wstring &&w_src, std::wstring &&w_trg) : StringVariants(std::move(w_src), std::move(w_trg))
+ {
initParser();
parseSrc();
- if(fSuccess){
+ if (fSuccess)
+ {
parseTrg();
logResults();
}
}
bool hasTarget() const { return !genericTarget.empty(); }
- bool replaceTags(std::wstring&& w_request_input);
-
- std::wstring& getNormStr(){ return norm; }
- std::wstring& getNpReplacedStr(){ return npReplaced; }
- std::wstring& getGenericTagsString() { return genericTags; }
- std::wstring& getNormTargetStr(){return normTarget; }
-
- wchar_t* getNormStrC(){return &norm[0];}
- wchar_t* getNpReplStrC(){return &npReplaced[0];}
- wchar_t* getGenericTagStrC() { return &genericTags[0]; }
- wchar_t* getGenericTargetStrC() {return &genericTarget[0];}
- wchar_t* getNormalizedTargetStrC() { return &normTarget[0]; }
+ bool replaceTags(std::wstring &&w_request_input);
+
+ std::wstring &getNormStr() { return norm; }
+ std::wstring &getNpReplacedStr() { return npReplaced; }
+ std::wstring &getGenericTagsString() { return genericTags; }
+ std::wstring &getGenericTargetStr() { return genericTarget; }
+ std::wstring &getNormTargetStr() { return normTarget; }
+
+ wchar_t *getNormStrC() { return norm.data(); }
+ wchar_t *getNpReplStrC() { return npReplaced.data(); }
+ wchar_t *getGenericTagStrC() { return genericTags.data(); }
+ wchar_t *getGenericTargetStrC() { return genericTarget.data(); }
+ wchar_t *getNormalizedTargetStrC() { return normTarget.data(); }
};
-class RequestTagReplacer: public StringVariants{
+class RequestTagReplacer : public StringVariants
+{
std::wstring replacedTagsSrc, replacedTagsTrg, genericTagsReq, originalReq;
void parseAndReplaceTags();
- public:
- RequestTagReplacer(std::wstring&& w_src, std::wstring&& w_trg, std::wstring&& w_req): StringVariants(std::move(w_src), std::move(w_trg)){
- originalReq = std::move(w_req);
- parseAndReplaceTags();
+public:
+ RequestTagReplacer(std::wstring &&w_src, std::wstring &&w_trg, std::wstring &&w_req) : StringVariants(std::move(w_src), std::move(w_trg))
+ {
+ originalReq = std::move(w_req);
+ parseAndReplaceTags();
};
- wchar_t* getSrcWithTagsFromRequestC(){ return &replacedTagsSrc[0];}
- wchar_t* getTrgWithTagsFromRequestC(){ return &replacedTagsTrg[0];}
- wchar_t* getReqGenericTagStrC(){return &genericTagsReq[0]; }
- wchar_t* getOrigReqC(){return &originalReq[0];}
+ wchar_t *getSrcWithTagsFromRequestC() { return &replacedTagsSrc[0]; }
+ wchar_t *getTrgWithTagsFromRequestC() { return &replacedTagsTrg[0]; }
+ wchar_t *getReqGenericTagStrC() { return &genericTagsReq[0]; }
+ wchar_t *getOrigReqC() { return &originalReq[0]; }
- std::wstring& getSrcWithTagsFromRequest(){ return replacedTagsSrc;}
- std::wstring& getTrgWithTagsFromRequest(){ return replacedTagsTrg;}
- std::wstring& getReqGenericTagStr(){return genericTagsReq; }
- std::wstring& getOrigReq(){return originalReq;}
+ std::wstring &getSrcWithTagsFromRequest() { return replacedTagsSrc; }
+ std::wstring &getTrgWithTagsFromRequest() { return replacedTagsTrg; }
+ std::wstring &getReqGenericTagStr() { return genericTagsReq; }
+ std::wstring &getOrigReq() { return originalReq; }
};
struct TMX_SENTENCE
{
- std::unique_ptr pStrings = nullptr;
- //StringTagVariants* pStrings = nullptr;
-
- PSZ_W pAddString = nullptr;
- //USHORT usNormLen = 0;
- PTMX_TERM_TOKEN pTermTokens = nullptr;
- LONG lTermAlloc = 0;
- PTMX_TAGTABLE_RECORD pTagRecord = nullptr;
- LONG lTagAlloc = 0;
- PTMX_TAGENTRY pTagEntryList = nullptr;
- USHORT usActVote = 0;
- PULONG pulVotes = nullptr;
- std::unique_ptr pPropString = nullptr;
- //StringTagVariants * pPropString = nullptr;
-
- PTMX_TERM_TOKEN pPropTermTokens = nullptr; // buffer for Termtokens
-
- //ADDINFO
- CHAR szSourceLanguage[MAX_LANG_LENGTH]; //language name of source
- CHAR szTargetLanguage[MAX_LANG_LENGTH]; //language name of target
- CHAR szAuthorName[MAX_FILESPEC]; //author name of target
- USHORT usTranslationFlag; /* type of translation, 0 = human, 1 = machine, 2 = GobalMemory */
- CHAR szFileName[MAX_FILESPEC]; //where source comes from name+ext
- LONG_FN szLongName; // name of source file (long name or EOS)
- ULONG ulSourceSegmentId; //seg. num. of source sentence from analysis
- CHAR szTagTable[MAX_FNAME]; //tag table name
- TIME_L lTime; //time stamp
- CHAR_W szContext[MAX_SEGMENT_SIZE]; //segment context
- CHAR_W szAddInfo[MAX_SEGMENT_SIZE]; // additional segment information
- BOOL fMarkupChanged; // Markup does not exist, changed to OTMUTF8 during import
- //end ADDINFO
+ // ADDINFO
+ std::array pAddString; // segment context
+ std::array szAddInfo; // additional segment information
+ std::array szContext; // additional segment information
+ std::array szAuthorName; // author name of target'
+ std::array szFileName; // where source comes from name+ext
+ std::array szTagTable; // tag table name
+ std::array szSourceLanguage; // language name of source
+ std::array szTargetLanguage; // language name of target
+
+ std::unique_ptr pStrings, pPropString;
+ std::vector pTermTokens;
+ std::vector pTagRecord;//TMX_TAGTABLE_RECORD
+ USHORT usActVote = 0;
+ std::vector pulVotes;
+ std::vector pPropTermTokens; // buffer for Termtokens
- std::vector tokens;
+
+ USHORT usTranslationFlag; /* type of translation, 0 = human, 1 = machine, 2 = GobalMemory */
+ LONG_FN szLongName; // name of source file (long name or EOS)
+ ULONG ulSourceSegmentId; // seg. num. of source sentence from analysis
+ TIME_L lTime; // time stamp
+ BOOL fMarkupChanged; // Markup does not exist, changed to OTMUTF8 during import
+ // end ADDINFO
+ std::vector tokens;
- TMX_SENTENCE(std::wstring&& w_src, std::wstring &&w_trg){
- if(w_trg.empty()){
- pStrings = std::make_unique(std::move(w_src));//new StringTagVariants(std::move(w_src)); //;std::make_unique (std::move(w_src));
- }else{
- pStrings = std::make_unique(std::move(w_src),std::move(w_trg));//new StringTagVariants(std::move(w_src), std::move(w_trg)); // std::make_unique (std::move(w_src), std::move(w_trg));
+ TMX_SENTENCE(std::wstring &&w_src, std::wstring &&w_trg)
+ {
+ if (w_trg.empty())
+ {
+ pStrings = std::make_unique(std::move(w_src));
}
- bool fOK = true;
- if ( fOK ) fOK = UtlAlloc( (PVOID *) &(pulVotes), 0L, (LONG)(ABS_VOTES * sizeof(ULONG)), NOMSG );
- if ( fOK ) fOK = UtlAlloc( (PVOID *) &(pTagRecord), 0L, (LONG)(2*TOK_SIZE), NOMSG);
- if ( fOK ) fOK = UtlAlloc( (PVOID *) &(pTermTokens), 0L, (LONG)TOK_SIZE, NOMSG );
-
- if ( fOK )
+ else
{
- lTermAlloc = (LONG)TOK_SIZE;
- lTagAlloc = (LONG)(2*TOK_SIZE);
- } /* endif */
- if(!fOK){
- throw ;//new Exception();
+ pStrings = std::make_unique(std::move(w_src),std::move(w_trg));
}
- //pStrings = input;
- //usNormLen = pStrings->getNormStr().length();
- }
-
- TMX_SENTENCE(wchar_t* w_src): TMX_SENTENCE(std::move(w_src), L""){}
-
- ~TMX_SENTENCE(){
- //if(pStrings){
- // delete pStrings;
- // pStrings = nullptr;
- //}
- //if(pPropString){
- // delete pPropString;
- // pPropString = nullptr;
- //}
- //if(pPropString) pPropString.reset();
- //if(pStrings) pStrings.reset();
- UtlAlloc( (PVOID *) &pTermTokens, 0L, 0L, NOMSG );
- UtlAlloc( (PVOID *) &pTagRecord, 0L, 0L, NOMSG );
- UtlAlloc( (PVOID *) &pulVotes, 0L, 0L, NOMSG );
- UtlAlloc( (PVOID *) &pAddString, 0L, 0L, NOMSG );
- UtlAlloc( (PVOID *) &pTermTokens, 0L, 0L, NOMSG );
+ bool fOK = true;
+ pulVotes.reserve(ABS_VOTES / sizeof(pulVotes[0]));
+ pTagRecord.reserve(2 * TOK_SIZE);
+ pTagRecord.resize(sizeof(TMX_TAGTABLE_RECORD));
+ pTermTokens.reserve(TOK_SIZE / sizeof(pTermTokens[0]));
}
- bool wasParsedSuccessfully()const {return pStrings && pStrings->isParsed(); }
-};
-using PTMX_SENTENCE = TMX_SENTENCE *;
+ explicit TMX_SENTENCE(const wchar_t* w_src) : TMX_SENTENCE(std::wstring(w_src), L"") {}
-//#pragma pack(pop)
-//#pragma pack()
+ bool wasParsedSuccessfully() const { return pStrings && pStrings->isParsed(); }
+};
+using PTMX_SENTENCE = TMX_SENTENCE *;
+// #pragma pack(pop)
+// #pragma pack()
-//#pragma pack(pop)
-//#pragma pack()
+// #pragma pack(pop)
+// #pragma pack()
typedef struct _TMX_REPLTAGPAIR
{
- PBYTE pSrcTok; // token for paired toks
- PBYTE pPropTok;
- BOOL fUsed; //TRUE = Tag pair has been used in replacement already
-} TMX_REPLTAGPAIR, * PTMX_REPLTAGPAIR;
+ PBYTE pSrcTok; // token for paired toks
+ PBYTE pPropTok;
+ BOOL fUsed; // TRUE = Tag pair has been used in replacement already
+} TMX_REPLTAGPAIR, *PTMX_REPLTAGPAIR;
typedef struct _TMX_SUBSTPROP
{
- CHAR_W szSource [ MAX_SEGMENT_SIZE ]; // source segment
- CHAR_W szPropSource[ MAX_SEGMENT_SIZE ]; // source proposal
- CHAR_W szPropTarget[ MAX_SEGMENT_SIZE ]; // translation of proposal
- char szSourceLanguage[MAX_LANG_LENGTH];// source language
- char szSourceTagTable[MAX_FNAME]; // source tagtable
- char szTargetLanguage[MAX_LANG_LENGTH];// target language
- char szPropTagTable[MAX_FNAME]; // tagtable for proposal
- PBYTE pTokSource; // token buffer for source tokens
- PBYTE pTokPropSource; // token buffer for proposal tokens
- PBYTE pTokPropTarget; // token buffer for proposal target ..
- //PTMX_TAGTABLE_RECORD pTagsSource; // tag table record for source ..
- //PTMX_TAGTABLE_RECORD pTagsPropSource; // tag table record for prop source
- //PTMX_TAGTABLE_RECORD pTagsPropTarget; // tag table record for prop target
- CHAR_W chBuffer[ MAX_SEGMENT_SIZE * 2 ]; // generic token buffer
+ CHAR_W szSource[MAX_SEGMENT_SIZE]; // source segment
+ CHAR_W szPropSource[MAX_SEGMENT_SIZE]; // source proposal
+ CHAR_W szPropTarget[MAX_SEGMENT_SIZE]; // translation of proposal
+ char szSourceLanguage[MAX_LANG_LENGTH]; // source language
+ char szSourceTagTable[MAX_FNAME]; // source tagtable
+ char szTargetLanguage[MAX_LANG_LENGTH]; // target language
+ char szPropTagTable[MAX_FNAME]; // tagtable for proposal
+ CHAR_W chBuffer[MAX_SEGMENT_SIZE * 2]; // generic token buffer
USHORT usTokenSource; // number of source tokens
USHORT usTokenPropSource; // number of prop source tokens
USHORT usTokenPropTarget; // number of prop target tokens
- ULONG ulRandom[MAX_RANDOM]; // random sequence number
- PTMX_REPLTAGPAIR pTagPairs; // tags to be replaced by each other
- PTMX_REPLTAGPAIR pDelTagPairs; // tags to be deleted in prop
-} TMX_SUBSTPROP, * PTMX_SUBSTPROP;
-
-
+ ULONG ulRandom[MAX_RANDOM]; // random sequence number
+} TMX_SUBSTPROP, *PTMX_SUBSTPROP;
//=======================================================================
typedef struct _TMX_PREFIX_IN
{
- USHORT usLengthInput; //length of complete input structure
- USHORT usTmCommand; //TM command id
-} TMX_PREFIX_IN, * PTMX_PREFIX_IN, XIN, * PXIN;
+ USHORT usLengthInput; // length of complete input structure
+ USHORT usTmCommand; // TM command id
+} TMX_PREFIX_IN, *PTMX_PREFIX_IN, XIN, *PXIN;
typedef struct _TMX_PUT_W
{
- CHAR_W szSource[MAX_SEGMENT_SIZE]; //source sentence
- CHAR_W szTarget[MAX_SEGMENT_SIZE]; //target sentence
- CHAR szSourceLanguage[MAX_LANG_LENGTH]; //language name of source
- CHAR szTargetLanguage[MAX_LANG_LENGTH]; //language name of target
- CHAR szAuthorName[MAX_LANG_LENGTH]; //author name of target
- USHORT usTranslationFlag; /* type of translation, 0 = human, 1 = machine, 2 = GobalMemory */
- CHAR szFileName[MAX_FILESPEC]; //where source comes from name+ext
- LONG_FN szLongName; // name of source file (long name or EOS)
- ULONG ulSourceSegmentId; //seg. num. of source sentence from analysis
- CHAR szTagTable[MAX_FNAME]; //tag table name
- TIME_L lTime; //time stamp
- CHAR_W szContext[MAX_SEGMENT_SIZE]; //segment context
- CHAR_W szAddInfo[MAX_SEGMENT_SIZE]; // additional segment information
- BOOL fMarkupChanged; // Markup does not exist, changed to OTMUTF8 during import
-} TMX_PUT_W, * PTMX_PUT_W;
-
-
+ CHAR_W szSource[MAX_SEGMENT_SIZE]; // source sentence
+ CHAR_W szTarget[MAX_SEGMENT_SIZE]; // target sentence
+ CHAR szSourceLanguage[MAX_LANG_LENGTH]; // language name of source
+ CHAR szTargetLanguage[MAX_LANG_LENGTH]; // language name of target
+ CHAR szAuthorName[MAX_LANG_LENGTH]; // author name of target
+ USHORT usTranslationFlag; /* type of translation, 0 = human, 1 = machine, 2 = GobalMemory */
+ CHAR szFileName[MAX_FILESPEC]; // where source comes from name+ext
+ LONG_FN szLongName; // name of source file (long name or EOS)
+ ULONG ulSourceSegmentId; // seg. num. of source sentence from analysis
+ CHAR szTagTable[MAX_FNAME]; // tag table name
+ TIME_L lTime; // time stamp
+ CHAR_W szContext[MAX_SEGMENT_SIZE]; // segment context
+ CHAR_W szAddInfo[MAX_SEGMENT_SIZE]; // additional segment information
+ BOOL fMarkupChanged; // Markup does not exist, changed to OTMUTF8 during import
+} TMX_PUT_W, *PTMX_PUT_W;
typedef struct _TMX_GET_W
{
- CHAR_W szSource[MAX_SEGMENT_SIZE]; //source sentence
- CHAR szTagTable[MAX_FNAME]; //tag table name of source
- CHAR szSourceLanguage[MAX_LANG_LENGTH]; //language of source
- CHAR szFileName[MAX_FILESPEC]; //file name the source comes from
- LONG_FN szLongName; // name of source file (long name or EOS)
- ULONG ulSegmentId; //segment number from analysis
- CHAR szAuthorName[MAX_LANG_LENGTH]; //author name
- CHAR szTargetLanguage[MAX_LANG_LENGTH]; //language of translation
- USHORT usRequestedMatches; //number of requested matches
- USHORT usMatchThreshold; //threshold for match level
- USHORT usConvert; //how the output should be converted
- ULONG ulParm; //for future use, xmp. GET_ONLY_MT_MATCHES, GET_ONLY_EXACT_MATCHES...)
- CHAR_W szContext[MAX_SEGMENT_SIZE]; //segment context
- CHAR_W szAddInfo[MAX_SEGMENT_SIZE]; // additional segment information
- ULONG ulSrcOemCP;
- ULONG ulTgtOemCP;
- PVOID pvReplacementList; // ptr to a SGML-DITA replacement list or NULL
- PVOID pvGMOptList; // ptr to a global memory option list or NULL
- bool fSourceLangIsPrefered;
- bool fTargetLangIsPrefered;
-} TMX_GET_W, * PTMX_GET_W;
-
+ CHAR_W szSource[MAX_SEGMENT_SIZE]{}; // source sentence
+ CHAR szTagTable[MAX_FNAME]{}; // tag table name of source
+ CHAR szSourceLanguage[MAX_LANG_LENGTH]{}; // language of source
+ LONG_FN szLongName{}; // name of source file (long name or EOS)
+ ULONG ulSegmentId = 0; // segment number from analysis
+ CHAR szAuthorName[MAX_LANG_LENGTH]{}; // author name
+ CHAR szTargetLanguage[MAX_LANG_LENGTH]{}; // language of translation
+ USHORT usRequestedMatches = 0; // number of requested matches
+ USHORT usMatchThreshold = 0; // threshold for match level
+ USHORT usConvert = 0; // how the output should be converted
+ ULONG ulParm = 0; // for future use, xmp. GET_ONLY_MT_MATCHES, GET_ONLY_EXACT_MATCHES...)
+ CHAR_W szContext[MAX_SEGMENT_SIZE]{}; // segment context
+ CHAR_W szAddInfo[MAX_SEGMENT_SIZE]{}; // additional segment information
+ PVOID pvReplacementList = nullptr; // ptr to a SGML-DITA replacement list or NULL
+ PVOID pvGMOptList = nullptr; // ptr to a global memory option list or NULL
+ bool fSourceLangIsPrefered = false;
+ bool fTargetLangIsPrefered = false;
+ bool fForceFuzzySearch = false;
+} TMX_GET_W, *PTMX_GET_W;
//=======================================================================
// structure TMX_GET_OUT
-typedef struct _TMX_MATCH_TABLE_W
+struct TMX_MATCH_TABLE_W
{
- CHAR_W szSource[MAX_SEGMENT_SIZE]; //source sentence with tags
- CHAR szFileName[MAX_FILESPEC]; //file name where the source comes from.
- LONG_FN szLongName; // name of source file (long name or EOS)
- ULONG ulSegmentId; //segment number from analysis
- CHAR_W szTarget[MAX_SEGMENT_SIZE]; //target sentence with tags
- CHAR szTargetLanguage[MAX_LANG_LENGTH]; //language of translation
- CHAR szOriginalSrcLanguage[MAX_LANG_LENGTH]; //language of src of translation
- USHORT usTranslationFlag; /* type of translation, 0 = human, 1 = machine, 2 = GobalMemory */
- CHAR szTargetAuthor[OTMPROPOSAL_MAXNAMELEN]; //author name of target
- TIME_L lTargetTime; //time stamp of target
- USHORT usMatchLevel; //similarity of the source
- int iWords;
- int iDiffs;
- USHORT usOverlaps; //temp field - nr of overlapping triples
- CHAR szTagTable[MAX_FNAME]; //tag table name of source
- ULONG ulKey; // key of match
- USHORT usTargetNum; // number of target
- USHORT usDBIndex; // number of memory in current hierarchy
- CHAR_W szContext[MAX_SEGMENT_SIZE]; // segment context info
- CHAR_W szAddInfo[MAX_SEGMENT_SIZE]; // additional segment information
- USHORT usContextRanking; // context ranking from user exit context processing
- USHORT usMatchInfo; // for future use: special info for match
-} TMX_MATCH_TABLE_W, * PTMX_MATCH_TABLE_W;
-
-using TMX_GET_OUT_W = struct _TMX_GET_OUT_W : public TMX_EXT_OUT_W
+ CHAR_W szSource[MAX_SEGMENT_SIZE]{}; // source sentence with tags
+ LONG_FN szLongName{}; // name of source file (long name or EOS)
+ ULONG ulSegmentId{}; // segment number from analysis
+ CHAR_W szTarget[MAX_SEGMENT_SIZE]{}; // target sentence with tags
+ CHAR szTargetLanguage[MAX_LANG_LENGTH]{}; // language of translation
+ CHAR szOriginalSrcLanguage[MAX_LANG_LENGTH]{}; // language of src of translation
+ USHORT usTranslationFlag{}; /* type of translation, 0 = human, 1 = machine, 2 = GobalMemory */
+ CHAR szTargetAuthor[OTMPROPOSAL_MAXNAMELEN]{}; // author name of target
+ TIME_L lTargetTime{}; // time stamp of target
+ USHORT usMatchLevel{}; // similarity of the source
+ int iWords{};
+ int iDiffs{};
+ USHORT usOverlaps{}; // temp field - nr of overlapping triples
+ CHAR szTagTable[MAX_FNAME]{}; // tag table name of source
+ LONG lKey{}; // key of match
+ USHORT usTargetNum{}; // number of target
+ USHORT usDBIndex{}; // number of memory in current hierarchy
+ CHAR_W szContext[MAX_SEGMENT_SIZE]{}; // segment context info
+ CHAR_W szAddInfo[MAX_SEGMENT_SIZE]{}; // additional segment information
+ USHORT usContextRanking{}; // context ranking from user exit context processing
+ USHORT usMatchInfo{}; // for future use: special info for match
+
+ bool sameTMLocation(LONG recordKey, USHORT targetKey)const{
+ return recordKey == lKey && targetKey == usTargetNum;
+ }
+
+ bool isLocationAlreadyAdded(USHORT elementsAdded, LONG recordKey, USHORT targetKey){//use this function only with the pointer to the first element
+ bool matchExists = std::any_of(
+ this, this + elementsAdded,
+ [&](const TMX_MATCH_TABLE_W& entry) {
+ return entry.sameTMLocation(recordKey, targetKey);
+ });
+ return matchExists;
+ }
+};
+
+using PTMX_MATCH_TABLE_W = TMX_MATCH_TABLE_W*;
+
+struct TMX_GET_OUT_W : public TMX_EXT_OUT_W
{
- //TMX_PREFIX_OUT stPrefixOut; //prefix of Output buffer
- USHORT usNumMatchesFound; //number of matches found
- TMX_MATCH_TABLE_W stMatchTable[MAX_MATCHES]; //match structure
- USHORT fsAvailFlags; // additional flags (more exact/fuzzy matches avail)
+ USHORT usNumMatchesFound = 0; // number of matches found
+ TMX_MATCH_TABLE_W stMatchTable[MAX_MATCHES]{}; // match structure
+ USHORT fsAvailFlags = 0; // additional flags (more exact/fuzzy matches avail)
std::vector tokens;
+ TMX_GET_OUT_W(){}
};
using PTMX_GET_OUT_W = TMX_GET_OUT_W *;
-
-
-
-
-
//=======================================================================
/**********************************************************************/
/* Attention: for special names mode of TMExtract, the TMX_EXT_IN */
@@ -1706,13 +1751,13 @@ using PTMX_GET_OUT_W = TMX_GET_OUT_W *;
/* names are available than fit into the output buffers. */
/* The remining fields are unused. */
/**********************************************************************/
-//structure TMX_EXT_IN
+// structure TMX_EXT_IN
typedef struct _TMX_EXT_IN
{
- ULONG ulTmKey; //tm get to get
- USHORT usConvert; //how the output is to appear
- USHORT usNextTarget; //which target record to address next
-} TMX_EXT_IN, * PTMX_EXT_IN;
+ LONG lTmKey{}; // tm get to get
+ USHORT usConvert{}; // how the output is to appear
+ USHORT usNextTarget{}; // which target record to address next
+} TMX_EXT_IN, *PTMX_EXT_IN;
typedef TMX_EXT_IN TMX_EXT_IN_W, *PTMX_EXT_IN_W;
//=======================================================================
@@ -1730,656 +1775,516 @@ typedef TMX_EXT_IN TMX_EXT_IN_W, *PTMX_EXT_IN_W;
// structure TMX_EXT_OUT
class EqfMemoryPlugin;
-class Dummy{};
+class Dummy
+{
+};
class RequestData;
-
-#define ASD_ORGANIZE 0x100 // work in organize mode
+#define ASD_ORGANIZE 0x100 // work in organize mode
std::string StatusToString(int eStatus);
#include
-class EqfMemory //: public TMX_CLB
-/*! \brief This class implements the standard translation memory (EQF) for OpenTM2.
-*/
-{
-
- USHORT LoadMem();
+namespace EqfMemoryError {
+ constexpr int ERROR_INTERNALKEY_MISSING = 1001;
+ constexpr int ERROR_MEMORYOBJECTISNULL = 8003;
+ constexpr int INFO_ENDREACHED = 8008;
+ constexpr int ERROR_ENTRYISCORRUPTED = 8009;
+}
-public:
- std::recursive_timed_mutex tmMutex;
- //bool fOpen = false;
+struct EqfMemoryState{
BTREE TmBtree;
BTREE InBtree;
TMX_TABLE Languages;
- TMX_TABLE FileNames;
TMX_TABLE Authors;
TMX_TABLE TagTables;
+ TMX_TABLE LangGroups; // table containing language group names
+ std::vector psLangIdToGroupTable; // language ID to group ID table
+
+ size_t expectedSizeInRam = 0;
+ bool fCorrupted = false;
USHORT usAccessMode = 0;
- USHORT usThreshold = 0;
TMX_SIGN stTmSign;
- BYTE bCompact[MAX_COMPACT_SIZE-1];
- BYTE bCompactChanged = 0;
- LONG alUpdCounter[MAX_UPD_COUNTERS];
- PTMX_LONGNAME_TABLE pLongNames = nullptr;
- TMX_TABLE LangGroups; // table containing language group names
- PSHORT psLangIdToGroupTable = nullptr; // language ID to group ID table
- LONG lLangIdToGroupTableSize = 0; // size of table (alloc size)
- LONG lLangIdToGroupTableUsed = 0; // size of table (bytes in use)
- PVOID pTagTable = nullptr; // tag table loaded for segment markup (TBLOADEDTABLE)
+ std::vector bCompact;
+ BYTE bCompactChanged = 0;
+ PVOID pTagTable = nullptr; // tag table loaded for segment markup (TBLOADEDTABLE)
// copy of long name table sorted ignoring the case of the file names
// Note: only the stTableEntry array is filled in this area, for all other
// information use the entries in the pLongNames structure
- PTMX_LONGNAME_TABLE pLongNamesCaseIgnore = nullptr;
+ // std::vector pLongNamesCaseIgnore;
+ TMX_LONGNAME_TABLE LongNames, LongNamesCaseIgnore;
// fields for work area pointers of various subfunctions which are allocated
// only once for performance reasons
- PVOID pvTempMatchList = nullptr; // matchlist of FillMatchEntry function
- PVOID pvIndexRecord = nullptr; // index record area of FillMatchEntry function
- PVOID pvTmRecord = nullptr; // buffer for memory record used by GetFuzzy and GetExact
- ULONG ulRecBufSize = 0; // current size of pvTMRecord;
-
- // fields for time measurements and logging
- BOOL fTimeLogging = 0; // TRUE = Time logging is active
- LONG64 lAllocTime = 0; // time for memory allocation
- LONG64 lTokenizeTime = 0; // time for tokenization
- LONG64 lGetExactTime = 0; // time for GetExact
- LONG64 lOtherTime = 0; // time for other activities
- LONG64 lGetFuzzyTime = 0; // time for GetFuzzy
- LONG64 lFuzzyOtherTime = 0; // other time spent in GetFuzzy
- LONG64 lFuzzyTestTime = 0; // FuzzyTest time spent in GetFuzzy
- LONG64 lFuzzyGetTime = 0; // NTMGet time spent in GetFuzzy
- LONG64 lFuzzyFillMatchEntry = 0; // FillMatchEntry time spent in GetFuzzy
- LONG64 lFillMatchAllocTime = 0; // FillMatchEntry: allocation time
- LONG64 lFillMatchOtherTime = 0; // FillMatchEntry: other times
- LONG64 lFillMatchReadTime = 0; // FillMatchEntry: read index DB time
- LONG64 lFillMatchFillTime = 0; // FillMatchEntry: fill match list time
- LONG64 lFillMatchCleanupTime = 0; // FillMatchEntry: cleanup match list time
- LONG64 lFillMatchFill1Time = 0; // FillMatchEntry: fill match list time
- LONG64 lFillMatchFill2Time = 0; // FillMatchEntry: fill match list time
- LONG64 lFillMatchFill3Time = 0; // FillMatchEntry: fill match list time
- LONG64 lFillMatchFill4Time = 0; // FillMatchEntry: fill match list time
-
- //std::shared_ptr readOnlyPtr;
- //std::shared_ptr writePtr;
+ std::vector pvTempMatchList; // matchlist of FillMatchEntry function
+ std::vector pvTmRecord; // buffer for memory record used by GetFuzzy and GetExact
+
+};
+
+class EqfMemory //: public TMX_CLB
+/*! \brief This class implements the standard translation memory (EQF) for OpenTM2.
+ */
+
+{
+public:
+ std::recursive_timed_mutex tmMutex;
+
+ std::unique_ptr state;
+
std::shared_ptr readOnlyCnt;
std::shared_ptr writeCnt;
+ RequestData *pActiveRequest;
+ COMMAND activeCommand = UNKNOWN_COMMAND;
+ time_t tLastAccessTime = 0; // last time memory has been used
+ MEMORY_STATUS eStatus; // status of the memory
+ MEMORY_STATUS eImportStatus; // status of the current/last memory import
+ std::unique_ptr importDetails;
- //std::weak_ptr pActiveRequest;
- RequestData* pActiveRequest;
- int lastErrorCode = 0;
+ std::string strError; // pointer to an error message (only when eStatus is IMPORT_FAILED_STATUS)
- size_t expectedSizeInRam = 0;
+ std::string szName; // name of the memory
+ std::string szDescription; // description of the memory
+ std::string szSourceLanguage; // memory source language
- int getErrorCode()const;
- int setErrorCode(int rc);
- void reserErrorCode();
+
+//methods
+
+ /*! \brief Constructors
+ */
+
+ /*! \brief Destructor
+ */
+ ~EqfMemory();
+
+ USHORT Load();
+
+ int sign(){
+ return state->TmBtree.EQFNTMSign(state->stTmSign);
+ }
COMMAND getActiveRequestCommand();
void setActiveRequest(std::weak_ptr request);
- void setActiveRequest(RequestData* request);
+ void setActiveRequest(RequestData *request);
void resetActiveRequest();
-
- COMMAND activeCommand = UNKNOWN_COMMAND;
+
void setActiveRequestCommand(COMMAND command);
void resetActiveRequestCommand();
- void setExpecedSizeInRAM(size_t newSize){
- expectedSizeInRam = newSize;
+ void setExpecedSizeInRAM(size_t newSize)
+ {
+ state->expectedSizeInRam = newSize;
}
- size_t getExpectedSizeInRAM()const{
- return expectedSizeInRam;
+ size_t getExpectedSizeInRAM() const
+ {
+ return state->expectedSizeInRam;
}
-
- std::string getStatusString()const;
- std::string getActiveRequestString()const;
- bool isWaitingToBeLoaded()const{
+ std::string getStatusString() const;
+ std::string getActiveRequestString() const;
+
+ bool isWaitingToBeLoaded() const
+ {
return WAITING_FOR_LOADING_STATUS == eStatus;
}
- bool isLoading()const{
+ bool isLoading() const
+ {
return LOADING_STATUS == eStatus;
}
- bool isLoaded()const{
+ bool isLoaded() const
+ {
return OPEN_STATUS == eStatus;
}
- bool isFailedToLoad()const{
+ bool isFailedToLoad() const
+ {
return FAILED_TO_OPEN_STATUS == eStatus;
}
- bool isReorganizeRunning()const{
+ bool isCorrupted()const{
+ return state->fCorrupted;
+ }
+
+ bool isReorganizeRunning() const
+ {
return REORGANIZE_RUNNING_STATUS == eStatus;
}
- bool isImportRunning()const{
+ bool isImportRunning() const
+ {
return IMPORT_RUNNING_STATUS == eStatus;
}
- //bool fReorganizeOnly = false;
- bool isOpenedOnlyForReorganize()const{
- return usAccessMode & ASD_ORGANIZE;
+ // bool fReorganizeOnly = false;
+ bool isOpenedOnlyForReorganize() const
+ {
+ return state->usAccessMode & ASD_ORGANIZE;
}
- void resetOpenedOnlyForReorganize(){
+ void resetOpenedOnlyForReorganize()
+ {
unsigned int mask = ~ASD_ORGANIZE;
- usAccessMode &= mask;
+ state->usAccessMode &= mask;
+ state->fCorrupted = false;
}
- void updateLastUseTime(){
+ void updateLastUseTime()
+ {
tLastAccessTime = time(0);
}
-/*! \brief OtmMemory related return codes
-
-*/
- static const int ERROR_INTERNALKEY_MISSING = 1001;
-
-/*! \brief Constructors
-*/
-
+ BYTE getMajorVersion()const{
+ return state->stTmSign.bMajorVersion;
+ }
-/*! \brief Destructor
-*/
- ~EqfMemory();
+ ushort TmtXDelSegm(
+ OtmProposal &pTmDelIn, // ptr to input struct
+ TMX_EXT_OUT_W *pTmDelOut // ptr to output struct
+ );
- USHORT Load();
-
-/*! \brief Info structure for an open translation memory
-*/
- //typedef struct _OPENEDMEMORY
- //{
- //char szName[260]; // name of the memory
- time_t tLastAccessTime = 0; // last time memory has been used
- long lHandle = 0; // memory handle
- MEMORY_STATUS eStatus; // status of the memory
- MEMORY_STATUS eImportStatus; // status of the current/last memory import
- //std::atomic dImportProcess;
- //ushort * pusImportPersent = nullptr;
- ImportStatusDetails* importDetails = nullptr;
- std::string strError; // pointer to an error message (only when eStatus is IMPORT_FAILED_STATUS)
-
- PPROP_NTM memoryProperties;
- /*! \brief structure for memory information */
- // typedef struct _MEMORYINFO
- // {
-
- // } MEMORYINFO, *PMEMORYINFO;
-//} OPENEDMEMORY ;
-
-/*! \brief Error code definition
-*/
- static const int ERROR_MEMORYOBJECTISNULL = 8003;
- static const int ERROR_BUFFERTOOSMALL = 8004;
- static const int ERROR_INVALIDOBJNAME = 8005;
- static const int ERROR_MEMORYEXISTS = 8006;
- static const int INFO_ENDREACHED = 8008;
- static const int ERROR_ENTRYISCORRUPTED = 8009;
+ USHORT TmtXDelSegmByKey(
+ OtmProposal &TmDelIn, // ptr to input struct
+ TMX_EXT_OUT_W *pTmDelOut // ptr to output struct
+ );
+ USHORT FindTargetAndDelete(
+ BytesRef TmRecord,
+ OtmProposal &TmDel,
+ TMX_EXT_OUT_W *pTmExtOut,
+ LONG& lKey);
- /*! \brief Flags for the update of proposals */
+ USHORT FindTargetByKeyAndDelete(
+ BytesRef pTmRecord,
+ OtmProposal &pTmDel,
+ PTMX_SENTENCE pSentence,
+ TMX_EXT_OUT_W *pTmExtOut,
+ LONG& lKey);
- static const int UPDATE_MARKUP = 0x01; // update markup/tag table
- static const int UPDATE_MTFLAG = 0x02; // update machine translation flag
- static const int UPDATE_TARGLANG = 0x04; // update target language
- static const int UPDATE_DATE = 0x08; // update proposal update time
+ USHORT TokenizeSource(PTMX_SENTENCE, PSZ, PSZ);
- //void setInternalCursor(ULONG recordKey, USHORT targetKey);
- //void resetInternalCursor();
+
+ bool areLangsMatching(const ushort langId1, const ushort langId2, const char* langStr1);//, bool fPrefferedLang1);
- ushort TmtXDelSegm
-(
- OtmProposal& pTmDelIn, //ptr to input struct
- TMX_EXT_OUT_W* pTmDelOut //ptr to output struct
-);
+ USHORT NTMGetIDFromName(PSZ, USHORT, PUSHORT,
+ LONG options = 0);
-USHORT TmtXDelSegmByKey
-(
- OtmProposal& TmDelIn, //ptr to input struct
- TMX_EXT_OUT_W* pTmDelOut //ptr to output struct
-);
+ USHORT NTMGetNameFromID(const USHORT, USHORT, PSZ, SHORT maxBuffLen = -1, bool fSuppressLogsAndResetValueIfNotFound = false);
+ USHORT NTMGetPointersToTable(USHORT, PTMX_TABLE *,
+ PTMX_TABLE_ENTRY *);
+ USHORT NTMAddNameToTable(PSZ, USHORT, PUSHORT, bool fUseProvidedId = false);
+
+ USHORT FillClb(BytesRef, OtmProposal &);
+ USHORT ComparePutData(
+ BytesRef ppTmRecord, // ptr to ptr of tm record data buffer
+ OtmProposal &TmProposal, // pointer to get in data
+ LONG& lKey // tm key
+ );
+ USHORT AddTmTarget(
+ OtmProposal &TmProposal, // pointer to get in data
+ BytesRef pTmRecord, // pointer to tm record data pointer
+ LONG& lKey); // tm key
-USHORT FindTargetAndDelete( PTMX_RECORD pTmRecord,
- OtmProposal& TmDel,
- TMX_EXT_OUT_W * pTmExtOut,
- PULONG pulKey );
-
-USHORT FindTargetByKeyAndDelete(
- PTMX_RECORD pTmRecord,
- OtmProposal& pTmDel,
- PTMX_SENTENCE pSentence,
- TMX_EXT_OUT_W * pTmExtOut,
- PULONG pulKey );
-
-
-USHORT TokenizeSource( PTMX_SENTENCE, PSZ, PSZ );
-
-USHORT NTMGetIDFromName( PSZ, PSZ, USHORT, PUSHORT );
-USHORT NTMGetIDFromNameEx
-(
- PSZ pszName, // input, name being looked up
- PSZ pszLongName, // input, long name (only for FILE_KEY)
- USHORT usTableType, // input, type of table to use
- PUSHORT pusID, // output, ID for name being looked up
- LONG lOptions,
- PUSHORT pusAlternativeID // output, alternative ID
-);
-USHORT NTMGetNameFromID( PUSHORT, USHORT, PSZ, PSZ );
-USHORT NTMGetPointersToTable( USHORT, PTMX_TABLE *,
- PTMX_TABLE_ENTRY * );
-USHORT NTMAddNameToTable( PSZ, USHORT, PUSHORT );
-PSZ NTMFindNameForID(
- PUSHORT pusID, //intput
- USHORT usTableType );
-
-USHORT FillClb( PTMX_TARGET_CLB, OtmProposal& );
-USHORT ComparePutData
-(
- PTMX_RECORD *ppTmRecord, // ptr to ptr of tm record data buffer
- PULONG pulRecBufSize, // current size of record buffer
- OtmProposal& TmProposal, // pointer to get in data
- PULONG pulKey // tm key
-);
-USHORT AddTmTarget(
- OtmProposal& TmProposal, //pointer to get in data
- PTMX_RECORD *ppTmRecord, //pointer to tm record data pointer
- PULONG pulRecBufSize, //ptr to current size of TM record buffer
- PULONG pulKey ); //tm key
+ /*! \brief Store the supplied proposal in the memory
+ When the proposal aready exists it will be overwritten with the supplied data
-/*! \brief Store the supplied proposal in the memory
- When the proposal aready exists it will be overwritten with the supplied data
+ \param pProposal pointer to a OtmProposal object
- \param pProposal pointer to a OtmProposal object
+ \returns 0 or error code in case of errors
+ */
+ int putProposal(
+ OtmProposal &Proposal);
- \returns 0 or error code in case of errors
-*/
- int putProposal
- (
- OtmProposal &Proposal
- );
-
- //fuzzy search
- USHORT TmtXGet
- (
- PTMX_GET_W pTmGetIn, //ptr to input struct
- PTMX_GET_OUT_W pTmGetOut //ptr to output struct
+ // fuzzy search
+ USHORT TmtXGet(
+ PTMX_GET_W pTmGetIn, // ptr to input struct
+ PTMX_GET_OUT_W pTmGetOut // ptr to output struct
);
- // TM segment update prototypes
- USHORT TmtXUpdSeg
- (
- OtmProposal* pTmPutIn, // ptr to put input data
- PTMX_EXT_OUT_W pTmPutOut, //ptr to output struct
- USHORT usFlags // flags controlling the updated fields
- );
- USHORT TmtXExtract
- (
- PTMX_EXT_IN_W pTmExtIn, //ptr to input struct
- TMX_EXT_OUT_W * pTmExtOut //ptr to output struct
- );
- //tm extract prototypes
- USHORT FillExtStructure( PTMX_TARGET_RECORD,
- PTMX_TARGET_CLB,
- PSZ_W, PLONG, PTMX_EXT_OUT_W );
+ USHORT TmtXExtract(
+ PTMX_EXT_IN_W pTmExtIn, // ptr to input struct
+ TMX_EXT_OUT_W *pTmExtOut // ptr to output struct
+ );
+ // tm extract prototypes
+ USHORT FillExtStructure(PTMX_TARGET_RECORD,
+ PTMX_TARGET_CLB,
+ std::wstring&, PLONG, PTMX_EXT_OUT_W, PBYTE);
int RewriteCompactTable();
-
-/*! \brief Get the next proposal from the memory (with progress info)
- \param lHandle the hande returned by GetFirstProposal
- \param Proposal reference to a OtmProposal object which will be filled with the proposal data
- \param piProgress pointer to buffer for progress indicator, this indicator goes from 0 up to 100
- \returns 0 or error code in case of errors
-*/
- int getNextProposal
- (
- OtmProposal &Proposal,
- int *piProgress = nullptr
- );
-
- /*! \brief Get the current sequential access key (the key for the next proposal in the memory)
- \param pszKeyBuffer pointer to the buffer to store the sequential access key
- \param iKeyBufferSize size of the key buffer in number of characters
- \returns 0 or error code in case of errors
+
+ /*! \brief Get the next proposal from the memory (with progress info)
+ \param lHandle the hande returned by GetFirstProposal
+ \param Proposal reference to a OtmProposal object which will be filled with the proposal data
+ \param piProgress pointer to buffer for progress indicator, this indicator goes from 0 up to 100
+ \returns 0 or error code in case of errors
*/
- int getSequentialAccessKey
- (
- char *pszKeyBuffer,
- int iKeyBufferSize
- );
+ int getNextProposal(
+ OtmProposal &Proposal,
+ int *piProgress = nullptr);
+
+ /*! \brief Get the current sequential access key (the key for the next proposal in the memory)
+ \param pszKeyBuffer pointer to the buffer to store the sequential access key
+ \param iKeyBufferSize size of the key buffer in number of characters
+ \returns 0 or error code in case of errors
+*/
+ int getSequentialAccessKey(
+ char *pszKeyBuffer,
+ int iKeyBufferSize);
+ USHORT AddToTm(OtmProposal &, LONG&);
+ USHORT UpdateTmIndex(PTMX_SENTENCE, ULONG);
- USHORT AddToTm( OtmProposal&, PULONG );
- USHORT UpdateTmIndex( PTMX_SENTENCE, ULONG );
+ void importDone(int iRC, char *pszError);
+ void reorganizeDone(int iRC, char *pszError);
- void importDone(int iRC, char *pszError );
- void reorganizeDone(int iRC, char *pszError );
-
/*! \brief Set the current sequential access key to resume the sequential access at the given position
\param pszKey a sequential access key previously returned by getSequentialAccessKey
- \returns 0 or error code in case of errors
+ \returns 0 or error code in case of errors
*/
- int setSequentialAccessKey
- (
- char *pszKey
- );
-
- size_t GetRAMSize()const;
- size_t GetExpectedRAMSize()const;
-
- USHORT ExtractRecordV6
- (
- PTMX_RECORD pTmRecord,
- PTMX_EXT_IN_W pTmExtIn,
- TMX_EXT_OUT_W * pTmExtOut
- );
+ int setSequentialAccessKey(
+ char *pszKey);
+ size_t GetRAMSize() const;
+ size_t GetExpectedRAMSize() const;
- USHORT TmtXReplace
- (
- OtmProposal& TmProposal, //ptr to input struct
- PTMX_EXT_OUT_W pTmPutOut //ptr to output struct
- );
-
-USHORT NTMLoadNameTable
-(
- ULONG ulTableKey, // key of table record
- PTMX_TABLE pTMTable, // ptr to table data pointer
- PULONG pulSize // ptr to buffer for size of table data
-);
-
-/*! \brief Get a list of memory proposals matching the given search key
+ USHORT ExtractRecord(
+ BytesRef pTmRecord,
+ PTMX_EXT_IN_W pTmExtIn,
+ TMX_EXT_OUT_W *pTmExtOut);
- This method uses the search data contained in the search key to find one or more
- matching proposals in the memory. At least the szSource and the szTargetLang members of the
- search key have to be filled by the caller.
- The caller provides a list of OtmProposals which will be filled with the data of the matching
- proposals. The number of requested proposals is determined by the number
- of proposals in the list.
-
- \param SearchKey proposal containing search string and meta data
- \param FoundProposals refernce to vector with OtmProposal objects
- \param ulOptions options for the lookup
-
- \returns 0 or error code in case of errors
-*/
- int SearchProposal
- (
- OtmProposal &SearchKey,
- std::vector &FoundProposals,
- unsigned long ulOptions
- );
-
- USHORT UpdateTmRecord( OtmProposal& );
-
- USHORT UpdateTmRecordByInternalKey
- (
- OtmProposal&
+ USHORT TmtXReplace(
+ OtmProposal &TmProposal, // ptr to input struct
+ PTMX_EXT_OUT_W pTmPutOut // ptr to output struct
);
-
- int getNumOfMarkupNames();
-/*! \brief Get markup name at position n [n = 0.. GetNumOfMarkupNames()-1]
- \param iPos position of markup table name
- \param pszBuffer pointer to a buffer for the markup table name
- \param iSize size of buffer in number of characters
- \returns number of characters copied to buffer
-*/
- int getMarkupName
- (
- int iPos,
- char *pszBuffer,
- int iSize
+ USHORT NTMLoadNameTable(
+ LONG lTableKey, // key of table record
+ PTMX_TABLE pTMTable // ptr to table data pointer
);
+ /*! \brief Get a list of memory proposals matching the given search key
-/*! \brief Get language at position n [n = 0.. GetNumOfLanguages()-1]
- \param iPos position of language
- \param pszBuffer pointer to a buffer for the document name
- \param iSize size of buffer in number of characters
- \returns number of characters copied to buffer
-*/
- int getLanguage
- (
- int iPos,
- char *pszBuffer,
- int iSize
- );
+ This method uses the search data contained in the search key to find one or more
+ matching proposals in the memory. At least the szSource and the szTargetLang members of the
+ search key have to be filled by the caller.
+ The caller provides a list of OtmProposals which will be filled with the data of the matching
+ proposals. The number of requested proposals is determined by the number
+ of proposals in the list.
+ \param SearchKey proposal containing search string and meta data
+ \param FoundProposals refernce to vector with OtmProposal objects
+ \param ulOptions options for the lookup
+ \returns 0 or error code in case of errors
+ */
+ int SearchProposal(
+ OtmProposal &SearchKey,
+ std::vector &FoundProposals,
+ unsigned long ulOptions);
-/*! \brief Get source language of the memory
- \param pszBuffer pointer to a buffer for the source language name
- \param iSize size of buffer in number of characters
- \returns number of characters copied to the buffer
-*/
- int getSourceLanguage
- (
- char *pszBuffer,
- int iSize
- );
+ USHORT UpdateTmRecord(OtmProposal &);
-/*! \brief Get the name of the memory
- \param pszBuffer pointer to a buffer for the name
- \param iSize size of buffer in number of characters
- \returns number of characters copied to the buffer
-*/
- int getName
- (
- char *pszBuffer,
- int iSize
- );
+ int getNumOfMarkupNames();
+
+ /*! \brief Get markup name at position n [n = 0.. GetNumOfMarkupNames()-1]
+ \param iPos position of markup table name
+ \param pszBuffer pointer to a buffer for the markup table name
+ \param iSize size of buffer in number of characters
+ \returns number of characters copied to buffer
+ */
+ int getMarkupName(
+ int iPos,
+ char *pszBuffer,
+ int iSize);
+
+ /*! \brief Get language at position n [n = 0.. GetNumOfLanguages()-1]
+ \param iPos position of language
+ \param pszBuffer pointer to a buffer for the document name
+ \param iSize size of buffer in number of characters
+ \returns number of characters copied to buffer
+ */
+ int getLanguage(
+ int iPos,
+ char *pszBuffer,
+ int iSize);
+
+ /*! \brief Get source language of the memory
+ \param pszBuffer pointer to a buffer for the source language name
+ \param iSize size of buffer in number of characters
+ \returns number of characters copied to the buffer
+ */
+ int getSourceLanguage(
+ char *pszBuffer,
+ int iSize);
+
+ /*! \brief Get the name of the memory
+ \param pszBuffer pointer to a buffer for the name
+ \param iSize size of buffer in number of characters
+ \returns number of characters copied to the buffer
+ */
+ int getName(
+ char *pszBuffer,
+ int iSize);
/*! \brief Get the name of the memory
\param strName reference of a string receiving the memory name
*/
- int getName
- (
- std::string &strName
- );
-
+ int getName(
+ std::string &strName);
-/*! \brief Get description of the memory
- \param pszBuffer pointer to a buffer for the description
- \param iSize size of buffer in number of characters
- \returns number of characters copied to the buffer
-*/
- int getDescription
- (
- char *pszBuffer,
- int iSize
- );
+ /*! \brief Get description of the memory
+ \param pszBuffer pointer to a buffer for the description
+ \param iSize size of buffer in number of characters
+ \returns number of characters copied to the buffer
+ */
+ int getDescription(
+ char *pszBuffer,
+ int iSize);
/*! \brief Set the description of the memory
\param pszBuffer pointer to the description text
*/
- void setDescription
- (
- char *pszBuffer
- );
+ void setDescription(
+ char *pszBuffer);
-/*! \brief Get plugin responsible for this memory
- \returns pointer to memory plugin object
-*/
+ /*! \brief Get plugin responsible for this memory
+ \returns pointer to memory plugin object
+ */
void *getPlugin();
-
-/*! \brief Get overall file size of this memory
- \returns size of memory in number of bytes
-*/
- unsigned long getFileSize();
-
-/*! \brief Get the error message for the last error occured
-
- \param strError reference to a string receiving the error mesage text
- \returns last error code
-*/
- int getLastError
- (
- std::string &strError
- );
-/*! \brief Get the error message for the last error occured
-
- \param pszError pointer to a buffer for the error text
- \param iBufSize size of error text buffer in number of characters
- \returns last error code
-*/
- int getLastError
- (
- char *pszError,
- int iBufSize
- );
-
-/*! \brief Set or clear the pointer to a loaded global memory option file
+ /*! \brief Get overall file size of this memory
+ \returns size of memory in number of bytes
+ */
+ unsigned long getFileSize();
- This method sets a pointer to a loaded global memory option file.
- When set the option file will be used to decide how global memory proposals will be processed.
+ /*! \brief Get the error message for the last error occured
- \param pvGlobalMemoryOptions pointer to a loaded global memory option file or NULL to clear the current option file pointer
+ \param strError reference to a string receiving the error mesage text
+ \returns last error code
+ */
+ int getLastError(
+ std::string &strError);
+ /*! \brief Get the error message for the last error occured
- \returns 0 or error code in case of errors
-*/
- int setGlobalMemoryOptions
- (
- void *pvGlobalMemoryOptions
- );
+ \param pszError pointer to a buffer for the error text
+ \param iBufSize size of error text buffer in number of characters
+ \returns last error code
+ */
+ int getLastError(
+ char *pszError,
+ int iBufSize);
- std::string strLastError;
- int iLastError = 0;
- void *pvGlobalMemoryOptions = nullptr; // pointert to global memory options to be used for global memory proposals
-public:
- char szPlugin[256]; // name of the plugin controlling this memory
- char szName[256]; // name of the memory
- char szDescription[256]; // description of the memory
- char szFullPath[256]; // full path to memory file(s) (if applicable only)
- char szFullDataFilePath[256]; // full path to memory file(s) (if applicable only)
- char szFullIndexFilePath[256]; // full path to memory file(s) (if applicable only)
- char szSourceLanguage[MAX_LANG_LENGTH+1]; // memory source language
- char szOwner[256]; // ID of the memory owner
- char szDescrMemoryType[256]; // descriptive name of the memory type
- unsigned long ulSize = 0; // size of the memory
- BOOL fEnabled = 0; // memory-is-enabled flag
-
- std::string getName()const { return szName; }
+ std::string getName() const { return szName; }
// functions dealing with long document tables
USHORT NTMCreateLongNameTable();
USHORT NTMReadLongNameTable();
USHORT NTMWriteLongNameTable();
USHORT NTMDestroyLongNameTable();
- USHORT NTMCreateLangGroupTable();
- USHORT NTMAddLangGroup( PSZ pszLang, USHORT sLangID );
- USHORT NTMOrganizeIndexFile();
-//private:
-/*! \brief Fill OtmProposal from TMX_GET_OUT_W structure
- \param ulKey key of record containing the proposal
- \param usTargetNum number of target within record
- \param Proposal reference to the OtmProposal being filled
- \returns 0 or error code in case of errors
-*/
-int SetProposalKey
-(
- ULONG ulKey,
- USHORT usTargetNum,
- OtmProposal *pProposal
-);
+ USHORT AddToLongNameTables(const char* pszLongName,PUSHORT pusID, bool fGenerateId =true, PSZ positionInReadBuffer = nullptr);
+ USHORT WriteLongNameTablesToTheTM();
+ USHORT SortLongNameTables();
-/*! \brief Fill OtmProposal from TMX_GET_OUT_W structure
- \param pExtOut pointer to the TMX_GET_OUT_W structure
- \param Proposal reference to the OtmProposal being filled
- \returns 0 or error code in case of errors
-*/
-int ExtOutToOtmProposal
-(
- TMX_EXT_OUT_W* pExtOut,
- OtmProposal &Proposal
-);
-
-/*! \brief Fill OtmProposal from TMX_MATCH_TABLE_W structure
- \param pMatch pointer to the TMX_MATCH_TABLE_W structure
- \param Proposal reference to the OtmProposal being filled
- \returns 0 or error code in case of errors
-*/
-int MatchToOtmProposal
-(
- PTMX_MATCH_TABLE_W pMatch,
- OtmProposal *pProposal
-);
+ USHORT NTMCreateLangGroupTable();
+ USHORT NTMAddLangGroup(PSZ pszLang, USHORT sLangID);
+ USHORT NTMOrganizeIndexFile();
+ // private:
+ /*! \brief Fill OtmProposal from TMX_GET_OUT_W structure
+ \param ulKey key of record containing the proposal
+ \param usTargetNum number of target within record
+ \param Proposal reference to the OtmProposal being filled
+ \returns 0 or error code in case of errors
+ */
+ int SetProposalKey(
+ LONG lKey,
+ USHORT usTargetNum,
+ OtmProposal *pProposal);
+
+ /*! \brief Fill OtmProposal from TMX_GET_OUT_W structure
+ \param pExtOut pointer to the TMX_GET_OUT_W structure
+ \param Proposal reference to the OtmProposal being filled
+ \returns 0 or error code in case of errors
+ */
+ int ExtOutToOtmProposal(
+ TMX_EXT_OUT_W *pExtOut,
+ OtmProposal &Proposal);
+
+ /*! \brief Fill OtmProposal from TMX_MATCH_TABLE_W structure
+ \param pMatch pointer to the TMX_MATCH_TABLE_W structure
+ \param Proposal reference to the OtmProposal being filled
+ \returns 0 or error code in case of errors
+ */
+ int MatchToOtmProposal(
+ PTMX_MATCH_TABLE_W pMatch,
+ OtmProposal *pProposal);
+
+ /*! \brief Fill TMX_GET_W structure with OtmProposal data
+ \param Proposal reference to the OtmProposal containing the data
+ \param pGetIn pointer to the TMX_GET_W structure
+ \returns 0 or error code in case of errors
+ */
+ int OtmProposalToGetIn(
+ OtmProposal &Proposal,
+ PTMX_GET_W pGetIn);
-/*! \brief Fill TMX_GET_W structure with OtmProposal data
- \param Proposal reference to the OtmProposal containing the data
- \param pGetIn pointer to the TMX_GET_W structure
- \returns 0 or error code in case of errors
-*/
-int OtmProposalToGetIn
-(
- OtmProposal &Proposal,
- PTMX_GET_W pGetIn
-);
+ int OtmProposalToPutIn(
+ OtmProposal &Proposal,
+ PTMX_PUT_W pPutIn);
-int OtmProposalToPutIn
-(
- OtmProposal &Proposal,
- PTMX_PUT_W pPutIn
-);
+ /// newTM code
+ EqfMemory(const std::string &tmName);
-/// newTM code
-public:
- EqfMemory(const std::string& tmName);
bool IsLoadedInRAM();
- int ReloadFromDisk();
+ int Reload(bool lockFromDisk);
int UnloadFromRAM();
- int FlushFilebuffers(MutexTimeout& tmLockTimeout);
+ int FlushFilebuffers(MutexTimeout &tmLockTimeout);
-private:
};
-
-OtmProposal::eProposalType FlagToProposalType( USHORT usTranslationFlag );
+OtmProposal::eProposalType FlagToProposalType(USHORT usTranslationFlag);
BYTE ProposalTypeToFlag(OtmProposal::eProposalType t);
-USHORT TmGetServerDrives( PDRIVES_IN pDrivesIn, // Pointer to DRIVES_IN struct
- PDRIVES_OUT pDrivesOut, // Pointer to DRIVES_OUT struct
- USHORT usMsgHandling );// Message handling parameter
-USHORT TmGetServerDrivesHwnd( PDRIVES_IN, PDRIVES_OUT, USHORT, HWND );
-USHORT TmGetServerTMs( PFILE_LIST_IN pTmListIn, // Pointer to FILE_LIST_IN struct !!! CHM
- PFILE_LIST_OUT pTmListOut, // Pointer to FILE_LIST_OUT struct !!! CHM
- USHORT usMsgHandling ); // Message handling parameter
-USHORT TmGetTMPart( HTM htm, // Memory database handle
- PSZ pszMemPat, // Full translation memory path
- PGETPART_IN pGetPartIn, // Pointer to GETPART_IN struct
- PGETPART_OUT pGetPartOut, // Pointer to GETPART_OUT struct
- USHORT usMsgHandling ); // Message handling parameter
-USHORT TmSendTMProp( SERVERNAME szServer, // Servername
- PSZ pszMemName, // Translation memory name
- USHORT usMsgHandling ); // Message handling parameter
-USHORT TmReceiveTMProp( SERVERNAME szServer, // Servername
- PSZ pszMemName, // Translation memory name
- USHORT usMsgHandling ); // Message handling parameter
-
-//use this define as usMsgHandling for special handling of greyedout TMs
+USHORT TmGetServerDrives(PDRIVES_IN pDrivesIn, // Pointer to DRIVES_IN struct
+ PDRIVES_OUT pDrivesOut, // Pointer to DRIVES_OUT struct
+ USHORT usMsgHandling); // Message handling parameter
+USHORT TmGetServerDrivesHwnd(PDRIVES_IN, PDRIVES_OUT, USHORT, HWND);
+USHORT TmGetServerTMs(PFILE_LIST_IN pTmListIn, // Pointer to FILE_LIST_IN struct !!! CHM
+ PFILE_LIST_OUT pTmListOut, // Pointer to FILE_LIST_OUT struct !!! CHM
+ USHORT usMsgHandling); // Message handling parameter
+USHORT TmGetTMPart(HTM htm, // Memory database handle
+ PSZ pszMemPat, // Full translation memory path
+ PGETPART_IN pGetPartIn, // Pointer to GETPART_IN struct
+ PGETPART_OUT pGetPartOut, // Pointer to GETPART_OUT struct
+ USHORT usMsgHandling); // Message handling parameter
+USHORT TmSendTMProp(SERVERNAME szServer, // Servername
+ PSZ pszMemName, // Translation memory name
+ USHORT usMsgHandling); // Message handling parameter
+USHORT TmReceiveTMProp(SERVERNAME szServer, // Servername
+ PSZ pszMemName, // Translation memory name
+ USHORT usMsgHandling); // Message handling parameter
+
+// use this define as usMsgHandling for special handling of greyedout TMs
#define DELETE_GREYEDOUT 2
-USHORT TmDeleteFile( SERVERNAME szServer, // Servername
- PSZ pszFilePath, // Full file path
- USHORT usMsgHandling ); // Message handling parameter
-USHORT TmGetServerFileInfo( SERVERNAME szServer, //Servername
- PSZ pszFilePath, //Full file path
- PFILEFINDBUF pstFile, // File info
- USHORT usMsgHandling ); // Message handling parameter
-USHORT TmGetServerFileInfoHwnd( SERVERNAME, PSZ, PFILEFINDBUF, USHORT, HWND );
-USHORT TmCompareLocalRemoteProperties( SERVERNAME, PSZ, USHORT );
-USHORT MemRcHandling( USHORT, PSZ, HTM *, PSZ );
-USHORT MemRcHandlingHwnd( USHORT, PSZ, HTM *, PSZ, HWND );
+USHORT TmDeleteFile(SERVERNAME szServer, // Servername
+ PSZ pszFilePath, // Full file path
+ USHORT usMsgHandling); // Message handling parameter
+USHORT TmGetServerFileInfo(SERVERNAME szServer, // Servername
+ PSZ pszFilePath, // Full file path
+ PFILEFINDBUF pstFile, // File info
+ USHORT usMsgHandling); // Message handling parameter
+USHORT TmGetServerFileInfoHwnd(SERVERNAME, PSZ, PFILEFINDBUF, USHORT, HWND);
+USHORT TmCompareLocalRemoteProperties(SERVERNAME, PSZ, USHORT);
+USHORT MemRcHandling(USHORT, PSZ, HTM *, PSZ);
+USHORT MemRcHandlingHwnd(USHORT, PSZ, HTM *, PSZ, HWND);
/**********************************************************************/
/* MemReadWriteSegment */
@@ -2392,89 +2297,87 @@ USHORT MemRcHandlingHwnd( USHORT, PSZ, HTM *, PSZ, HWND );
// TMRWS_NOMSG: show no error message at all
// TMRWS_ALLMSG: show all error messages
// TMRWS_WRITEMSG: show only error messages for write segment (for TM organize!)
-#define TMRWS_NOMSG 0
-#define TMRWS_ALLMSG 1
+#define TMRWS_NOMSG 0
+#define TMRWS_ALLMSG 1
#define TMRWS_WRITEMSG 2
-USHORT NTMReadWriteSegmentW( HTM, //Handle of Input TM
- PSZ, //Full path to Input TM
- HTM, //Handle of Output TM
- PSZ, //Full path to Output TM
- PTMX_EXT_IN_W,//Pointer to the EXTRACT_IN structure
- TMX_EXT_OUT_W *, //Pointer to the EXTRACT_OUT structure
- PTMX_PUT_W, //Pointer to the REPLACE_OUT structure
- PTMX_EXT_OUT_W, //Pointer to the REPLACE_OUT structure
- ULONG *, //Pointer to a segment counter
- ULONG *, //Pointer to the invalid segment counter
- PSZ, //pointer to TM source language
- USHORT ); //message handling flags
-USHORT NTMReadWriteSegmentHwndW( HTM, //Handle of Input TM
- PSZ, //Full path to Input TM
- HTM, //Handle of Output TM
- PSZ, //Full path to Output TM
- PTMX_EXT_IN_W, //Pointer to the EXTRACT_IN structure
- TMX_EXT_OUT_W *, //Pointer to the EXTRACT_OUT structure
- PTMX_PUT_W, //Pointer to the REPLACE_OUT structure
- PTMX_EXT_OUT_W, //Pointer to the REPLACE_OUT structure
- ULONG *, //Pointer to a segment counter
- ULONG *, //Pointer to the invalid segment counter
- PSZ, //pointer to TM source language
- USHORT, //message handling flags
- HWND ); //handle for error messages parent
-
-
-
-BOOL fMemIsAvail( PSZ, PSZ, PSZ ); // memory is available and accessible
-USHORT MemFillCBNames( HWND, PSZ, PSZ );
-USHORT MemFillTableLB( HWND hListBox, USHORT usBoxType, PSZ pszLastUsed );
+USHORT NTMReadWriteSegmentW(HTM, // Handle of Input TM
+ PSZ, // Full path to Input TM
+ HTM, // Handle of Output TM
+ PSZ, // Full path to Output TM
+ PTMX_EXT_IN_W, // Pointer to the EXTRACT_IN structure
+ TMX_EXT_OUT_W *, // Pointer to the EXTRACT_OUT structure
+ PTMX_PUT_W, // Pointer to the REPLACE_OUT structure
+ PTMX_EXT_OUT_W, // Pointer to the REPLACE_OUT structure
+ ULONG *, // Pointer to a segment counter
+ ULONG *, // Pointer to the invalid segment counter
+ PSZ, // pointer to TM source language
+ USHORT); // message handling flags
+USHORT NTMReadWriteSegmentHwndW(HTM, // Handle of Input TM
+ PSZ, // Full path to Input TM
+ HTM, // Handle of Output TM
+ PSZ, // Full path to Output TM
+ PTMX_EXT_IN_W, // Pointer to the EXTRACT_IN structure
+ TMX_EXT_OUT_W *, // Pointer to the EXTRACT_OUT structure
+ PTMX_PUT_W, // Pointer to the REPLACE_OUT structure
+ PTMX_EXT_OUT_W, // Pointer to the REPLACE_OUT structure
+ ULONG *, // Pointer to a segment counter
+ ULONG *, // Pointer to the invalid segment counter
+ PSZ, // pointer to TM source language
+ USHORT, // message handling flags
+ HWND); // handle for error messages parent
+
+BOOL fMemIsAvail(PSZ, PSZ, PSZ); // memory is available and accessible
+USHORT MemFillCBNames(HWND, PSZ, PSZ);
+USHORT MemFillTableLB(HWND hListBox, USHORT usBoxType, PSZ pszLastUsed);
/**********************************************************************/
/* TmOpen */
/**********************************************************************/
-USHORT TmOpen( PSZ, HTM *, USHORT, USHORT, //(in) location: TM_LOCAL
- // TM_REMOTE
- // TM_LOCAL_REMOTE
- USHORT, //(in) message handling parameter
- // TRUE: display error message
- // FALSE: display no error message
- HWND ); //(in) window handle for error messages
+USHORT TmOpen(PSZ, HTM *, USHORT, USHORT, //(in) location: TM_LOCAL
+ // TM_REMOTE
+ // TM_LOCAL_REMOTE
+ USHORT, //(in) message handling parameter
+ // TRUE: display error message
+ // FALSE: display no error message
+ HWND); //(in) window handle for error messages
/**********************************************************************/
/* TmClose */
/**********************************************************************/
USHORT
-TmClose( HTM, //(in) TM handle returned from open
- PSZ, //(in) full TM name x:\eqf\mem\mem.mem
- USHORT, //(in) message handling parameter
- // TRUE: display error message
- // FALSE: display no error message
- HWND ); //(in) window handle for error messages
+TmClose(HTM, //(in) TM handle returned from open
+ PSZ, //(in) full TM name x:\eqf\mem\mem.mem
+ USHORT, //(in) message handling parameter
+ // TRUE: display error message
+ // FALSE: display no error message
+ HWND); //(in) window handle for error messages
/**********************************************************************/
/* TmReplace */
/**********************************************************************/
USHORT
-TmReplace( HTM, PSZ, PTMX_PUT_W, PTMX_EXT_OUT_W, USHORT, HWND );
+TmReplace(HTM, PSZ, PTMX_PUT_W, PTMX_EXT_OUT_W, USHORT, HWND);
/**********************************************************************/
/* TmGet */
/**********************************************************************/
USHORT
-TmGetW(EqfMemory*, //(in) TM handle
- PSZ, //(in) full TM name x:\eqf\mem\mem.tmd
+TmGetW(EqfMemory *, //(in) TM handle
+ PSZ, //(in) full TM name x:\eqf\mem\mem.tmd
PTMX_GET_W, //(in) pointer to get input structure
- PTMX_GET_OUT_W, //(out) pointer to get output structure
- USHORT ); //(in) message handling parameter
- // TRUE: display error message
- // FALSE: display no error message
+ PTMX_GET_OUT_W, //(out) pointer to get output structure
+ USHORT); //(in) message handling parameter
+ // TRUE: display error message
+ // FALSE: display no error message
/**********************************************************************/
/* TmExtract */
/**********************************************************************/
USHORT
-TmExtractW( HTM, PSZ, PTMX_EXT_IN_W, TMX_EXT_OUT_W *, USHORT );
+TmExtractW(HTM, PSZ, PTMX_EXT_IN_W, TMX_EXT_OUT_W *, USHORT);
USHORT
-TmExtractHwndW( HTM, PSZ, PTMX_EXT_IN_W, TMX_EXT_OUT_W *, USHORT, HWND );
+TmExtractHwndW(HTM, PSZ, PTMX_EXT_IN_W, TMX_EXT_OUT_W *, USHORT, HWND);
/**********************************************************************/
/* information levels for TmInfo function call */
@@ -2485,319 +2388,282 @@ TmExtractHwndW( HTM, PSZ, PTMX_EXT_IN_W, TMX_EXT_OUT_W *, USHORT, HWND );
/**********************************************************************/
/* TmDeleteTM */
/**********************************************************************/
-USHORT TmDeleteTM( PSZ, USHORT, HWND, PUSHORT );
+USHORT TmDeleteTM(PSZ, USHORT, HWND, PUSHORT);
/**********************************************************************/
/* TmDeleteSegment */
/**********************************************************************/
USHORT
-TmDeleteSegmentW( HTM, PSZ, PTMX_PUT_W, PTMX_EXT_OUT_W, USHORT );
-
-
+TmDeleteSegmentW(HTM, PSZ, PTMX_PUT_W, PTMX_EXT_OUT_W, USHORT);
/**********************************************************************/
/* NTMConvertCRLF */
/**********************************************************************/
VOID
-NTMConvertCRLF( PSZ,
- PSZ,
- USHORT );
-VOID NTMConvertCRLFW( PSZ_W, PSZ_W, USHORT );
-
+ NTMConvertCRLF(PSZ,
+ PSZ,
+ USHORT);
+VOID NTMConvertCRLFW(PSZ_W, PSZ_W, USHORT);
/**********************************************************************/
/* NTMOpenProperties */
/**********************************************************************/
USHORT
-NTMOpenProperties( HPROP *,
- PVOID *,
- PSZ,
- PSZ,
- USHORT,
- BOOL );
-
-
-
+NTMOpenProperties(HPROP *,
+ PVOID *,
+ PSZ,
+ PSZ,
+ USHORT,
+ BOOL);
// Update specific parts of segment
// flags controlling the updated segment parts
-#define TMUPDSEG_MARKUP 0x01 // update markup/tag table
-#define TMUPDSEG_MTFLAG 0x02 // update MT flag
-#define TMUPDSEG_TARGLANG 0x04 // update target language
-#define TMUPDSEG_DATE 0x08 // update segment time
-
-
-USHORT TmUpdSegW
-(
- HTM htm, //(in) TM handle
- PSZ szMemPath, //(in) full TM name x:\eqf\mem\mem
- PTMX_PUT_W pstPutIn, //(in) pointer to put input structure
- ULONG ulUpdKey, //(in) key of record being updated
- USHORT usUpdTarget, //(in) number of target being updated
- USHORT usFlags, //(in) flags controlling the updated fields
- USHORT usMsgHandling //(in) message handling parameter
- // TRUE: display error message
- // FALSE: display no error message
+#define TMUPDSEG_MARKUP 0x01 // update markup/tag table
+#define TMUPDSEG_MTFLAG 0x02 // update MT flag
+#define TMUPDSEG_TARGLANG 0x04 // update target language
+#define TMUPDSEG_DATE 0x08 // update segment time
+
+USHORT TmUpdSegW(
+ HTM htm, //(in) TM handle
+ PSZ szMemPath, //(in) full TM name x:\eqf\mem\mem
+ PTMX_PUT_W pstPutIn, //(in) pointer to put input structure
+ ULONG ulUpdKey, //(in) key of record being updated
+ USHORT usUpdTarget, //(in) number of target being updated
+ USHORT usFlags, //(in) flags controlling the updated fields
+ USHORT usMsgHandling //(in) message handling parameter
+ // TRUE: display error message
+ // FALSE: display no error message
);
-USHORT TmUpdSegHwndW
-(
- HTM htm, //(in) TM handle
- PSZ szMemPath, //(in) full TM name x:\eqf\mem\mem
- PTMX_PUT_W pstPutIn, //(in) pointer to put input structure
- ULONG ulUpdKey, //(in) key of record being updated
- USHORT usUpdTarget, //(in) number of target being updated
- USHORT usFlags, //(in) flags controlling the updated fields
- USHORT usMsgHandling, //(in) message handling parameter
- // TRUE: display error message
- // FALSE: display no error message
- HWND hwnd //(in) handle for error messages
-);
-
-
-
-// structure for MT_TMMERGE pointer
-typedef struct _MT_TMMERGE
-{
- CHAR chMemory[MAX_EQF_PATH]; // TM name to be merged into
- CHAR chSGMLFile[MAX_EQF_PATH]; // external memory
- OBJNAME szObjName; // document object name
- HWND hwndNotify; // parent to be notified
- CHAR szTargetLang[MAX_LANG_LENGTH];
- OBJNAME szFolObjName; // object name of folder
-} MT_TMMERGE, *PMT_TMMERGE;
-
-BOOL MTTMMergeStart
-(
- PLISTCOMMAREA pCommArea,
- PMT_TMMERGE pTMMerge
+USHORT TmUpdSegHwndW(
+ HTM htm, //(in) TM handle
+ PSZ szMemPath, //(in) full TM name x:\eqf\mem\mem
+ PTMX_PUT_W pstPutIn, //(in) pointer to put input structure
+ ULONG ulUpdKey, //(in) key of record being updated
+ USHORT usUpdTarget, //(in) number of target being updated
+ USHORT usFlags, //(in) flags controlling the updated fields
+ USHORT usMsgHandling, //(in) message handling parameter
+ // TRUE: display error message
+ // FALSE: display no error message
+ HWND hwnd //(in) handle for error messages
);
-
// return codes of function MemConvertMem
// memory converted successfully
-#define MEM_CONVERTMEM_SUCCESS 0
+#define MEM_CONVERTMEM_SUCCESS 0
// memory conversion not required, memory is in new format already
#define MEM_CONVERTMEM_ALREADYNEWFORMAT 7001
-
// do a cleanup of temporary memories
-void TMCleanupTempMem
-(
- PSZ pszPrefix // ptr to memory prefix
+void TMCleanupTempMem(
+ PSZ pszPrefix // ptr to memory prefix
);
// create a temporary memory
-USHORT TMCreateTempMem
-(
- PSZ pszPrefix, // short prefix to be used for memory name (should start with a dollar sign)
- PSZ pszMemPath, // ptr to buffer for memory path
- HTM *pHtm, // ptr to buffer for memory handle
- HTM htm, // htm of similar memory
- PSZ pszSourceLang, // memory source language
- HWND hwnd // window handle for error messages
+USHORT TMCreateTempMem(
+ PSZ pszPrefix, // short prefix to be used for memory name (should start with a dollar sign)
+ PSZ pszMemPath, // ptr to buffer for memory path
+ HTM *pHtm, // ptr to buffer for memory handle
+ HTM htm, // htm of similar memory
+ PSZ pszSourceLang, // memory source language
+ HWND hwnd // window handle for error messages
);
// delete a temporary memory
-void TMDeleteTempMem
-(
- PSZ pszMemPath // ptr to memory path
+void TMDeleteTempMem(
+ PSZ pszMemPath // ptr to memory path
);
-BOOL TMFuzzynessEx
-(
- PSZ pszMarkup, // markup table name
- PSZ_W pszSource, // original string
- PSZ_W pszMatch, // found match
- SHORT sLanguageId, // language id to be used
- PUSHORT pusFuzzy, // fuzzyness
- ULONG ulOemCP,
- PUSHORT pusWords, // number of words in segment
- PUSHORT pusDiffs // number of diffs in segment
+BOOL TMFuzzynessEx(
+ PSZ pszMarkup, // markup table name
+ PSZ_W pszSource, // original string
+ PSZ_W pszMatch, // found match
+ SHORT sLanguageId, // language id to be used
+ PUSHORT pusFuzzy, // fuzzyness
+ PUSHORT pusWords, // number of words in segment
+ PUSHORT pusDiffs // number of diffs in segment
);
-
-USHORT NTMMorphTokenizeW( SHORT, PSZ_W, PULONG, PVOID*, USHORT);
-
-BOOL NTMTagSubst // generic inline tagging for TM
-(
- PTMX_SUBSTPROP pSubstProp,
- ULONG ulSrcOemCP,
- ULONG ulTgtOemCP
+/**********************************************************************/
+/* Structure to access MORPH_FLAG_OFFSLIST type term lists */
+/**********************************************************************/
+typedef struct _FLAGOFFSLIST
+{
+ LONG lFlags; // flags of term
+ USHORT usLen; // length of term
+ USHORT usOffs; // offset of term
+} FLAGOFFSLIST, *PFLAGOFFSLIST;
+
+USHORT NTMMorphTokenizeW(SHORT, PSZ_W, std::vector &);
+
+USHORT MorphAddTermToList2W(
+ std::vector &pList, // ptr to term list pointer
+ PSZ_W pszTerm, // ptr to new term being added to list
+ USHORT usLength, // length of term
+ USHORT usOffs, // offset of term
+ ULONG ulFlags // flags for the ter
);
-BOOL NTMDocMatch( PSZ pszShort1, PSZ pszLong1, PSZ pszShort2, PSZ pszLong2 );
-
-
-void NTMFreeSubstProp( PTMX_SUBSTPROP pSubstProp );
+BOOL NTMDocMatch(PSZ pszLong1, PSZ pszLong2);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*! tm.h Internal header file for Translation Memory functions
- Copyright (c) 1990-2016, International Business Machines Corporation and others. All rights reserved.
+ Copyright (c) 1990-2016, International Business Machines Corporation and others. All rights reserved.
*/
-//#ifndef _EQFTMI_H_
-//#define _EQFTMI_H_
+// #ifndef _EQFTMI_H_
+// #define _EQFTMI_H_
/**********************************************************************/
/* This include file requires EQFDDE.H!!! */
/**********************************************************************/
#ifndef EQFDDE_INCLUDED
- #include "EQFDDE.H"
+#include "EQFDDE.H"
#endif
// include external memory export/import interface
#include "EQFMEMIE.H"
-
#ifndef FIELDOFFSET
- #define FIELDOFFSET(type, field) (LOWORD(&(((type *)0)->field)))
+#define FIELDOFFSET(type, field) (LOWORD(&(((type *)0)->field)))
#endif
// file extension used for shared memory (LAN based) property files in property directory
#define LANSHARED_MEM_PROP ".SLM"
-
/*---------------------------------------------------------------------*\
#Define
\*---------------------------------------------------------------------*/
// memory export and import formats
-#define MEM_SGMLFORMAT_ANSI 1
-#define MEM_SGMLFORMAT_ASCII 2
-#define MEM_SGMLFORMAT_UNICODE 3
-#define MEM_FORMAT_TMX 4
+#define MEM_SGMLFORMAT_ANSI 1
+#define MEM_SGMLFORMAT_ASCII 2
+#define MEM_SGMLFORMAT_UNICODE 3
+#define MEM_FORMAT_TMX 4
// the same define value is used for the import as TMX (Trados) and for export as TMX (UTF-8)
-#define MEM_FORMAT_TMX_UTF8 5
-#define MEM_FORMAT_TMX_TRADOS 5
+#define MEM_FORMAT_TMX_UTF8 5
+#define MEM_FORMAT_TMX_TRADOS 5
-#define MEM_FORMAT_TMX_NOCRLF 6
+#define MEM_FORMAT_TMX_NOCRLF 6
#define MEM_FORMAT_TMX_UTF8_NOCRLF 7
-#define MEM_FORMAT_XLIFF_MT 8
-
+#define MEM_FORMAT_XLIFF_MT 8
// filter for mem SGML formats (same sequence as memory export and import formats required)
-//#define MEM_FORMAT_FILTERS "SGML ANSI\0*.*\0SGML ASCII\0*.*\0SGML Unicode\0*.*\0\0\0"
+// #define MEM_FORMAT_FILTERS "SGML ANSI\0*.*\0SGML ASCII\0*.*\0SGML Unicode\0*.*\0\0\0"
#define MEM_FORMAT_FILTERS "SGML ANSI\0*.*\0SGML ASCII\0*.*\0SGML UTF-16\0*.*\0TMX\0*.*\0TMX (Trados)\0*.*\0XLIFF (MT)\0*.*\0\0\0"
// filter for mem SGML formats (same sequence as memory export and import formats required)
-//#define MEM_FORMAT_FILTERS_EXP "SGML ANSI\0*.*\0SGML ASCII\0*.*\0SGML Unicode\0*.*\0\0\0"
+// #define MEM_FORMAT_FILTERS_EXP "SGML ANSI\0*.*\0SGML ASCII\0*.*\0SGML Unicode\0*.*\0\0\0"
#define MEM_FORMAT_FILTERS_EXP "SGML ANSI (*.EXP)\0*.EXP\0SGML ASCII (*.EXP)\0*.EXP\0SGML UTF-16 (*.EXP)\0*.EXP\0TMX (UTF-16) (*.TMX)\0*.TMX\0TMX (UTF-8) (*.TMX)\0*.TMX\0TMX (UTF-16) (remove CRLF) (*.TMX)\0*.TMX\0TMX (UTF-8) (remove CRLF) (*.TMX)\0*.TMX\0\0\0"
// defines for retries in case of BTREE_IN_USE conditions
#define MAX_RETRY_COUNT 30
-#define MAX_WAIT_TIME 100
+#define MAX_WAIT_TIME 100
-#define TMT_CODE_VERSION 5 // Code version
-#define TM_PREFIX "EQFTMT$$" // TM DB identifier
-#define HUNDRED 100 //
+#define TMT_CODE_VERSION 5 // Code version
+#define TM_PREFIX "EQFTMT$$" // TM DB identifier
+#define HUNDRED 100 //
// ID to be used if a table overflow occurs
-#define OVERFLOW_ID 32000
+#define OVERFLOW_ID 32000
// name to be used if a table overflow occurs
-#define OVERFLOW_NAME "$$$$$$$$"
+#define OVERFLOW_NAME "$$$$$$$$"
-#define LAST_CLUSTER_NUMBER 4095
+#define LAST_CLUSTER_NUMBER 4095
//--- size of the message buffer for the Error message /*@1108A*/
//--- ERROR_MEM_SEGMENT_TOO_LARGE_CON /*@1108A*/
-#define MSG_BUFFER 35 /*@1108A*/
-
+#define MSG_BUFFER 35 /*@1108A*/
-#define MIN_SPOOL_SIZE 20480 // 20k bytes for preformatted TM blocks
-#define SECTOR_SIZE 4096 // Disk sector. Fixed now, dynamic later
-#define BLOCK_HEADER_SIZE 8 // size of block header
-#define MAX_TM_HEADER_SIZE 47600 // max size of TM header
-#define MAX_BLOCK_SIZE 4096 // Maximum block size
+#define MIN_SPOOL_SIZE 20480 // 20k bytes for preformatted TM blocks
+#define SECTOR_SIZE 4096 // Disk sector. Fixed now, dynamic later
+#define BLOCK_HEADER_SIZE 8 // size of block header
+#define MAX_TM_HEADER_SIZE 47600 // max size of TM header
+#define MAX_BLOCK_SIZE 4096 // Maximum block size
#define MAX_TEXT_TAB_SIZE (MAX_TAGS_TAB_ENTRIES * sizeof(TOKENENTRY))
#define MAX_WORDS_TAB_SIZE (MAX_WORDS_TAB_ENTRIES * sizeof(TOKENENTRY))
-#define MAX_TM_WORK_AREA ( MAX_TGT_LENGTH + 300 )
- /* Work areas to convert LF into CRFL */
- /* and the other way round */
+#define MAX_TM_WORK_AREA (MAX_TGT_LENGTH + 300)
+/* Work areas to convert LF into CRFL */
+/* and the other way round */
// The following define should not exceed 65535 Bytes
-#define MAX_TMT_GLOBALS_SIZE (sizeof(TMT_GLOBALS) +\
- MAX_TM_HEADER_SIZE +\
- MAX_BLOCK_SIZE+\
- MAX_TEXT_TAB_SIZE+\
- MAX_WORDS_TAB_SIZE)
+#define MAX_TMT_GLOBALS_SIZE (sizeof(TMT_GLOBALS) + \
+ MAX_TM_HEADER_SIZE + \
+ MAX_BLOCK_SIZE + \
+ MAX_TEXT_TAB_SIZE + \
+ MAX_WORDS_TAB_SIZE)
-
-#define MAX_WORDS_TAB_ENTRIES 200 /* Number of entries in WordsTable */
-#define MAX_TAGS_TAB_ENTRIES 100 /* number of entries in TextTable */
-#define KEY_DIR_ENTRIES_NUM 4096 /* number of entries key directory */
+#define MAX_WORDS_TAB_ENTRIES 200 /* Number of entries in WordsTable */
+#define MAX_TAGS_TAB_ENTRIES 100 /* number of entries in TextTable */
+#define KEY_DIR_ENTRIES_NUM 4096 /* number of entries key directory */
#define TOP_BLOCK_NUMBER (USHORT)65535
- /* 2**16 - 1, the max number of a block */
-#define MAX_BLOCKS_NUM (USHORT)65535
- /* 2**16 - 1, maximal number of blocks */
-#define GROUP_NUM 8 /* number of distribution groups */
-
-#define TAG_STARTING_VALUE 0 /* the lowest attribute to tags in text */
- /* table */
-#ifndef TM_ADM
-#define MAX_SERVER_NAME 15 /* length of server name */
+/* 2**16 - 1, the max number of a block */
+#define MAX_BLOCKS_NUM (USHORT)65535
+/* 2**16 - 1, maximal number of blocks */
+#define GROUP_NUM 8 /* number of distribution groups */
+
+#define TAG_STARTING_VALUE 0 /* the lowest attribute to tags in text */
+ /* table */
+#ifndef TM_ADM
+#define MAX_SERVER_NAME 15 /* length of server name */
#endif
/* The two defines below should not be used. Displacement can be */
/* computed in runtime from the structure. */
-#define SEG_LENGTH_DISP 5 /* disp of length field in a SEGMENT */
-#define DEL_FLAG_DISP 6 /* disp of del flag from segment start */
+#define SEG_LENGTH_DISP 5 /* disp of length field in a SEGMENT */
+#define DEL_FLAG_DISP 6 /* disp of del flag from segment start */
// data compress flag
-#define BOCU_COMPRESS 0x01
-
+#define BOCU_COMPRESS 0x01
/* define for write Tm Header function */
-#define WF_ALL 0x0000 /* Write the whole header............*/
-#define WF_CORRUPT 0x0001
-#define WF_TMBLOCKS 0x0002
-#define WF_FREEBLOCKS 0x0004
-#define WF_FIRSTAVAIL 0x0008
-#define WF_UPDATE 0x4000 /* Write all but the key directory...*/
-#define WF_KEYDIR 0x8000 /* Write the key directory...........*/
-
+#define WF_ALL 0x0000 /* Write the whole header............*/
+#define WF_CORRUPT 0x0001
+#define WF_TMBLOCKS 0x0002
+#define WF_FREEBLOCKS 0x0004
+#define WF_FIRSTAVAIL 0x0008
+#define WF_UPDATE 0x4000 /* Write all but the key directory...*/
+#define WF_KEYDIR 0x8000 /* Write the key directory...........*/
/*---------------------------------------------------------------------*\
match type definitions
\*---------------------------------------------------------------------*/
-#define USE_CRLF 1
-#define ALIGN_CRLF 2
-#define IGNORE_CRLF 3
+#define USE_CRLF 1
+#define ALIGN_CRLF 2
+#define IGNORE_CRLF 3
/* return codes for the Tmt Commands */
-#define OK NO_ERROR /* for Tmt commands */
-
-
+#define OK NO_ERROR /* for Tmt commands */
/*----------------------------------------------------------------------------*\
System wide lengthes for correction of the thresholds in dependency
of the length of the input segment
\*----------------------------------------------------------------------------*/
//@@@ // segments, defined thru LENGTH_SHORTER_VALUE
-#define LENGTH_SHORTER_VALUE 2 // Length for shorter segment
+#define LENGTH_SHORTER_VALUE 2 // Length for shorter segment
//@@@ // segments, defined thru LENGTH_SHORTER_VALUE
-#define LENGTH_SHORT_VALUE 6 // Length for short segment
-#define LENGTH_MEDIUM_VALUE 10 // Length for medium segment
-#define LENGTH_LONG_VALUE 20 // Length for long segment
+#define LENGTH_SHORT_VALUE 6 // Length for short segment
+#define LENGTH_MEDIUM_VALUE 10 // Length for medium segment
+#define LENGTH_LONG_VALUE 20 // Length for long segment
/*----------------------------------------------------------------------------*\
System wide percentages for correction of the MATCH threshold
\*----------------------------------------------------------------------------*/
-#define MATCH_PERCENTAGE_SHORT_VALUE 1L // percentage for short segment
-#define MATCH_PERCENTAGE_MEDIUM_VALUE 10L // percentage for medium segment
-#define MATCH_PERCENTAGE_LONG_VALUE 20L // percentage for long segment
-#define MATCH_PERCENTAGE_LONGER_VALUE 40L // percentage for longer segment
+#define MATCH_PERCENTAGE_SHORT_VALUE 1L // percentage for short segment
+#define MATCH_PERCENTAGE_MEDIUM_VALUE 10L // percentage for medium segment
+#define MATCH_PERCENTAGE_LONG_VALUE 20L // percentage for long segment
+#define MATCH_PERCENTAGE_LONGER_VALUE 40L // percentage for longer segment
/*----------------------------------------------------------------------------*\
System wide percentages for correction of the LENGTH threshold
\*----------------------------------------------------------------------------*/
-#define LENGTH_PERCENTAGE_SHORT_VALUE 1L // percentage for short segment
-#define LENGTH_PERCENTAGE_MEDIUM_VALUE 10L // percentage for medium segment
-#define LENGTH_PERCENTAGE_LONG_VALUE 20L // percentage for long segment
-#define LENGTH_PERCENTAGE_LONGER_VALUE 30L // percentage for longer segment
+#define LENGTH_PERCENTAGE_SHORT_VALUE 1L // percentage for short segment
+#define LENGTH_PERCENTAGE_MEDIUM_VALUE 10L // percentage for medium segment
+#define LENGTH_PERCENTAGE_LONG_VALUE 20L // percentage for long segment
+#define LENGTH_PERCENTAGE_LONGER_VALUE 30L // percentage for longer segment
/*---------------------------------------------------------------------*\
Macro Definition
@@ -2807,16 +2673,15 @@ void NTMFreeSubstProp( PTMX_SUBSTPROP pSubstProp );
/**********************************************************************/
/* macro to build index name from fully qualified data name */
/**********************************************************************/
-#define INDEXNAMEFROMMEMPATH( mem, ind ) \
- { \
- Utlstrccpy( ind, mem, DOT ); \
- if ( strcmp( strrchr( mem, DOT ), EXT_OF_SHARED_MEM ) == 0 ) \
- strcat( ind, EXT_OF_SHARED_MEMINDEX ); \
- else \
- strcat( ind, EXT_OF_TMINDEX ); \
+#define INDEXNAMEFROMMEMPATH(mem, ind) \
+ { \
+ Utlstrccpy(ind, mem, DOT); \
+ if (strcmp(strrchr(mem, DOT), EXT_OF_SHARED_MEM) == 0) \
+ strcat(ind, EXT_OF_SHARED_MEMINDEX); \
+ else \
+ strcat(ind, EXT_OF_TMINDEX); \
}
-
#include "EQFTAG.H"
/*---------------------------------------------------------------------*\
Typedefs Definition
@@ -2827,66 +2692,66 @@ void NTMFreeSubstProp( PTMX_SUBSTPROP pSubstProp );
CHAR buf[]
\*---------------------------------------------------------------------*/
-
-typedef struct _TM_HEADER_UPDATE { /* tmhu */
- BOOL fCorruption ;
- USHORT usNumTMBlocks, /* number of blocks in the TM */
- usNumFreeBlocks, /* # of free, pre-formatted blocks */
- usFirstAvailBlock;/* points to first available block */
+typedef struct _TM_HEADER_UPDATE
+{ /* tmhu */
+ BOOL fCorruption;
+ USHORT usNumTMBlocks, /* number of blocks in the TM */
+ usNumFreeBlocks, /* # of free, pre-formatted blocks */
+ usFirstAvailBlock; /* points to first available block */
} TM_HEADER_UPDATE;
-typedef union _UNIONIN
+typedef union _UNIONIN
{
- PREFIX_IN in;
- ADD_IN ain;
- DEL_IN din;
- REP_IN rin;
- EXT_IN ein;
- GET_IN gin;
- CLOSE_IN clin;
- OPEN_IN oin;
- CREATE_IN crin;
- INFO_IN infoin;
- CLOSEHANDLER_IN chin;
- EXIT_IN xin;
- DRIVES_IN drivesin;
- FILE_LIST_IN filelistin; // !!! CHM
- GETPART_IN getpartin;
- PUTPROP_IN putpropin;
- PUTDICTPROP_IN PutDictPropIn; // !!! CHM added
- PUTPROPCOMBINED_IN PutPropCombinedIn; // !!! CHM added
- GETPROP_IN getpropin;
- ENDORG_IN endorgin;
- DELTM_IN deltmin;
- DELFILE_IN delfilein;
- FILEINFO_IN fileinfoin;
- RENFILE_IN renfilein;
-} UNIONIN, * PUNIONIN; /* uin */
-
-typedef union _UNIONOUT
+ PREFIX_IN in;
+ ADD_IN ain;
+ DEL_IN din;
+ REP_IN rin;
+ EXT_IN ein;
+ GET_IN gin;
+ CLOSE_IN clin;
+ OPEN_IN oin;
+ CREATE_IN crin;
+ INFO_IN infoin;
+ CLOSEHANDLER_IN chin;
+ EXIT_IN xin;
+ DRIVES_IN drivesin;
+ FILE_LIST_IN filelistin; // !!! CHM
+ GETPART_IN getpartin;
+ PUTPROP_IN putpropin;
+ PUTDICTPROP_IN PutDictPropIn; // !!! CHM added
+ PUTPROPCOMBINED_IN PutPropCombinedIn; // !!! CHM added
+ GETPROP_IN getpropin;
+ ENDORG_IN endorgin;
+ DELTM_IN deltmin;
+ DELFILE_IN delfilein;
+ FILEINFO_IN fileinfoin;
+ RENFILE_IN renfilein;
+} UNIONIN, *PUNIONIN; /* uin */
+
+typedef union _UNIONOUT
{
- PREFIX_OUT out;
- ADD_OUT aout;
- DEL_OUT dout;
- REP_OUT rout;
- EXT_OUT eout;
- GET_OUT gout;
- CLOSE_OUT clout;
- OPEN_OUT oout;
- CREATE_OUT crout;
- INFO_OUT infoout;
- EXIT_OUT xout;
- DRIVES_OUT drivesout;
- FILE_LIST_OUT filelistout; // !!! CHM
- GETPART_OUT getpartout;
- PUTPROP_OUT putpropout;
- GETPROP_OUT getpropout;
- ENDORG_OUT endorgout;
- DELTM_OUT deltmout;
- DELFILE_OUT delfileout;
- FILEINFO_OUT fileinfoout;
- RENFILE_OUT renfileout;
-} UNIONOUT, * PUNIONOUT; /* uout */
+ PREFIX_OUT out;
+ ADD_OUT aout;
+ DEL_OUT dout;
+ REP_OUT rout;
+ EXT_OUT eout;
+ GET_OUT gout;
+ CLOSE_OUT clout;
+ OPEN_OUT oout;
+ CREATE_OUT crout;
+ INFO_OUT infoout;
+ EXIT_OUT xout;
+ DRIVES_OUT drivesout;
+ FILE_LIST_OUT filelistout; // !!! CHM
+ GETPART_OUT getpartout;
+ PUTPROP_OUT putpropout;
+ GETPROP_OUT getpropout;
+ ENDORG_OUT endorgout;
+ DELTM_OUT deltmout;
+ DELFILE_OUT delfileout;
+ FILEINFO_OUT fileinfoout;
+ RENFILE_OUT renfileout;
+} UNIONOUT, *PUNIONOUT; /* uout */
/*
+---------------------------------------------------------------------------+
@@ -2901,117 +2766,111 @@ typedef union _UNIONOUT
Samples: fRc = fTmComInit ();
+---------------------------------------------------------------------------+
*/
-BOOL fTmComInit (VOID);
-
-
-
-typedef struct _TMT_GLOBALS { /* tmtg */
- /* this structure keeps data and pointers to variables that exist from*/
- /* the point that the TM was created or opened, until close command */
- /* BlockImage, TextTable, WordsTable and TmHeader are allocated */
- /* dynamically during Create/Open and are freed at Close time. */
- HFILE hfTM; /* handle to TM db (from Dos call) */
- PUCHAR pchBlockImage; /* pointer to block image */
- PTOKENENTRY pteTextTable, /* pointer to TextTable */
- pteWordsTable, /* pointer to WordsTable */
- pteFirstSigWord, /* pointer to first significant word */
- pteSecondSigWord; /* pointer to second significant word*/
- PPREFIX_OUT pPrefixOut; /* pointer to the current PrefixOut */
- /* to be used by FormatMore */
- SEGMENT seg; /* placed here instead of allocating */
- /* this space on stack (point 276) */
- MATCH mtch; /* placed here instead of allocating */
- /* this space on stack (point 276) */
- PCHAR pWorkArea1; /* Pointer to work area 1 */
- PCHAR pWorkArea2; /* Pointer to work area 2 */
- PTM_HEADER pTmHeader; /* pointer to Tm header structure */
- LONG lActLengthThr; /* length corrected length threshold values*/
- LONG lActMatchThr; /* length corrected match threshold values */
- PLOADEDTABLE pLoadedTagTable; /* pointer to loaded tagtable */
- PVOID pstLoadedTagTable; /* pointer to loaded tagtable, used for */
- /* function TATagTokenize */
-} TMT_GLOBALS, * PTMT_GLOBALS, ** PPTMT_GLOBALS;
+BOOL fTmComInit(VOID);
+
+typedef struct _TMT_GLOBALS
+{ /* tmtg */
+ /* this structure keeps data and pointers to variables that exist from*/
+ /* the point that the TM was created or opened, until close command */
+ /* BlockImage, TextTable, WordsTable and TmHeader are allocated */
+ /* dynamically during Create/Open and are freed at Close time. */
+ HFILE hfTM; /* handle to TM db (from Dos call) */
+ PUCHAR pchBlockImage; /* pointer to block image */
+ PTOKENENTRY pteTextTable, /* pointer to TextTable */
+ pteWordsTable, /* pointer to WordsTable */
+ pteFirstSigWord, /* pointer to first significant word */
+ pteSecondSigWord; /* pointer to second significant word*/
+ PPREFIX_OUT pPrefixOut; /* pointer to the current PrefixOut */
+ /* to be used by FormatMore */
+ SEGMENT seg; /* placed here instead of allocating */
+ /* this space on stack (point 276) */
+ MATCH mtch; /* placed here instead of allocating */
+ /* this space on stack (point 276) */
+ PCHAR pWorkArea1; /* Pointer to work area 1 */
+ PCHAR pWorkArea2; /* Pointer to work area 2 */
+ PTM_HEADER pTmHeader; /* pointer to Tm header structure */
+ LONG lActLengthThr; /* length corrected length threshold values*/
+ LONG lActMatchThr; /* length corrected match threshold values */
+ PLOADEDTABLE pLoadedTagTable; /* pointer to loaded tagtable */
+ PVOID pstLoadedTagTable; /* pointer to loaded tagtable, used for */
+ /* function TATagTokenize */
+} TMT_GLOBALS, *PTMT_GLOBALS, **PPTMT_GLOBALS;
// ***************** Work Constants global **************************
-#define INIT_NUMB_OF_ENTRIES 5 // Initial number of entries in a table or List
-#define SEG_NUMB 6 // Segment number in char.
-#define ASCII_FLAG 1 // Ascii flag converted to char.
-#define MACH_TRANS 1 // Machine trans.flag converted to char.
-#define TIME_STAMP 16 // Time integer converted to character
-#define IND_CODES 20 // External industry codes space to hold a maximum of 6 codes
-#define ASCII_IND_CODES_LENGTH 3 // Length of Industry codes in external format
-#define NUMB_OF_IND_CODES 6 // Number of Industry codes in external format
-#define MEM_NAME 8 // Length of memory database name without extension
-#define DRIVE_NAME 12 // Special drive name
-#define PTR_MEMHANDLER_IDA 0 // Relative position in the extra bytes for handler
-#define PTR_MEM_IDA 0 // Relative position in the extra bytes for instance
-#define PTR_CRT_IDA 0 // Relative position in the extra bytes for create dialog
-#define PTR_DLG_IDA 0 // Relative position in the extra bytes for dialogs
-#define TEMP 40 // Size of temporaty work area
- // of WinRegisterClass call.
-#define TEXT_100_CHAR 100 // string length for temporary strings
-//#define NUMB_OF_TOKENS 1000 // Number of tokens in the token list
-#define NUMB_OF_TOKENS 8000 // Number of tokens in the toklist:RJ increase nec.
- // if 65520 bytes are read-in at once during MemImport
-#define MEM_PROP_SIZE 2048 // Global size of all memory database properties
-#define MEM_BLOCK_SIZE 1024 // Translation Memory block size
-#define PROCESS_NUMB_OF_MESSAGES 10 // Number of messages to be process till next message is issued
-#define MEM_DBCS 0 // 0 = No support, 1 = DBCS support
-#define MEM_LOAD_PATTERN_NAME "*" // Default names to be shown for load dialog
-#define MEM_LOAD_PATTERN_EXT ".*" // Default extension to be shown for load dialog
-#define EQF_IDENTIFICATION "EQF" // EQF identification
-#define CLBCOL_TITLE_STRING " " // Placeholder for of CLBCOL titles
-
+#define INIT_NUMB_OF_ENTRIES 5 // Initial number of entries in a table or List
+#define SEG_NUMB 6 // Segment number in char.
+#define ASCII_FLAG 1 // Ascii flag converted to char.
+#define MACH_TRANS 1 // Machine trans.flag converted to char.
+#define TIME_STAMP 16 // Time integer converted to character
+#define IND_CODES 20 // External industry codes space to hold a maximum of 6 codes
+#define ASCII_IND_CODES_LENGTH 3 // Length of Industry codes in external format
+#define NUMB_OF_IND_CODES 6 // Number of Industry codes in external format
+#define MEM_NAME 8 // Length of memory database name without extension
+#define DRIVE_NAME 12 // Special drive name
+#define PTR_MEMHANDLER_IDA 0 // Relative position in the extra bytes for handler
+#define PTR_MEM_IDA 0 // Relative position in the extra bytes for instance
+#define PTR_CRT_IDA 0 // Relative position in the extra bytes for create dialog
+#define PTR_DLG_IDA 0 // Relative position in the extra bytes for dialogs
+#define TEMP 40 // Size of temporaty work area
+ // of WinRegisterClass call.
+#define TEXT_100_CHAR 100 // string length for temporary strings
+// #define NUMB_OF_TOKENS 1000 // Number of tokens in the token list
+#define NUMB_OF_TOKENS 8000 // Number of tokens in the toklist:RJ increase nec.
+ // if 65520 bytes are read-in at once during MemImport
+#define MEM_PROP_SIZE 2048 // Global size of all memory database properties
+#define MEM_BLOCK_SIZE 1024 // Translation Memory block size
+#define PROCESS_NUMB_OF_MESSAGES 10 // Number of messages to be process till next message is issued
+#define MEM_DBCS 0 // 0 = No support, 1 = DBCS support
+#define MEM_LOAD_PATTERN_NAME "*" // Default names to be shown for load dialog
+#define MEM_LOAD_PATTERN_EXT ".*" // Default extension to be shown for load dialog
+#define EQF_IDENTIFICATION "EQF" // EQF identification
+#define CLBCOL_TITLE_STRING " " // Placeholder for of CLBCOL titles
// ***************** Memory database load **************************
-//#define MEM_CONTEXT_TOKEN_END 0 //
-//#define MEM_CONTROL_TOKEN_END 1 // UNUSED!
-//#define NTM_DESCRIPTION_TOKEN_END 2 //
-//#define MEM_MEMORYDB_TOKEN_END 3 //
-//#define NTM_MEMORYDB_TOKEN_END 4 //
-//#define MEM_SEGMENT_TOKEN_END 5 //
-//#define MEM_SOURCE_TOKEN_END 6 //
-//#define MEM_TARGET_TOKEN_END 7 //
-//#define MEM_CONTEXT_TOKEN 8 //
-//#define MEM_CONTROL_TOKEN 9 //
-//#define NTM_DESCRIPTION_TOKEN 10 //
-//#define MEM_MEMORYDB_TOKEN 11 //
-//#define NTM_MEMORYDB_TOKEN 12 //
-//#define MEM_SEGMENT_TOKEN 13 //
-//#define MEM_SOURCE_TOKEN 14 //
-//#define MEM_TARGET_TOKEN 15 //
+// #define MEM_CONTEXT_TOKEN_END 0 //
+// #define MEM_CONTROL_TOKEN_END 1 // UNUSED!
+// #define NTM_DESCRIPTION_TOKEN_END 2 //
+// #define MEM_MEMORYDB_TOKEN_END 3 //
+// #define NTM_MEMORYDB_TOKEN_END 4 //
+// #define MEM_SEGMENT_TOKEN_END 5 //
+// #define MEM_SOURCE_TOKEN_END 6 //
+// #define MEM_TARGET_TOKEN_END 7 //
+// #define MEM_CONTEXT_TOKEN 8 //
+// #define MEM_CONTROL_TOKEN 9 //
+// #define NTM_DESCRIPTION_TOKEN 10 //
+// #define MEM_MEMORYDB_TOKEN 11 //
+// #define NTM_MEMORYDB_TOKEN 12 //
+// #define MEM_SEGMENT_TOKEN 13 //
+// #define MEM_SOURCE_TOKEN 14 //
+// #define MEM_TARGET_TOKEN 15 //
// strings to create the token IDs for the tags dynamically using TATagTokenize
-#define MEM_CONTEXT_TOKEN_END L""
-#define MEM_CONTROL_TOKEN_END L""
-#define NTM_DESCRIPTION_TOKEN_END L""
-#define MEM_MEMORYDB_TOKEN_END L""
-#define NTM_MEMORYDB_TOKEN_END L""
-#define MEM_SEGMENT_TOKEN_END L""
-#define MEM_SOURCE_TOKEN_END L""
-#define MEM_TARGET_TOKEN_END L""
-#define MEM_CONTEXT_TOKEN L""
-#define MEM_CONTROL_TOKEN L""
-#define NTM_DESCRIPTION_TOKEN L""
-#define MEM_MEMORYDB_TOKEN L""
-#define NTM_MEMORYDB_TOKEN L""
-#define MEM_SEGMENT_TOKEN L""
-#define MEM_SOURCE_TOKEN L""
-#define MEM_TARGET_TOKEN L""
-#define MEM_CODEPAGE_TOKEN L""
-#define MEM_CODEPAGE_TOKEN_END L""
-#define MEM_ADDDATA_TOKEN_END L""
-#define MEM_ADDDATA_TOKEN L""
-
-
-
-
-#define TM_IMPORT_OK 0 // Translation memory import OK
-#define TM_IMPORT_FAILED 1 // Translation memory import failed
-#define TM_IMPORT_FORCED 2 // Translation memory import was forced
-
-
-//used for input from create folder dialog
+#define MEM_CONTEXT_TOKEN_END L""
+#define MEM_CONTROL_TOKEN_END L""
+#define NTM_DESCRIPTION_TOKEN_END L""
+#define MEM_MEMORYDB_TOKEN_END L""
+#define NTM_MEMORYDB_TOKEN_END L""
+#define MEM_SEGMENT_TOKEN_END L""
+#define MEM_SOURCE_TOKEN_END L""
+#define MEM_TARGET_TOKEN_END L""
+#define MEM_CONTEXT_TOKEN L""
+#define MEM_CONTROL_TOKEN L""
+#define NTM_DESCRIPTION_TOKEN L""
+#define MEM_MEMORYDB_TOKEN L""
+#define NTM_MEMORYDB_TOKEN L""
+#define MEM_SEGMENT_TOKEN L""
+#define MEM_SOURCE_TOKEN L""
+#define MEM_TARGET_TOKEN L""
+#define MEM_CODEPAGE_TOKEN L""
+#define MEM_CODEPAGE_TOKEN_END L""
+#define MEM_ADDDATA_TOKEN_END L""
+#define MEM_ADDDATA_TOKEN L""
+
+#define TM_IMPORT_OK 0 // Translation memory import OK
+#define TM_IMPORT_FAILED 1 // Translation memory import failed
+#define TM_IMPORT_FORCED 2 // Translation memory import was forced
+
+// used for input from create folder dialog
typedef enum
{
MEM_CREATE_NAME_IND,
@@ -3020,8 +2879,7 @@ typedef enum
MEM_CREATE_TARGETLANG_IND
} MEM_CREATEINDEX;
-#define MEM_TEXT_BUFFER 65520 // Length of the text buffer
-
+#define MEM_TEXT_BUFFER 65520 // Length of the text buffer
// ************ Definitions for TM list box display *********************
typedef enum
@@ -3042,14 +2900,14 @@ typedef enum
/* string IDs to parse the CONTROL string of the TM exported format */
/* using UtlParseX15 */
/**********************************************************************/
-//#define NTM_SEGNR_ID 0 //seg nr from analysis
-//#define NTM_MTFLAG_ID 1 //machine translation flag
-//#define NTM_TIME_ID 2 //time stamp
-//#define NTM_SOURCELNG_ID 3 //source language
-//#define NTM_TARGETLNG_ID 4 //target language
-//#define NTM_AUTHORNAME_ID 5 //author name
-//#define NTM_TAGTABLENAME_ID 6 //tag table name
-//#define NTM_FILENAME_ID 7 //file name
+// #define NTM_SEGNR_ID 0 //seg nr from analysis
+// #define NTM_MTFLAG_ID 1 //machine translation flag
+// #define NTM_TIME_ID 2 //time stamp
+// #define NTM_SOURCELNG_ID 3 //source language
+// #define NTM_TARGETLNG_ID 4 //target language
+// #define NTM_AUTHORNAME_ID 5 //author name
+// #define NTM_TAGTABLENAME_ID 6 //tag table name
+// #define NTM_FILENAME_ID 7 //file name
typedef enum
{
@@ -3064,15 +2922,15 @@ typedef enum
NTM_LONGNAME_ID
} NTM_IMPORTINDEX;
-#define START_KEY 0xFFFFFF
+#define START_KEY 0xFFFFFF
-#define EXT_OF_RENAMED_TMDATA ".TRD"
+#define EXT_OF_RENAMED_TMDATA ".TRD"
#define EXT_OF_RENAMED_TMINDEX ".TRI"
-#define EXT_OF_TEMP_TMPROP ".TMR"
-#define EXT_OF_RENAMED_TMPROP ".RMR"
-#define EXT_OF_TEMP_TMDATA ".TTD"
-#define EXT_OF_TEMP_TMINDEX ".TTI"
-#define EXT_OF_TMPROP EXT_OF_MEM
+#define EXT_OF_TEMP_TMPROP ".TMR"
+#define EXT_OF_RENAMED_TMPROP ".RMR"
+#define EXT_OF_TEMP_TMDATA ".TTD"
+#define EXT_OF_TEMP_TMINDEX ".TTI"
+#define EXT_OF_TMPROP EXT_OF_MEM
#include
class ProposalFilter;
@@ -3081,163 +2939,147 @@ class ProposalFilter;
typedef struct _SEG_CTRL_DATA
{
- CHAR chSegmentNumber[SEG_NUMB]; /* Segment number converted to character*/
- CHAR chAsciiFlag[ASCII_FLAG]; /* Ascii flag converted to char. */
- CHAR chMachineTrans[MACH_TRANS]; /* Machine trans.flag converted to char.*/
- CHAR chTimeStamp[TIME_STAMP]; /* Time integer converted to character */
- CHAR chIndustryCodes[IND_CODES]; /* Industry codes */
- CHAR chFileName[MAX_FILESPEC-1]; /* Segment origin. from that file name */
-}SEG_CTRL_DATA, * PSEG_CTRL_DATA;
-
-
+ CHAR chSegmentNumber[SEG_NUMB]; /* Segment number converted to character*/
+ CHAR chAsciiFlag[ASCII_FLAG]; /* Ascii flag converted to char. */
+ CHAR chMachineTrans[MACH_TRANS]; /* Machine trans.flag converted to char.*/
+ CHAR chTimeStamp[TIME_STAMP]; /* Time integer converted to character */
+ CHAR chIndustryCodes[IND_CODES]; /* Industry codes */
+ CHAR chFileName[MAX_FILESPEC - 1]; /* Segment origin. from that file name */
+} SEG_CTRL_DATA, *PSEG_CTRL_DATA;
/*! \brief search a string in a proposal
- \param pProposal pointer to the proposal
- \param pszSearch pointer to the search string (when fIngoreCase is being used, this strign has to be in uppercase)
+ \param pProposal pointer to the proposal
+ \param pszSearch pointer to the search string (when fIgnoreCase is being used, this strign has to be in uppercase)
\param lSearchOptions combination of search options
\returns TRUE if the proposal contains the searched string otherwise FALSE is returned
*/
-BOOL searchInProposal
-(
- OtmProposal *pProposal,
- PSZ_W pszSearch,
- LONG lSearchOptions
-);
-
+BOOL searchInProposal(
+ OtmProposal *pProposal,
+ PSZ_W pszSearch,
+ LONG lSearchOptions);
/*! \brief search a string in a proposal
- \param pProposal pointer to the proposal
- \param pszSearch pointer to the search string (when fIngoreCase is being used, this strign has to be in uppercase)
+ \param pProposal pointer to the proposal
+ \param pszSearch pointer to the search string (when fIgnoreCase is being used, this strign has to be in uppercase)
\param lSearchOptions combination of search options
\returns TRUE if the proposal contains the searched string otherwise FALSE is returned
*/
-BOOL searchExtendedInProposal
-(
- OtmProposal *pProposal,
- std::vector& filters,
- LONG lSearchOptions
-);
-
-
-
+BOOL searchExtendedInProposal(
+ OtmProposal *pProposal,
+ std::vector &filters,
+ LONG lSearchOptions);
/*! \brief check if search string matches current data
\param pData pointer to current position in data area
\param pSearch pointer to search string
\returns 0 if search string matches data
*/
-SHORT compareString
-(
- PSZ_W pData,
- PSZ_W pSearch
-);
+SHORT compareString(
+ PSZ_W pData,
+ PSZ_W pSearch);
/*! \brief find the given string in the provided data
\param pszData pointer to the data being searched
\param pszSearch pointer to the search string
\returns TRUE if the data contains the searched string otherwise FALSE is returned
*/
-BOOL findString
-(
- PSZ_W pszData,
- PSZ_W pszSearch
-);
+BOOL findString(
+ PSZ_W pszData,
+ PSZ_W pszSearch);
typedef struct _MEM_MERGE_IDA
{
- CHAR szPathMergeMem[MAX_LONGPATH]; // Full path and name of TM to be merged
- CHAR szPathMergeProp[MAX_LONGPATH]; // Full path and name of Properties to be imported
- CHAR szDriveMergeMem[MAX_DRIVE]; // Drive letter of TM to be merged w o : ( d )
- CHAR szNameMergeMem[MAX_LONGFILESPEC];// Name of TM to be merged w o ext ( heller )
- CHAR szShortNameMergeMem[MAX_FILESPEC];// Short name of TM being merged
- CHAR szDirMergeMem[MAX_LONGPATH]; // Path of directories fo TM to be merged ( \eqf\import\ )
- CHAR szExtMergeMem[MAX_FEXT]; // Ext of TM to be merged ( MIP or MEM or ? )
- EqfMemory *pMergeMem; // TM handle of TM to be merged
- CHAR szInvokingHandler[40]; // ??? 40 ???? to be in Gerds stuff. Name of handler which invoked the process
- CHAR szSystemPath[MAX_EQF_PATH]; // Path to the EQF system
- CHAR szTemp[MAX_EQF_PATH]; // Temporary path area
- CHAR szPropName[MAX_FILESPEC]; // TM property name ( xxxx.MEM )
- CHAR szPathMem[MAX_LONGPATH]; // Full name and Path to the TM ( c:\EQF\MEM\xxxx.MEM )
- CHAR szPathProp[MAX_LONGPATH]; // Full name and Path to the Properties
- CHAR szDriveMem[MAX_DRIVE]; // Drive letter of TM w o : ( h )
- CHAR szNameMem[MAX_LONGFILESPEC]; // Long name of TM w o ext ( gallus )
- CHAR szShortNameMem[MAX_FILESPEC]; // Short name of TM w o ext ( gallus )
- EqfMemory *pOutputMem; // TM handle
- BOOL fPropExist; // Existence of properties 0=No 1=Yes
- BOOL fPropCreated; // Tm properties have been created
- BOOL fMsg; // A message has been issued already
- BOOL fImport; // If set the merge is started via an import
- USHORT usImportRc; // Import function return code
- ULONG ulSegmentCounter; // Number of segments merged
- ULONG ulInvSegmentCounter; // Invalid Segment counter
- EXT_IN stOldExtIn; // input for TmOldExtract
- EXT_OUT stOldExtOut; // output for TmOldExtract
- TMX_EXT_IN_W stExtIn; // TMX_EXTRACT_IN structure
- TMX_EXT_OUT_W stExtOut; // TMX_EXTRACT_OUT structure
- TMX_PUT_W stPutIn; // TMX_PUT_IN structure
- TMX_EXT_OUT_W stPutOut; // TMX_PUT_OUT structure
- TIME_L tStamp; // Time stamp of merge start time
- HWND hwndMemLb; // Handle to the TM listbox
- HWND hProgressWindow; // Handle of progress indicator window
- ULONG ulProgressPos; // position of progress indicator
- CHAR szServer[MAX_LONGPATH]; // Server Name of TM or \0 if TM is local
- BOOL fPropReceived; // Property file got via Receive ?
- BOOL fOrganizeInvoked; // TRUE if Organize is invoked
- BOOL fImportAnyway; // FALSE if import of TM with
- // different IDs is canceled
- CHAR szSourceMemSourceLang[MAX_LANG_LENGTH];
- CHAR szSourceMemTargetLang[MAX_LANG_LENGTH];
- CHAR szSourceMemMarkup[MAX_FNAME]; /*@1276A*/
- CHAR szTargetMemSourceLang[MAX_LANG_LENGTH];
- CHAR szTargetMemTargetLang[MAX_LANG_LENGTH];
- CHAR szTargetMemMarkup[MAX_FNAME]; /*@1276A*/
- BOOL fDisplayMsg; // message flag if segment not /*@47A*/
- // not replaced message should /*@47A*/
- // be displayed or not /*@47A*/
- BOOL fOldPropFile; // used for folder import
- CHAR szTagTable[MAX_FILESPEC]; // tag table of org TM
- CHAR szPathMergeIndex[MAX_LONGPATH];// Full path and name of index to be merged
- CHAR szPathIndex[MAX_LONGPATH]; // name and path to index C:\EQF\MEM\xxxx.TMI )
- BOOL fBatch; // TRUE = we are in batch mode
- HWND hwndErrMsg; // parent handle for error messages
- CHAR szLongName[MAX_LONGFILESPEC]; // buffer for long TM names
- USHORT usTask; // current taskl to do (batch mode)
- OtmProposal *pProposal; // buffer for proposal data
- BOOL fFirstExtract; // TRUE = this ist the first extract call
- int iComplete; // process completion rate
-}MEM_MERGE_IDA, * PMEM_MERGE_IDA;
+ CHAR szPathMergeMem[MAX_LONGPATH]; // Full path and name of TM to be merged
+ CHAR szPathMergeProp[MAX_LONGPATH]; // Full path and name of Properties to be imported
+ CHAR szDriveMergeMem[MAX_DRIVE]; // Drive letter of TM to be merged w o : ( d )
+ CHAR szNameMergeMem[MAX_LONGFILESPEC]; // Name of TM to be merged w o ext ( heller )
+ CHAR szShortNameMergeMem[MAX_FILESPEC]; // Short name of TM being merged
+ CHAR szDirMergeMem[MAX_LONGPATH]; // Path of directories fo TM to be merged ( \eqf\import\ )
+ CHAR szExtMergeMem[MAX_FEXT]; // Ext of TM to be merged ( MIP or MEM or ? )
+ EqfMemory *pMergeMem; // TM handle of TM to be merged
+ CHAR szInvokingHandler[40]; // ??? 40 ???? to be in Gerds stuff. Name of handler which invoked the process
+ CHAR szSystemPath[MAX_EQF_PATH]; // Path to the EQF system
+ CHAR szTemp[MAX_EQF_PATH]; // Temporary path area
+ CHAR szPropName[MAX_FILESPEC]; // TM property name ( xxxx.MEM )
+ CHAR szPathMem[MAX_LONGPATH]; // Full name and Path to the TM ( c:\EQF\MEM\xxxx.MEM )
+ CHAR szPathProp[MAX_LONGPATH]; // Full name and Path to the Properties
+ CHAR szDriveMem[MAX_DRIVE]; // Drive letter of TM w o : ( h )
+ CHAR szNameMem[MAX_LONGFILESPEC]; // Long name of TM w o ext ( gallus )
+ CHAR szShortNameMem[MAX_FILESPEC]; // Short name of TM w o ext ( gallus )
+ EqfMemory *pOutputMem; // TM handle
+ BOOL fPropExist; // Existence of properties 0=No 1=Yes
+ BOOL fPropCreated; // Tm properties have been created
+ BOOL fMsg; // A message has been issued already
+ BOOL fImport; // If set the merge is started via an import
+ USHORT usImportRc; // Import function return code
+ ULONG ulSegmentCounter; // Number of segments merged
+ ULONG ulInvSegmentCounter; // Invalid Segment counter
+ EXT_IN stOldExtIn; // input for TmOldExtract
+ EXT_OUT stOldExtOut; // output for TmOldExtract
+ TMX_EXT_IN_W stExtIn; // TMX_EXTRACT_IN structure
+ TMX_EXT_OUT_W stExtOut; // TMX_EXTRACT_OUT structure
+ TMX_PUT_W stPutIn; // TMX_PUT_IN structure
+ TMX_EXT_OUT_W stPutOut; // TMX_PUT_OUT structure
+ TIME_L tStamp; // Time stamp of merge start time
+ HWND hwndMemLb; // Handle to the TM listbox
+ HWND hProgressWindow; // Handle of progress indicator window
+ ULONG ulProgressPos; // position of progress indicator
+ CHAR szServer[MAX_LONGPATH]; // Server Name of TM or \0 if TM is local
+ BOOL fPropReceived; // Property file got via Receive ?
+ BOOL fOrganizeInvoked; // TRUE if Organize is invoked
+ BOOL fImportAnyway; // FALSE if import of TM with
+ // different IDs is canceled
+ CHAR szSourceMemSourceLang[MAX_LANG_LENGTH];
+ CHAR szSourceMemTargetLang[MAX_LANG_LENGTH];
+ CHAR szSourceMemMarkup[MAX_FNAME]; /*@1276A*/
+ CHAR szTargetMemSourceLang[MAX_LANG_LENGTH];
+ CHAR szTargetMemTargetLang[MAX_LANG_LENGTH];
+ CHAR szTargetMemMarkup[MAX_FNAME]; /*@1276A*/
+ BOOL fDisplayMsg; // message flag if segment not /*@47A*/
+ // not replaced message should /*@47A*/
+ // be displayed or not /*@47A*/
+ BOOL fOldPropFile; // used for folder import
+ CHAR szTagTable[MAX_FILESPEC]; // tag table of org TM
+ CHAR szPathMergeIndex[MAX_LONGPATH]; // Full path and name of index to be merged
+ CHAR szPathIndex[MAX_LONGPATH]; // name and path to index C:\EQF\MEM\xxxx.TMI )
+ BOOL fBatch; // TRUE = we are in batch mode
+ HWND hwndErrMsg; // parent handle for error messages
+ CHAR szLongName[MAX_LONGFILESPEC]; // buffer for long TM names
+ USHORT usTask; // current taskl to do (batch mode)
+ OtmProposal *pProposal; // buffer for proposal data
+ BOOL fFirstExtract; // TRUE = this ist the first extract call
+ int iComplete; // process completion rate
+} MEM_MERGE_IDA, *PMEM_MERGE_IDA;
+
/**********************************************************************/
/* Dialog IDA for TM property dialog */
/**********************************************************************/
typedef struct _MEM_PROP_IDA
{
- CHAR szMemName[MAX_LONGFILESPEC];// Memory database name without extension
- EqfMemory *pMem; // Handle of memory database
- //HPROP hPropMem; // Memory database property handle
- //PPROP_NTM pPropMem; // pointer to TM properties
- CHAR szPropName[MAX_FILESPEC]; // buffer for property name
- CHAR szPropPath[MAX_EQF_PATH]; // buffer for property path
- CHAR szTempPath[MAX_EQF_PATH]; // buffer for path names
-}MEM_PROP_IDA, * PMEM_PROP_IDA;
-
-
-BOOL EqfMemPropsToHtml( HWND hwndParent, PMEM_IDA pIDA, EqfMemory *pMem );
-
-VOID EQFMemImportTrojaEnd( PMEM_MERGE_IDA );
-USHORT CloseMergeTmAndTm( PMEM_MERGE_IDA, BOOL ); /*@1139A*/
-USHORT MemFuncMergeTM
-(
- PMEM_MERGE_IDA pMIDA // Pointer to the merge IDA
+ CHAR szMemName[MAX_LONGFILESPEC]; // Memory database name without extension
+ EqfMemory *pMem; // Handle of memory database
+ // HPROP hPropMem; // Memory database property handle
+ // PPROP_NTM pPropMem; // pointer to TM properties
+ CHAR szPropName[MAX_FILESPEC]; // buffer for property name
+ CHAR szPropPath[MAX_EQF_PATH]; // buffer for property path
+ CHAR szTempPath[MAX_EQF_PATH]; // buffer for path names
+} MEM_PROP_IDA, *PMEM_PROP_IDA;
+
+BOOL EqfMemPropsToHtml(HWND hwndParent, PMEM_IDA pIDA, EqfMemory *pMem);
+
+VOID EQFMemImportTrojaEnd(PMEM_MERGE_IDA);
+USHORT CloseMergeTmAndTm(PMEM_MERGE_IDA, BOOL); /*@1139A*/
+USHORT MemFuncMergeTM(
+ PMEM_MERGE_IDA pMIDA // Pointer to the merge IDA
);
-//#endif
+// #endif
typedef struct _MEMORY_HANDLER_DATA
{
- IDA_HEAD stIdaHead; // Standard Ida head
-}MEMORY_HANDLER_DATA, * PMEMORY_HANDLER_DATA;
-
+ IDA_HEAD stIdaHead; // Standard Ida head
+} MEMORY_HANDLER_DATA, *PMEMORY_HANDLER_DATA;
/**********************************************************************/
/* TMX_ENDORG_IN, TMX_ENDORG_OUT used by NTMCloseOrganize */
@@ -3249,8 +3091,6 @@ typedef struct _MEMORY_HANDLER_DATA
/* The temporary file has to be closed previously. */
/**********************************************************************/
-
-
/**********************************************************************/
/* The following structures for dialog IDAs are defined only */
/* if INCL_EQFMEM_DLGIDAS has been defined */
@@ -3259,374 +3099,328 @@ typedef struct _MEMORY_HANDLER_DATA
typedef struct _MEM_INCL_DLG_IDA
{
- BOOL fInitErrorOccurred; // Important init error occurred
-}MEM_INCL_DLG_IDA, * PMEM_INCL_DLG_IDA;
+ BOOL fInitErrorOccurred; // Important init error occurred
+} MEM_INCL_DLG_IDA, *PMEM_INCL_DLG_IDA;
#endif
-
typedef struct _SLIDER_DATA
{
- CHAR szLine [5] [TEXT_100_CHAR+MAX_PATH144]; // 5 text lines of 100 characters
- // + max path length
-} SLIDER_DATA, * PSLIDER_DATA;
-
-
+ CHAR szLine[5][TEXT_100_CHAR + MAX_PATH144]; // 5 text lines of 100 characters
+ // + max path length
+} SLIDER_DATA, *PSLIDER_DATA;
/*--------------------------------------------------------------------------*\
Function prototypes.
\*--------------------------------------------------------------------------*/
USHORT
- OpenTmFile (PTMT_GLOBALS ptmtg, /*.The TM Globals Area.............*/
- PSZ pszFileName,/*.The TM Full File Name...........*/
- USHORT idCommand), /* TMC_CREATE / TMC_OPEN...........*/
+OpenTmFile(PTMT_GLOBALS ptmtg, /*.The TM Globals Area.............*/
+ PSZ pszFileName, /*.The TM Full File Name...........*/
+ USHORT idCommand), /* TMC_CREATE / TMC_OPEN...........*/
- ReadTmHeader (PTMT_GLOBALS ptmtg), /* Tmt Globals area ................*/
+ ReadTmHeader(PTMT_GLOBALS ptmtg), /* Tmt Globals area ................*/
- AllocTmtGlobals (USHORT usTmtGlobalsSize, /* The allocateion size.......*/
- PPTMT_GLOBALS pptmtg), /* The TM Globals Area........*/
+ AllocTmtGlobals(USHORT usTmtGlobalsSize, /* The allocateion size.......*/
+ PPTMT_GLOBALS pptmtg), /* The TM Globals Area........*/
- SetTmtWorkPointers (PTMT_GLOBALS ptmtg); /* The TM Globals Area........*/
+ SetTmtWorkPointers(PTMT_GLOBALS ptmtg); /* The TM Globals Area........*/
/*--------------------------------------------------------------------------*\
Function prototypes.
\*--------------------------------------------------------------------------*/
-VOID
-GetFirstSegAddress
-(
- PTMT_GLOBALS ptmtg, // Pointer to Tmt globals
- PSZ pszSource, // pointer to source segment
- PTM_ADDRESS pAddr // pointer to address
+VOID GetFirstSegAddress(
+ PTMT_GLOBALS ptmtg, // Pointer to Tmt globals
+ PSZ pszSource, // pointer to source segment
+ PTM_ADDRESS pAddr // pointer to address
);
-VOID
-CleanSource
-(
- PTMT_GLOBALS ptmtg, // Pointer to Tmt globals
- PSZ pszSource // Pointer to string to be tokenized
+VOID CleanSource(
+ PTMT_GLOBALS ptmtg, // Pointer to Tmt globals
+ PSZ pszSource // Pointer to string to be tokenized
);
-VOID
-CalcPrimaryKey
-(
- PTMT_GLOBALS ptmtg, // Pointer to Globals structure
- PUCHAR pchPrimaryKey // Pointer to primary key
+VOID CalcPrimaryKey(
+ PTMT_GLOBALS ptmtg, // Pointer to Globals structure
+ PUCHAR pchPrimaryKey // Pointer to primary key
);
-VOID
-CalcSecondaryKey
-(
- PTMT_GLOBALS ptmtg, // Pointer to Tmt globals
- PSZ pszSortedSecKey // Ptr to sorted secondary key
+VOID CalcSecondaryKey(
+ PTMT_GLOBALS ptmtg, // Pointer to Tmt globals
+ PSZ pszSortedSecKey // Ptr to sorted secondary key
);
-VOID
-Get4Chars
-(
- PTMT_GLOBALS ptmtg, // Pointer to Tmt globals
- SHORT sTokenId, // WORD/USELESS/NOISE/TEXT/TAG
- PTOKENENTRY pteFirst, // Ptr to Text or Word Table
- PUCHAR pchPrimaryKey // 4 chars for primary key
+VOID Get4Chars(
+ PTMT_GLOBALS ptmtg, // Pointer to Tmt globals
+ SHORT sTokenId, // WORD/USELESS/NOISE/TEXT/TAG
+ PTOKENENTRY pteFirst, // Ptr to Text or Word Table
+ PUCHAR pchPrimaryKey // 4 chars for primary key
);
-VOID
-WordsTokenize
-(
- PTMT_GLOBALS ptmtg // Pointer to Tmt globals
+VOID WordsTokenize(
+ PTMT_GLOBALS ptmtg // Pointer to Tmt globals
);
-VOID
-UselessFiltering
-(
- PTOKENENTRY pteWord // Pointer to word in WordsTable
+VOID UselessFiltering(
+ PTOKENENTRY pteWord // Pointer to word in WordsTable
);
USHORT
-Tmt
-(
- HTM htm, // Pointer to TmtGlobals
- PIN pIn, // Pointer to input buffer
- POUT pOut // Pointer to output buffer
+Tmt(
+ HTM htm, // Pointer to TmtGlobals
+ PIN pIn, // Pointer to input buffer
+ POUT pOut // Pointer to output buffer
);
-
/**********************************************************************/
/* TmtX */
/**********************************************************************/
USHORT
-TmtX ( HTM htm, // Pointer to TmtGlobals
- PXIN pIn, // Pointer to input buffer
- PXOUT pOut ); // Pointer to output buffer
-
+TmtX(HTM htm, // Pointer to TmtGlobals
+ PXIN pIn, // Pointer to input buffer
+ PXOUT pOut); // Pointer to output buffer
USHORT
-CalcEntryInKeyDir
-(
- PTM_HEADER ptmh, // Pointer to Tm Header
- PUCHAR pchPrimaryKey // Primary Key
+CalcEntryInKeyDir(
+ PTM_HEADER ptmh, // Pointer to Tm Header
+ PUCHAR pchPrimaryKey // Primary Key
);
USHORT
-WriteTmhToDisk
-(
- PTMT_GLOBALS ptmtg, // Pointer to globals
- USHORT fsWrite // Write control flags word
+WriteTmhToDisk(
+ PTMT_GLOBALS ptmtg, // Pointer to globals
+ USHORT fsWrite // Write control flags word
);
USHORT
-WriteToDisk
-(
- PTMT_GLOBALS ptmtg, // TMT globals
- ULONG ldispPtr, // New file pointer location
- PVOID pvWrite, // Pointer to write buffer
- USHORT numWrite // Number of bytes to write
+WriteToDisk(
+ PTMT_GLOBALS ptmtg, // TMT globals
+ ULONG ldispPtr, // New file pointer location
+ PVOID pvWrite, // Pointer to write buffer
+ USHORT numWrite // Number of bytes to write
);
USHORT
-FormatMore
-(
- PTMT_GLOBALS ptmtg // Pointer to Tmt globals
+FormatMore(
+ PTMT_GLOBALS ptmtg // Pointer to Tmt globals
);
USHORT
-ReadStringFromDisk
-(
- PTMT_GLOBALS ptmtg, // Pointer to Tmt globals
- PCHAR bufRead, // Read buffer
- USHORT lenString, // String length
- PTM_ADDRESS paddr // Pointer to string buffer
+ReadStringFromDisk(
+ PTMT_GLOBALS ptmtg, // Pointer to Tmt globals
+ PCHAR bufRead, // Read buffer
+ USHORT lenString, // String length
+ PTM_ADDRESS paddr // Pointer to string buffer
);
USHORT
-ReadSegmentFromDisk
-(
- PTMT_GLOBALS ptmtg, // pointer to Tmt globals
- PTM_ADDRESS pAddr, // Pointer to an address
- PSEGMENT pSegment, // Pointer to seg. buffer
- PBOOL pfFirstSeg, // Pointer to 1st seg. flag
- PBOOL pfLastSeg // Pointer to last seg. flag
+ReadSegmentFromDisk(
+ PTMT_GLOBALS ptmtg, // pointer to Tmt globals
+ PTM_ADDRESS pAddr, // Pointer to an address
+ PSEGMENT pSegment, // Pointer to seg. buffer
+ PBOOL pfFirstSeg, // Pointer to 1st seg. flag
+ PBOOL pfLastSeg // Pointer to last seg. flag
);
USHORT
-ReadBlock
-(
- PTMT_GLOBALS ptmtg, // Pointer to Tmt globals
- PTM_ADDRESS paddr, // Pointer to an address
- BOOL fAddressInParameter // Address in pAddr
+ReadBlock(
+ PTMT_GLOBALS ptmtg, // Pointer to Tmt globals
+ PTM_ADDRESS paddr, // Pointer to an address
+ BOOL fAddressInParameter // Address in pAddr
);
-INT
-CharCompare
-(
- const void * arg1, // First comparand
- const void * arg2 // Second comparand
+INT CharCompare(
+ const void *arg1, // First comparand
+ const void *arg2 // Second comparand
);
-BOOL
-fStrcmpCRLF
-(
- PSZ pszStr1, // pointer to first string to be compared
- PSZ pszStr2, // pointer to second string to be compared
- PUSHORT pusEqualChars, // (return value) pointer to USHORT where the
- // number of equal characters (first string)
- USHORT fCompareType); // flag indicating whether CRLF and LF are ignored
- // ALIGN_CRLF -> CRLF and LF are equal equal
- // USE_CRLF -> exact matches required s
- // IGNORE_CRL -> characters are equal
-
+BOOL fStrcmpCRLF(
+ PSZ pszStr1, // pointer to first string to be compared
+ PSZ pszStr2, // pointer to second string to be compared
+ PUSHORT pusEqualChars, // (return value) pointer to USHORT where the
+ // number of equal characters (first string)
+ USHORT fCompareType); // flag indicating whether CRLF and LF are ignored
+ // ALIGN_CRLF -> CRLF and LF are equal equal
+ // USE_CRLF -> exact matches required s
+ // IGNORE_CRL -> characters are equal
/*--------------------------------------------------------------------------*\
Function prototypes.
\*--------------------------------------------------------------------------*/
USHORT
- TmtExtract (PTMT_GLOBALS ptmtg, /* pointer to Tmt globals....*/
- PEXT_IN pExtIn, /* pointer to input buffer...*/
- PEXT_OUT pExtOut); /* pointer to output buffer..*/
+TmtExtract(PTMT_GLOBALS ptmtg, /* pointer to Tmt globals....*/
+ PEXT_IN pExtIn, /* pointer to input buffer...*/
+ PEXT_OUT pExtOut); /* pointer to output buffer..*/
USHORT
- TmtGet (PTMT_GLOBALS ptmtg, /* pointer to Tmt globals....*/
- PGET_IN pGetIn, /* pointer to input buffer...*/
- PGET_OUT pGetOut), /* pointer to output buffer..*/
-
- TmtGetTMPart( PTMT_GLOBALS ptmtg, /* pointer to Tmt globals....*/
- PGETPART_IN pGetPartIn, /* pointer to input buffer...*/
- PGETPART_OUT pGetPartOut), /* pointer to output buffer..*/
-
- GetSegByAddr (PTMT_GLOBALS ptmtg, /* pointer to TmtGlobals.....*/
- PTM_ADDRESS pAddr, /* pointer to input address..*/
- PTM_ADDRESS pAddrNext, /* pointer to next address...*/
- PSEGMENT pseg), /* pointer to segment........*/
-
-
- TmtInfo (PTMT_GLOBALS ptmtg, /* pointer to Tmt globals....*/
- PINFO_OUT pInfoOut); /* pointer to output buffer..*/
-
-
-LONG
- CheckSimilar (PTMT_GLOBALS ptmtg, /* pointer to Tmt globals.....*/
- PSEGMENT pCurrentSegment,/* pointer to current segmnt .*/
- PTOKENENTRY pTokenEntry, /* points to 1'st & 2'nd word */
- PGET_IN pGetIn, /* pointer to input buffer....*/
- PSZ pszInputKey, /* pointer to sortedkey of....*/
- /* input segment..............*/
- PMATCH pmtch), /* pointer to stMatch.........*/
-
- CheckExact (PGET_IN pGetIn, /* pointer to input segment....*/
- PSEGMENT pseg, /* pointer to current seg......*/
- BOOL fSimilarMod, /* Similar= TRUE, Exact=FALSE..*/
- PMATCH pmtch), /* pointer to stMatch..........*/
-
- CalcExactIndustry (PGET_IN pGetIn, /* pointer to input segment....*/
- PSEGMENT pseg); /* pointer to current seg......*/
-
-VOID
- RankNewMatch (USHORT numMatchesReq, // number of matches required
- USHORT usConvert, // Conversion indicator
- PMATCH pmtchCurrent, // pointer to stMatch
- PSEGMENT pseg, // pointer to current seg
- PGET_OUT pGetOut); // pointer to GET_OUT struct
-
-BOOL
- CheckWord (PTOKENENTRY pteFirst, /*Point to first word ..........*/
- PTOKENENTRY pteSecond) ; /*Point to second word .........*/
-
-VOID
-LengthCorrectThresholds( PTMT_GLOBALS ptmtg, //pointer to Tmt globals
- USHORT usLenInput, //number of words in inp. seg.
- PGET_IN pGetIn ); //pointer to input buffer
+TmtGet(PTMT_GLOBALS ptmtg, /* pointer to Tmt globals....*/
+ PGET_IN pGetIn, /* pointer to input buffer...*/
+ PGET_OUT pGetOut), /* pointer to output buffer..*/
+
+ TmtGetTMPart(PTMT_GLOBALS ptmtg, /* pointer to Tmt globals....*/
+ PGETPART_IN pGetPartIn, /* pointer to input buffer...*/
+ PGETPART_OUT pGetPartOut), /* pointer to output buffer..*/
+
+ GetSegByAddr(PTMT_GLOBALS ptmtg, /* pointer to TmtGlobals.....*/
+ PTM_ADDRESS pAddr, /* pointer to input address..*/
+ PTM_ADDRESS pAddrNext, /* pointer to next address...*/
+ PSEGMENT pseg), /* pointer to segment........*/
+
+ TmtInfo(PTMT_GLOBALS ptmtg, /* pointer to Tmt globals....*/
+ PINFO_OUT pInfoOut); /* pointer to output buffer..*/
+
+LONG CheckSimilar(PTMT_GLOBALS ptmtg, /* pointer to Tmt globals.....*/
+ PSEGMENT pCurrentSegment, /* pointer to current segmnt .*/
+ PTOKENENTRY pTokenEntry, /* points to 1'st & 2'nd word */
+ PGET_IN pGetIn, /* pointer to input buffer....*/
+ PSZ pszInputKey, /* pointer to sortedkey of....*/
+ /* input segment..............*/
+ PMATCH pmtch), /* pointer to stMatch.........*/
+
+ CheckExact(PGET_IN pGetIn, /* pointer to input segment....*/
+ PSEGMENT pseg, /* pointer to current seg......*/
+ BOOL fSimilarMod, /* Similar= TRUE, Exact=FALSE..*/
+ PMATCH pmtch), /* pointer to stMatch..........*/
+
+ CalcExactIndustry(PGET_IN pGetIn, /* pointer to input segment....*/
+ PSEGMENT pseg); /* pointer to current seg......*/
+
+VOID RankNewMatch(USHORT numMatchesReq, // number of matches required
+ USHORT usConvert, // Conversion indicator
+ PMATCH pmtchCurrent, // pointer to stMatch
+ PSEGMENT pseg, // pointer to current seg
+ PGET_OUT pGetOut); // pointer to GET_OUT struct
+
+BOOL CheckWord(PTOKENENTRY pteFirst, /*Point to first word ..........*/
+ PTOKENENTRY pteSecond); /*Point to second word .........*/
+
+VOID LengthCorrectThresholds(PTMT_GLOBALS ptmtg, // pointer to Tmt globals
+ USHORT usLenInput, // number of words in inp. seg.
+ PGET_IN pGetIn); // pointer to input buffer
USHORT
- TmtAdd (PTMT_GLOBALS pTmtGlobals, /* Pointer to Tmt Globals........*/
- PADD_IN pAddIn, /* Pointer to input buffer.......*/
- PADD_OUT pAddOut), /* Pointer to output buffer......*/
-
- TmtDelete (PTMT_GLOBALS ptmtg, /* Pointer to Tmt Globals....*/
- PDEL_IN pDeleteIn, /* Pointer to input buffer...*/
- PDEL_OUT pDeleteOut), /* Pointer to output buffer..*/
-
- TmtReplace (PTMT_GLOBALS ptmtg, /* Pointer to Tmt Globals....*/
- PREP_IN pReplaceIn, /* Pointer to input buffer...*/
- PREP_OUT pReplaceOut), /* Pointer to output buffer..*/
-
- AddSegToCluster (PTMT_GLOBALS ptmtg, /* Pointer to globals area..*/
- PTM_ADDRESS pAddr, /* Ptr to initial address...*/
- PSEGMENT pseg), /* Pointer to a segment.....*/
+TmtAdd(PTMT_GLOBALS pTmtGlobals, /* Pointer to Tmt Globals........*/
+ PADD_IN pAddIn, /* Pointer to input buffer.......*/
+ PADD_OUT pAddOut), /* Pointer to output buffer......*/
- FindFreshAddrInCluster (PTMT_GLOBALS ptmtg, /* Pointer to Tmt globals.*/
- PTM_ADDRESS pAddr, /* Pointer to address.....*/
- BOOL fReadFirstBlock), /* Read block flag........*/
+ TmtDelete(PTMT_GLOBALS ptmtg, /* Pointer to Tmt Globals....*/
+ PDEL_IN pDeleteIn, /* Pointer to input buffer...*/
+ PDEL_OUT pDeleteOut), /* Pointer to output buffer..*/
- TakeBlockFromSpool (PTMT_GLOBALS ptmtg, /* Pointer to Tmt globals.....*/
- USHORT rcPrevious, /* RC of the previous call....*/
- PTM_ADDRESS pAddr), /* Pointer to an address......*/
+ TmtReplace(PTMT_GLOBALS ptmtg, /* Pointer to Tmt Globals....*/
+ PREP_IN pReplaceIn, /* Pointer to input buffer...*/
+ PREP_OUT pReplaceOut), /* Pointer to output buffer..*/
- WriteStringToDisk (PTMT_GLOBALS ptmtg, /* Pointer to Tmt globals.....*/
- PCHAR bufWrite, /* Pointer to the string......*/
- USHORT lenString, /* String length..............*/
- PTM_ADDRESS pAddr), /* Pointer to string address..*/
+ AddSegToCluster(PTMT_GLOBALS ptmtg, /* Pointer to globals area..*/
+ PTM_ADDRESS pAddr, /* Ptr to initial address...*/
+ PSEGMENT pseg), /* Pointer to a segment.....*/
- WriteBlock (PTMT_GLOBALS ptmtg), /* Pointer to Tmt globals.....*/
+ FindFreshAddrInCluster(PTMT_GLOBALS ptmtg, /* Pointer to Tmt globals.*/
+ PTM_ADDRESS pAddr, /* Pointer to address.....*/
+ BOOL fReadFirstBlock), /* Read block flag........*/
- FindMatchSegInCluster (PTMT_GLOBALS ptmtg, /* Ptr to Tmt globals...*/
- PTM_ADDRESS pAddr, /* Pointer to address...*/
- PBOOL pfLastSeg, /* Last segment flag....*/
- PSEGMENT psegIn, /* Ptr to input buffer..*/
- PSEGMENT pseg), /* Pointer to segment...*/
+ TakeBlockFromSpool(PTMT_GLOBALS ptmtg, /* Pointer to Tmt globals.....*/
+ USHORT rcPrevious, /* RC of the previous call....*/
+ PTM_ADDRESS pAddr), /* Pointer to an address......*/
- DeleteSegment (PTMT_GLOBALS ptmtg, /* Pointer to Tmt globals........*/
- PTM_ADDRESS pAddr, /* Address of segment to delete..*/
- BOOL fLastSeg, /* Last segment in cluster flag..*/
- PSEGMENT pseg); /* Pointer to the segment........*/
+ WriteStringToDisk(PTMT_GLOBALS ptmtg, /* Pointer to Tmt globals.....*/
+ PCHAR bufWrite, /* Pointer to the string......*/
+ USHORT lenString, /* String length..............*/
+ PTM_ADDRESS pAddr), /* Pointer to string address..*/
-BOOL
- CheckMatchForDelete (PSEGMENT psegIn, /* pointer to input buffer.......*/
- PSEGMENT pseg); /* currently, output buffer......*/
+ WriteBlock(PTMT_GLOBALS ptmtg), /* Pointer to Tmt globals.....*/
-USHORT TmtDeleteTM( HTM hMem, // TM handle
- PDELTM_IN pDelTmIn, // Input structure
- PDELTM_OUT pDelTmOut ); // Output structure
+ FindMatchSegInCluster(PTMT_GLOBALS ptmtg, /* Ptr to Tmt globals...*/
+ PTM_ADDRESS pAddr, /* Pointer to address...*/
+ PBOOL pfLastSeg, /* Last segment flag....*/
+ PSEGMENT psegIn, /* Ptr to input buffer..*/
+ PSEGMENT pseg), /* Pointer to segment...*/
+ DeleteSegment(PTMT_GLOBALS ptmtg, /* Pointer to Tmt globals........*/
+ PTM_ADDRESS pAddr, /* Address of segment to delete..*/
+ BOOL fLastSeg, /* Last segment in cluster flag..*/
+ PSEGMENT pseg); /* Pointer to the segment........*/
-USHORT TmtCloseOrganize( HTM hMem, // TM handle
- PENDORG_IN pEndOrgIn, // Input structure
- PENDORG_OUT pEndOrgOut ); // Output structure
+BOOL CheckMatchForDelete(PSEGMENT psegIn, /* pointer to input buffer.......*/
+ PSEGMENT pseg); /* currently, output buffer......*/
+USHORT TmtDeleteTM(HTM hMem, // TM handle
+ PDELTM_IN pDelTmIn, // Input structure
+ PDELTM_OUT pDelTmOut); // Output structure
+USHORT TmtCloseOrganize(HTM hMem, // TM handle
+ PENDORG_IN pEndOrgIn, // Input structure
+ PENDORG_OUT pEndOrgOut); // Output structure
-VOID TmtDeleteFile( PDELFILE_IN pDelFileIn, // Input structure
- PDELFILE_OUT pDelFileOut ); // Output structure
+VOID TmtDeleteFile(PDELFILE_IN pDelFileIn, // Input structure
+ PDELFILE_OUT pDelFileOut); // Output structure
-VOID GetFileInfo( PFILEINFO_IN pFileInfoIn, // Input structure
- PFILEINFO_OUT pFileInfoOut ); // Output structure
+VOID GetFileInfo(PFILEINFO_IN pFileInfoIn, // Input structure
+ PFILEINFO_OUT pFileInfoOut); // Output structure
-VOID RenameFile( PRENFILE_IN pRenFileIn, // Input structure
- PRENFILE_OUT pRenFileOut ); // Output structure
-
-BOOL fCheckFileClosed ( PSZ ); //--- pointer to file name
+VOID RenameFile(PRENFILE_IN pRenFileIn, // Input structure
+ PRENFILE_OUT pRenFileOut); // Output structure
+BOOL fCheckFileClosed(PSZ); //--- pointer to file name
/*--------------------------------------------------------------------------*\
Function prototypes.
\*--------------------------------------------------------------------------*/
USHORT
- TmtOpen (POPEN_IN pOpenIn, /* Pointer to input structure....*/
- POPEN_OUT pOpenOut), /* Pointer to output structure...*/
-
- TmtCreate (PCREATE_IN pCreateIn, /* Pointer to input structure....*/
- PCREATE_OUT pCreateOut), /* Pointer to output structure...*/
-
- TmtClose (PTMT_GLOBALS ptmtg, /* Pointer to Globals structure.....*/
- PCLOSE_OUT pCloseOut); /* Pointer to output buffer.........*/
-
-INT_PTR /*CALLBACK*/ MEMCREATEDLG( HWND, WINMSG, WPARAM, LPARAM );
-INT_PTR /*CALLBACK*/ MEMLOADDLG( HWND, WINMSG, WPARAM, LPARAM );
-INT_PTR /*CALLBACK*/ MEMEXPORTDLG( HWND, WINMSG, WPARAM, LPARAM );
-INT_PTR /*CALLBACK*/ MEMMERGEDLG( HWND, WINMSG, WPARAM, LPARAM );
-INT_PTR /*CALLBACK*/ MEMPROPDLG( HWND, WINMSG, WPARAM, LPARAM );
-INT_PTR /*CALLBACK*/ MemCreateName( HWND, USHORT, WPARAM, LPARAM );
-INT_PTR /*CALLBACK*/ UTLSERVERLISTDLG( HWND, WINMSG, WPARAM, LPARAM );
-INT_PTR /*CALLBACK*/ UTLSERVERLISTNAMEDLG( HWND, WINMSG, WPARAM, LPARAM );
-INT_PTR /*CALLBACK*/ MEMINCLUDEDLG( HWND, WINMSG, WPARAM, LPARAM );
-INT_PTR /*CALLBACK*/ SERVWAITDLG( HWND, WINMSG, WPARAM, LPARAM );
-USHORT MemCreateProcess( PMEM_IDA, PSZ, USHORT );
-VOID MemDestroyProcess( PMEM_IDA, USHORT * );
-USHORT MemGetAddressOfProcessIDA( PMEM_IDA, WPARAM, USHORT *, PVOID * );
-VOID MemRcHandlingErrorUndefined( USHORT, PSZ );
-VOID MemRcHandlingErrorUndefinedHwnd( USHORT, PSZ, HWND );
-USHORT EQFMemOrganizeStart( PPROCESSCOMMAREA );
-VOID EQFMemOrganizeProcess( PPROCESSCOMMAREA );
-VOID EQFMemOrganizeEnd( PPROCESSCOMMAREA );
-VOID EQFMemLoadStart( PPROCESSCOMMAREA, HWND );
-VOID EQFMemLoadProcess( PPROCESSCOMMAREA, HWND );
-VOID EQFMemLoadEnd( PPROCESSCOMMAREA, HWND, LPARAM );
-USHORT EQFMemExportStart( PPROCESSCOMMAREA, HWND );
-USHORT EQFMemExportProcess( PPROCESSCOMMAREA, HWND );
-USHORT EQFMemExportEnd( PPROCESSCOMMAREA, HWND, LPARAM );
-VOID EQFMemMergeStart( PPROCESSCOMMAREA, HWND );
-VOID EQFMemMergeProcess( PPROCESSCOMMAREA, HWND );
-VOID EQFMemMergeEnd( PPROCESSCOMMAREA, HWND, LPARAM );
-USHORT EQFMemImportTrojaStart( HWND, LPARAM, HWND );
-USHORT MemInitSlider( HWND, USHORT, PSZ, USHORT, PSZ, PHWND, USHORT, USHORT);
-USHORT ReadABGrouping( PSZ, PSZ, ABGROUP );
-MRESULT MemOrganizeCallBack( PPROCESSCOMMAREA, HWND, WINMSG, WPARAM, LPARAM );
-MRESULT MemExportCallBack( PPROCESSCOMMAREA, HWND, WINMSG, WPARAM, LPARAM );
-MRESULT MemMergeCallBack( PPROCESSCOMMAREA, HWND, WINMSG, WPARAM, LPARAM );
-MRESULT MemImportCallBack( PPROCESSCOMMAREA, HWND, WINMSG, WPARAM, LPARAM );
-
-
+TmtOpen(POPEN_IN pOpenIn, /* Pointer to input structure....*/
+ POPEN_OUT pOpenOut), /* Pointer to output structure...*/
+
+ TmtCreate(PCREATE_IN pCreateIn, /* Pointer to input structure....*/
+ PCREATE_OUT pCreateOut), /* Pointer to output structure...*/
+
+ TmtClose(PTMT_GLOBALS ptmtg, /* Pointer to Globals structure.....*/
+ PCLOSE_OUT pCloseOut); /* Pointer to output buffer.........*/
+
+INT_PTR /*CALLBACK*/ MEMCREATEDLG(HWND, WINMSG, WPARAM, LPARAM);
+INT_PTR /*CALLBACK*/ MEMLOADDLG(HWND, WINMSG, WPARAM, LPARAM);
+INT_PTR /*CALLBACK*/ MEMEXPORTDLG(HWND, WINMSG, WPARAM, LPARAM);
+INT_PTR /*CALLBACK*/ MEMMERGEDLG(HWND, WINMSG, WPARAM, LPARAM);
+INT_PTR /*CALLBACK*/ MEMPROPDLG(HWND, WINMSG, WPARAM, LPARAM);
+INT_PTR /*CALLBACK*/ MemCreateName(HWND, USHORT, WPARAM, LPARAM);
+INT_PTR /*CALLBACK*/ UTLSERVERLISTDLG(HWND, WINMSG, WPARAM, LPARAM);
+INT_PTR /*CALLBACK*/ UTLSERVERLISTNAMEDLG(HWND, WINMSG, WPARAM, LPARAM);
+INT_PTR /*CALLBACK*/ MEMINCLUDEDLG(HWND, WINMSG, WPARAM, LPARAM);
+INT_PTR /*CALLBACK*/ SERVWAITDLG(HWND, WINMSG, WPARAM, LPARAM);
+USHORT MemCreateProcess(PMEM_IDA, PSZ, USHORT);
+VOID MemDestroyProcess(PMEM_IDA, USHORT *);
+USHORT MemGetAddressOfProcessIDA(PMEM_IDA, WPARAM, USHORT *, PVOID *);
+VOID MemRcHandlingErrorUndefined(USHORT, PSZ);
+VOID MemRcHandlingErrorUndefinedHwnd(USHORT, PSZ, HWND);
+USHORT EQFMemOrganizeStart(PPROCESSCOMMAREA);
+VOID EQFMemOrganizeProcess(PPROCESSCOMMAREA);
+VOID EQFMemOrganizeEnd(PPROCESSCOMMAREA);
+VOID EQFMemLoadStart(PPROCESSCOMMAREA, HWND);
+VOID EQFMemLoadProcess(PPROCESSCOMMAREA, HWND);
+VOID EQFMemLoadEnd(PPROCESSCOMMAREA, HWND, LPARAM);
+USHORT EQFMemExportStart(PPROCESSCOMMAREA, HWND);
+USHORT EQFMemExportProcess(PPROCESSCOMMAREA, HWND);
+USHORT EQFMemExportEnd(PPROCESSCOMMAREA, HWND, LPARAM);
+VOID EQFMemMergeStart(PPROCESSCOMMAREA, HWND);
+VOID EQFMemMergeProcess(PPROCESSCOMMAREA, HWND);
+VOID EQFMemMergeEnd(PPROCESSCOMMAREA, HWND, LPARAM);
+USHORT EQFMemImportTrojaStart(HWND, LPARAM, HWND);
+USHORT MemInitSlider(HWND, USHORT, PSZ, USHORT, PSZ, PHWND, USHORT, USHORT);
+USHORT ReadABGrouping(PSZ, PSZ, ABGROUP);
+MRESULT MemOrganizeCallBack(PPROCESSCOMMAREA, HWND, WINMSG, WPARAM, LPARAM);
+MRESULT MemExportCallBack(PPROCESSCOMMAREA, HWND, WINMSG, WPARAM, LPARAM);
+MRESULT MemMergeCallBack(PPROCESSCOMMAREA, HWND, WINMSG, WPARAM, LPARAM);
+MRESULT MemImportCallBack(PPROCESSCOMMAREA, HWND, WINMSG, WPARAM, LPARAM);
// ************* Memory macro definitions *******************************
//=======================================================================
-//prototypes and definitions for TM utilities
+// prototypes and definitions for TM utilities
#define SIZE_32K 32768
#define ERROR_TABLE_FULL 1111
-#define ID_NOT_FOUND 2222
-
+#define ID_NOT_FOUND 2222
// adjust pointger for a new location
-#define ADJUSTPTR( new, old, offsptr ) \
- ((PBYTE)new + ((PBYTE)offsptr - (PBYTE)old))
+#define ADJUSTPTR(new, old, offsptr) \
+ ((PBYTE) new + ((PBYTE)offsptr - (PBYTE)old))
// do not update name tables when name is not contained in the table
#define NTMGETID_NOUPDATE_OPT 0x00000001
@@ -3635,49 +3429,42 @@ MRESULT MemImportCallBack( PPROCESSCOMMAREA, HWND, WINMSG, WPARAM, LPARAM );
#define NTMGETID_NOTFOUND_ID 0xFFFF
-USHORT TmtXGet( EqfMemory*, PTMX_GET_W, PTMX_GET_OUT_W );
+// tm put prototypes
+VOID HashSentence(PTMX_SENTENCE);
+USHORT HashTupel(PBYTE, USHORT, USHORT);
+USHORT HashTupelW(PSZ_W, USHORT);
+VOID BuildVotes(PTMX_SENTENCE);
+VOID Vote(PTMX_TERM_TOKEN, PTMX_SENTENCE, USHORT);
+USHORT CheckCompactArea(PTMX_SENTENCE, EqfMemory *);
-//tm put prototypes
-VOID HashSentence( PTMX_SENTENCE );
-USHORT HashTupel( PBYTE, USHORT, USHORT );
-USHORT HashTupelW( PSZ_W, USHORT );
-static VOID BuildVotes( PTMX_SENTENCE );
-static VOID Vote( PTMX_TERM_TOKEN, PTMX_SENTENCE, USHORT );
-USHORT CheckCompactArea( PTMX_SENTENCE, EqfMemory* );
+VOID FillTmRecord(PTMX_SENTENCE,
+ BytesRef TmRecord, // filled tm record returned
+ BytesRef, USHORT);
-USHORT TokenizeTarget( StringTagVariants*, PTMX_TAGTABLE_RECORD*, PLONG, PSZ, EqfMemory* );
+USHORT DetermineTmRecord(EqfMemory *, PTMX_SENTENCE, std::vector& pulSids );
-VOID FillTmRecord( PTMX_SENTENCE,
- PTMX_RECORD, PTMX_TARGET_CLB, USHORT );
+VOID FillTargetRecord(PTMX_SENTENCE, PTMX_TARGET_RECORD, PTMX_TARGET_CLB);
-USHORT DetermineTmRecord( EqfMemory*, PTMX_SENTENCE, PULONG );
+VOID DeleteOldestRecord(PTMX_RECORD, PULONG);
-VOID FillTargetRecord( PTMX_SENTENCE, //PTMX_TAGTABLE_RECORD,
- PSZ_W, USHORT, PTMX_TARGET_RECORD *, PTMX_TARGET_CLB );
+// tm get prototypes
+USHORT GetExactMatch(EqfMemory *, PTMX_SENTENCE, PTMX_GET_W, PTMX_MATCH_TABLE_W,
+ PUSHORT, PTMX_GET_OUT_W);
+USHORT ExactTest(EqfMemory *, PTMX_RECORD, PTMX_GET_W, PTMX_SENTENCE,
+ PTMX_MATCH_TABLE_W, PUSHORT, LONG, PBYTE);
-VOID DeleteOldestRecord( PTMX_RECORD, PULONG );
-//tm get prototypes
-USHORT GetExactMatch( EqfMemory*, PTMX_SENTENCE, PTMX_GET_W, PTMX_MATCH_TABLE_W,
- PUSHORT, PTMX_GET_OUT_W );
-USHORT ExactTest( EqfMemory*, PTMX_RECORD, PTMX_GET_W, PTMX_SENTENCE,
- PTMX_MATCH_TABLE_W, PUSHORT, ULONG );
+INT CompCount(const void *, const void *);
+INT CompCountVotes(const void *, const void *);
+VOID CleanupTempMatch(PTMX_MATCHENTRY, std::vector&, PUSHORT, PUSHORT);
+USHORT FillMatchEntry(EqfMemory *, PTMX_SENTENCE, std::vector&, PUSHORT);
+USHORT FuzzyTest(EqfMemory *, PTMX_RECORD, PTMX_GET_W, PTMX_MATCH_TABLE_W, PUSHORT,
+ PUSHORT, PUSHORT, PUSHORT, PTMX_SENTENCE, LONG, PBYTE);
+USHORT GetFuzzyMatch(EqfMemory *, PTMX_SENTENCE, PTMX_GET_W, PTMX_MATCH_TABLE_W, PUSHORT);
-BOOL AddTagsToString( PSZ, PULONG, PTMX_TAGTABLE_RECORD, PSZ );
-BOOL AddTagsToStringW( PSZ_W, PLONG, PTMX_TAGTABLE_RECORD, PSZ_W );
+// tm delete segment prototypes
+USHORT NTMCheckForUpdates(EqfMemory *);
-INT CompCount( const void *, const void * );
-INT CompCountVotes( const void *, const void * );
-VOID CleanupTempMatch( PTMX_MATCHENTRY, PTMX_MATCHENTRY *, PUSHORT, PUSHORT );
-USHORT FillMatchEntry( EqfMemory*, PTMX_SENTENCE, PTMX_MATCHENTRY, PUSHORT );
-USHORT FuzzyTest( EqfMemory*, PTMX_RECORD, PTMX_GET_W, PTMX_MATCH_TABLE_W, PUSHORT,
- PUSHORT, PUSHORT, PUSHORT, PTMX_SENTENCE, ULONG );
-USHORT GetFuzzyMatch( EqfMemory*, PTMX_SENTENCE, PTMX_GET_W, PTMX_MATCH_TABLE_W, PUSHORT );
-
-
-//tm delete segment prototypes
-USHORT NTMCheckForUpdates( EqfMemory* );
-USHORT NTMLockTM( EqfMemory*, BOOL, PBOOL );
// definitions for terse of TM name tables
// max size of in-memory name table
@@ -3686,40 +3473,27 @@ USHORT NTMLockTM( EqfMemory*, BOOL, PBOOL );
// magic word for recognition of tersed name tables
// Note: this ULONG value has to ensure that it will never been used
// as a name so it is prefixed and suffixed by a 0x00
-#define TERSEMAGICWORD 0x0019FF00L
-// structure of header for tersed name tables
-typedef struct _TERSEHEADER
-{
- USHORT usAllocSize; // alloc size in untersed tables
- USHORT usMaxEntries; // max entries in untersed tables
- ULONG ulMagicWord; // magic word for tersed name
- USHORT usDataSize; // size of data area when expanded
- USHORT usCompression; // type of compression used for data
- // (values as defined in EQFCMPR.H)
-} TERSEHEADER, *PTERSEHEADER;
-
-BOOL TMDelTargetClb
-(
- PTMX_RECORD pTmRecord, // ptr to TM record
- PTMX_TARGET_RECORD pTargetRecord, // ptr to target record within TM record
- PTMX_TARGET_CLB pTargetClb // ptr to target control record
+
+BOOL TMDelTargetClb(
+ BytesRef TmRecord, // ptr to TM record
+ PTMX_TARGET_RECORD pTargetRecord, // ptr to target record within TM record
+ PTMX_TARGET_CLB pTargetClb // ptr to target control record
);
-ULONG EQFUnicode2Compress( PBYTE pTarget, PSZ_W pInput, ULONG usLenChar );
-LONG EQFCompress2Unicode( PSZ_W pOutput, PBYTE pTarget, ULONG usLenComp );
+ULONG EQFUnicode2Compress(PBYTE pTarget, PSZ_W pInput, ULONG usLenChar);
+LONG EQFCompress2Unicode(std::wstring &pOutput, PBYTE pTarget, ULONG usLenComp);
#include "EncodingHelper.h"
-
/*
class FilterParam{
public:
- FilterParam(std::string& search, FilterField field, FilterType type): m_field(field), m_type(type),
+ FilterParam(std::string& search, FilterField field, FilterType type): m_field(field), m_type(type),
m_searchString(search), m_searchStringW(convertStrToWstr(search)){};
-
+
FilterParam(long t1, long t2, FilterField field = TIMESTAMP): m_timestamp1(t1), m_timestamp2(t2), m_field{field}{}
private:
@@ -3729,8 +3503,6 @@ class FilterParam{
long m_timestamp1=0, m_timestamp2=0;
};//*/
-
-
/*
class StringFilterParam{
std::string m_searchString;
@@ -3740,234 +3512,221 @@ class StringFilterParam{
StringFilterParam(std::string& search, ProposalFilter::FilterType type): FilterParam(type, field), {}
}//*/
-typedef struct _MEM_ORGANIZE_IDA
+struct MEM_ORGANIZE_IDA
{
- std::shared_ptr memRef;
- TMX_PUT_W stPutIn; // input for TmReplace
- TMX_EXT_OUT_W stPutOut; // The REPLACE_OUT structure
- TMX_EXT_IN_W stExtIn; // input for TmExtract
- TMX_EXT_OUT_W stExtOut; // output for TmExtract
- CHAR szPathOrganizeMem[2048]; // Full path and name of TM to be organized
- CHAR szDrive[MAX_DRIVE]; // Drive letter without colum
- CHAR szMemName[MAX_LONGFILESPEC]; // Translation memory name
- CHAR szTempMemName[MAX_LONGFILESPEC];// name of temporary translation memory
- CHAR szPluginName[MAX_LONGFILESPEC]; // name of plugin used for the memory
- CHAR szPathTempMem[2048]; // Full path of temporary transl. mem.
- OtmProposal *pProposal; // buffer for memory proposal
- std::shared_ptr pMem; // Handle of transl. memory
- std::shared_ptr pMemTemp; // Handle of tmporary transl. memory
- BOOL fMsg; // A message has been issued already
- //ULONG ulSegmentCounter; // Number of segments organized
- //ULONG ulInvSegmentCounter; // Invalid Segment counter
- TIME_L tStamp; // Time stamp of organize start time
- HWND hProgressWindow; // Handle of progress indicator window
- ULONG ulProgressPos; // position of progress indicator
- CHAR szPathTempIndex[MAX_EQF_PATH]; //full temporary index name
-
- LANGUAGE szSourceLanguage; // source language of org TM
- LANGUAGE szTargetLanguage; // target language of org TM
- CHAR szTagTable[MAX_FILESPEC]; // tag table of org TM
-
- CHAR szPropertyName[MAX_FILESPEC]; // property name with ext.
- CHAR szTempPropertyName[MAX_FILESPEC]; // property name temp TM with ext
-
- CHAR szOrgProp[MAX_EQF_PATH]; // full name of original property file
- CHAR szTmpProp[MAX_EQF_PATH]; // full name of temporary property file
-
- CHAR szEqfPath[MAX_EQF_PATH]; // system path D:\EQF
- USHORT usOrgType; // type ORGANIZE, CONVERT
- BOOL fBatch; // TRUE if organizing in batch mode
- HWND hwndErrMsg; // handle of window to be used for error msgs
- PDDEMEMORG pDDEMemOrg; // ptr to batch memory organize data
- USHORT usRC; // return code / error code
- LONG NextTask; // next task in non-DDE batch mode
- PSZ pszNameList; // pointer to list of TMs being organized
- PSZ pszActiveName; // points to current name in pszNameList
- CHAR szBuffer[2048]; // general purpose buffer
- BOOL fFirstGet; // TRUE = this is the first get access
- std::vector m_reorganizeFilters;
- MutexTimeout tmListTimeout ;
- MutexTimeout tmLockTimeout ;
-}MEM_ORGANIZE_IDA, * PMEM_ORGANIZE_IDA;
-
-USHORT NTMConvertProperties( PPROPTRANSLMEM, PMEM_ORGANIZE_IDA );
+ std::shared_ptr memRef;
+ TMX_PUT_W stPutIn; // input for TmReplace
+ TMX_EXT_OUT_W stPutOut; // The REPLACE_OUT structure
+ TMX_EXT_IN_W stExtIn; // input for TmExtract
+ TMX_EXT_OUT_W stExtOut; // output for TmExtract
+ CHAR szPathOrganizeMem[2048]; // Full path and name of TM to be organized
+ CHAR szDrive[MAX_DRIVE]; // Drive letter without colum
+ CHAR szMemName[MAX_LONGFILESPEC]; // Translation memory name
+ CHAR szTempMemName[MAX_LONGFILESPEC]; // name of temporary translation memory
+ CHAR szPluginName[MAX_LONGFILESPEC]; // name of plugin used for the memory
+ CHAR szPathTempMem[2048]; // Full path of temporary transl. mem.
+ OtmProposal *pProposal; // buffer for memory proposal
+ std::shared_ptr pMem; // Handle of transl. memory
+ std::shared_ptr pMemTemp; // Handle of tmporary transl. memory
+ BOOL fMsg; // A message has been issued already
+ // ULONG ulSegmentCounter; // Number of segments organized
+ // ULONG ulInvSegmentCounter; // Invalid Segment counter
+ TIME_L tStamp; // Time stamp of organize start time
+ HWND hProgressWindow; // Handle of progress indicator window
+ ULONG ulProgressPos; // position of progress indicator
+ CHAR szPathTempIndex[MAX_EQF_PATH]; // full temporary index name
+
+ LANGUAGE szSourceLanguage; // source language of org TM
+ LANGUAGE szTargetLanguage; // target language of org TM
+ CHAR szTagTable[MAX_FILESPEC]; // tag table of org TM
+
+ CHAR szPropertyName[MAX_FILESPEC]; // property name with ext.
+ CHAR szTempPropertyName[MAX_FILESPEC]; // property name temp TM with ext
+
+ CHAR szOrgProp[MAX_EQF_PATH]; // full name of original property file
+ CHAR szTmpProp[MAX_EQF_PATH]; // full name of temporary property file
+
+ CHAR szEqfPath[MAX_EQF_PATH]; // system path D:\EQF
+ USHORT usOrgType; // type ORGANIZE, CONVERT
+ BOOL fBatch; // TRUE if organizing in batch mode
+ HWND hwndErrMsg; // handle of window to be used for error msgs
+ PDDEMEMORG pDDEMemOrg; // ptr to batch memory organize data
+ USHORT usRC; // return code / error code
+ LONG NextTask; // next task in non-DDE batch mode
+ PSZ pszActiveName; // points to current name in pszNameList
+ CHAR szBuffer[2048]; // general purpose buffer
+ BOOL fFirstGet; // TRUE = this is the first get access
+ std::vector m_reorganizeFilters;
+ MutexTimeout tmListTimeout;
+ MutexTimeout tmLockTimeout;
+};
+using PMEM_ORGANIZE_IDA = MEM_ORGANIZE_IDA*;
+
+USHORT TmCloseOrganize(PMEM_ORGANIZE_IDA, USHORT);
+
+USHORT NTMCloseOrganize(PMEM_ORGANIZE_IDA, USHORT);
+USHORT NTMConvertProperties(PPROPTRANSLMEM, PMEM_ORGANIZE_IDA);
/*! \brief constant defining the maximum number of opened memories
-*/
+ */
#define OTMMEMSERVICE_MAX_NUMBER_OF_OPEN_MEMORIES 40
-//5MB reserved for service
+// 5MB reserved for service
#define MEMORY_RESERVED_FOR_SERVICE 5000000
-
class CreateMemRequestData;
class EqfMemoryPlugin : public OtmPlugin
/*! \brief This class implements the standard translation memory plugin (EQF) for OpenTM2.
-*/
+ */
{
- //static EqfMemoryPlugin* _instance;
+ // static EqfMemoryPlugin* _instance;
public:
-/*! \brief Constructor
-*/
- EqfMemoryPlugin();
-/*! \brief Destructor
-*/
- ~EqfMemoryPlugin();
+ /*! \brief Constructor
+ */
+ EqfMemoryPlugin();
+ /*! \brief Destructor
+ */
+ ~EqfMemoryPlugin();
- static EqfMemoryPlugin* GetInstance();
+ static EqfMemoryPlugin *GetInstance();
- virtual bool isUsable()
- {return OtmPlugin::isUsable();};
+ virtual bool isUsable()
+ {
+ return OtmPlugin::isUsable();
+ };
-
-/*! \enum eRegRc
- Possible return values of EqfMemory and EqfMemoryPlugin methods
-*/
- enum eRc
- {
- eSuccess = 0, /*!< method completed successfully */
- eUnknownPlugin, /*!< the specified memory plugin is not available */
-// eInvalidName, /*!< plugin-name is invalid */
-// eAlreadyRegistered, /*!< plugin with same name was already registered before */
-// eInvalidRequest, /*!< method may only be called from within registerPlugins call */
- eMemoryNotFound, /*!< the specified memory does not exist or is not controlled by this memory plugin*/
- eUnknown, /*!< plugin with that name was not registered before */
- eNotSupported, /*!< method is not supported by this plugin */
- eBufferTooSmall, /*!< the provided buffer is too small */
+ /*! \enum eRegRc
+ Possible return values of EqfMemory and EqfMemoryPlugin methods
+ */
+ enum eRc
+ {
+ eSuccess = 0, /*!< method completed successfully */
+ eUnknownPlugin, /*!< the specified memory plugin is not available */
+ // eInvalidName, /*!< plugin-name is invalid */
+ // eAlreadyRegistered, /*!< plugin with same name was already registered before */
+ // eInvalidRequest, /*!< method may only be called from within registerPlugins call */
+ eMemoryNotFound, /*!< the specified memory does not exist or is not controlled by this memory plugin*/
+ eUnknown, /*!< plugin with that name was not registered before */
+ eNotSupported, /*!< method is not supported by this plugin */
+ eBufferTooSmall, /*!< the provided buffer is too small */
eNotSupportedMemoryType,
- eNotEnoughMemory, /*!< not enough system memory to process the request */
- eRepeat /*!< repeat calling this method until processing has been completed*/
- };
-
-
-// options for the importFromMemoryFiles method
-static const int IMPORTFROMMEMFILES_COMPLETEINONECALL_OPT = 1; // complete the import in one call, do not divide the processing into smaller steps
+ eNotEnoughMemory, /*!< not enough system memory to process the request */
+ eRepeat /*!< repeat calling this method until processing has been completed*/
+ };
+ // options for the importFromMemoryFiles method
+ static const int IMPORTFROMMEMFILES_COMPLETEINONECALL_OPT = 1; // complete the import in one call, do not divide the processing into smaller steps
+
+ /*! \brief Returns the name of the plugin
+ */
+ const char *getName();
+ /*! \brief Returns a short plugin-Description
+ */
+ const char *getShortDescription();
+ /*! \brief Returns a verbose plugin-Description
+ */
+ const char *getLongDescription();
+ /*! \brief Returns the version of the plugin
+ */
+ const char *getVersion();
+ /*! \brief Returns the name of the plugin-supplier
+ */
+ const char *getSupplier();
+
+ EqfMemory *initTM(const std::string &memName,
+ size_t requiredMemory,
+ unsigned short usAccessMode,
+ bool fReorganizeOnly);
+
+
+
+ /*! \brief set description of a memory
+ \param pszName name of the memory
+ \param pszDesc description information
+ \returns 0 if successful or error return code
+ */
+ int setDescription(
+ const char *pszName,
+ const char *pszDesc);
-/*! \brief Returns the name of the plugin
-*/
- const char* getName();
-/*! \brief Returns a short plugin-Description
-*/
- const char* getShortDescription();
-/*! \brief Returns a verbose plugin-Description
-*/
- const char* getLongDescription();
-/*! \brief Returns the version of the plugin
-*/
- const char* getVersion();
-/*! \brief Returns the name of the plugin-supplier
-*/
- const char* getSupplier();
+ /*! \brief Get the error message for the last error occured
- EqfMemory* initTM(const std::string& memName,
- size_t requiredMemory,
- unsigned short usAccessMode,
- bool fReorganizeOnly);
+ \param strError reference to a string receiving the error mesage text
+ \returns last error code
+ */
+ int getLastError(
+ std::string &strError);
+ /*! \brief Get the error message for the last error occured
-/*! \brief Close a memory
- \param pMemory pointer to memory object
-*/
- int closeMemory(
- EqfMemory *pMemory
- );
+ \param pszError pointer to a buffer for the error text
+ \param iBufSize size of error text buffer in number of characters
+ \returns last error code
+ */
+ int getLastError(
+ char *pszError,
+ int iBufSize);
-/*! \brief set description of a memory
- \param pszName name of the memory
- \param pszDesc description information
- \returns 0 if successful or error return code
-*/
- int setDescription(
- const char* pszName,
- const char* pszDesc);
+ /*! \brief Stops the plugin.
+ Terminating-function for the plugin, will be called directly before
+ the DLL containing the plugin will be unloaded.\n
+ The method should call PluginManager::deregisterPlugin() to tell the PluginManager
+ that the plugin is not active anymore.
+ Warning: THIS METHOD SHOULD BE CALLED BY THE PLUGINMANAGER ONLY!
+ \param fForce, TRUE = force stop of the plugin even if functions are active, FALSE = only stop plugin when it is inactive
+ \returns TRUE when successful */
+ bool stopPlugin(bool fForce = false);
-/*! \brief Get the error message for the last error occured
- \param strError reference to a string receiving the error mesage text
- \returns last error code
-*/
- int getLastError
- (
- std::string &strError
- );
-/*! \brief Get the error message for the last error occured
-
- \param pszError pointer to a buffer for the error text
- \param iBufSize size of error text buffer in number of characters
- \returns last error code
-*/
- int getLastError
- (
- char *pszError,
- int iBufSize
- );
-
-/*! \brief Stops the plugin.
- Terminating-function for the plugin, will be called directly before
- the DLL containing the plugin will be unloaded.\n
- The method should call PluginManager::deregisterPlugin() to tell the PluginManager
- that the plugin is not active anymore.
- Warning: THIS METHOD SHOULD BE CALLED BY THE PLUGINMANAGER ONLY!
- \param fForce, TRUE = force stop of the plugin even if functions are active, FALSE = only stop plugin when it is inactive
- \returns TRUE when successful */
- bool stopPlugin( bool fForce = false );
-
-/*! \brief Handle a return code from the memory functions and create the approbriate error message text for it
- \param iRC return code from memory function
- \param pszMemName long memory name
- \param pszMarkup markup table name or NULL if not available
- \param pszMemPath fully qualified memory path name or NULL if not available
- \param strLastError reference to string object receiving the message text
- \param iLastError reference to a integer variable receiving the error code
- \returns original or modified error return code
-*/
-static int handleError( int iRC, char *pszMemName, char *pszMarkup, char *pszMemPath, std::string &strLastError, int &iLastError );
-
- int iLastError;
- std::string strLastError;
- std::vector< std::shared_ptr > m_MemInfoVector;
+ int iLastError;
+ std::string strLastError;
private:
- std::shared_ptr findMemory( const char *pszName );
- int findMemoryIndex(const char *pszName);
-
- std::string name;
- std::string shortDesc;
- std::string longDesc;
- std::string version;
- std::string supplier;
- std::string descrType;
- char szBuffer[4000]; // general purpose buffer area
- char szSupportedDrives[27]; // list of supported drives
+ std::string name;
+ std::string shortDesc;
+ std::string longDesc;
+ std::string version;
+ std::string supplier;
+ std::string descrType;
+ char szBuffer[4000]; // general purpose buffer area
+};
+// enum TIMED_BOOL{
+// FALSE = 0,
+// TRUE = 1,
+// TIMEOUT = -2
+// };
+
+enum TMManagarState{
+ INIT=0,
+ READY=1,
+ SHUTDOWN_CALLED,
+ WAITING_FOR_IMPORTS,
+ OFF
};
-//enum TIMED_BOOL{
-// FALSE = 0,
-// TRUE = 1,
-// TIMEOUT = -2
-//};
-class TMManager{
+class TMManager
+{
- public:
-
-
- std::atomic_bool fWriteRequestsAllowed{0};
- std::atomic_bool fServiceIsRunning{1};
- /*! \brief Pointer to the list of opened memories
- */
- //std::vector vMemoryList;
- typedef std::map > TMMap;
+public:
+ inline static std::mutex mutex_tmManager;
+ inline static bool fWriteRequestsAllowed{0};
+ inline static bool fServiceIsRunning{1};
+ inline static bool fLoadingTmIsAllowed{0};
+ /*! \brief Pointer to the list of opened memories
+ */
+ // std::vector vMemoryList;
+ typedef std::map> TMMap;
TMMap tms;
std::recursive_timed_mutex mutex_requestTM;
std::recursive_timed_mutex mutex_access_tms;
- enum TMManagerCodes{
+ enum TMManagerCodes
+ {
TMM_NO_ERROR = 0,
TMM_TMD_NOT_FOUND = 16,
@@ -3975,233 +3734,228 @@ class TMManager{
TMM_TM_NOT_FOUND = TMM_TMD_NOT_FOUND + TMM_TMI_NOT_FOUND,
};
- bool IsMemoryLoaded(const std::string& strMemName, MutexTimeout& tmListTimeout);
- bool IsMemoryInList(const std::string& strMemName, MutexTimeout& tmListTimeout);
- bool IsMemoryLoading(const std::string& strMemName, MutexTimeout& tmListTimeout);
- bool IsMemoryFailedToLoad(const std::string& strMemName, MutexTimeout& tmListTimeout);
- int TMExistsOnDisk(const std::string& tmName, bool logErrorIfNotExists = true);
+ bool IsMemoryLoaded(const std::string &strMemName, MutexTimeout &tmListTimeout);
+ bool IsMemoryInList(const std::string &strMemName, MutexTimeout &tmListTimeout);
+ bool IsMemoryLoading(const std::string &strMemName, MutexTimeout &tmListTimeout);
+ bool IsMemoryFailedToLoad(const std::string &strMemName, MutexTimeout &tmListTimeout);
+ int TMExistsOnDisk(const std::string &tmName, bool logErrorIfNotExists = true);
- int AddMem(const std::shared_ptr NewMem, MutexTimeout& tmListTimeout);
- int OpenTM(const std::string& strMemName, MutexTimeout& tmListTimeout, COMMAND command);
- int CloseTM(const std::string& strMemName, MutexTimeout& tmListTimeout);
- int DeleteTM(const std::string& strMemName, std::string& outputMsg);
+ int AddMem(const std::shared_ptr NewMem, MutexTimeout &tmListTimeout);
+ int OpenTM(const std::string &strMemName, MutexTimeout &tmListTimeout, COMMAND command);
+ int CloseTM(const std::string &strMemName, MutexTimeout &tmListTimeout);
+ int DeleteTM(const std::string &strMemName, std::string &outputMsg);
- int RenameTM(const std::string& oldMemName, const std::string& newMemName, std::string& outputMsg,MutexTimeout& tmListTimeout);
+ int RenameTM(const std::string &oldMemName, const std::string &newMemName, std::string &outputMsg, MutexTimeout &tmListTimeout);
int MoveTM(
- const std::string& oldMemoryName,
- const std::string& newMemoryName,
- std::string &strError,
- MutexTimeout& tmListTimeout
- );
-
- std::shared_ptr requestServicePointer(const std::string& strMemName, MutexTimeout& requestTMTimeout, MutexTimeout& tmListTimeout, COMMAND command);
- std::shared_ptr requestReadOnlyTMPointer(const std::string& strMemName, std::shared_ptr& refBack, MutexTimeout& requestTMTimeout, MutexTimeout& tmListTimeout, COMMAND command);
- std::shared_ptr requestWriteTMPointer(const std::string& strMemName, std::shared_ptr& refBack, MutexTimeout& requestTMTimeout, MutexTimeout& tmListTimeout, COMMAND command);
-
- std::shared_ptr CreateNewEmptyTM(const std::string& strMemName, const std::string& strSrcLang,
- const std::string& strMemDescription, int& _rc_, bool keepInRamOnly = false);
-
-
- /*! \brief OpenTM2 API session handle
- */
- LONG hSession = 0;
- /*! \brief close a memory and remove it from the open list
- \param iIndex index of memory in the open list
- \returns 0
- */
-
- /*! \brief find a memory in our list of active memories
- \param pszMemory name of the memory
- \returns index in the memory table if successful, -1 if memory is not contained in the list
- */
- int findMemoryInList( const std::string& memName );
-
- /*! \brief close any memories which haven't been used for a long time
- \returns 0
- */
- size_t CleanupMemoryList(size_t memoryRequested, MutexTimeout& tmListTimeout);
-
-
- /*! \brief close any memories which haven't been used for a long time
- \returns size of closed tms
- */
- size_t CloseTmsThatWasNotUsedForTooLong(MutexTimeout& tmListTimeout, const std::string& tmToOpen);
-
- /*! \brief calcuate total amount of RAM occupied by opened memory files
- \returns 0
- */
- size_t CalculateOccupiedRAM(MutexTimeout& tmListTimeout);
-
- std::shared_ptr findOpenedMemory( const std::string& memName);
-
- int GetMemImportInProcessCount(MutexTimeout& tmListTimeout);
-
- /*! \brief Close all open memories
- \returns http return code0 if successful or an error code in case of failures
- */
- int closeAll();
-
-///MEMORY FACTORY REGION
- /*! \brief This class provides factory methods for EqfMemory objects
+ const std::string &oldMemoryName,
+ const std::string &newMemoryName,
+ std::string &strError,
+ MutexTimeout &tmListTimeout);
+
+ std::shared_ptr requestServicePointer(const std::string &strMemName, MutexTimeout &requestTMTimeout, MutexTimeout &tmListTimeout, COMMAND command);
+ std::shared_ptr requestReadOnlyTMPointer(const std::string &strMemName, std::shared_ptr &refBack, MutexTimeout &requestTMTimeout, MutexTimeout &tmListTimeout, COMMAND command);
+ std::shared_ptr requestWriteTMPointer(const std::string &strMemName, std::shared_ptr &refBack, MutexTimeout &requestTMTimeout, MutexTimeout &tmListTimeout, COMMAND command);
+
+ std::shared_ptr CreateNewEmptyTM(const std::string &strMemName, const std::string &strSrcLang,
+ const std::string &strMemDescription, int &_rc_, bool keepInRamOnly = false);
+
+ /*! \brief OpenTM2 API session handle
+ */
+ LONG hSession = 0;
+ /*! \brief close a memory and remove it from the open list
+ \param iIndex index of memory in the open list
+ \returns 0
+ */
-*/
+ /*! \brief find a memory in our list of active memories
+ \param pszMemory name of the memory
+ \returns index in the memory table if successful, -1 if memory is not contained in the list
+ */
+ int findMemoryInList(const std::string &memName);
-//public:
+ /*! \brief close any memories which haven't been used for a long time
+ \returns 0
+ */
+ size_t CleanupMemoryList(size_t memoryRequested, MutexTimeout &tmListTimeout);
+ /*! \brief close any memories which haven't been used for a long time
+ \returns size of closed tms
+ */
+ size_t CloseTmsThatWasNotUsedForTooLong(MutexTimeout &tmListTimeout, const std::string &tmToOpen);
-/*! \brief Error code definition
-*/
- static const int ERROR_PLUGINNOTAVAILABLE = 1002;
- static const int ERROR_MEMORYOBJECTISNULL = 1003;
- static const int ERROR_BUFFERTOOSMALL = 1004;
- static const int ERROR_INVALIDOBJNAME = 1005;
- static const int ERROR_MISSINGPARAMETER = 1006;
+ /*! \brief calcuate total amount of RAM occupied by opened memory files
+ \returns 0
+ */
+ size_t CalculateOccupiedRAM(MutexTimeout &tmListTimeout);
-/*! \brief Options for proposal sorting
-*/
- static const LONG LATESTPROPOSAL_FIRST = 0x00000001;
+ std::shared_ptr findOpenedMemory(const std::string &memName);
- /*! \brief This static method returns a pointer to the TMManager object.
- The first call of the method creates the TMManager instance.
-*/
- static TMManager* GetInstance();
+ int GetMemImportInProcessCount(MutexTimeout &tmListTimeout);
- TMManager(){
- T5LOG( T5DEBUG) << "::Ctor of TMManager";
- pluginList = NULL;
- pHandleToMemoryList = new std::vector;
- refreshPluginList();
- }
+ /*! \brief Close all open memories
+ \returns http return code0 if successful or an error code in case of failures
+ */
+ int closeAll();
+
+ /// MEMORY FACTORY REGION
+ /*! \brief This class provides factory methods for EqfMemory objects
-/* \brief Close a memory
- Close the memory object and free all memory related resources.
- The memory object is not valid anymore.
- \param pMemory pointer to the memory object being closes
- \returns 0 when successful or a error return code
*/
-int closeMemory
-(
- EqfMemory *pMemory
-);
+ // public:
-/*! \brief get error message for the last error
- \param pMemory pointer to existing memory object or NULL if not available
- \param iLastError the last error number
- \param strError the error string returned with
- \returns the last error string
-*/
-std::string& getLastError(
- EqfMemory *pMemory,
- int& iLastError,
- std::string& strError);
-
-/*! \brief Copy best matches from one proposal vector into another
- and sort the proposals
- \param SourceProposals refernce to a vector containing the source proposals
- \param TargetProposals reference to a vector receiving the copied proposals
- the vector may already contain proposals. The proposals are
- inserted on their relevance
- \param iMaxProposals maximum number of proposals to be filled in TargetProposals
- When there are more proposals available proposals with lesser relevance will be replaced
-*/
-void copyBestMatches(
- std::vector &SourceProposals,
- std::vector &TargetProposals,
- int iMaxProposals
-);
+ /*! \brief Error code definition
+ */
+ static const int ERROR_PLUGINNOTAVAILABLE = 1002;
+ static const int ERROR_MEMORYOBJECTISNULL = 1003;
+ static const int ERROR_BUFFERTOOSMALL = 1004;
+ static const int ERROR_INVALIDOBJNAME = 1005;
+ static const int ERROR_MISSINGPARAMETER = 1006;
-/*! \brief Copy best matches from one proposal vector into another
- and sort the proposals
- \param SourceProposals refernce to a vector containing the source proposals
- \param TargetProposals reference to a vector receiving the copied proposals
- the vector may already contain proposals. The proposals are
- inserted on their relevance
- \param iMaxProposals maximum number of proposals to be filled in TargetProposals
- When there are more proposals available proposals with lesser relevance will be replaced
- \param iMTDisplayFactor factor for the placement of machine matches within the table
- \param fExactAndFuzzies switch to control the handling of fuzzy matches when exact matches exist, TRUE = keep fuzzy matches even when exact matches exist
- \param lOptions options for the sorting of the proposals
-*/
-void copyBestMatches(
- std::vector &SourceProposals,
- std::vector &TargetProposals,
- int iMaxProposals,
- int iMTDisplayFactor,
- BOOL fExactAndFuzzies,
- LONG lOptions = 0
-);
+ /*! \brief Options for proposal sorting
+ */
+ static const LONG LATESTPROPOSAL_FIRST = 0x00000001;
-/*! \brief Insert proposal into proposal vector at the correct position and
- remove a proposal with lesser relevance when iMaxPropoals have already been filled
- \param NewProposal pointer to proposal being inserted
- \param SourceProposals refernce to a vector containing the source proposals
- \param TargetProposals reference to a vector receiving the copied proposals
- the vector may already contain proposals. The proposals are
- inserted on their relevance
- \param iMaxProposals maximum number of proposals to be filled in TargetProposals
- When there are more proposals available proposals with lesser relevance will be replaced
- \param fLastEntry true = this is the last entry in the table
- \param iMTDisplayFactor factor for the placement of machine matches within the table
- \param lOptions options for the sorting of the proposals
+ /*! \brief This static method returns a pointer to the TMManager object.
+ The first call of the method creates the TMManager instance.
*/
-void insertProposalData(
- OtmProposal *newProposal,
- std::vector &Proposals,
- int iMaxProposals,
- BOOL fLastEntry,
- int iMTDisplayFactor = -1,
- LONG lOptions = 0
-);
+ static TMManager *GetInstance();
-/*! \brief Get the object name for the memory
- \param pMemory pointer to the memory object
- \param pszObjName pointer to a buffer for the object name
- \param iBufSize size of the object name buffer
- \returns 0 when successful or the error code
-*/
-int getObjectName( EqfMemory *pMemory, char *pszObjName, int iBufSize );
-
-/*! \brief Get the plugin name and the memory name from a memory object name
- \param pszObjName pointer to the memory object name
- \param pszPluginName pointer to the buffer for the plugin name or
- NULL if no plugin name is requested
- \param iPluginBufSize size of the buffer for the plugin name
- \param pszluginName pointer to the buffer for the plugin name or
- NULL if no memory name is requested
- \param iNameBufSize size of the buffer for the memory name
- \returns 0 when successful or the error code
-*/
-int splitObjName( char *pszObjName, char *pszPluginName, int iPluginBufSize, char *pszMemoryName, int iNameBufSize );
-
- /*! \brief Get the sort order key for a memory match
- \param Proposal reference to a proposal for which the sort key is evaluated
- \param iMTDisplayFactor the machine translation display factor, -1 to ignore the factor
- \param usContextRanking the context ranking for the proposal
- \param fEndIfTable TRUE when this proposal is the last in a proposal table
- When there are more proposals available proposals with lesser relevance will be replaced
- \returns the proposal sort key
-*/
- int getProposalSortKey( OtmProposal &Proposal, int iMTDisplayFactor, USHORT usContextRanking, BOOL fEndOfTable, LONG lOptions = 0 );
+ TMManager()
+ {
+ T5LOG(T5DEBUG) << "::Ctor of TMManager";
+ pluginList = NULL;
+ pHandleToMemoryList = new std::vector;
+ refreshPluginList();
+ }
- /*! \brief Get the sort order key for a memory match
- \param Proposal reference to a proposal for which the sort key is evaluated
- \returns the proposal sort key
-*/
-int getProposalSortKey( OtmProposal &Proposal );
-
- /*! \brief Get the sort order key for a memory match
- \param MatchType match type of the match
- \param ProposalType type of the proposal
- \param iFuzziness fuzziness of the proposal
- \param iMTDisplayFactor the machine translation display factor, -1 to use the system MT display factor
- \param usContextRanking the context ranking for the proposal
- \param fEndIfTable TRUE when this proposal is the last in a proposal table
- When there are more proposals available proposals with lesser relevance will be replaced
- \returns the proposal sort key
-*/
-int getProposalSortKey( OtmProposal::eMatchType MatchType, OtmProposal::eProposalType ProposalType, int iFuzzyness, int iMTDisplayFactor, USHORT usContextRanking, BOOL fEndOfTable, LONG lOptions = 0 );
+ /*! \brief Show error message for the last error
+ \param pszPlugin plugin-name or NULL if not available or memory object name is used
+ \param pszMemoryName name of the memory causing the problem
+ memory object name (pluginname + colon + memoryname)
+ \param pMemory pointer to existing memory object or NULL if not available
+ \param hwndErrMsg handle of parent window message box
+ */
+ void showLastError(
+ char *pszPluginName,
+ char *pszMemoryName,
+ EqfMemory *pMemory,
+ HWND hwndErrMsg);
+
+ /*! \brief get error message for the last error
+ \param pMemory pointer to existing memory object or NULL if not available
+ \param iLastError the last error number
+ \param strError the error string returned with
+ \returns the last error string
+ */
+ std::string &getLastError(
+ EqfMemory *pMemory,
+ int &iLastError,
+ std::string &strError);
+
+ /*! \brief Copy best matches from one proposal vector into another
+ and sort the proposals
+ \param SourceProposals refernce to a vector containing the source proposals
+ \param TargetProposals reference to a vector receiving the copied proposals
+ the vector may already contain proposals. The proposals are
+ inserted on their relevance
+ \param iMaxProposals maximum number of proposals to be filled in TargetProposals
+ When there are more proposals available proposals with lesser relevance will be replaced
+ */
+ void copyBestMatches(
+ std::vector &SourceProposals,
+ std::vector &TargetProposals,
+ int iMaxProposals);
+
+ /*! \brief Copy best matches from one proposal vector into another
+ and sort the proposals
+ \param SourceProposals refernce to a vector containing the source proposals
+ \param TargetProposals reference to a vector receiving the copied proposals
+ the vector may already contain proposals. The proposals are
+ inserted on their relevance
+ \param iMaxProposals maximum number of proposals to be filled in TargetProposals
+ When there are more proposals available proposals with lesser relevance will be replaced
+ \param iMTDisplayFactor factor for the placement of machine matches within the table
+ \param fExactAndFuzzies switch to control the handling of fuzzy matches when exact matches exist, TRUE = keep fuzzy matches even when exact matches exist
+ \param lOptions options for the sorting of the proposals
+ */
+ void copyBestMatches(
+ std::vector &SourceProposals,
+ std::vector &TargetProposals,
+ int iMaxProposals,
+ int iMTDisplayFactor,
+ BOOL fExactAndFuzzies,
+ LONG lOptions = 0);
+
+ /*! \brief Insert proposal into proposal vector at the correct position and
+ remove a proposal with lesser relevance when iMaxPropoals have already been filled
+ \param NewProposal pointer to proposal being inserted
+ \param SourceProposals refernce to a vector containing the source proposals
+ \param TargetProposals reference to a vector receiving the copied proposals
+ the vector may already contain proposals. The proposals are
+ inserted on their relevance
+ \param iMaxProposals maximum number of proposals to be filled in TargetProposals
+ When there are more proposals available proposals with lesser relevance will be replaced
+ \param fLastEntry true = this is the last entry in the table
+ \param iMTDisplayFactor factor for the placement of machine matches within the table
+ \param lOptions options for the sorting of the proposals
+ */
+ void insertProposalData(
+ OtmProposal *newProposal,
+ std::vector &Proposals,
+ int iMaxProposals,
+ BOOL fLastEntry,
+ int iMTDisplayFactor = -1,
+ LONG lOptions = 0);
+
+ /*! \brief Get the object name for the memory
+ \param pMemory pointer to the memory object
+ \param pszObjName pointer to a buffer for the object name
+ \param iBufSize size of the object name buffer
+ \returns 0 when successful or the error code
+ */
+ int getObjectName(EqfMemory *pMemory, char *pszObjName, int iBufSize);
+
+ /*! \brief Get the plugin name and the memory name from a memory object name
+ \param pszObjName pointer to the memory object name
+ \param pszPluginName pointer to the buffer for the plugin name or
+ NULL if no plugin name is requested
+ \param iPluginBufSize size of the buffer for the plugin name
+ \param pszluginName pointer to the buffer for the plugin name or
+ NULL if no memory name is requested
+ \param iNameBufSize size of the buffer for the memory name
+ \returns 0 when successful or the error code
+ */
+ int splitObjName(char *pszObjName, char *pszPluginName, int iPluginBufSize, char *pszMemoryName, int iNameBufSize);
+
+ /*! \brief Get the sort order key for a memory match
+ \param Proposal reference to a proposal for which the sort key is evaluated
+ \param iMTDisplayFactor the machine translation display factor, -1 to ignore the factor
+ \param usContextRanking the context ranking for the proposal
+ \param fEndIfTable TRUE when this proposal is the last in a proposal table
+ When there are more proposals available proposals with lesser relevance will be replaced
+ \returns the proposal sort key
+ */
+ int getProposalSortKey(OtmProposal &Proposal, int iMTDisplayFactor, USHORT usContextRanking, BOOL fEndOfTable, LONG lOptions = 0);
+
+ /*! \brief Get the sort order key for a memory match
+ \param Proposal reference to a proposal for which the sort key is evaluated
+ \returns the proposal sort key
+ */
+ int getProposalSortKey(OtmProposal &Proposal);
+
+ /*! \brief Get the sort order key for a memory match
+ \param MatchType match type of the match
+ \param ProposalType type of the proposal
+ \param iFuzziness fuzziness of the proposal
+ \param iMTDisplayFactor the machine translation display factor, -1 to use the system MT display factor
+ \param usContextRanking the context ranking for the proposal
+ \param fEndIfTable TRUE when this proposal is the last in a proposal table
+ When there are more proposals available proposals with lesser relevance will be replaced
+ \returns the proposal sort key
+ */
+ int getProposalSortKey(OtmProposal::eMatchType MatchType, OtmProposal::eProposalType ProposalType, int iFuzzyness, int iMTDisplayFactor, USHORT usContextRanking, BOOL fEndOfTable, LONG lOptions = 0);
/*! \brief Replace a memory with the data from another memory
This method bevaves like deleting the replace memory and renaming the
@@ -4210,95 +3964,86 @@ int getProposalSortKey( OtmProposal::eMatchType MatchType, OtmProposal::ePropos
\param pszPluginName name of plugin of the memory
\param pszReplace name of the memory being replaced
\param pszReplaceWith name of the memory replacing the pszReplace memory
- returns 0 if successful or error return code
+ returns 0 if successful or error return code
*/
- int ReplaceMemory
- (
- const std::string& strReplace,
- const std::string& strReplaceWith,
- std::string& outputMsg,
- MutexTimeout& tmListTimeout
- );
-
+ int ReplaceMemory(
+ const std::string &strReplace,
+ const std::string &strReplaceWith,
+ std::string &outputMsg,
+ MutexTimeout &tmListTimeout);
private:
-
/* \brief Get memory plugin with the given plugin name
\param pszPlugin plugin-name
\returns pointer to plugin or NULL if no memory pluging with the given name is specified
*/
-OtmPlugin *getPlugin
-(
- const char *pszPluginName
-);
+ OtmPlugin *getPlugin(
+ const char *pszPluginName);
-/* \brief Refresh internal list of memory plugins
-*/
-void refreshPluginList();
+ /* \brief Refresh internal list of memory plugins
+ */
+ void refreshPluginList();
/*! \brief search option flags
-*/
-#define SEARCH_SOURCE 1
-#define SEARCH_TARGET 2
+ */
+#define SEARCH_SOURCE 1
+#define SEARCH_TARGET 2
#define SEARCH_CASEINSENSITIVE 4
#define SEARCH_WHITESPACETOLERANT 8
+ /*! \brief Pointer to the list of installed memory plugins
+ */
+ std::vector