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

Doron Cohen commented on LUCENE-1350:
-------------------------------------

These are interesting points to consider. 

Let's look at the two cases reuse and non-reuse.

The current SnowballFilter implements the non-reuse method next(). It actually 
clones,  just without using clone(). So I still think that fixing it to use 
clone is acceptable. Hope you agree with this.

(Btw, I checked LUCENE-1142 ("Updated Snowball package") - there too the 
non-reuse version is used.)

For the reuse case, i.e. next(Token), there is a distinction between 
*consumers* and *producers* (in TokenStream API) - only consumers invoke 
clear(), and then set everything. Filters are consumers, so clear() is not in 
place. 

(As a side comment, I think an explicit call like setEndOffset() is somewhat 
clearer than a method with 3 int args.)

> SnowballFilter resets the payload
> ---------------------------------
>
>                 Key: LUCENE-1350
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1350
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Analysis, contrib/*
>            Reporter: Doron Cohen
>            Assignee: Doron Cohen
>         Attachments: LUCENE-1350.patch
>
>
> Passing tokens with payloads through SnowballFilter results in tokens with no 
> payloads.
> A workaround for this is to apply stemming first and only then run whatever 
> logic creates the payload, but this is not always convenient.
> Patch to follow that preserves the payload.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to