G_1991
G_1991

Reputation: 149

R- could not find function "tokenize"

I'm trying to tokenize a sentence. I have installed the openNLP and the NLP packages but when I'm trying to run the tokenize function on a sentence I'm getting the below array:

        Error: could not find function "tokenize"     
        > library(NLP)
        > library(openNLP)
        > s
         [1] "This is a sentence."
        > tokenize(s,"en") 
          Error: could not find function "tokenize"

Thanks

Upvotes: 0

Views: 1394

Answers (1)

iembry
iembry

Reputation: 944

I have NLP version 0.1-7 and openNLP version 0.2-5 installed on my computer. There is not a function named tokenize anymore in the openNLP package. You can ask the maintainer about the old function.

Alternatively, you can perform the following:

install.packages("sos")
library(sos)
???tokenize

???tokenize will search for the keyword tokenize in R packages, but look at the date. You will see that tokenize is listed under openNLP in 2012. You may find other functions in other packages that perform the task(s) that you are seeking.

Upvotes: 2

Related Questions