All URIs are relative to https://lilt.com/2
Method | HTTP request | Description |
---|---|---|
createSegment | POST /segments | Create a Segment |
deleteSegment | DELETE /segments | Delete a Segment |
getSegment | GET /segments | Retrieve a Segment |
tagSegment | GET /segments/tag | Tag a Segment |
unlockSegments | POST /segments/review/unlock | Unaccept and unlock segments |
updateSegment | PUT /segments | Update a Segment |
Segment createSegment(body)
Create a Segment
Create a Segment and add it to a Memory. A Segment is a source/target pair that is used to train the machine translation system and populate the translation memory. This is not intended to be used on documents and will throw an error. The maximum source length is 5,000 characters.
import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';
let apiInstance = new LiltNode.SegmentsApi();
let body = new LiltNode.SegmentCreateParameters(); // SegmentCreateParameters |
apiInstance.createSegment(body).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
body | SegmentCreateParameters |
- Content-Type: application/json
- Accept: application/json
SegmentDeleteResponse deleteSegment(id)
Delete a Segment
Delete a Segment from memory. This will not delete a segment from a document.
import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';
let apiInstance = new LiltNode.SegmentsApi();
let id = 56; // Number | A unique Segment identifier.
apiInstance.deleteSegment(id).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
id | Number | A unique Segment identifier. |
- Content-Type: Not defined
- Accept: application/json
SegmentWithComments getSegment(id, opts)
Retrieve a Segment
Retrieve a Segment.
import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';
let apiInstance = new LiltNode.SegmentsApi();
let id = 56; // Number | A unique Segment identifier.
let opts = {
'includeComments': false // Boolean | Include comments in the response.
};
apiInstance.getSegment(id, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
id | Number | A unique Segment identifier. | |
includeComments | Boolean | Include comments in the response. | [optional] [default to false] |
- Content-Type: Not defined
- Accept: application/json
TaggedSegment tagSegment(sourceTagged, target, memoryId)
Tag a Segment
Project tags for a segment. The `source_tagged` string contains one or more SGML tags. The `target` string is untagged. This endpoint will automatically place the source tags in the target. Usage charges apply to this endpoint for production REST API keys.
import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';
let apiInstance = new LiltNode.SegmentsApi();
let sourceTagged = "sourceTagged_example"; // String | The tagged source string.
let target = "target_example"; // String | The target string.
let memoryId = 56; // Number | A unique Memory identifier.
apiInstance.tagSegment(sourceTagged, target, memoryId).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
sourceTagged | String | The tagged source string. | |
target | String | The target string. | |
memoryId | Number | A unique Memory identifier. |
- Content-Type: Not defined
- Accept: application/json
[Number] unlockSegments(body)
Unaccept and unlock segments
Unaccept and unlock segments. Sets individual segments' "Review Done" to false. Confirmed segments will remain confirmed. Example curl: ``` curl --X --request POST 'https://lilt.com/2/segments/review/unlock?key=API_KEY' \ --header 'Content-Type: application/json' \ --data-raw '{ "segmentIds": [23921, 23922] }' ```
import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';
let apiInstance = new LiltNode.SegmentsApi();
let body = new LiltNode.SegmentDoneResponse(); // SegmentDoneResponse |
apiInstance.unlockSegments(body).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
body | SegmentDoneResponse |
[Number]
- Content-Type: application/json
- Accept: application/json
Segment updateSegment(body)
Update a Segment
Update a Segment in memory. The Memory will be updated with the new target string.
import LiltNode from 'lilt-node';
let defaultClient = LiltNode.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
// Configure HTTP basic authorization: BasicAuth
let BasicAuth = defaultClient.authentications['BasicAuth'];
BasicAuth.username = 'YOUR USERNAME';
BasicAuth.password = 'YOUR PASSWORD';
let apiInstance = new LiltNode.SegmentsApi();
let body = new LiltNode.SegmentUpdateParameters(); // SegmentUpdateParameters |
apiInstance.updateSegment(body).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
body | SegmentUpdateParameters |
- Content-Type: application/json
- Accept: application/json