Tabnine Logo
FrequencyDistribution.incAll
Code IndexAdd Tabnine to your IDE (free)

How to use
incAll
method
in
de.tudarmstadt.ukp.dkpro.teaching.core.FrequencyDistribution

Best Java code snippets using de.tudarmstadt.ukp.dkpro.teaching.core.FrequencyDistribution.incAll (Showing top 2 results out of 315)

origin: de.tudarmstadt.ukp.dkpro.teaching/de.tudarmstadt.ukp.dkpro.teaching.core

public void addSamples(C t, Iterable<V> samples) {
  FrequencyDistribution<V> freqDist = null;
  if (cfd.containsKey(t)) {
    freqDist = cfd.get(t);
  }
  else {
    freqDist = new FrequencyDistribution<V>();
    cfd.put(t, freqDist);
  }
  long countBefore = freqDist.getN();
  freqDist.incAll(samples);
  this.n = n + (freqDist.getN() - countBefore); 
}
 
origin: de.tudarmstadt.ukp.dkpro.teaching/de.tudarmstadt.ukp.dkpro.teaching.core

  @Test
  public void cfdTest() {
    
    List<String> tokens = Arrays.asList("This is a first test that contains a first test example".split(" "));
    
    FrequencyDistribution<String> fd = new FrequencyDistribution<String>();
    fd.incAll(tokens);
    
    System.out.println(fd);
    
    assertEquals(11, fd.getN());
    assertEquals(8, fd.getB());
    
    assertEquals(0, fd.getCount("humpelgrumpf"));
    assertEquals(1, fd.getCount("This"));
    assertEquals(2, fd.getCount("test"));
  }
}
de.tudarmstadt.ukp.dkpro.teaching.coreFrequencyDistributionincAll

Popular methods of FrequencyDistribution

  • getN
  • <init>
  • getCount
  • addSample
  • getB
  • toString

Popular in Java

  • Reactive rest calls using spring rest template
  • notifyDataSetChanged (ArrayAdapter)
  • setContentView (Activity)
  • onCreateOptionsMenu (Activity)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now