Exemple #1
0
 @Override
 public String getGroundTruthPath(br.edimarmanica.dataset.Attribute attr) {
   return getDomain().getDataset().getFolderName()
       + File.separator
       + "groundtruth/"
       + getDomain().getFolderName()
       + File.separator
       + getFolderName()
       + "-"
       + attr.getAttributeID()
       + ".txt";
 }
  // obter as masterRules de cada site para cada atributo
  private String getMasterRule(Site site, Attribute attribute) {
    try (Reader in = new FileReader(Paths.PATH_INTRASITE + "/" + site.getPath() + "/result.csv")) {
      try (CSVParser parser = new CSVParser(in, CSVFormat.EXCEL.withHeader())) {

        for (CSVRecord record : parser) {
          if (record.get("ATTRIBUTE").equals(attribute.getAttributeID())) {
            if (record.get("RULE").equals("Attribute not found")) {
              return null;
            }
            return record.get("RULE");
          }
        }
      }
    } catch (FileNotFoundException ex) {
      Logger.getLogger(CheckDistanceExpectedMapping.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
      Logger.getLogger(CheckDistanceExpectedMapping.class.getName()).log(Level.SEVERE, null, ex);
    }

    return null;
  }