Recently a user of NLP/openNLP wrote to me wondering why
require("openNLP")
require("NLP")
s <- paste(c("Pierre Vinken, 61 years old, will join the board as a ",
"nonexecutive director Nov. 29.\n",
"Mr. Vinken is chairman of Elsevier N.V., ",
"the Dutch publishing group."),
collapse = "")
s<-as.String(s)
sent_token_annotator <- Maxent_Sent_Token_Annotator()
word_token_annotator <- Maxent_Word_Token_Annotator()
pos_tag_annotator <- Maxent_POS_Tag_Annotator()
a3 <- annotate(s,
list(sent_token_annotator,
word_token_annotator,
pos_tag_annotator))
would not work for him. Turns out that he also had done
require("qdap")
after loading and attaching NLP, which modifies the search path (adding
the packages in its Depends), in particular adding ggplot2, which also
has an annotate() function: so the wrong annotate() was being called.
I told the user to work around the problem, but of course, ideally qdap
would not modify the search path when getting loaded ...
From Kurt H: Consider...