Package dmt.tools

Examples of dmt.tools.CSVFileWriter.writeFields()


    int countNonNull=0;
    CSVFileWriter out = new CSVFileWriter("clusteringDistancesCSV.csv", ',');
    Vector<String> headers = new Vector<String>();
    headers.add("Euclidean");
    headers.add("Manhattan");
    out.writeFields(headers);

    CSVFileReader in1 = new CSVFileReader("csv_out.csv", ',');
    // skip the headers
    Vector<String> fields1 = in1.readFields();
    fields1 = in1.readFields();
View Full Code Here


        double d1 = TextInstance.computeEuclideanDistance(
            instance1, instance2);
        distances.add(d1+"");
        distances.add(TextInstance.computeManhattanDistance(instance1, instance2)
            + "");
        out.writeFields(distances);
        fields2 = in2.readFields();
        count2++;
        if(count2==num_instances) break;
      }
      fields1 = in1.readFields();
View Full Code Here

        Vector<PreFeature> preFeatures = PreFeature.getFeatures();
      for(int i=0; i < preFeatures.size(); i++)
      {
        preFeatures.get(i).run(fields);
      }
      out.writeFields(fields);
        fields = in.readFields();
        k++;
        //if(k>10) break;
       
      }
View Full Code Here

    {
      Vector<String> fields = new Vector<String>();
      fields.add(keys[i].toString());
      fields.add(stemWords.get(keys[i]).toString());
      fields.add(stemWordsTotal.get(keys[i]).toString());
      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

      fields.add("ClusterVictor");
      fields.add("ClusterMarina");
      String toc = fields.get(2);
      fields.remove(2);
      fields.add(toc);
      out.writeFields(fields);
      fields = in.readFields();
      int k=0;
     
      while(fields!=null)
      {
View Full Code Here

       
        toc = fields.get(2);
        fields.remove(2);
        fields.add(toc);
       
        out.writeFields(fields);
        fields = in.readFields();
        k++;
       
      }
 
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.