A simple wrapper around reverso.net.
$ npm install reverso-api
const Reverso = require('reverso-api');
const reverso = new Reverso();
Congrats! You can use all the methods now.
Let's read through the README and find out how it works.
reverso.getContext('meet me half way', 'English', 'Russian').then(response => {
return console.log(response);
}).catch(err => {
return console.error(err);
});
This method provides you examples of how to use a certain phrase or a word in target language.
In this case, the phrase is meet me half way
, its language is English
and the target language is Russian
.
The method returns an object that contains given text, its language, examples' language, text's translation and examples of usage. Available languages for this method: English, Russian, German, Spanish, French, Italian, Polish.
reverso.getSpellCheck('helo', 'English').then(response => {
return console.log(response);
}).catch(err => {
return console.error(err);
});
This method provides you your mistakes that you might make in the text.
In this case, the text is Helo
, its language is English
. The response will be corrected version of the text, therefore Hello
.
The method returns an array of objects. Available languages for this method: English and French.
reverso.getSynonyms('dzień dobry', 'Polish').then(response => {
return console.log(response);
}).catch(err => {
return console.error(err);
});
This method provides you synonyms of word/phrase/sentence.
In this case, the text is dzień dobry
, its language is Polish
.
The method returns an object that contains given text, its language and array of found synonyms. Available languages for this method: English, Russian, German, Spanish, French, Italian, Polish.
Warning: eventually, this method may stop working because your server's IP address will be banned by Reverso moderators.
reverso.getTranslation('So, how is your day today?', 'English', 'French').then(response => {
return console.log(response);
}).catch(err => {
return console.error(err);
});
This method provides you full translation of word/phrase/sentence.
The method returns an object that contains given text, translation, context examples and voice. Available languages for this method: English, Russian, German, Spanish, French, Italian, Polish.
- All the data is fetched from reverso.net.
- Author of the API s0ftik3.