Examples of StringTuple


Examples of org.apache.mahout.common.StringTuple

    return weightSum.get(BayesConstants.TOTAL_SUM);
  }
 
  public static double readVocabCount(FileSystem fs, Path pathPattern, Configuration conf) throws IOException {
    Map<String,Double> weightSum = new HashMap<String,Double>();
    StringTuple key = new StringTuple();
    DoubleWritable value = new DoubleWritable();
   
    FileStatus[] outputFiles = fs.globStatus(pathPattern);
    for (FileStatus fileStatus : outputFiles) {
      Path path = fileStatus.getPath();
      SequenceFile.Reader reader = new SequenceFile.Reader(fs, path, conf);
      while (reader.next(key, value)) {
        if (weightSum.size() > 1) {
          throw new IOException("Incorrect vocabCount File");
        }
        if (key.stringAt(0).equals(BayesConstants.FEATURE_SET_SIZE)) {
          weightSum.put(BayesConstants.FEATURE_SET_SIZE, value.get());
        }
       
      }
    }
View Full Code Here

Examples of org.springframework.data.redis.connection.StringRedisConnection.StringTuple

    Cursor<StringTuple> tuples = connection.zScan("myset", ScanOptions.NONE);

    int count = 0;
    while (tuples.hasNext()) {

      StringTuple tuple = tuples.next();

      assertThat(tuple.getValueAsString(), anyOf(equalTo("Bob"), equalTo("James"), equalTo("Joe")));
      assertThat(tuple.getScore(), anyOf(equalTo(1D), equalTo(2D), equalTo(4D)));

      count++;
    }

    assertThat(count, equalTo(3));
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.