Ejemplo n.º 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
Ejemplo n.º 2
0
 private void showAnnotation() {
   Sentence s = corpusText.get(sentIndex);
   try {
     s = annotator.annotate(s);
   } catch (Exception ex) {
     JOptionPane.showMessageDialog(
         this, ex.getMessage(), "Exception occured", JOptionPane.ERROR_MESSAGE);
   }
   updateTable(s);
   updateTextPane(s);
 }
Ejemplo n.º 3
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