Česílko

Introduction

This section serves as a reference to developers who would like to use Cesilko translation API in their web applications. The Cesilko API is available via REST. The Cesilko REST API can be accessed directly or via any other web programming tools that support standard HTTP request methods and JSON for output handling. The following sections explain the invocation of Cesilko REST API with examples.

At the moment, for all the API requests, the response format is JSON.

API Reference

# Service Request Description HTTP Method
1 translate translates text in Czech (CZ) to Slovak (SK) GET/POST
2 version returns the version number of Cesilko system GET/POST

1. translate

The translate is the main operation/service offered by the REST API. This service translates the given text in Czech language into Slovak. The possible parameters for the translate service are described in the following table.

# Parameter Mandatory Data type Description
1 data yes string Czech input text in UTF-8
Example #1:
Browser Example
https://lindat.mff.cuni.cz/services/rest/cesilko/translate?data={Czech text}
https://lindat.mff.cuni.cz/services/rest/cesilko/translate?data=Já mám hlad

CURL Example
curl -X POST --data-urlencode "data=Já mám hlad" https://lindat.mff.cuni.cz/services/rest/cesilko/translate
JSON Response
{
  "input": "'J\u00e1 m\u00e1m hlad'", 
  "result": " 'Ja m\u00e1m hlad' \n\n"
}

2. version

This service returns the version number of the Cesilko system

Browser Example
https://lindat.mff.cuni.cz/services/rest/cesilko/version

CURL Example
curl https://lindat.mff.cuni.cz/services/rest/cesilko/version
JSON Response
{
  "version": "v1.0", 
  "author": [
    "Jan Haji\u010d", 
    "Vladislav Kubo\u0148", 
    "Petr Homola"
  ]
}