Comments (11)
Honestly I don't have the slightest idea. It looks like legal Java to me, but no one ever hired me to be a Java compiler.
What happens if you comment out a line such as 91, if(tree.yield().size() > maxLen) continue;
Maybe Eclipse is incorrectly thinking the loop always shortcuts there?
Or a different variable name? No idea if something weird happened where that variable name was used elsewhere and that is confusing Eclipse
from corenlp.
Maybe Eclipse is incorrectly thinking the loop always shortcuts there?
Interesting hypothesis...I have commented the first few lines, which made the first error disappear (the other errors are still there).
On the other hand, changing the variable name from tree to tree2 didn't change anything
from corenlp.
And a similar problem occurs here:
from corenlp.
What if you took the variable out of the loop and only did the operations once? Would it compile then? (Obviously the functionality would be broken)
from corenlp.
If I use it exactly once, it goes away...
from corenlp.
However, here is a way to make it fail even at the first usage:
from corenlp.
Hmm, I had actually meant to remove the loop and test compiling with nothing there, but this might still be useful to know.
If memory serves, yield
is actually now a keyword in future versions of Java. (Anything after 8 is "future" from our point of view.) Perhaps there is some effect going on here. Each of the examples you've pasted so far has that in the error.
In the case of the one where the line has yield().size()
, would you try replacing that with taggedYield().size()
? If that clears up some of the errors, I'll put a little effort into generalizing it, especially if you can help point out where the compiler is spazzing.
Incidentally, handling this error is kinda reinforcing my belief that pasting images is a lot less useful than pasting text - I wanted to copy/paste the line I wanted to change, but couldn't
from corenlp.
Good point, I will include text from now on.
Tried to remove the whole loop, all the errors disappear.
Here is the text where the four errors occur (lines 95,98,101,104)
91 for (Tree tree : tb) {
92 if(tree.yield().size() > maxLen) continue;
93 ++numTrees;
94 if (printTrees) {
95 pw.println(tree.toString());
} else if (flattenTrees) {
pw.println(SentenceUtils.listToString(tree.yield()));
} else if (printPOS) {
pw.println(SentenceUtils.listToString(tree.preTerminalYield()));
} else if (printTnT) {
List<CoreLabel> yield = tree.taggedLabeledYield();
for (CoreLabel label : yield) {
pw.printf("%s\t%s%n", label.word(), label.tag());
}
pw.println();
}
}
And the same error occurs in the class AnCoraPOSStats, at line 51 (below),
there is yield in this instance. The two instances have in common that the variable
is declared with the colon syntax inside of for (....)
48 Tree t;
49 for (File file : fileList) {
50 Reader in =
51 new BufferedReader(new InputStreamReader(new FileInputStream(file), ANCORA_ENCODING));
TreeReader tr = trf.newTreeReader(in);
// Tree reading will implicitly perform tree normalization for us
while ((t = tr.readTree()) != null) {
// Update tagger with this tree
List<CoreLabel> yield = t.taggedLabeledYield();
for (CoreLabel leafLabel : yield) {
if (leafLabel.tag().equals(SpanishTreeNormalizer.MW_TAG))
continue;
unigramTagger.incrementCount(leafLabel.word(), leafLabel.tag());
}
}
}
}
from corenlp.
What happens if you try this one
92 if(tree.yield().size() > maxLen) continue;
with getLeaves()
instead of yield()
? That one would be an easy fix if it's the yield
keyword causing the problem, since the effect should be exactly the same.
from corenlp.
Would you try compiling the dev branch? I removed two usages of the keyword yield
from in those functions. If that improves the compilation, I can do the same in any other places you find a compile error.
from corenlp.
The dev branch does not trigger the error, thanks for finding a solution!
There is still one error that pops up in file OSXAdapter:
private static com.apple.eawt.Application app can not be resolved,
I will open a new issue for it
from corenlp.
Related Issues (20)
- An exception occurred: Expecting value: line 1 column 1 (char 0) HOT 1
- IntervalTree#remove null pointer exception HOT 4
- i am getting a lock screen bug HOT 3
- Upgrade Apache Lucene to resolve vulnerability for consumers HOT 8
- negation modifier HOT 4
- Add Automatic-Module-Name to MANIFEST.MF HOT 22
- english.all.3class.distsim.crf.ser.gz ???? HOT 1
- Training Shift Reduce Parser HOT 1
- German Lemma not working? HOT 10
- Wrong POS for "keine": PRON instead of DET HOT 7
- Support HOT 2
- Is downloads.cs.stanford.edu down? HOT 3
- Arabic Processing data HOT 2
- VBN vs VBD in the input files from PTB
- Is https://corenlp.run down? HOT 1
- Local Server Run Fails Due to Main Website Outage HOT 3
- Cannot instantiate a StanfordCoreNLP pipeline in a Springboot Project using Maven HOT 3
- I use this command, but the word-cut results are same to space-split. Thank you very much.
- Unable to install CoreNLP software HOT 7
- KBA appears to miss per:child when separated by location
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from corenlp.