lilt-python

API bindings for the Lilt REST API.

View the Project on GitHub lilt/lilt-python

lilt.LexiconApi

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

query_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.

Example

The client must configure the authentication and authorization parameters

in accordance with the API server security policy.

Examples for each auth method are provided below, use the example that

satisfies your auth use case.

Configure API key authorization: ApiKeyAuth

configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )

Uncomment below to setup prefix (e.g. Bearer) for API key, if needed

configuration.api_key_prefix[‘key’] = ‘Bearer’

Configure HTTP basic authorization: BasicAuth

configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )

Enter a context with an instance of the API client

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) ```

The client must configure the authentication and authorization parameters

in accordance with the API server security policy.

Examples for each auth method are provided below, use the example that

satisfies your auth use case.

Configure API key authorization: ApiKeyAuth

configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )

Uncomment below to setup prefix (e.g. Bearer) for API key, if needed

configuration.api_key_prefix[‘key’] = ‘Bearer’

Configure HTTP basic authorization: BasicAuth

configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )

Enter a context with an instance of the API client

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) ```

Parameters

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]

Return type

list[LexiconEntry]

Authorization

ApiKeyAuth, BasicAuth

HTTP request headers

HTTP response details

| 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]

update_lexicon

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.

Example

The client must configure the authentication and authorization parameters

in accordance with the API server security policy.

Examples for each auth method are provided below, use the example that

satisfies your auth use case.

Configure API key authorization: ApiKeyAuth

configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )

Uncomment below to setup prefix (e.g. Bearer) for API key, if needed

configuration.api_key_prefix[‘key’] = ‘Bearer’

Configure HTTP basic authorization: BasicAuth

configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )

Enter a context with an instance of the API client

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) ```

The client must configure the authentication and authorization parameters

in accordance with the API server security policy.

Examples for each auth method are provided below, use the example that

satisfies your auth use case.

Configure API key authorization: ApiKeyAuth

configuration = lilt.Configuration( host = “https://lilt.com/2”, api_key = { ‘key’: ‘YOUR_API_KEY’ } )

Uncomment below to setup prefix (e.g. Bearer) for API key, if needed

configuration.api_key_prefix[‘key’] = ‘Bearer’

Configure HTTP basic authorization: BasicAuth

configuration = lilt.Configuration( username = ‘YOUR_USERNAME’, password = ‘YOUR_PASSWORD’ )

Enter a context with an instance of the API client

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) ```

Parameters

Name Type Description Notes
body LexiconUpdateParameters    

Return type

LexiconUpdateResponse

Authorization

ApiKeyAuth, BasicAuth

HTTP request headers

HTTP response details

| 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]