API bindings for the Lilt REST API.
All URIs are relative to https://lilt.com/2
Method | HTTP request | Description |
---|---|---|
query_lexicon | GET /lexicon | Query a Lexicon |
update_lexicon | POST /lexicon | Update a Lexicon |
list[LexiconEntry] query_lexicon(memory_id, srclang, trglang, query, n=n)
Query a Lexicon
Query the Lexicon. The Lexicon is an editable termbase / concordance that is integrated with the Memory.
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lilt.LexiconApi(api_client) memory_id = 56 # int | A unique Memory identifier. srclang = ‘srclang_example’ # str | An ISO 639-1 language code. trglang = ‘trglang_example’ # str | An ISO 639-1 language code. query = ‘query_example’ # str | The query term. n = 1 # int | The maximum number of results to return. (optional) (default to 1)
try:
# Query a Lexicon
api_response = api_instance.query_lexicon(memory_id, srclang, trglang, query, n=n)
pprint(api_response)
except ApiException as e:
print("Exception when calling LexiconApi->query_lexicon: %s\n" % e) ```
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lilt.LexiconApi(api_client) memory_id = 56 # int | A unique Memory identifier. srclang = ‘srclang_example’ # str | An ISO 639-1 language code. trglang = ‘trglang_example’ # str | An ISO 639-1 language code. query = ‘query_example’ # str | The query term. n = 1 # int | The maximum number of results to return. (optional) (default to 1)
try:
# Query a Lexicon
api_response = api_instance.query_lexicon(memory_id, srclang, trglang, query, n=n)
pprint(api_response)
except ApiException as e:
print("Exception when calling LexiconApi->query_lexicon: %s\n" % e) ```
Name | Type | Description | Notes |
---|---|---|---|
memory_id | int | A unique Memory identifier. | |
srclang | str | An ISO 639-1 language code. | |
trglang | str | An ISO 639-1 language code. | |
query | str | The query term. | |
n | int | The maximum number of results to return. | [optional] [default to 1] |
| Status code | Description | Response headers | |————-|————-|——————| 200 | A list of LexiconEntry objects. | - | 0 | Unexpected error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
LexiconUpdateResponse update_lexicon(body)
Update a Lexicon
Update the Lexicon (Termbase as displayed in the ui) with a new term. The maximum source length is 250 characters.
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lilt.LexiconApi(api_client) body = lilt.LexiconUpdateParameters() # LexiconUpdateParameters |
try:
# Update a Lexicon
api_response = api_instance.update_lexicon(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling LexiconApi->update_lexicon: %s\n" % e) ```
configuration = lilt.Configuration( host = “https://lilt.com/2” )
configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )
configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )
with lilt.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lilt.LexiconApi(api_client) body = lilt.LexiconUpdateParameters() # LexiconUpdateParameters |
try:
# Update a Lexicon
api_response = api_instance.update_lexicon(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling LexiconApi->update_lexicon: %s\n" % e) ```
Name | Type | Description | Notes |
---|---|---|---|
body | LexiconUpdateParameters |
| Status code | Description | Response headers | |————-|————-|——————| 200 | A status object. | - | 0 | Unexpected error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]