List of usage examples for java.lang StackOverflowError getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:pltag.corpus.TagCorpus.java
public void singleSentExtractor(String inputFilename, PennTree tree, int treeNo) { try {// w w w . j a v a 2s. co m if (verbose) { printOutput(tree.getString()); } List<LexEntry> lexEntries = calculateLexEntries(tree); reconstructAndBuildLexicon(inputFilename, treeNo, tree, convertToElementaryStringTrees(lexEntries, inputFilename, treeNo, tree.getRandomGenerator())); } catch (IOException ex) { LogInfo.error("during conversion: " + ex.getClass().toString()); } catch (StackOverflowError e) { LogInfo.error("during conversion: " + e.getClass().toString()); } }
From source file:pltag.corpus.TagCorpus.java
/** * Extracts the lexicon from the annotated Penn Treebank. * @param augmented: the annotated treebank * @param filename//from w ww . j a v a 2s .c o m * @return the lexicon for the given part of the treebank */ private List<StringTree> makeLexicon(PennCorpus augmented, String filename) { List treeList = augmented.getTrees(); totalNumOfPropositionArgs += augmented.getTotalNumOfPropositionArgs(); List<StringTree> allCorpus = new ArrayList<StringTree>(); //for each sentence: for (int treeNo = 0; treeNo < treeList.size(); treeNo++) {//*/ try { PennTree tree = (PennTree) treeList.get(treeNo); if (verbose) { LogInfo.logs(tree.getString()); } List<LexEntry> lexEntries = calculateLexEntries(tree); List<ElementaryStringTree> elementTrees = convertToElementaryStringTrees(lexEntries, filename, treeNo, tree.getRandomGenerator()); allCorpus.addAll(reconstructAndBuildLexicon(filename, treeNo, tree, elementTrees)); } catch (Exception ex) { if (verbose) { LogInfo.error(ex); //ex.printStackTrace(); } listErrors.add("File: " + filename + " Tree: " + treeNo); } catch (StackOverflowError e) { if (verbose) { LogInfo.error(e.getClass().toString()); } listErrors.add("File: " + filename + " Tree: " + treeNo); } } for (StringTree elemTree : allCorpus) { extractedNumOfPropositionArgs += elemTree.getNumOfRoles(); } return allCorpus; }