public DepPrintStates(String inputFile, String outputFile) {
    DepReader reader = new DepReader(inputFile, true);
    DepTree tree;
    ShiftPopParser parser = new ShiftPopParser(AbstractDepParser.FLAG_PRINT_TRANSITION, outputFile);

    while ((tree = reader.nextTree()) != null) {
      parser.parse(tree);
    }
  }
Exemplo n.º 2
0
  public DepKrClean(String inputDir, String outputDir) {
    File dir = new File(inputDir);
    DepReader reader;
    DepTree tree;
    PrintStream fout;

    for (String filename : dir.list()) {
      if (!filename.endsWith(".dep")) continue;
      System.out.println(filename);

      reader = new DepReader(inputDir + File.separator + filename, true);
      fout = IOUtil.createPrintFileStream(outputDir + File.separator + filename);

      while ((tree = reader.nextTree()) != null) {
        if (check(tree)) fout.println(tree + "\n");
      }

      reader.close();
      fout.close();
    }
  }