Пример #1
0
 private void showTreeMenuItemActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_showTreeMenuItemActionPerformed
   Sentence s = corpusText.get(this.sentIndex);
   s = parserAnnotator.annotate(s);
   treeViewDialog.setTree(s.getParseTree());
   treeViewDialog.repaint();
   treeViewDialog.setVisible(true);
 } // GEN-LAST:event_showTreeMenuItemActionPerformed
Пример #2
0
 private void showDepGraphMenuItemActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_showDepGraphMenuItemActionPerformed
   Sentence s = corpusText.get(this.sentIndex);
   if (!s.isAnnotatedBy("PARSED")) s = parserAnnotator.annotate(s);
   Tree t = s.getParseTree();
   EnglishGrammaticalStructure egs = new EnglishGrammaticalStructure(t);
   Collection<TypedDependency> tld = egs.typedDependenciesCCprocessed(true);
   try {
     String path = System.getProperty("java.io.tmpdir") + "tmp.png";
     com.chaoticity.dependensee.Main.writeImage(t, tld, "tmp.png");
     Desktop.getDesktop().open(new File("tmp.png"));
   } catch (Exception ex) {
     System.err.println(ex.getMessage());
   }
 } // GEN-LAST:event_showDepGraphMenuItemActionPerformed