Request example:
{
"source": "The end",
"target": "The target",
"sourceLang": "en", // langs would be checked with languages.xml
"targetLang": "de",
//additional field
["documentName": "Translate5 Demo Text-en-de.xlf"],
["segmentNumber": 8,]
["author": "Thomas Lauria"],
["timeStamp": "20210621T071042Z"], // if there is no timestamp, current time would be used
["context": "2_2"], // context and addInfo would be saved in TM in the same field
["addInfo": "2_2"],
["type": "Manual"], // could be GlobalMemory, GlobalMemoryStar, MachineTranslation, Manual, by default Undefined
["markupTable": "OTMXUXLF"], //if there is no markup, default OTMXUXLF would be used.
//Markup tables should be located inside ~/.t5memory/TABLE/%markup$.TBL
["loggingThreshold": 0],
["save2disk": 0] // flag if we need to flush tm to disk after update. by default is true
}
here are data struct used for search, so you can see max numbers of symbols
typedef struct _LOOKUPINMEMORYDATA
{
char szMemory[260];
wchar_t szSource[2050];
wchar_t szTarget[2050];
char szIsoSourceLang[40];
char szIsoTargetLang[40];
int lSegmentNum;
char szDocName[260];
char szMarkup[128];
wchar_t szContext[2050];
wchar_t szAddInfo[2050];
wchar_t szError[512];
char szType[256];
char szAuthor[80];
char szDateTime[40];
char szSearchMode[40]; // only for concordance search
char szSearchPos[80]; // only for concordance search
int iNumOfProposals;
int iSearchTime;
wchar_t szSearchString[2050];
} LOOKUPINMEMORYDATA, *PLOOKUPINMEMORYDATA;
Response example:success:
{
"sourceLang": "de-DE",
"targetLang": "en-GB",
"source": "The end",
"target": "The target",
"documentName": "Translate5 Demo Text-en-de.xlf",
"segmentNumber": 222,
"markupTable": "OTMXUXLF",
"timeStamp": "20210621T071042Z",
"author": "Thomas Lauria"
}
in case if similar record exists, t5memory comparing source text,
if it's the same, t5memory would compare docName,
if it's the same,t5memory would compare timestamps and would leave only newer one
in case if TM is alreade reached it's limit, you would get
{
"ReturnValue": 5034,
"ErrorMsg": ""
}or{
"ReturnValue": 5035,
"ErrorMsg": ""
} |