T
- The type of element which is counted.public class FreqDist<T> extends Object implements Serializable
Constructor and Description |
---|
FreqDist()
Creates an empty FreqDist.
|
FreqDist(Collection<T> collection)
Instantiate a FreqDist and count the given collection.
|
Modifier and Type | Method and Description |
---|---|
void |
count(Collection<T> collection)
Increment the counts for all elements contained in the collection.
|
void |
count(T element)
Increment the count for the given element.
|
void |
count(T element,
int number)
Increment the count by number for the given element.
|
int |
getCount(T element)
Returns the count of the given element
|
Map<T,Double> |
getProbabilities()
Returns a mapping of elements to probabilities of their occurrence.
|
int |
getTotalCount()
Returns the accumulated count of all elements.
|
public FreqDist(Collection<T> collection)
collection
- a collection.public FreqDist()
public Map<T,Double> getProbabilities()
public int getCount(T element)
element
- an element.public void count(T element)
element
- the element to be countedpublic void count(T element, int number)
element
- the element to be countednumber
- an increment.public void count(Collection<T> collection)
collection
- a collection of elementspublic int getTotalCount()
Copyright © 2007–2018 Ubiquitous Knowledge Processing (UKP) Lab, Technische Universität Darmstadt. All rights reserved.