The polyglotr
package provides convenient functions to
access the Linguee API and retrieve translations, examples, and external
sources. This vignette demonstrates the usage of three key functions:
linguee_external_sources()
,
linguee_translation_examples()
, and
linguee_word_translation()
.
The linguee_external_sources()
function retrieves
external sources using the Linguee Translation API. Here’s an example
usage:
external_sources <- linguee_external_sources("hello", src = "en", dst = "de")
print(external_sources)
#> # A tibble: 30 × 4
#> src dst src_url dst_url
#> <chr> <chr> <chr> <chr>
#> 1 "On this forehead of business to elevated cognitive co… "Auf… http:/… http:/…
#> 2 "Hello and welcome to a project [...] that aims to col… "Hal… http:/… http:/…
#> 3 "Hello people, you'll hardly believe [...] this, but i… "Leu… http:/… http:/…
#> 4 "Wu Kun: Hello, everyone, very grateful [...] to all n… "Wu … http:/… http:/…
#> 5 "Hello,I am Desperately looking [...] for a new home t… "Hal… http:/… http:/…
#> 6 "The two children who are playing Slovakia and Hungary… "Die… http:/… http:/…
#> 7 "In our city, the local and foreign tourists, in a pea… "In … http:/… http:/…
#> 8 "For example, soup is traditionally eaten in China at … "So … http:/… http:/…
#> 9 "Example of application: In case you want to send an S… "Anw… http:/… http:/…
#> 10 "It begins with mouth percussion, with playful greetin… "Es … http:/… http:/…
#> # ℹ 20 more rows
The linguee_translation_examples()
function provides
translation examples using the Linguee Translation API. Here’s an
example usage:
translation_examples <- linguee_translation_examples("hello", src = "en", dst = "de")
print(translation_examples)
#> # A tibble: 4 × 3
#> source target pos
#> <chr> <chr> <chr>
#> 1 say hello to grüßen verb
#> 2 say hello guten Tag sagen verb
#> 3 Hello everybody! Hallo allerseits! interjection
#> 4 big hello großes Hallo noun, neuter
The linguee_word_translation()
function translates a
word using the Linguee Translation API. Here’s an example usage: