It takes more than a minute even for Stanfords nlp package, but it does work when restarting Java with special
JVMArguments. I tried to just use InstallJava
, but that was not enough, somehow. I have to first initialize the TextStructure
code by calling something simple like TextStructure["JLink is fantastic"];
Then use ReinstallJava
with extra JVMArguments arguments. Credits go to Vitalii Fedorenko
AbsoluteTiming[TextStructure["JLink is fantastic"];
JLink`ReinstallJava[
JLink`JVMArguments -> {"-Xmx1g -XX:+UseConcMarkSweepGC"}];
TextStructure[
"The University may terminate this lease when the Lessee, having \
made application and executed this lease in advance of enrollment, is \
not eligible to enroll or fails to enroll in the University or leaves \
the University at any time prior to the expiration of this lease, or \
for violation of any provisions of this lease, or for violation of \
any University regulation relative to resident Halls, or for health \
reasons, by providing the student with written notice of this \
termination 30 days prior to the effective data of termination, \
unless life, limb, or property would be jeopardized, the Lessee \
engages in the sales of purchase of controlled substances in \
violation of federal, state or local law, or the Lessee is no longer \
enrolled as a student, or the Lessee engages in the use or possession \
of firearms, explosives, inflammable liquids, fireworks, or other \
dangerous weapons within the building, or turns in a false alarm, in \
which cases a maximum of 24 hours notice would be sufficient."]]