Skip to content

Latest commit

 

History

History
32 lines (29 loc) · 1.07 KB

README.md

File metadata and controls

32 lines (29 loc) · 1.07 KB

Reverso context API

Simple Kotlin API for Reverso Context. This project is used in the university telegram bot project of an English teacher. More information in the wiki

ReversoAPIlogo

Installation

In build.gradle.kts:

  • Add jitpack repo
repositories {
    maven("https://jitpack.io")
}
  • then (replace tag with version)
implementation("com.github.freQuensy23-coder:reverso-api:Tag")

Usage example

val text = "Hello"
val translator = reversoTranslatorAPI() // Init translator
val translationResponse: TranslationResponse = reversoTranslatorAPI.translate(text, "en", "fr")
val translations: List<Translation> = translationResponse.dictionary_entry_list
translations.forEach {
    println("$text -> ${it.term} (usage frequency = ${it.frequency}). - ${it.defenition}")
}
println("Usage examples")
translationResponse.usages.forEach {
    println("${it.s_text} -> ${it.t_text}")
}