Examples of IntCounter


Examples of com.google.code.http4j.utils.IntCounter

 
  private Counter<Integer> counter;
 
  @BeforeClass
  public void beforeClass() {
    counter = new IntCounter();
  }
View Full Code Here

Examples of edu.stanford.nlp.stats.IntCounter

    this(trees, 2);
  }
  */

  public ChineseWordFeatureExtractor(int featureLevel) {
    wordCounter = new IntCounter();
    setFeatureLevel(featureLevel);
  }
View Full Code Here

Examples of edu.stanford.nlp.stats.IntCounter

  }

  private Collection<String> threshedFeatures;

  public void applyFeatureCountThreshold(Collection<String> data, int thresh) {
    IntCounter c = new IntCounter();
    for (String datum : data) {
      for (String feat : makeFeatures(datum)) {
        c.incrementCount(feat);
      }
    }
    threshedFeatures = c.keysAbove(thresh);
    System.err.println((c.size() - threshedFeatures.size()) + " word features removed due to thresholding.");
  }
View Full Code Here

Examples of edu.stanford.nlp.stats.IntCounter

  private Map<Object, String> varsToStrings;
  private IntCounter numVarsSet;

  public VariableStrings() {
    varsToStrings = new HashMap<Object,String>();
    numVarsSet = new IntCounter();
  }
View Full Code Here

Examples of eu.stratosphere.api.common.accumulators.IntCounter

      // getAccumulator()
      this.distinctWords = new SetAccumulator<StringRecord>();
      this.getRuntimeContext().addAccumulator("distinct-words", distinctWords);

      // Create counter and test increment
      IntCounter simpleCounter = getRuntimeContext().getIntCounter("simple-counter");
      simpleCounter.add(1);
      Assert.assertEquals(simpleCounter.getLocalValue().intValue(), 1);

      // Test if we get the same counter
      IntCounter simpleCounter2 = getRuntimeContext().getIntCounter("simple-counter");
      Assert.assertEquals(simpleCounter.getLocalValue(), simpleCounter2.getLocalValue());

      // Should fail if we request it with different type
      try {
        @SuppressWarnings("unused")
        DoubleCounter simpleCounter3 = getRuntimeContext().getDoubleCounter("simple-counter");
View Full Code Here

Examples of org.apache.flink.api.common.accumulators.IntCounter

      // getAccumulator()
      this.distinctWords = new SetAccumulator<StringValue>();
      this.getRuntimeContext().addAccumulator("distinct-words", distinctWords);

      // Create counter and test increment
      IntCounter simpleCounter = getRuntimeContext().getIntCounter("simple-counter");
      simpleCounter.add(1);
      Assert.assertEquals(simpleCounter.getLocalValue().intValue(), 1);

      // Test if we get the same counter
      IntCounter simpleCounter2 = getRuntimeContext().getIntCounter("simple-counter");
      Assert.assertEquals(simpleCounter.getLocalValue(), simpleCounter2.getLocalValue());

      // Should fail if we request it with different type
      try {
        @SuppressWarnings("unused")
        DoubleCounter simpleCounter3 = getRuntimeContext().getDoubleCounter("simple-counter");
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.