Exemplo n.º 1
0
 public OpenNLPChunkerFilter(TokenStream input, NLPChunkerOp chunkerOp)
     : base(input)
 {
     this.chunkerOp = chunkerOp;
     this.typeAtt   = AddAttribute <ITypeAttribute>();
     this.flagsAtt  = AddAttribute <IFlagsAttribute>();
     this.termAtt   = AddAttribute <ICharTermAttribute>();
 }
Exemplo n.º 2
0
        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);
            }
        }