示例#1
0
 private static void processFileList(String fileList) throws IOException {
   // open list of files
   BufferedReader reader = new BufferedReader(new FileReader(fileList));
   int docCount = 0;
   String currentDoc;
   while ((currentDoc = reader.readLine()) != null) {
     // process file 'currentDoc'
     docCount++;
     System.out.println("\nProcessing document " + docCount + ": " + currentDoc);
     String textFileName = ACEdir + currentDoc + ".sgm";
     ExternalDocument doc = new ExternalDocument("sgml", textFileName);
     doc.setAllTags(true);
     doc.open();
     String APFfileName = ACEdir + currentDoc + apfExtension;
     AceDocument aceDoc = new AceDocument(textFileName, APFfileName);
     addMentionTags(doc, aceDoc);
     doc.setSGMLwrapMargin(0);
     doc.saveAs(outputDir, currentDoc + ".co.txt");
   }
   reader.close();
 }
示例#2
0
 /** process a single file, 'docName', generating a file with in-line XML. */
 public static void processFile(String docName) {
   docCount++;
   System.out.println("\nProcessing document " + docCount + ": " + docName);
   String textFileName = ACEdir + docName + ".sgm";
   ExternalDocument doc = new ExternalDocument("sgml", textFileName);
   doc.setAllTags(true);
   if (year.equals("2003") || year.equals("2004")) doc.setEmptyTags(new String[] {"TURN"});
   doc.open();
   String APFfileName = ACEdir + docName + "." + apfExtension;
   AceDocument aceDoc = new AceDocument(textFileName, APFfileName);
   addAnnotations(doc, aceDoc);
   doc.setSGMLwrapMargin(0);
   doc.saveAs(outputDir, docName + "." + outputExtension);
 }