Examples of increment()


Examples of edu.umd.cloud9.io.map.HMapSIW.increment()

        for (String token : tokens) {
          if (!sent.containsKey(token)) {
            dfTable.increment(token);
          }
          sent.increment(token);
        }
        sentTfs.add(sent);
        sents.add(line);
        cnt++;
        sent.clear();
View Full Code Here

Examples of edu.umd.cloud9.io.map.Int2FloatOpenHashMapWritable.increment()

    m.put(1, 29.0f);

    assertEquals(7, m.get(2), 10e-6);
    assertEquals(29, m.get(1), 10e-6);

    m.increment(2);
    m.increment(1);
    m.increment(3);

    assertEquals(8, m.get(2), 10e-6);
    assertEquals(30, m.get(1), 10e-6);
View Full Code Here

Examples of edu.umd.cloud9.io.map.Int2IntOpenHashMapWritable.increment()

    m.put(1, 29);

    assertEquals(7, m.get(2));
    assertEquals(29, m.get(1));

    m.increment(2);
    m.increment(1);
    m.increment(3);

    assertEquals(8, m.get(2));
    assertEquals(30, m.get(1));
View Full Code Here

Examples of edu.umd.cloud9.io.map.String2IntOpenHashMapWritable.increment()

    assertEquals(1, map1.getInt("\u00E0"));
    assertEquals(2, map1.getInt("\u00E6"));
    assertEquals(3, map1.getInt("\u00E7"));
    assertEquals(4, map1.getInt("\u00FC"));

    map1.increment("\u00E0");
    map1.increment("\u00E6");
    map1.increment("\u00E7");
    map1.increment("\u00FC");

    assertEquals(2, map1.getInt("\u00E0"));
View Full Code Here

Examples of edu.umd.cloud9.util.fd.Int2IntFrequencyDistribution.increment()

    System.out.println("Complete postings list for 'gold': " + value);

    Int2IntFrequencyDistribution goldHist = new Int2IntFrequencyDistributionEntry();
    postings = value.getRightElement();
    for (PairOfInts pair : postings) {
      goldHist.increment(pair.getRightElement());
    }

    System.out.println("histogram of tf values for gold");
    for (PairOfInts pair : goldHist) {
      System.out.println(pair.getLeftElement() + "\t" + pair.getRightElement());
View Full Code Here

Examples of edu.umd.cloud9.util.fd.Int2IntFrequencyDistributionEntry.increment()

    System.out.println("Complete postings list for 'gold': " + value);

    Int2IntFrequencyDistribution goldHist = new Int2IntFrequencyDistributionEntry();
    postings = value.getRightElement();
    for (PairOfInts pair : postings) {
      goldHist.increment(pair.getRightElement());
    }

    System.out.println("histogram of tf values for gold");
    for (PairOfInts pair : goldHist) {
      System.out.println(pair.getLeftElement() + "\t" + pair.getRightElement());
View Full Code Here

Examples of edu.umd.cloud9.util.fd.Int2IntFrequencyDistributionFastutil.increment()

    for (Int2IntFrequencyDistributionFastutil fd : distributions.values()) {
      long conditionalSum = 0;

      for (PairOfInts pair : fd) {
        conditionalSum += pair.getRightElement();
        m.increment(pair.getLeftElement(), pair.getRightElement());
      }

      if (conditionalSum != fd.getSumOfCounts()) {
        throw new RuntimeException("Internal Error!");
      }
View Full Code Here

Examples of edu.umd.cloud9.util.map.HMapID.increment()

  @Test
  public void testIncrement() {
    HMapID m = new HMapID();
    assertEquals(0.0, m.get(1), 10E-6);

    m.increment(1, 0.5);
    assertEquals(0.5, m.get(1), 10E-6);

    m.increment(1, 1.0);
    m.increment(2, 0.0);
    m.increment(3, -0.5);
View Full Code Here

Examples of edu.umd.cloud9.util.map.HMapIF.increment()

  @Test
  public void testIncrement() {
    HMapIF m = new HMapIF();
    assertEquals(0.0f, m.get(1), 10E-6);

    m.increment(1, 0.5f);
    assertEquals(0.5f, m.get(1), 10E-6);

    m.increment(1, 1.0f);
    m.increment(2, 0.0f);
    m.increment(3, -0.5f);
View Full Code Here

Examples of edu.umd.cloud9.util.map.HMapII.increment()

  public void testIncrement() {
    HMapII m = new HMapII();
    // When we put a value, we should get back the old value.

    assertEquals(0, m.get(1));
    m.increment(1);

    assertEquals(1, m.get(1));
    m.increment(1, 5);
    m.increment(2, 0);
    m.increment(3, 2);
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.