Ejemplo n.º 1
0
 private void openConnArgMenuItemActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_openConnArgMenuItemActionPerformed
   JFileChooser fileChooser = new JFileChooser(".//resource//ml//data");
   fileChooser.showDialog(this, "Open Connective Argument Annotated Text");
   File file = fileChooser.getSelectedFile();
   System.out.println(file.getAbsolutePath());
   if (file != null) {
     markup = new ClauseArgMarkup();
     annotator = new SerialAnnotator();
     annotator.add(new GeniaTagger());
     annotator.add(new ClauseBoundaryAnnotator(false));
     annotator.add(new ClauseAnnotator());
     annotator.add(new DiscourseMarkerAnnotator(false));
     textReader =
         new GenericTextReader(
             "\n\n",
             "\n",
             "\t",
             new String[] {"word", "CONN", "ARG1S", "ARG1E", "ARG2S", "ARG2E"});
     // initTable(new String[]{"POS", "CHUNK", "DIS_CON",
     // "DIS_CON_SCP","DIS_CON_TYP","CLS_ANN","CLS_S#","CLS_E#","Arg"});
     initTable(new String[] {"POS", "CHUNK", "DIS_CON", "CLS_ANN", "CLS_S#", "CLS_E#"});
     loadFile(file);
   }
 } // GEN-LAST:event_openConnArgMenuItemActionPerformed
Ejemplo n.º 2
0
 private void inputMenuItemActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_inputMenuItemActionPerformed
   String msg =
       JOptionPane.showInputDialog(
           this, "Enter one or more lines:", "Input", JOptionPane.PLAIN_MESSAGE);
   if (msg != null) {
     markup = new ClauseAnnotationMarkup();
     annotator = new SerialAnnotator();
     annotator.add(new GeniaTagger());
     annotator.add(new ClauseBoundaryAnnotator(false));
     annotator.add(new ClauseAnnotator());
     annotator.add(new DiscourseMarkerAnnotator(false));
     textReader = new LPTextReader();
     initTable(new String[] {"POS", "CHUNK", "DIS_CON", "CLS_BN_S", "CLS_BN_E", "CLS_ANN"});
     loadText(msg);
   }
 } // GEN-LAST:event_inputMenuItemActionPerformed
Ejemplo n.º 3
0
 private void openMenuItemActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_openMenuItemActionPerformed
   JFileChooser fileChooser = new JFileChooser(".//resource//ml//data");
   fileChooser.showDialog(this, "Open Raw Text");
   File file = fileChooser.getSelectedFile();
   System.out.println(file.getAbsolutePath());
   if (file != null) {
     markup = new ClauseAnnotationMarkup();
     annotator = new SerialAnnotator();
     annotator.add(new GeniaTagger());
     annotator.add(new ClauseBoundaryAnnotator(false));
     annotator.add(new ClauseAnnotator());
     annotator.add(new DiscourseMarkerAnnotator(false));
     textReader = new LPTextReader();
     initTable(new String[] {"POS", "CHUNK", "DIS_CON", "CLS_BN_S", "CLS_BN_E", "CLS_ANN"});
     loadFile(file);
   }
 } // GEN-LAST:event_openMenuItemActionPerformed
Ejemplo n.º 4
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.º 5
0
 private void initTable() {
   String[] fieldNames = annotator.getFieldNames();
   this.initTable(fieldNames);
 }