Comments (3)
Thank you for submitting the issue!
I will look into this soon.
In the meantime, is the method as described in this vignette viable for your use case?
See also the code below applied to your example:
text_to_translate <- c("the", "quick", "brown")
df <- data.frame(original_text = text_to_translate)
df %>%
dplyr::mutate(translated_text = purrr::map_chr(original_text, ~ google_translate(.x, target_language = "fr", source_language = "en")))
from polyglotr.
The function has now been vectorized, see commit abbaf0b. Pushing updates to CRAN is planned for the end of July.
In the meantime, you can check it when using the development version on GitHub:
devtools::install_github("polyglotr")
library(polyglotr)
text_to_translate <- c("the", "quick", "brown")
google_translate (text_to_translate, "fr", "en")
>
[[1]]
[1] "le"
[[2]]
[1] "rapide"
[[3]]
[1] "brun"
And for the dataframe:
df <- as.data.frame(text_to_translate)
df %>%
mutate(translated_text = google_translate(text_to_translate, "fr", "en"))
>
text_to_translate translated_text
1 the le
2 quick rapide
3 brown brun
from polyglotr.
Version 1.2.0 has been published to CRAN, which includes the fix for vectorization.
from polyglotr.
Related Issues (10)
- Release polyglotr 1.0.0
- Broaden wmcloud functionality HOT 2
- Feat: look into the following services HOT 1
- Broaden Pons translate functionalities
- get linguee api examples HOT 1
- get linguee api external sources HOT 1
- write linguee api vignette
- Get the supported languages for google translate HOT 1
- Encoding issue HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from polyglotr.