Skip to content

Commit

Permalink
analysis-common: make UniqueTokenFilter public
Browse files Browse the repository at this point in the history
this way the filter can also be used from plugins which implement
analyzers and want to use it.
the current workaround is that the plugin has to implement the usage
from it in a package with the same name, which is just an ugly hack.

Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com>
  • Loading branch information
rursprung committed Jun 11, 2024
1 parent 4c25257 commit e22345b
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@
* A token filter that generates unique tokens. Can remove unique tokens only on the same
* position increments as well.
*/
class UniqueTokenFilter extends TokenFilter {
public class UniqueTokenFilter extends TokenFilter {

private final CharTermAttribute termAttribute = addAttribute(CharTermAttribute.class);
private final PositionIncrementAttribute posIncAttribute = addAttribute(PositionIncrementAttribute.class);

private final CharArraySet previous = new CharArraySet(8, false);
private final boolean onlyOnSamePosition;

UniqueTokenFilter(TokenStream in) {
public UniqueTokenFilter(TokenStream in) {
this(in, false);
}

UniqueTokenFilter(TokenStream in, boolean onlyOnSamePosition) {
public UniqueTokenFilter(TokenStream in, boolean onlyOnSamePosition) {
super(in);
this.onlyOnSamePosition = onlyOnSamePosition;
}
Expand Down

0 comments on commit e22345b

Please sign in to comment.