Open vivekparekh8 opened 9 years ago
So, this might be an unsatisfying answer; but, I'd recommend not using this and using the new Simple CoreNLP wrapper in CoreNLP instead: https://github.com/stanfordnlp/CoreNLP/tree/master/src/edu/stanford/nlp/simple . You can think of it as the third incarnation of this library, in the same flavor but with a bunch of things handled much better. Documentation can be found at: http://stanfordnlp.github.io/CoreNLP/simple.html
Once the new CoreNLP release comes out and the API is available on more than just GitHub I intend to just redirect everyone to there on the README of this repo.
Otherwise, for the actual bug, it looks like CoreNLP is not in your classpath and the scalac command in the Makefile is unable to find it.
$make mkdir -p classes sed -e 's/BerkeleyUtil.berkeleyParser/throw new IllegalStateException("Could not find parser model (and was not compiled to run with Berkeley parser)")/g' src/edu/stanford/nlp/NLP.scala > /tmp/NLP_stanfordonly.scala scalac -cp /classes:/lib/joda-time.jar:/lib/jollyday-0.4.7.jar -d classes
find src -name "*.scala" ! -name "*Berkeley.scala" ! -name "NLP.scala"
/tmp/NLPstanfordonly.scala src/edu/stanford/nlp/Classify.scala:14: error: object classify is not a member of package edu.stanford.nlp import edu.stanford.nlp.classify.LinearClassifierFactory ^ src/edu/stanford/nlp/Classify.scala:15: error: object classify is not a member of package edu.stanford.nlp import edu.stanford.nlp.classify.LogPrior ^ src/edu/stanford/nlp/Classify.scala:16: error: object classify is not a member of package edu.stanford.nlp import edu.stanford.nlp.classify.RVFDataset ^ src/edu/stanford/nlp/Classify.scala:17: error: object ie is not a member of package edu.stanford.nlp import edu.stanford.nlp.ie.NERClassifierCombiner ^ src/edu/stanford/nlp/Classify.scala:18: error: object io is not a member of package edu.stanford.nlp import edu.stanford.nlp.io.IOUtils ^ src/edu/stanford/nlp/Classify.scala:19: error: object ling is not a member of package edu.stanford.nlp import edu.stanford.nlp.ling.HasWord ^ src/edu/stanford/nlp/Classify.scala:20: error: object ling is not a member of package edu.stanford.nlp import edu.stanford.nlp.ling.RVFDatum ^ src/edu/stanford/nlp/Classify.scala:21: error: object ling is not a member of package edu.stanford.nlp import edu.stanford.nlp.ling.Word ^ src/edu/stanford/nlp/Classify.scala:22: error: object ling is not a member of package edu.stanford.nlp import edu.stanford.nlp.ling.CoreLabel ^ src/edu/stanford/nlp/Classify.scala:23: error: object optimization is not a member of package edu.stanford.nlp import edu.stanford.nlp.optimization.DiffFunction ^ src/edu/stanford/nlp/Classify.scala:24: error: object optimization is not a member of package edu.stanford.nlp import edu.stanford.nlp.optimization.QNMinimizer ^ src/edu/stanford/nlp/Classify.scala:25: error: object optimization is not a member of package edu.stanford.nlp import edu.stanford.nlp.optimization.SGDToQNMinimizer ^ src/edu/stanford/nlp/Classify.scala:26: error: object parser is not a member of package edu.stanford.nlp import edu.stanford.nlp.parser.lexparser.LexicalizedParser ^ src/edu/stanford/nlp/Classify.scala:27: error: object process is not a member of package edu.stanford.nlp import edu.stanford.nlp.process.Morphology ^ src/edu/stanford/nlp/Classify.scala:28: error: object process is not a member of package edu.stanford.nlp import edu.stanford.nlp.process.PTBTokenizer ^ src/edu/stanford/nlp/Classify.scala:29: error: object stats is not a member of package edu.stanford.nlp import edu.stanford.nlp.stats.ClassicCounter ^ src/edu/stanford/nlp/Classify.scala:30: error: object stats is not a member of package edu.stanford.nlp import edu.stanford.nlp.stats.Counter ^ src/edu/stanford/nlp/Classify.scala:31: error: object tagger is not a member of package edu.stanford.nlp import edu.stanford.nlp.tagger.maxent.MaxentTagger ^ src/edu/stanford/nlp/Classify.scala:32: error: object trees is not a member of package edu.stanford.nlp import edu.stanford.nlp.trees.CollinsHeadFinder ^ src/edu/stanford/nlp/Classify.scala:33: error: object trees is not a member of package edu.stanford.nlp import edu.stanford.nlp.trees.LabeledScoredTreeNode ^ src/edu/stanford/nlp/Classify.scala:34: error: object trees is not a member of package edu.stanford.nlp import edu.stanford.nlp.trees.Tree ^ src/edu/stanford/nlp/Classify.scala:35: error: object trees is not a member of package edu.stanford.nlp import edu.stanford.nlp.trees.Trees ^ src/edu/stanford/nlp/Classify.scala:36: error: object trees is not a member of package edu.stanford.nlp import edu.stanford.nlp.trees.GrammaticalStructureFactory ^ src/edu/stanford/nlp/Classify.scala:37: error: object trees is not a member of package edu.stanford.nlp import edu.stanford.nlp.trees.GrammaticalStructure ^ src/edu/stanford/nlp/Classify.scala:38: error: object trees is not a member of package edu.stanford.nlp import edu.stanford.nlp.trees.PennTreebankLanguagePack ^ src/edu/stanford/nlp/Classify.scala:39: error: object trees is not a member of package edu.stanford.nlp import edu.stanford.nlp.trees.TypedDependency ^ src/edu/stanford/nlp/Classify.scala:40: error: object util is not a member of package edu.stanford.nlp import edu.stanford.nlp.util.logging.Redwood.Util. ^ /tmp/NLPstanfordonly.scala:14: error: object ling is not a member of package edu.stanford.nlp import edu.stanford.nlp.ling.CoreAnnotations. ^ /tmp/NLPstanfordonly.scala:42: error: object util is not a member of package edu.stanford.nlp import edu.stanford.nlp.util.logging.Redwood.Util. ^ /tmp/NLP_stanfordonly.scala:21: error: object ling is not a member of package edu.stanford.nlp import edu.stanford.nlp.ling.HasWord ^ /tmp/NLPstanfordonly.scala:47: error: not found: type HasWord implicit def list2hasWordList(lst:Seq[String]):java.util.List[<:HasWord] ^ src/edu/stanford/nlp/Classify.scala:63: error: not found: type RVFDataset val dataset = new RVFDatasetO, F ^ src/edu/stanford/nlp/Classify.scala:65: warning: abstract type pattern I is unchecked since it is eliminated by erasure case ((input:I, (output:O, weight:Float)),i:Int) => ^ src/edu/stanford/nlp/Classify.scala:65: warning: abstract type pattern O is unchecked since it is eliminated by erasure case ((input:I, (output:O, weight:Float)),i:Int) => ^ src/edu/stanford/nlp/Classify.scala:70: error: not found: type LogPrior val prior = new LogPrior(LogPrior.LogPriorType.QUADRATIC) ^ src/edu/stanford/nlp/Classify.scala:70: error: not found: value LogPrior val prior = new LogPrior(LogPrior.LogPriorType.QUADRATIC) ^ src/edu/stanford/nlp/Classify.scala:71: error: not found: type LinearClassifierFactory val factory = new LinearClassifierFactory[O,F]() ^ src/edu/stanford/nlp/Classify.scala:89: error: not found: type Counter def toCounterX,F:Counter[F] = { ^ src/edu/stanford/nlp/Classify.scala:90: error: not found: type ClassicCounter val counts = new ClassicCounter[F] ^ src/edu/stanford/nlp/Classify.scala:92: warning: abstract type pattern F is unchecked since it is eliminated by erasure case (feat:F, n:Number) => counts.incrementCount(feat, n.doubleValue) ^ src/edu/stanford/nlp/Classify.scala:93: warning: abstract type pattern F is unchecked since it is eliminated by erasure case (feat:F) => counts.incrementCount(feat, 1) ^ src/edu/stanford/nlp/Classify.scala:100: warning: abstract type pattern I is unchecked since it is eliminated by erasure new Mapping(map.map{ case (i:I, x:X) => x match { ^ src/edu/stanford/nlp/Classify.scala:100: warning: abstract type pattern X is unchecked since it is eliminated by erasure new Mapping(map.map{ case (i:I, x:X) => x match { ^ src/edu/stanford/nlp/Classify.scala:101: warning: abstract type pattern O is unchecked since it is eliminated by erasure case (o:O, n:Number) => (i, (o, n.floatValue)) ^ src/edu/stanford/nlp/Classify.scala:102: warning: abstract type pattern O is unchecked since it is eliminated by erasure case (o:O) => (i, (o, 1.0.asInstanceOf[Float])) ^ /tmp/NLP_stanfordonly.scala:24: error: object ling is not a member of package edu.stanford.nlp import edu.stanford.nlp.ling.CoreLabel ^ /tmp/NLPstanfordonly.scala:182: error: not found: type CoreLabel trait CoreLabelSeq extends Seq[CoreLabel] { ^ src/edu/stanford/nlp/Sentence.scala:40: error: object util is not a member of package edu.stanford.nlp import edu.stanford.nlp.util.logging.Redwood.Util. ^ src/edu/stanford/nlp/Classify.scala:170: error: not found: value warn warn("Classifiers trained on different data; taking union") ^ src/edu/stanford/nlp/Classify.scala:194: error: not found: value startTrack startTrack("Running Weak Learners") ^ src/edu/stanford/nlp/Classify.scala:199: error: not found: value log log("running " + h.toString) ^ src/edu/stanford/nlp/Classify.scala:200: warning: abstract type pattern I is unchecked since it is eliminated by erasure (h, dataAsArray.map{ case (in:I, (out:Boolean, weight:Float)) => ^ src/edu/stanford/nlp/Classify.scala:204: error: not found: value endTrack endTrack("Running Weak Learners") ^ src/edu/stanford/nlp/NLPConfig.scala:3: error: object pipeline is not a member of package edu.stanford.nlp import edu.stanford.nlp.pipeline.DefaultPaths._ ^ src/edu/stanford/nlp/Classify.scala:235: error: not found: value startTrack startTrack("Iteration " + t) ^ src/edu/stanford/nlp/Classify.scala:242: error: not found: value log log("optimal classifier: " + hOpt) ^ src/edu/stanford/nlp/Classify.scala:243: error: not found: value log log("e_t: " + et) ^ src/edu/stanford/nlp/Classify.scala:253: error: not found: value log log("at: " + at) ^ src/edu/stanford/nlp/Classify.scala:254: error: not found: value endTrack endTrack("Iteration " + t) ^ src/edu/stanford/nlp/Classify.scala:264: error: not found: value startTrack startTrack("Boosting over " + members.length + " classifier and " + data.size + " examples") ^ src/edu/stanford/nlp/Classify.scala:266: error: not found: value endTrack endTrack("Boosting over " + members.length + " classifier and " + data.size + " examples") ^ src/edu/stanford/nlp/Document.scala:14: error: object classify is not a member of package edu.stanford.nlp import edu.stanford.nlp.classify.LinearClassifierFactory ^ src/edu/stanford/nlp/Document.scala:15: error: object classify is not a member of package edu.stanford.nlp import edu.stanford.nlp.classify.LogPrior ^ src/edu/stanford/nlp/Document.scala:16: error: object classify is not a member of package edu.stanford.nlp import edu.stanford.nlp.classify.RVFDataset ^ src/edu/stanford/nlp/Document.scala:17: error: object ie is not a member of package edu.stanford.nlp import edu.stanford.nlp.ie.NERClassifierCombiner ^ src/edu/stanford/nlp/Document.scala:18: error: object io is not a member of package edu.stanford.nlp import edu.stanford.nlp.io.IOUtils ^ src/edu/stanford/nlp/Document.scala:19: error: object ling is not a member of package edu.stanford.nlp import edu.stanford.nlp.ling.HasWord ^ src/edu/stanford/nlp/Document.scala:20: error: object ling is not a member of package edu.stanford.nlp import edu.stanford.nlp.ling.RVFDatum ^ src/edu/stanford/nlp/Document.scala:21: error: object ling is not a member of package edu.stanford.nlp import edu.stanford.nlp.ling.Word ^ src/edu/stanford/nlp/Document.scala:22: error: object ling is not a member of package edu.stanford.nlp import edu.stanford.nlp.ling.CoreLabel ^ src/edu/stanford/nlp/Document.scala:23: error: object optimization is not a member of package edu.stanford.nlp import edu.stanford.nlp.optimization.DiffFunction ^ src/edu/stanford/nlp/Document.scala:24: error: object optimization is not a member of package edu.stanford.nlp import edu.stanford.nlp.optimization.QNMinimizer ^ src/edu/stanford/nlp/Document.scala:25: error: object optimization is not a member of package edu.stanford.nlp import edu.stanford.nlp.optimization.SGDToQNMinimizer ^ src/edu/stanford/nlp/Document.scala:26: error: object parser is not a member of package edu.stanford.nlp import edu.stanford.nlp.parser.lexparser.LexicalizedParser ^ src/edu/stanford/nlp/Document.scala:27: error: object process is not a member of package edu.stanford.nlp import edu.stanford.nlp.process.Morphology ^ src/edu/stanford/nlp/Document.scala:28: error: object process is not a member of package edu.stanford.nlp import edu.stanford.nlp.process.PTBTokenizer ^ src/edu/stanford/nlp/Document.scala:29: error: object stats is not a member of package edu.stanford.nlp import edu.stanford.nlp.stats.ClassicCounter ^ src/edu/stanford/nlp/Document.scala:30: error: object stats is not a member of package edu.stanford.nlp import edu.stanford.nlp.stats.Counter ^ src/edu/stanford/nlp/Document.scala:31: error: object tagger is not a member of package edu.stanford.nlp import edu.stanford.nlp.tagger.maxent.MaxentTagger ^ src/edu/stanford/nlp/Document.scala:32: error: object trees is not a member of package edu.stanford.nlp import edu.stanford.nlp.trees.CollinsHeadFinder ^ src/edu/stanford/nlp/Document.scala:33: error: object trees is not a member of package edu.stanford.nlp import edu.stanford.nlp.trees.LabeledScoredTreeNode ^ src/edu/stanford/nlp/Document.scala:34: error: object trees is not a member of package edu.stanford.nlp import edu.stanford.nlp.trees.Tree ^ src/edu/stanford/nlp/Document.scala:35: error: object trees is not a member of package edu.stanford.nlp import edu.stanford.nlp.trees.Trees ^ src/edu/stanford/nlp/Document.scala:36: error: object trees is not a member of package edu.stanford.nlp import edu.stanford.nlp.trees.GrammaticalStructureFactory ^ src/edu/stanford/nlp/Document.scala:37: error: object trees is not a member of package edu.stanford.nlp import edu.stanford.nlp.trees.GrammaticalStructure ^ src/edu/stanford/nlp/Document.scala:38: error: object trees is not a member of package edu.stanford.nlp import edu.stanford.nlp.trees.PennTreebankLanguagePack ^ src/edu/stanford/nlp/Document.scala:39: error: object trees is not a member of package edu.stanford.nlp import edu.stanford.nlp.trees.TypedDependency ^ src/edu/stanford/nlp/Document.scala:40: error: object util is not a member of package edu.stanford.nlp import edu.stanford.nlp.util.logging.Redwood.Util. ^ src/edu/stanford/nlp/Magic.scala:14: error: object classify is not a member of package edu.stanford.nlp import edu.stanford.nlp.classify.LinearClassifierFactory ^ src/edu/stanford/nlp/Magic.scala:15: error: object classify is not a member of package edu.stanford.nlp import edu.stanford.nlp.classify.LogPrior ^ src/edu/stanford/nlp/Magic.scala:16: error: object classify is not a member of package edu.stanford.nlp import edu.stanford.nlp.classify.RVFDataset ^ src/edu/stanford/nlp/Magic.scala:17: error: object ie is not a member of package edu.stanford.nlp import edu.stanford.nlp.ie.NERClassifierCombiner ^ src/edu/stanford/nlp/Magic.scala:18: error: object io is not a member of package edu.stanford.nlp import edu.stanford.nlp.io.IOUtils ^ src/edu/stanford/nlp/Magic.scala:19: error: object ling is not a member of package edu.stanford.nlp import edu.stanford.nlp.ling.HasWord ^ src/edu/stanford/nlp/Magic.scala:20: error: object ling is not a member of package edu.stanford.nlp import edu.stanford.nlp.ling.RVFDatum ^ src/edu/stanford/nlp/Magic.scala:21: error: object ling is not a member of package edu.stanford.nlp import edu.stanford.nlp.ling.Word ^ src/edu/stanford/nlp/Magic.scala:22: error: object ling is not a member of package edu.stanford.nlp import edu.stanford.nlp.ling.CoreLabel ^ src/edu/stanford/nlp/Magic.scala:23: error: object optimization is not a member of package edu.stanford.nlp import edu.stanford.nlp.optimization.DiffFunction ^ src/edu/stanford/nlp/Magic.scala:24: error: object optimization is not a member of package edu.stanford.nlp import edu.stanford.nlp.optimization.QNMinimizer ^ src/edu/stanford/nlp/Magic.scala:25: error: object optimization is not a member of package edu.stanford.nlp import edu.stanford.nlp.optimization.SGDToQNMinimizer ^ src/edu/stanford/nlp/Magic.scala:26: error: object parser is not a member of package edu.stanford.nlp import edu.stanford.nlp.parser.lexparser.LexicalizedParser ^ src/edu/stanford/nlp/Magic.scala:27: error: object process is not a member of package edu.stanford.nlp import edu.stanford.nlp.process.Morphology ^ src/edu/stanford/nlp/Magic.scala:28: error: object process is not a member of package edu.stanford.nlp import edu.stanford.nlp.process.PTBTokenizer ^ src/edu/stanford/nlp/Magic.scala:29: error: object stats is not a member of package edu.stanford.nlp import edu.stanford.nlp.stats.ClassicCounter ^ src/edu/stanford/nlp/Magic.scala:30: error: object stats is not a member of package edu.stanford.nlp import edu.stanford.nlp.stats.Counter ^ src/edu/stanford/nlp/Magic.scala:31: error: object tagger is not a member of package edu.stanford.nlp import edu.stanford.nlp.tagger.maxent.MaxentTagger ^ src/edu/stanford/nlp/Magic.scala:32: error: object trees is not a member of package edu.stanford.nlp import edu.stanford.nlp.trees.CollinsHeadFinder ^ src/edu/stanford/nlp/Magic.scala:33: error: object trees is not a member of package edu.stanford.nlp import edu.stanford.nlp.trees.LabeledScoredTreeNode ^ src/edu/stanford/nlp/Magic.scala:34: error: object trees is not a member of package edu.stanford.nlp import edu.stanford.nlp.trees.Tree ^ src/edu/stanford/nlp/Sentence.scala:236: warning: non-variable type argument String in type pattern Seq[String](the underlying of Seq[String]) is unchecked since it is eliminated by erasure case (s:Seq[String]) => seqMatch(s) ^ 10 warnings found 238 errors found make: *\ [stanford] Error 1