39
39
# ' @seealso \code{\link{predict.word2vec}}, \code{\link{as.matrix.word2vec}}
40
40
# ' @export
41
41
# ' @examples
42
+ # ' \dontshow{if(require(udpipe))\{}
42
43
# ' library(udpipe)
43
44
# ' ## Take data and standardise it a bit
44
45
# ' data(brussels_reviews, package = "udpipe")
103
104
# ' nn
104
105
# ' nn <- predict(model, c("accueillir/VBN", "accueillir/VBG"), type = "nearest")
105
106
# ' nn
107
+ # '
108
+ # ' \dontshow{\} # End of main if statement running only if the required packages are installed}
106
109
word2vec <- function (x ,
107
110
type = c(" cbow" , " skip-gram" ),
108
111
dim = 50 , window = ifelse(type == " cbow" , 5L , 10L ),
@@ -215,9 +218,8 @@ as.matrix.word2vec_trained <- function(x, encoding='UTF-8', ...){
215
218
# ' \dontshow{
216
219
# ' file.remove(path)
217
220
# ' }
218
- # ' \dontshow{if(require(udpipe))
219
- # ' \{
220
- # ' }
221
+ # '
222
+ # ' \dontshow{if(require(udpipe))\{}
221
223
# ' ## Save the model to hard disk as a text file (uses package udpipe)
222
224
# ' library(udpipe)
223
225
# ' path <- "mymodel.txt"
@@ -228,10 +230,7 @@ as.matrix.word2vec_trained <- function(x, encoding='UTF-8', ...){
228
230
# ' \dontshow{
229
231
# ' file.remove(path)
230
232
# ' }
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}
235
234
write.word2vec <- function (x , file , type = c(" bin" , " txt" ), encoding = " UTF-8" ){
236
235
type <- match.arg(type )
237
236
if (type == " bin" ){
0 commit comments