public OpenNLPChunkerFilter(TokenStream input, NLPChunkerOp chunkerOp) : base(input) { this.chunkerOp = chunkerOp; this.typeAtt = AddAttribute <ITypeAttribute>(); this.flagsAtt = AddAttribute <IFlagsAttribute>(); this.termAtt = AddAttribute <ICharTermAttribute>(); }
public override TokenStream Create(TokenStream input) { try { NLPChunkerOp chunkerOp = null; if (chunkerModelFile != null) { chunkerOp = OpenNLPOpsFactory.GetChunker(chunkerModelFile); } return(new OpenNLPChunkerFilter(input, chunkerOp)); } catch (IOException e) { throw new ArgumentException(e.ToString(), e); } }