Tabnine Logo
FrequencyDistribution.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
de.tudarmstadt.ukp.dkpro.teaching.core.FrequencyDistribution
constructor

Best Java code snippets using de.tudarmstadt.ukp.dkpro.teaching.core.FrequencyDistribution.<init> (Showing top 3 results out of 315)

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

  public static void main(String[] args) {
    
    List<String> tokens = Arrays.asList(StringUtils.split("This is a simple example sentence containing an example ."));
    FrequencyDistribution<String> fq = new FrequencyDistribution<String>(tokens);
    
    System.out.println(fq.getCount("example"));
    System.out.println(fq.getCount("is"));
  }
}
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.coreFrequencyDistribution<init>

Popular methods of FrequencyDistribution

  • getN
  • getCount
  • incAll
  • addSample
  • getB
  • toString

Popular in Java

  • Finding current android device location
  • runOnUiThread (Activity)
  • compareTo (BigDecimal)
  • getApplicationContext (Context)
  • Kernel (java.awt.image)
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • 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