Example usage for org.apache.commons.collections.bidimap TreeBidiMap TreeBidiMap

List of usage examples for org.apache.commons.collections.bidimap TreeBidiMap TreeBidiMap

Introduction

In this page you can find the example usage for org.apache.commons.collections.bidimap TreeBidiMap TreeBidiMap.

Prototype

public TreeBidiMap(final Map map) 

Source Link

Document

Constructs a new TreeBidiMap by copying an existing Map.

Usage

From source file:org.apache.mahout.classifier.sequencelearning.hmm.HmmModel.java

/**
 * Get a copy of this model//from   w  ww. java2s.c  o m
 */
@Override
public HmmModel clone() throws CloneNotSupportedException {
    super.clone();
    HmmModel model = new HmmModel(transitionMatrix.clone(), emissionMatrix.clone(),
            initialProbabilities.clone());
    if (hiddenStateNames != null) {
        model.hiddenStateNames = new TreeBidiMap(hiddenStateNames);
    }
    if (outputStateNames != null) {
        model.outputStateNames = new TreeBidiMap(outputStateNames);
    }
    return model;
}

From source file:org.apache.mahout.classifier.sequencelearning.hmm.HmmModel.java

/**
 * Register a map of hidden state Names/state IDs
 *
 * @param stateNames <String,Integer> Map that assigns each state name an integer ID
 */// w w w  .  j  a v  a 2  s  .  c  o m
public void registerHiddenStateNames(Map<String, Integer> stateNames) {
    if (stateNames != null) {
        hiddenStateNames = new TreeBidiMap(stateNames);
    }
}

From source file:org.apache.mahout.classifier.sequencelearning.hmm.HmmModel.java

/**
 * Register a map of hidden state Names/state IDs
 *
 * @param stateNames <String,Integer> Map that assigns each state name an integer ID
 *//*  w w w.j  a v  a2 s .c  o  m*/
public void registerOutputStateNames(Map<String, Integer> stateNames) {
    if (stateNames != null) {
        outputStateNames = new TreeBidiMap(stateNames);
    }
}