Skip to content

Kotlin wrapper for (unofficial) reveso context translator api

Notifications You must be signed in to change notification settings

freQuensy23-coder/reverso-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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}")
}

About

Kotlin wrapper for (unofficial) reveso context translator api

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages