// Path: src/main/java/uk/ac/shef/dcs/oak/jate/JATEException.java
// public class JATEException extends Exception {
// 	private static final long serialVersionUID = -4511571544868986419L;
// 
// 	public JATEException(String exception){
// 		super(exception);
// 	}
// 
// 	public JATEException(Exception e){
// 		super(e);
// 	}
// 
// 	public JATEException(String exception, Throwable cause){
// 		super(exception, cause);
// 	}
// }


import java.util.Iterator;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import uk.ac.shef.dcs.oak.jate.JATEException;
import uk.ac.shef.dcs.oak.jate.core.feature.indexer.GlobalIndex;
import org.apache.log4j.Logger;

package uk.ac.shef.dcs.oak.jate.core.feature;



/**
 * A specific type of feature builder that builds an instance of FeatureTermNest from a GlobalIndex.
 * Counting of term nested frequency is based on <b>canonical forms</b>.
 *
 *  <br>Also credits to <b>pmclachlan@gmail.com</b> for revision for performance tweak </br>
 *
 * @author <a href="mailto:z.zhang@dcs.shef.ac.uk">Ziqi Zhang</a>
 */


public class FeatureBuilderTermNest extends AbstractFeatureBuilder {

    private static final Logger _logger = Logger.getLogger(FeatureBuilderTermNest.class);

    /**
     * Default constructor
     */
    public FeatureBuilderTermNest() {
        super(null, null, null);
    }

    /**
     * Build an instance of FeatureTermNest from an instance of GlobalIndexMem
     *
     * @param index
     * @return
     * @throws uk.ac.shef.dcs.oak.jate.JATEException
     *
     */

// Path: src/main/java/uk/ac/shef/dcs/oak/jate/JATEException.java
// public class JATEException extends Exception {
// 	private static final long serialVersionUID = -4511571544868986419L;
// 
// 	public JATEException(String exception){
// 		super(exception);
// 	}
// 
// 	public JATEException(Exception e){
// 		super(e);
// 	}
// 
// 	public JATEException(String exception, Throwable cause){
// 		super(exception, cause);
// 	}
// }


// Path: src/main/java/uk/ac/shef/dcs/oak/jate/core/feature/FeatureBuilderTermNest.java
import java.util.Iterator;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import uk.ac.shef.dcs.oak.jate.JATEException;
import uk.ac.shef.dcs.oak.jate.core.feature.indexer.GlobalIndex;
import org.apache.log4j.Logger;

package uk.ac.shef.dcs.oak.jate.core.feature;



/**
 * A specific type of feature builder that builds an instance of FeatureTermNest from a GlobalIndex.
 * Counting of term nested frequency is based on <b>canonical forms</b>.
 *
 *  <br>Also credits to <b>pmclachlan@gmail.com</b> for revision for performance tweak </br>
 *
 * @author <a href="mailto:z.zhang@dcs.shef.ac.uk">Ziqi Zhang</a>
 */


public class FeatureBuilderTermNest extends AbstractFeatureBuilder {

    private static final Logger _logger = Logger.getLogger(FeatureBuilderTermNest.class);

    /**
     * Default constructor
     */
    public FeatureBuilderTermNest() {
        super(null, null, null);
    }

    /**
     * Build an instance of FeatureTermNest from an instance of GlobalIndexMem
     *
     * @param index
     * @return
     * @throws uk.ac.shef.dcs.oak.jate.JATEException
     *
     */

    public FeatureTermNest build(GlobalIndex index) throws JATEException {
