I was able to run a tiny test in SMC. Don't really know what coreNLP is about yet though.
Here's a summary of the steps:
Give project >= 3 g memory (this can be tuned, I'm sure)
install jdk1.8 in ~/jdk1.8.0_91
create wrapper ~/bin/sage that does the equivalent of
export JAVA_HOME=$HOME/jdk1.8.0_91
export PATH="$JAVA_HOME/bin:$PATH"
export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64:$JAVA_HOME/jre/lib/amd64/server:$LD_LIBRARY_PATH
/usr/local/bin/sage "$@"
in .term session, do
R CMD javareconf -e
sage -R
install.packages("rJava",type="source")
install.packages("coreNLP")
in .sagews file, do
%default_mode r
--
# verify rJava built with Java 8
library(rJava)
.jinit()
.jcall("java/lang/System","S","getProperty","java.version")
[1] "1.8.0_91"
--
# need to omit the "ner" annotator or we get heap overflow in gc
initCoreNLP(mem = "2g", annotators = c("tokenize", "ssplit", "pos"))
Adding annotator tokenize
Adding annotator ssplit
Adding annotator pos
sIn <- "Mother died today. Or, maybe, yesterday; I can't be sure."
annoObj <- annotateString(sIn)
summary(annoObj)
Length Class Mode
token 9 data.frame list
parse 0 -none- NULL
basicDep 0 -none- NULL
collapsedDep 0 -none- NULL
collapsedProcDep 0 -none- NULL
coref 0 -none- NULL
sentiment 3 data.frame list
==