func NewFilteringTokenFilter(spi FilteringTokenFilterSPI,
	version util.Version, in TokenStream) *FilteringTokenFilter {
	ans := &FilteringTokenFilter{
		spi:         spi,
		input:       in,
		TokenFilter: NewTokenFilter(in),
		version:     version,
		first:       true,
	}
	ans.posIncrAtt = ans.Attributes().Add("PositionIncrementAttribute").(PositionIncrementAttribute)
	ans.enablePositionIncrements = true
	return ans
}
/* Creates a new FilteringTokenFilter.
package util
import (
	. "github.com/balzaczyy/golucene/core/analysis"
	. "github.com/balzaczyy/golucene/core/analysis/tokenattributes"
	"github.com/balzaczyy/golucene/core/util"
)
type FilteringTokenFilterSPI interface {
	Accept() bool
}
type FilteringTokenFilter struct {
	*TokenFilter
	spi                      FilteringTokenFilterSPI
	input                    TokenStream
	version                  util.Version
	posIncrAtt               PositionIncrementAttribute
	enablePositionIncrements bool
	first                    bool
	skippedPositions         int
}