// Path: src/main/java/com/asher_stern/crf/crf/filters/CrfFeaturesAndFilters.java
// public class CrfFeaturesAndFilters<K, G> implements Serializable
// {
// 	private static final long serialVersionUID = 5815029007668803039L;
// 	
// 	public CrfFeaturesAndFilters(FilterFactory<K, G> filterFactory,
// 			CrfFilteredFeature<K, G>[] filteredFeatures,
// 			Map<Filter<K, G>, Set<Integer>> mapActiveFeatures,
// 			Set<Integer> indexesOfFeaturesWithNoFilter)
// 	{
// 		super();
// 		this.filterFactory = filterFactory;
// 		this.filteredFeatures = filteredFeatures;
// 		this.mapActiveFeatures = mapActiveFeatures;
// 		this.indexesOfFeaturesWithNoFilter = indexesOfFeaturesWithNoFilter;
// 	}
// 	
// 	
// 	/**
// 	 * Returns the {@link FilterFactory} to be used with the features encapsulated here, for efficient feature-value calculations.
// 	 */
// 	public FilterFactory<K, G> getFilterFactory()
// 	{
// 		return filterFactory;
// 	}
// 	
// 	/**
// 	 * An array of all the features in the CRF model.
// 	 */
// 	public CrfFilteredFeature<K, G>[] getFilteredFeatures()
// 	{
// 		return filteredFeatures;
// 	}
// 	
// 	/**
// 	 * Returns a map from each filter to a set of indexes of features, that might be active if their filters are equal to
// 	 * this filter. "Active" means that they might return non-zero. 
// 	 */
// 	public Map<Filter<K, G>, Set<Integer>> getMapActiveFeatures()
// 	{
// 		return mapActiveFeatures;
// 	}
// 	
// 	/**
// 	 * Returns a set of indexes of features that might be active for any type of input. These features have no filters. 
// 	 */
// 	public Set<Integer> getIndexesOfFeaturesWithNoFilter()
// 	{
// 		return indexesOfFeaturesWithNoFilter;
// 	}
// 
// 
// 
// 
// 	private final FilterFactory<K, G> filterFactory;
// 	private final CrfFilteredFeature<K, G>[] filteredFeatures;
// 	private final Map<Filter<K, G>, Set<Integer>> mapActiveFeatures;
// 	private final Set<Integer> indexesOfFeaturesWithNoFilter;
// }


import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import com.asher_stern.crf.crf.filters.CrfFeaturesAndFilters;
package com.asher_stern.crf.crf;



/**
 * This class encapsulates the set of all possible tags, the list of features (f_i), and the list of parameters (\theta_i).
 * 
 * @author Asher Stern
 * Date: Nov 8, 2014
 *
 * @param <K> token type - must implement equals() and hashCode()
 * @param <G> tag type - must implement equals() and hashCode()
 */
public class CrfModel<K,G> implements Serializable // K = token, G = tag
{
	private static final long serialVersionUID = -5703467522848303660L;
	
// Path: src/main/java/com/asher_stern/crf/crf/filters/CrfFeaturesAndFilters.java
// public class CrfFeaturesAndFilters<K, G> implements Serializable
// {
// 	private static final long serialVersionUID = 5815029007668803039L;
// 	
// 	public CrfFeaturesAndFilters(FilterFactory<K, G> filterFactory,
// 			CrfFilteredFeature<K, G>[] filteredFeatures,
// 			Map<Filter<K, G>, Set<Integer>> mapActiveFeatures,
// 			Set<Integer> indexesOfFeaturesWithNoFilter)
// 	{
// 		super();
// 		this.filterFactory = filterFactory;
// 		this.filteredFeatures = filteredFeatures;
// 		this.mapActiveFeatures = mapActiveFeatures;
// 		this.indexesOfFeaturesWithNoFilter = indexesOfFeaturesWithNoFilter;
// 	}
// 	
// 	
// 	/**
// 	 * Returns the {@link FilterFactory} to be used with the features encapsulated here, for efficient feature-value calculations.
// 	 */
// 	public FilterFactory<K, G> getFilterFactory()
// 	{
// 		return filterFactory;
// 	}
// 	
// 	/**
// 	 * An array of all the features in the CRF model.
// 	 */
// 	public CrfFilteredFeature<K, G>[] getFilteredFeatures()
// 	{
// 		return filteredFeatures;
// 	}
// 	
// 	/**
// 	 * Returns a map from each filter to a set of indexes of features, that might be active if their filters are equal to
// 	 * this filter. "Active" means that they might return non-zero. 
// 	 */
// 	public Map<Filter<K, G>, Set<Integer>> getMapActiveFeatures()
// 	{
// 		return mapActiveFeatures;
// 	}
// 	
// 	/**
// 	 * Returns a set of indexes of features that might be active for any type of input. These features have no filters. 
// 	 */
// 	public Set<Integer> getIndexesOfFeaturesWithNoFilter()
// 	{
// 		return indexesOfFeaturesWithNoFilter;
// 	}
// 
// 
// 
// 
// 	private final FilterFactory<K, G> filterFactory;
// 	private final CrfFilteredFeature<K, G>[] filteredFeatures;
// 	private final Map<Filter<K, G>, Set<Integer>> mapActiveFeatures;
// 	private final Set<Integer> indexesOfFeaturesWithNoFilter;
// }


// Path: src/main/java/com/asher_stern/crf/crf/CrfModel.java
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import com.asher_stern.crf.crf.filters.CrfFeaturesAndFilters;

package com.asher_stern.crf.crf;



/**
 * This class encapsulates the set of all possible tags, the list of features (f_i), and the list of parameters (\theta_i).
 * 
 * @author Asher Stern
 * Date: Nov 8, 2014
 *
 * @param <K> token type - must implement equals() and hashCode()
 * @param <G> tag type - must implement equals() and hashCode()
 */
public class CrfModel<K,G> implements Serializable // K = token, G = tag
{
	private static final long serialVersionUID = -5703467522848303660L;
	
	public CrfModel(CrfTags<G> crfTags, CrfFeaturesAndFilters<K, G> features, ArrayList<BigDecimal> parameters)