RE: How to deal with Token in the new TS API

2009-11-22 Thread Uwe Schindler
://www.thetaphi.de eMail: u...@thetaphi.de > -Original Message- > From: Shai Erera [mailto:ser...@gmail.com] > Sent: Sunday, November 22, 2009 8:26 PM > To: java-user@lucene.apache.org > Subject: Re: How to deal with Token in the new TS API > > Ok I see you fixed it at the

Re: How to deal with Token in the new TS API

2009-11-22 Thread Shai Erera
gt; Uwe Schindler >> H.-H.-Meier-Allee 63, D-28213 Bremen >> http://www.thetaphi.de >> eMail: u...@thetaphi.de >> >> >> > -Original Message- >> > From: Uwe Schindler [mailto:u...@thetaphi.de] >> > Sent: Sunday, November 22, 2009 8:03 PM &

Re: How to deal with Token in the new TS API

2009-11-22 Thread Shai Erera
www.thetaphi.de > eMail: u...@thetaphi.de > > > > -Original Message- > > From: Uwe Schindler [mailto:u...@thetaphi.de] > > Sent: Sunday, November 22, 2009 8:03 PM > > To: java-user@lucene.apache.org > > Subject: RE: How to deal with Token in the new TS A

RE: How to deal with Token in the new TS API

2009-11-22 Thread Uwe Schindler
age- > From: Uwe Schindler [mailto:u...@thetaphi.de] > Sent: Sunday, November 22, 2009 8:14 PM > To: java-user@lucene.apache.org > Subject: RE: How to deal with Token in the new TS API > > Another idea, what you can also do is, create an AttributeSource instance > in > your

RE: How to deal with Token in the new TS API

2009-11-22 Thread Uwe Schindler
-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: u...@thetaphi.de > -Original Message- > From: Shai Erera [mailto:ser...@gmail.com] > Sent: Sunday, November 22, 2009 8:15 PM > To: java-user@lucene.apache.org > Subject: Re: How to deal with Token in the new TS API &g

Re: How to deal with Token in the new TS API

2009-11-22 Thread Shai Erera
> > > > - > > Uwe Schindler > > H.-H.-Meier-Allee 63, D-28213 Bremen > > http://www.thetaphi.de > > eMail: u...@thetaphi.de > > > > > -Original Message- > > > From: Shai Erera [mailto:ser...@gmail.com] > > > Se

RE: How to deal with Token in the new TS API

2009-11-22 Thread Uwe Schindler
://www.thetaphi.de eMail: u...@thetaphi.de > -Original Message- > From: Uwe Schindler [mailto:u...@thetaphi.de] > Sent: Sunday, November 22, 2009 8:03 PM > To: java-user@lucene.apache.org > Subject: RE: How to deal with Token in the new TS API > > I said, you *could* i

RE: How to deal with Token in the new TS API

2009-11-22 Thread Uwe Schindler
://www.thetaphi.de eMail: u...@thetaphi.de > -Original Message- > From: Shai Erera [mailto:ser...@gmail.com] > Sent: Sunday, November 22, 2009 7:53 PM > To: java-user@lucene.apache.org > Subject: Re: How to deal with Token in the new TS API > > Yes I can clo

Re: How to deal with Token in the new TS API

2009-11-22 Thread Shai Erera
> > Uwe Schindler > > > H.-H.-Meier-Allee 63, D-28213 Bremen > > > http://www.thetaphi.de > > > eMail: u...@thetaphi.de > > > > > > > > > > -Original Message- > > > > From: Shai Erera [mailto:ser...@gmail.com] > > > &

RE: How to deal with Token in the new TS API

2009-11-22 Thread Uwe Schindler
a > TermAttribute. > > > Any > > > > ideas? > > > > > > > > Shai > > > > > > > > > > > > On Sun, Nov 22, 2009 at 3:33 PM, Uwe Schindler > > wrote: > > > > > > > >> Use captureState

Re: How to deal with Token in the new TS API

2009-11-22 Thread Shai Erera
gt; Boolean is set. > > Uwe > > - > Uwe Schindler > H.-H.-Meier-Allee 63, D-28213 Bremen > http://www.thetaphi.de > eMail: u...@thetaphi.de > > > > -Original Message- > > From: Shai Erera [mailto:ser...@gmail.com] > > Sent: Sunday, Nove

RE: How to deal with Token in the new TS API

2009-11-22 Thread Uwe Schindler
D-28213 Bremen http://www.thetaphi.de eMail: u...@thetaphi.de > -Original Message- > From: Shai Erera [mailto:ser...@gmail.com] > Sent: Sunday, November 22, 2009 3:28 PM > To: java-user@lucene.apache.org > Subject: Re: How to deal with Token in the new TS API >

Re: How to deal with Token in the new TS API

2009-11-22 Thread Shai Erera
TokenStream. CachingTokenFilter does this. >> >> So the new API uses the State object to put away tokens for later >> reference. >> >> - >> Uwe Schindler >> H.-H.-Meier-Allee 63, D-28213 Bremen >> http://www.thetaphi.de >> eMail: u...@thetaphi

Re: How to deal with Token in the new TS API

2009-11-22 Thread Shai Erera
.-H.-Meier-Allee 63, D-28213 Bremen > http://www.thetaphi.de > eMail: u...@thetaphi.de > > > -Original Message- > > From: Shai Erera [mailto:ser...@gmail.com] > > Sent: Sunday, November 22, 2009 2:29 PM > > To: java-user@lucene.apache.org > > Subject: Re:

RE: How to deal with Token in the new TS API

2009-11-22 Thread Uwe Schindler
://www.thetaphi.de eMail: u...@thetaphi.de > -Original Message- > From: Shai Erera [mailto:ser...@gmail.com] > Sent: Sunday, November 22, 2009 2:29 PM > To: java-user@lucene.apache.org > Subject: Re: How to deal with Token in the new TS API > > ok so from what I understand, I should

Re: How to deal with Token in the new TS API

2009-11-22 Thread Shai Erera
ok so from what I understand, I should stop working w/ Token, and move to working w/ the Attributes. addAttribute indeed does not work. Even though it does not through an exception, if I call in.addAttribute(Token.class), I get a new instance of Token and not the once that was added by in. So this

RE: How to deal with Token in the new TS API

2009-11-22 Thread Uwe Schindler
> But I do use addAttribute(Token.class), so I don't understand why you say > it's not possible. And I completely don't understand why the new API > allows > me to just work w/ interfaces and not impls ... A while ago I got the > impression that we're trying to get rid of interfaces because they're

Re: How to deal with Token in the new TS API

2009-11-22 Thread Shai Erera
But I do use addAttribute(Token.class), so I don't understand why you say it's not possible. And I completely don't understand why the new API allows me to just work w/ interfaces and not impls ... A while ago I got the impression that we're trying to get rid of interfaces because they're not easy

RE: How to deal with Token in the new TS API

2009-11-22 Thread Uwe Schindler
> > I want to add Token.class, and then work w/ Token. Not TermAttribute, > PosIncrAttribute, OffsetAttribute, PayloadAttribute and TypeAttribute > (these > are the five attributes I'm using from Token). Why can't the code add > Token > to the attributes map? If all of these are anyway mapped to t

RE: How to deal with Token in the new TS API

2009-11-22 Thread Uwe Schindler
> I started to migrate my Analyzers, Tokenizer, TokenStreams and > TokenFilters > to the new API. Since the entire set of classes handled Token before, I > decided to not change it for now, and was happy to discover that Token > extends AttributeImpl, which makes the migration easier. > > So I sta

Re: How to deal with Token in the new TS API

2009-11-22 Thread Shai Erera
Thanks Uwe for the response, however that doesn't get me anywhere. I already know that Token is added once, and that after I add Token I cannot add more of them. And I understand why the double printing. I want to add Token.class, and then work w/ Token. Not TermAttribute, PosIncrAttribute, Offset

RE: How to deal with Token in the new TS API

2009-11-22 Thread Uwe Schindler
> To add to my previous email, If I do the following: > > StringReader sr = new StringReader("hello world"); > TokenStream ts = new WhitespaceTokenizer(Token.TOKEN_ATTRIBUTE_FACTORY, > sr); > > for (Iterator> iter = > ts.getAttributeClassesIterator(); iter.hasNext();) { > Class< ? extends Attri

Re: How to deal with Token in the new TS API

2009-11-22 Thread Shai Erera
To add to my previous email, If I do the following: StringReader sr = new StringReader("hello world"); TokenStream ts = new WhitespaceTokenizer(Token.TOKEN_ATTRIBUTE_FACTORY, sr); for (Iterator> iter = ts.getAttributeClassesIterator(); iter.hasNext();) { Class< ? extends Attribute> type = iter.