it.unimi.dsi.archive4j.tool
Class MergePreprocessedData.LengthFilter

java.lang.Object
  extended by it.unimi.dsi.archive4j.tool.MergePreprocessedData.LengthFilter
All Implemented Interfaces:
MergePreprocessedData.TermFilter
Enclosing class:
MergePreprocessedData

public static class MergePreprocessedData.LengthFilter
extends Object
implements MergePreprocessedData.TermFilter

A filter that eliminates too long or too short terms.


Constructor Summary
MergePreprocessedData.LengthFilter(int minLen, int maxLen)
          Creates a new length filter.
 
Method Summary
 boolean accept(MutableString word, int frequency)
          Returns true if the given term must be accepted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MergePreprocessedData.LengthFilter

public MergePreprocessedData.LengthFilter(int minLen,
                                          int maxLen)
Creates a new length filter.

Parameters:
minLen - the minimum length of an accepted term (inclusive).
maxLen - the maximum length of an accepted term (exclusive).
Method Detail

accept

public boolean accept(MutableString word,
                      int frequency)
Description copied from interface: MergePreprocessedData.TermFilter
Returns true if the given term must be accepted.

Specified by:
accept in interface MergePreprocessedData.TermFilter
Parameters:
word - the term.
frequency - the frequency of term.