3939# ' @seealso \code{\link{predict.word2vec}}, \code{\link{as.matrix.word2vec}}
4040# ' @export
4141# ' @examples
42+ # ' \dontshow{if(require(udpipe))\{}
4243# ' library(udpipe)
4344# ' ## Take data and standardise it a bit
4445# ' data(brussels_reviews, package = "udpipe")
103104# ' nn
104105# ' nn <- predict(model, c("accueillir/VBN", "accueillir/VBG"), type = "nearest")
105106# ' nn
107+ # '
108+ # ' \dontshow{\} # End of main if statement running only if the required packages are installed}
106109word2vec <- function (x ,
107110 type = c(" cbow" , " skip-gram" ),
108111 dim = 50 , window = ifelse(type == " cbow" , 5L , 10L ),
@@ -215,9 +218,8 @@ as.matrix.word2vec_trained <- function(x, encoding='UTF-8', ...){
215218# ' \dontshow{
216219# ' file.remove(path)
217220# ' }
218- # ' \dontshow{if(require(udpipe))
219- # ' \{
220- # ' }
221+ # '
222+ # ' \dontshow{if(require(udpipe))\{}
221223# ' ## Save the model to hard disk as a text file (uses package udpipe)
222224# ' library(udpipe)
223225# ' path <- "mymodel.txt"
@@ -228,10 +230,7 @@ as.matrix.word2vec_trained <- function(x, encoding='UTF-8', ...){
228230# ' \dontshow{
229231# ' file.remove(path)
230232# ' }
231- # ' \dontshow{
232- # ' \}
233- # ' # End of main if statement running only if the required packages are installed
234- # ' }
233+ # ' \dontshow{\} # End of main if statement running only if the required packages are installed}
235234write.word2vec <- function (x , file , type = c(" bin" , " txt" ), encoding = " UTF-8" ){
236235 type <- match.arg(type )
237236 if (type == " bin" ){
0 commit comments