Beispiel #1
0
  /*
  	-- This is a helper methid to run the morph files
  */
  private static void runMorphDataSet() throws Exception {

    String morph_directory =
        "../../thesis-datasets/morph/"; // directory where all the morph code is stored
    File d = new File(morph_directory);
    // get all the files from a directory
    File[] fList = d.listFiles();
    List<String> dir_list = new ArrayList<String>();
    for (File file : fList) {
      if (file.isDirectory()) {
        dir_list.add(file.getName());
      }
    }
    for (String dir : dir_list) {
      directory = morph_directory + dir + "/";
      System.out.println("Running TDDD " + directory);
      ReadFile.readFile(directory, fileList); // read the two files
      System.out.println(fileList.get(0) + " " + fileList.get(1));
      preliminaryStep(directory);
      startCDC();
      fileList.clear();
      fileArray.clear();
      hashed_File_List.clear();
    }
  }
 /**
  * Takes a line and looks for an archive group tag. If one is found, the information from the tag
  * is returned as an <CODE>ArchiveGroup</CODE>. If a tag is found, the data in the tag is stored
  * in the <CODE>HashMap</CODE> provided.
  *
  * @param currentLine The line in which to look for the archive tag.
  * @param template The <CODE>Template</CODE> to which the <CODE>ArchiveGroup</CODE> belongs.
  * @return The archive request tag data as an instance of <CODE>ArchiveGroup</CODE>, <CODE>null
  *     </CODE> if the line passed in does not contain an arFile tag.
  */
 private ArchiveGroup parseArchiveGroupTag(String currentLine, Template template) {
   ArchiveGroup archiveTag;
   Matcher currentMatcher = archiveRequestPattern.matcher(currentLine);
   if (currentMatcher.find()) {
     String fileName = currentMatcher.group(1);
     archiveTag = template.getArchiveGroup(fileName);
     if (archiveTag == null) {
       File groupFile = new File(fileName);
       archiveTag = new ArchiveGroup(groupFile.getParent(), groupFile.getName());
       template.addArchiveGroup(archiveTag);
     }
   } else archiveTag = null;
   return archiveTag;
 }