code: public static <E> Distribution<E> distributionWithDirichletPrior(Counter<E> c, Distribution<E> prior, double weight) {
      Distribution<E> norm = new Distribution<E>();
      double totalWeight = c.totalCount() + weight;
      if (prior instanceof DynamicDistribution) {
        throw new UnsupportedOperationException("Cannot make normalized counter with Dynamic prior.");
      }
      norm.counter = Counters.linearCombination(c, 1 / totalWeight, prior.counter, weight / totalWeight);
      norm.numberOfKeys = prior.numberOfKeys;
      norm.reservedMass = prior.reservedMass * weight / totalWeight;
      //System.out.println("totalCount: " + norm.totalCount());
      return norm;
    }
docs: Returns a Distribution that uses prior as a Dirichlet prior
  weighted by weight.  Essentially adds "pseudo-counts" for each Object
  in prior equal to that Object's mass in prior times weight,
  then normalizes.
  <p/>
  WARNING: If unseen item is encountered in c, total may not be 1.
  NOTE: This will not work if prior is a DynamicDistribution
  to fix this, you could add a CounterView to Distribution and use that
  in the linearCombination call below
  
  @param weight multiplier of prior to get "pseudo-count"
  @return new Distribution