Code example for Multiset

Methods: add

   * @param originalForm The original form of the value as a string. 
   * @param data         The vector to which the value should be added. 
  public void addToVector(String originalForm, double weight, Vector data) {
    super.addToVector(originalForm, weight, data);
  protected double getWeight(byte[] originalForm, double w) {
    return w * weight(originalForm);
  protected double weight(byte[] originalForm) {
    // the counts here are adjusted so that every observed value has an extra 0.5 count 
    // as does a hypothetical unobserved value.  This smooths our estimates a bit and 
    // allows the first word seen to have a non-zero weight of -log(1.5 / 2) 
    double thisWord = dictionary.count(new String(originalForm, Charsets.UTF_8)) + 0.5;