Linguatools Collocation API
Looks up a word in a dictionary and returns
How to use Linguatools Collocation API
Connect to API
Endpoint and Parameters
|query||any word (Case insensitive)||ex. change|
|lang||One of the following language short codes (Case sensitive):||
|relation||One of the following relations (Case sensitive, optional):||
|min_sig||any number as the minimum significance (Optional)||
Test the API
You can test the API and develop your own application with out test translate API – for free.
Test the test API with:
Important note (!):
The initial API call might take up to 15 seconds because the heroku dyno falls asleep after 30 minutes of inactivity. (The TEST-API runs on a free heroku dyno.)
Further limits of the test API:
The test API contains only a subset of the complete collocation database. Only high significant collocations (significance > 30000) are included. Therefore only 6 thousand collocations are included in the test API. The paid API (see below) contains more than 4 millions collocations.
"collocation":"to smoke pipe",
"Breakfast was over , and a number were <b>smoking</b> <b>pipes</b> .",
"The tramp was sitting outside , <b>smoking</b> a <b>pipe</b> .",
"The old man was standing outside , <b>smoking</b> a <b>pipe</b> ."
In raw format you will see the html tags <b> and </b> as \u003cb\u003e and \u003c/b\u003e
apiurl = "https://lt-collocation-test.herokuapp.com/todos/?query=smoke&lang=en"
api = Curl::Easy.new(apiurl)
json_data = JSON.parse(api.body_str)
apiurl = 'https://lt-collocation-test.herokuapp.com/todos/?query=smoke&lang=en'
response = requests.get(apiurl)
json_data = json.loads(response.text)
Examples of use
1. Query the complete linguatools collocations database online:
2. We make use of collocations in our online tool Gramomat:
URL: https://gramomat.com/ [A click into the object field to see the suggested collocations]