Package dmt.tools

Examples of dmt.tools.CSVFileWriter.writeFields()


        line = reader.readLine();
      }

      CSVFileWriter out = new CSVFileWriter("output/" + clustersCount
          + "clusterCentersMarina.csv", ',');
      out.writeFields(headers);
      for (int i = 0; i < clustersCount; i++)
      {
        Vector<String> fields = clusterCenters.get(i);
        fields.add(0, "Cluster" + i);
        out.writeFields(fields);
View Full Code Here


      out.writeFields(headers);
      for (int i = 0; i < clustersCount; i++)
      {
        Vector<String> fields = clusterCenters.get(i);
        fields.add(0, "Cluster" + i);
        out.writeFields(fields);
      }
      out.close();

    }
  }
View Full Code Here

    Object[] clusters = clResponsePartition.toArray();
    CSVFileWriter out = new CSVFileWriter("completeLinkClustersCSV.csv",
        ',');
    Vector<String> header = new Vector<String>();
    header.add("Cluster label");
    out.writeFields(header);
    Object[] textInstancesArray = TextInstance.textInstancesSet.toArray();
    for (int i = 0; i < textInstancesArray.length; i++)
    {
      for (int j = 0; j < clusters.length; j++)
      {
View Full Code Here

        if (((Set<TextInstance>) clusters[j])
            .contains(textInstancesArray[i]))
        {
          Vector<String> clusterLabel = new Vector<String>();
          clusterLabel.add((j + 1) + "");
          out.writeFields(clusterLabel);
        }
      }
    }
    out.close();
View Full Code Here

        .hierarchicalCluster(TextInstance.textInstancesSet);
    Set<Set<TextInstance>> slResponsePartition = singleLinkDendrogram
        .partitionK(k);
    clusters = slResponsePartition.toArray();
    out = new CSVFileWriter("singleLinkClustersCSV.csv", ',');
    out.writeFields(header);
    for (int i = 0; i < textInstancesArray.length; i++)
    {
      for (int j = 0; j < clusters.length; j++)
      {
        if (((Set<TextInstance>) clusters[j])
View Full Code Here

        if (((Set<TextInstance>) clusters[j])
            .contains(textInstancesArray[i]))
        {
          Vector<String> clusterLabel = new Vector<String>();
          clusterLabel.add((j + 1) + "");
          out.writeFields(clusterLabel);
        }
      }
    }
    out.close();
View Full Code Here

        ',');
    Vector<String> header = new Vector<String>();
    header.add("Document ID");
    header.add("XPath");
    header.add("Cluster label");
    out.writeFields(header);
    for (int i = 0; i < clusters.size(); i++)
    {
      for (int j = 0; j < clusters.get(i).size(); j++)
      {
        DataPoint point = clusters.get(i).get(j);
View Full Code Here

        String XPath = point.getId().substring(point.getId().indexOf("/"), point.getId().length());
        Vector<String> fields = new Vector<String>();
        fields.add(documentId);
        fields.add(XPath);
        fields.add(i+"");
        out.writeFields(fields);
      }
    }
    out.close();
  }
}
View Full Code Here

   
    CSVFileReader in = new CSVFileReader(tmpFile, ',');
    CSVFileWriter out = new CSVFileWriter(outCSV, ',');
   
    //adding headers
    out.writeFields(getHeaders());

      Vector<String> fields = in.readFields();
      int k=0;
     
      while(fields!=null)
View Full Code Here

         
        }
      }
      fields.remove(3);
      //fields.set(3, new Integer(fields.get(3).length()).toString());
        out.writeFields(fields);
        fields = in.readFields();
        k++;
        //if(k>1000) break;
       
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.