...
- import new openTM2-TMs
- delete openTM2-TMs
- create new empty openTM2-TM
- import TMX
- open TM and close TM: not possible see extra section in this document. Maybe we need trigger to flush tm to the disk, but also it could be done in some specific cases...
- query TM for Matches: one query per TM, not quering multiple TMs at once.
- query TM for concordance search
- extract segment by it's location
- save new entry to TM
- delete entry from TM
- localy clone TM
- reorganize TM
- get some statistics about service
- also you can use tagreplacement endpoint to test tag replacement mechanism
...
Endpoints overview | default endpoint/example | Is async? | ||||
---|---|---|---|---|---|---|
1 | Get the list of TMs | Returns JSON list of TMs | GET | /%service%/ | /t5memory/ | |
2 | Create TM | Creates TM with the provided name | POST | /%service%/ | /t5memory/ | |
3 | Create/Import TM in internal format | Import and unpack base64 encoded archive of .TMD, .TMI, .MEM files. Rename it to provided name | POST | /%service%/ | /t5memory/ | |
4 | Clone TM Localy | Makes clone of existing tm | POST | /%service%/%tm_name%/clone | /t5memory/my+TM/clone (+is placeholder for whitespace in tm name, so there should be 'my TM.TMD' and 'my TM.TMI'(and in pre 0.5.x 'my TM.MEM' also) files on the disk ) tm name IS case sensetive in url | |
5 | Reorganize TM | Reorganizing tm(replacing tm with new one and reimporting segments from tmd) - async | GET | /%service%/%tm_name%/reorganize | /t5memory/my+other_tm/reorganize | + in 0.5.x and up |
5 | Delete TM | Deletes .TMD, .TMI files | DELETE | /%service%/%tm_name%/ | /t5memory/%tm_name%/ | |
6 | Import TMX into TM | Import provided base64 encoded TMX file into TM - async | POST | /%service%/%tm_name%/import | /t5memory/%tm_name%/import | + |
7 | Export TMX from TM | Creates TMX from tm. Encoded in base64 | GET | /%service%/%tm_name%/ | /t5memory/%tm_name%/ | |
8 | Export in Internal format | Creates and exports archive with .TMD, .TMI files of TM | GET | /%service%/%tm_name%/ | /t5memory/%tm_name%/status | |
9 | Status of TM | Returns status\import status of TM | GET | /%service%/%tm_name%/status | /t5memory/%tm_name%/status | |
10 | Fuzzy search | Returns entries\translations with small differences from requested | POST | /%service%/%tm_name%/fuzzysearch | /t5memory/%tm_name%/fuzzysearch | |
11 | Concordance search | Returns entries\translations that contain requested segment | POST | /%service%/%tm_name%/concordancesearch | /t5memory/%tm_name%/concordancesearch | |
12 | Entry update | Updates entry\translation | POST | /%service%/%tm_name%/entry | /t5memory/%tm_name%/entry | |
13 | Entry delete | Deletes entry\translation | POST | /%service%/%tm_name%/entrydelete | /t5memory/%tm_name%/entrydelete | |
14 | Save all TMs | Flushes all filebuffers(TMD, TMI files) into the filesystem | GET | /%service%_service/savetms | /t5memory_service/saveatms | |
15 | Shutdown service | Flushes all filebuffers into the filesystem and shutting down the service | GET | /%service%_service/shutdown | /t5memory_service/shutdown | |
16 | Test tag replacement call | For testing tag replacement | POST | /%service%_service/tagreplacement | /t5memory_service/tagreplacement | |
17 | Resources | Returns resources and service data | GET | /%service%_service/resources | /t5memory_service/resources | |
18 | Import tmx from local file(in removing lookuptable git branch) | Similar to import tmx, but instead of base64 encoded file, use local path to file | POST | /%service%/%tm_name%/importlocal | /t5memory/%tm_name%/importlocal | + |
19 | Mass deletion of entries(from v0.6.0) | It's like reorganize, but with skipping import of segments, that after checking with provided filters combined with logical AND returns true. | POST | /%service%/%tm_name%/entriesdelete | /t5memory/tm1/entriesdelete | + |
20 | New concordance search(from v0.6.0) | It's extended concordance search, where you can search in different field of the segment | POST | /%service%/%tm_name%/search | /t5memory/tm1/search | |
21 | Get segment by internal key | Extracting segment by it's location in tmd file. | POST | /%service%/%tm_name%/getentry | /t5memory/tm1/getentry | |
22 | NEW Import tmx | Imports tmx in non-base64 format | POST | /%service%/%tm_name%/importtmx | /t5memory/tm1/tmporttmx | + |
23 | NEW import in internal format(tm) | Extracts tm zip attached to request(it should contains tmd and tmi files) into MEM folder | POST | /%service%/%tm_name%/ | /t5memory/tm1/ ("multipart/form-data") | |
24 | NEW export tmx | Exports tmx file as a file. Could be used to export selected number of segments starting from selected position | GET (could be with body) | /%service%/%tm_name%/download.tmx | /t5memory/tm1/download.tmx | |
25 | NEW export tm (internal format) | Exports tm archive | GET | /%service%/%tm_name%/download.tm | /t5memory/tm1/download.tm |
Available end points
List of TMs | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Purpose | Returns JSON list of TMs | |||||||||
Request | GET /%service%/ | |||||||||
Params | - | |||||||||
Returns list of open TMs and then list of available(excluding open) in the app.
|
...
Import provided base64 encoded TMX file into TM | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Purpose | Import provided base64 encoded TMX file into TM. Starts another thead for import. For checking import status use status call | |||||||||
Request | POST /%service%/%tm_name%/import | |||||||||
Params | {"tmxData": "base64EncodedTmxFile" }
| |||||||||
TM must exist Handling if framing tag situation differs from source to target - for skipAll or skipPairedIf framing tags situation is the same in source and target, both sides should be treated as described above. If framing tags only exist in source, then still they should be treated as described above. If they only exist in target, then nothing should be removed.
|
...
Table of Contents
Overview and API introduction
In this document the translate5 TM service REST interface is described.
The translate5 TM service is build by using the OpenTM2 Translation Memory Engine.
It provides the following functionality:
- import new openTM2-TMs
- delete openTM2-TMs
- create new empty openTM2-TM
- import TMX
- open TM and close TM: not possible see extra section in this document. Maybe we need trigger to flush tm to the disk, but also it could be done in some specific cases...
- query TM for Matches: one query per TM, not quering multiple TMs at once.
- query TM for concordance search
- extract segment by it's location
- save new entry to TM
- delete entry from TM
- localy clone TM
- reorganize TM
- get some statistics about service
- also you can use tagreplacement endpoint to test tag replacement mechanism
This can be achieved by the following specification of a RESTful HTTP Serive, the specification is given in the following form:
- URL of the HTTP Resource, where servername and an optional path prefix is configurable.
- HTTP Method with affected functionality
- Brief Description
- Sent and returned Body.
Request Data Format:
The transferred data in the requests is JSON and is directly done in the request body. It's should be pretty json and ends with '\n}" symbol, because of bug in proxygen that caused garbage after valid data.
URL Format:
In this document, the OpenTM2 is always assumed under http://opentm2/.
To rely on full networking features (proxying etc.) the URL is configurable in Translate5 so that the OpenTM2 instance can also reside under http://xyz/foo/bar/.
Errors
For each request, the possible errors are listed below for each resource. In case of an error, the body should contain at least the following JSON, if it is senseful the attributes of the original representation can be added.
{
errors: [{errorMsg: 'Given tmxData is no TMX.'}]
}
Values | |
---|---|
%service% | Name of service(default - t5memory, could be changed in t5m3mory.conf file |
%tm_name% | Name of Translation Memory |
Example | http://localhost:4040/t5memory/examle_tm/fuzzysearch/? |
Endpoints overview | default endpoint/example | Is async? | ||||
---|---|---|---|---|---|---|
1 | Get the list of TMs | Returns JSON list of TMs | GET | /%service%/ | /t5memory/ | |
2 | Create TM | Creates TM with the provided name | POST | /%service%/ | /t5memory/ | |
3 | Create/Import TM in internal format | Import and unpack base64 encoded archive of .TMD, .TMI, .MEM files. Rename it to provided name | POST | /%service%/ | /t5memory/ | |
4 | Clone TM Localy | Makes clone of existing tm | POST | /%service%/%tm_name%/clone | /t5memory/my+TM/clone (+is placeholder for whitespace in tm name, so there should be 'my TM.TMD' and 'my TM.TMI'(and in pre 0.5.x 'my TM.MEM' also) files on the disk ) tm name IS case sensetive in url | |
5 | Reorganize TM | Reorganizing tm(replacing tm with new one and reimporting segments from tmd) - async | GET | /%service%/%tm_name%/reorganize | /t5memory/my+other_tm/reorganize | + in 0.5.x and up |
5 | Delete TM | Deletes .TMD, .TMI files | DELETE | /%service%/%tm_name%/ | /t5memory/%tm_name%/ | |
6 | Import TMX into TM | Import provided base64 encoded TMX file into TM - async | POST | /%service%/%tm_name%/import | /t5memory/%tm_name%/import | + |
7 | Export TMX from TM | Creates TMX from tm. Encoded in base64 | GET | /%service%/%tm_name%/ | /t5memory/%tm_name%/ | |
8 | Export in Internal format | Creates and exports archive with .TMD, .TMI files of TM | GET | /%service%/%tm_name%/ | /t5memory/%tm_name%/status | |
9 | Status of TM | Returns status\import status of TM | GET | /%service%/%tm_name%/status | /t5memory/%tm_name%/status | |
10 | Fuzzy search | Returns entries\translations with small differences from requested | POST | /%service%/%tm_name%/fuzzysearch | /t5memory/%tm_name%/fuzzysearch | |
11 | Concordance search | Returns entries\translations that contain requested segment | POST | /%service%/%tm_name%/concordancesearch | /t5memory/%tm_name%/concordancesearch | |
12 | Entry update | Updates entry\translation | POST | /%service%/%tm_name%/entry | /t5memory/%tm_name%/entry | |
13 | Entry delete | Deletes entry\translation | POST | /%service%/%tm_name%/entrydelete | /t5memory/%tm_name%/entrydelete | |
14 | Save all TMs | Flushes all filebuffers(TMD, TMI files) into the filesystem | GET | /%service%_service/savetms | /t5memory_service/saveatms | |
15 | Shutdown service | Flushes all filebuffers into the filesystem and shutting down the service | GET | /%service%_service/shutdown | /t5memory_service/shutdown | |
16 | Test tag replacement call | For testing tag replacement | POST | /%service%_service/tagreplacement | /t5memory_service/tagreplacement | |
17 | Resources | Returns resources and service data | GET | /%service%_service/resources | /t5memory_service/resources | |
18 | Import tmx from local file(in removing lookuptable git branch) | Similar to import tmx, but instead of base64 encoded file, use local path to file | POST | /%service%/%tm_name%/importlocal | /t5memory/%tm_name%/importlocal | + |
19 | Mass deletion of entries(from v0.6.0) | It's like reorganize, but with skipping import of segments, that after checking with provided filters combined with logical AND returns true. | POST | /%service%/%tm_name%/entriesdelete | /t5memory/tm1/entriesdelete | + |
20 | New concordance search(from v0.6.0) | It's extended concordance search, where you can search in different field of the segment | POST | /%service%/%tm_name%/search | /t5memory/tm1/search | |
21 | Get segment by internal key | Extracting segment by it's location in tmd file. | POST | /%service%/%tm_name%/getentry | /t5memory/tm1/getentry | |
22 | NEW Import tmx | Imports tmx in non-base64 format | POST | /%service%/%tm_name%/importtmx | /t5memory/tm1/tmporttmx | + |
23 | NEW import in internal format(tm) | Extracts tm zip attached to request(it should contains tmd and tmi files) into MEM folder | POST | /%service%/%tm_name%/ | /t5memory/tm1/ ("multipart/form-data") | |
24 | NEW export tmx | Exports tmx file as a file. Could be used to export selected number of segments starting from selected position | GET (could be with body) | /%service%/%tm_name%/download.tmx | /t5memory/tm1/download.tmx | |
25 | NEW export tm (internal format) | Exports tm archive | GET | /%service%/%tm_name%/download.tm | /t5memory/tm1/download.tm |
Available end points
List of TMs | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Purpose | Returns JSON list of TMs | |||||||||
Request | GET /%service%/ | |||||||||
Params | - | |||||||||
Returns list of open TMs and then list of available(excluding open) in the app.
|
Create TM | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Purpose | Creates TM with the provided name(tmd and tmi files in/MEM/ folder) | |||||||||
Request | Post /%service%/%tm_name%/ | |||||||||
Params | Required: name, sourceLang | |||||||||
|
Create/Import TM in internal format | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Purpose | Import and unpack base64 encoded archive of .TMD, .TMI, .MEM(in pre 0.5.x versions) files. Rename it to provided name | |||||||||
Request | POST /%service%/ | |||||||||
Params | { "name": "examle_tm", "sourceLang": "bg-BG" , "data":"base64EncodedArchive" } or alternatively data could be provided in non-base64 binary format as a file attached to the request | |||||||||
curl -X POST \ -H "Content-Type: application/json" \ -F "file=@/path/to/12434615271d732fvd7te3.gz;filename=myfile.tg" \ -F "json_data={\"name\": \"TM name\", \"sourceLang\": \"en-GB\"}" \ http://t5memory:4045/t5memory | ||||||||||
Do not import tms created in other version of t5memory. Starting from 0.5.x tmd and tmi files has t5memory version where they were created in the header of the file, and different middle version(0.5.x) or global version(0.5.x) would be represented as This would create example_tm.TMD(data file) and example.TMI(index file) in MEM folder In 0.6.20 and up data could be send as attachment instead of base64 encoded. Content-type then should be set to "multipart/form-data" and then json(with name of new tm) should be provided with json_data key(search is made this way: part.headers.at("Content-Disposition").find("name=\"json_data\"") curl command example : curl -X POST \
|
Clone TM localy | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Purpose | Creates TM with the provided name | |||||||||
Request | Post /%service%/%tm_name%/clone | |||||||||
Params | Required: name, sourceLang | |||||||||
Endpoint is sync(blocking)
|
Delete TM | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Purpose | Deletes .TMD, .TMI, .MEM files | ||||||||||||||||||
Request | Delete /%service%/%tm_name%/ | ||||||||||||||||||
Params | - | ||||||||||||||||||
|
Import binary TMX file into TM | |
---|---|
Purpose | Import provided base64 encoded TMX file into TM. Starts another thead for import. For checking import status use status call |
Request | POST /%service%/%tm_name%/importtmx |
Params | Request has a file attached and a body as an option, Implemented in 0.6.19 curl -X POST \ -H "Content-Type: application/json" \ -F "file=@/path/to/12434615271d732fvd7te3.tmx;filename=myfile.tmx" \ -F "json_data={\"framingTags\": \"value\", \"timeout\": 1500}" \ http://t5memory:4045/t5memory/{memory_name}/importtmx Body should be provided in multiform under json_data key { ["framingTags": "saveAll"], // framing tags behaviour [timeout: 100] // timeout in sec after which import stops, even if it doesn't reach end of tmx yet }
|
TM must exist TMX import could be interrupted in case of invalid XML or TM reaching it's limit or timeout. For both cases check status request to have info about position in tmx file where it was interrupted. Handling if framing tag situation differs from source to target - for skipAll or skipPairedIf framing tags situation is the same in source and target, both sides should be treated as described above. If framing tags only exist in source, then still they should be treated as described above. If they only exist in target, then nothing should be removed. |
Reorganize TM | |
---|---|
Purpose | Reorganizes tm and fixing issues. |
Request | GET /%service%/%tm_name%/reorganize |
Headers | Accept - applicaton/xml |
up to v0.4.x reorganize is sync, so t5memory reorganize would check this condition
| Reorganizes tm and fixing issues. |
Request | GET /%service%/%tm_name%/reorganize |
Headers | Accept - applicaton/xml |
up to v0.4.x reorganize is sync, so t5memory starting from 0.5.x is async, so you can check status of reorganize similar to how you can check status for importTMX 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 reorganize would check this condition
, and in case if this condition is true and then it passes segment to putProposal function, which is also used by UpdateRequest and ImportTmx request, so other
{ |
...
New Concordance search | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Purpose | Returns entries\translations that fits selected filters. | |||||||||
Request | POST /%service%/%tm_name%/search | |||||||||
Params | Required: NONE iNumOfProposal - limit of found proposals - max is 200, if 0 → use default value '5' | |||||||||
Search is made segment-by segment, and it's checking segment if it fits selected filters. You can search for EXACT or CONCORDANCE matches in this fields: "Filters":" It's possible to apply filter just with SearchMode, like if you would type "authorSearchMode": "exact",but there would be no "author" field, it would look for segments, where author field is empty. "timestampSpanStart":"20000121T115234Z", You should set both parameters to apply filter, otherwise you would get error as return. Check output to see how it was parsed and applied. "logicalOr": 1, Instead of returning segments, just count them and return counter in "NumOfFoundSegments":22741 "sourceLang":"en-GB", Lang filters could be applied with major lang feature, so source lang in this case would be applied as exact filter for source lang, but target lang would check if langs is in the same lang group. That check is done in languages.xml file with isPreferred flag. "GlobalSearchOptions":"SEARCH_FILTERS_LOGICAL_OR|SEARCH_EXACT_MATCH_OF_SRC_LANG_OPT, lang = en-GB|SEARCH_GROUP_MATCH_OF_TRG_LANG_OPT, lang = de", Other that you can send is: "searchPosition":"8:1", So search position is position where to start search internaly in btree. This search is limited by num of found segment(set by numResults) or timeout(set by msSearchAfterNumResults), but timeout would be ignored in case if there are no segments in the tm to fit params. Max numResults is 200. from responce.
Here is search request with all possible parameters: "source":"the", "sourceSearchMode":"CONTAINS, CASEINSENSETIVE, WHITESPACETOLERANT, INVERTED", "target":"", "targetSearchMode":"EXACT, CASEINSENSETIVE", "document":"evo3_p1137_reports_translation_properties_de_fr_20220720_094902", "documentSearchMode":"CONTAINS, INVERTED", "author":"some author", "timestampSpanStart": "20000121T115234Z", "timestampSpanEnd": "20240121T115234Z", "addInfo":"some add info", "addInfoSearchMode":"CONCORDANCE, WHITESPACETOLERANT", "context":"context context", "contextSearchMode":"EXACT", "sourceLang":"en-GB", "targetLang":"SV", "searchPosition": "8:1", "numResults": 2, "msSearchAfterNumResults": 25, So request with this body would also work: | ||||||||||
Parameter | valueType | default value | possible values | requireField | description | |||||
sourceLang | string | "" | langs that can be matched to langs in languages.xml | - | Filter segments on src/trg lang attribute, If specified lang is preffered, matching is done based on lang family, | |||||
targetLang | ||||||||||
searchPosition | string | "" (search would start from "7:1" then | "8:1" etc | point where to start search in tmd file | ||||||
numResults | int | 5 | (0....200] | points how many matches return in current request | ||||||
msSearchAfterNumResults | 0 | no check | sets how many ms should pass between first found segment and search stop, if it didn't reach the end yet. | |||||||
loggingThreshold | -1 | [0...6] | additional field to set log level on the run | |||||||
logicalOr | int | 0 | 0 for false, any other number as true, example: "logicalOr": 1, "onlyCountSegments": 1 | 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 | ||||||
onlyCountSegments | 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 | |||||||||
source | string | "" | any string, example "source": "data in the segment" | sourceSearchMode | 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. | |||||
target | targetSearchMode | --//–(the same as above but for corresponding fields) | ||||||||
document | documentSearchMode | |||||||||
author | authorSearchMode | |||||||||
context | contextSearchMode | |||||||||
addInfo | addInfoSearchMode | |||||||||
timestampSpanStart | string | string with date in format "20240121T115234Z" | timestampSpanEnd | Sets filter for time. You need to provid both timestamps, or none, otherwise request would return an error. Could be used in "OR" combination in "logicalOr": 1,, but, maybe, it's better to change that behaviour to similar like with langs(Always AND) | ||||||
timestampSpanEnd | timestampSpanStart | sourceSearchMode | string | "" | String with required- | |||||
targetSearchMode | ||||||||||
documentSearchMode | ||||||||||
authorSearchMode | ||||||||||
contextSearchMode | ||||||||||
addInfoSearchMode |
, OpenTM2 returns than a string in NewSearchPosition, which is just resent to OpenTM2 in the next request.
Not found:{
"ReturnValue": 0,
"NewSearchPosition": null,
"ErrorMsg": ""
}TM not found:{
"ReturnValue": 133,
"ErrorMsg": "OtmMemoryServiceWorker::concordanceSearch::"
} |
Here is search request with all possible parameters:
{
"logicalOr": 1,
"source":"the",
"sourceSearchMode":"CONTAINS, CASEINSENSETIVE, WHITESPACETOLERANT, INVERTED",
"target":"", "targetSearchMode":"EXACT, CASEINSENSETIVE",
"document":"evo3_p1137_reports_translation_properties_de_fr_20220720_094902",
"documentSearchMode":"CONTAINS, INVERTED",
"author":"some author",
"authorSearchMode":"CONTAINS",
"timestampSpanStart": "20000121T115234Z",
"timestampSpanEnd": "20240121T115234Z",
"addInfo":"some add info",
"addInfoSearchMode":"CONCORDANCE, WHITESPACETOLERANT",
"context":"context context",
"contextSearchMode":"EXACT",
"sourceLang":"en-GB",
"targetLang":"SV",
"searchPosition": "8:1",
"numResults": 2,
"msSearchAfterNumResults": 25,
"loggingThreshold": 3
}
All fields is optional, but some depends on other, so error should be returned in case of not providing required field
So request with this body would also work:
{
}
Parameter | valueType | default value | possible values | requireField | description |
---|---|---|---|---|---|
sourceLang | string | "" | langs that can be matched to langs in languages.xml | - | Filter segments on src/trg lang attribute, If specified lang is preffered, matching is done based on lang family, |
targetLang | |||||
searchPosition | string | "" (search would start from "7:1" then | "8:1" etc | point where to start search in tmd file | |
numResults | int | 5 | (0....200] | points how many matches return in current request | |
msSearchAfterNumResults | 0 | no check | sets how many ms should pass between first found segment and search stop, if it didn't reach the end yet. | ||
loggingThreshold | -1 | [0...6] | additional field to set log level on the run | ||
logicalOr | int | 0 | 0 for false, any other number as true, example: "logicalOr": 1, "onlyCountSegments": 1 | 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 | |
onlyCountSegments | 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 | ||||
source | string | "" | any string, example "source": "data in the segment" | sourceSearchMode | 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. |
target | targetSearchMode | --//–(the same as above but for corresponding fields) | |||
document | documentSearchMode | ||||
author | authorSearchMode | ||||
context | contextSearchMode | ||||
addInfo | addInfoSearchMode | ||||
timestampSpanStart | string | string with date in format "20240121T115234Z" | timestampSpanEnd | Sets filter for time. You need to provid both timestamps, or none, otherwise request would return an error. Could be used in "OR" combination in "logicalOr": 1,, but, maybe, it's better to change that behaviour to similar like with langs(Always AND) | |
timestampSpanEnd | timestampSpanStart | ||||
sourceSearchMode | string | "" | String with required EXACT or CONCORDANCE (or CONTAINS, what's equal to CONCORDANCE) words and some optional, like CASEINSENSETIVE for non case sensetive comparison, WHITESPACETOLERANT for modifying whitespaces(result of this actions you can see in filters in responce) INVERTED for applying filter in inverted state, so to return false on match and true if no match. Logical NOT Attributes is not case sensetive, Separator doen't matters | - | Sets type of search for corresponding field. 4) "author": "Ed Sheeran", - ERROR, search mode(Exact\Contains) is not selected
|
targetSearchMode | |||||
documentSearchMode | |||||
authorSearchMode | |||||
contextSearchMode | |||||
addInfoSearchMode |
Concordance search | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Purpose | Returns entries\translations that contain requested segment | |||||||||
Request | POST /%service%/%tm_name%/concordancesearch | |||||||||
Params | Required: searchString - what we are looking for , searchType ["Source"|"Target"|"SourceAndTarget"] - where to look iNumOfProposal - limit of found proposals - max is 20, if 0 → use default value '5' | |||||||||
| ||||||||||
Concordance search | ||||||||||
Purpose | Returns entries\translations that contain requested segment | |||||||||
Request | POST /%service%/%tm_name%/concordancesearch | |||||||||
Params | Required: searchString - what we are looking for , searchType ["Source"|"Target"|"SourceAndTarget"] - where to look iNumOfProposal - limit of found proposals - max is 20, if 0 → use default value '5' | |||||||||
|
Get entry | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Purpose | Returns entry that located in [recordKey:targetKey] location or error if it's empty | |||||||||
Request | POST /%service%/%tm_name%/getentry | |||||||||
Params | Required: recordKey- it's position in the tmd file, starting from 7(first 6 it's service records) targetKey - position in record, starting from 1 Implemented in 0.6.24 | |||||||||
|
Update entry | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Purpose | Updates entry\translation | ||||||||||||||||||
Request | POST /%service%/%tm_name%/entry | ||||||||||||||||||
Params | Only sourceLang, targetLang, source and target are required | ||||||||||||||||||
This request would made changes only in the filebuffer(so files on disk would not be changed)
|
...