[ 
https://issues.apache.org/jira/browse/LUCENE-5384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13862824#comment-13862824
 ] 

Uwe Schindler commented on LUCENE-5384:
---------------------------------------

Hi Benson,
thank you for the patch! I would suggest to change the sentence that mentions 
clearAttributes() to be more clear, some ideas:
- every Tokenizer must call clearAttributes (as we have already in the text)
- every TokenFilter that inserts new tokens into the stream must also call 
clearAttributes(). Alternatively use captureState()/restoreState() to clone the 
previous token and modify it afterwards (this is the recommended way to insert 
tokens from TokenFilters).

Uwe

> Analysis overview could mention clearAttributes and end
> -------------------------------------------------------
>
>                 Key: LUCENE-5384
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5384
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Benson Margulies
>            Assignee: Benson Margulies
>
> It would be helpful to tokenizer implementors for the analysis package 
> overview to mention more things. I'll supply a patch.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to