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

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

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

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

  @Override
  public long getNrOfTokens()
    throws Exception
  {
    return cfd.getFrequencyDistribution(1).getN();
  }
}
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.coreFrequencyDistributiongetN

Popular methods of FrequencyDistribution

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

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (ScheduledExecutorService)
  • findViewById (Activity)
  • runOnUiThread (Activity)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • String (java.lang)
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • JButton (javax.swing)
  • CodeWhisperer alternatives
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