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

Adrien Grand commented on LUCENE-5734:
--------------------------------------

+1 to having different methods to correct start offsets and end offsets, and 
making {{HTMLStripCharFilter}} do {{correctOffset(endOffset-1)+1}} for end 
offsets. However I would suggest that we still make other char filters correct 
end offsets the same way as start offsets: {{HTMLStripCharFilter}} is safe 
since it may only remove characters. However other char filters may introduce 
characters which make  {{correctOffset(endOffset-1)+1}} unsafe as we could more 
easily create tokens that have greater start offsets than end offsets.

> HTMLStripCharFilter end offset should be left of closing tags
> -------------------------------------------------------------
>
>                 Key: LUCENE-5734
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5734
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/analysis
>            Reporter: David Smiley
>            Priority: Minor
>
> Consider this simple input:
> {noformat}
> <em>hello</em>
> {noformat}
> to be analyzed by HTMLStripCharFilter and WhitespaceTokenizer.
> You get back one token for "hello".  Good.  The start offset of this token is 
> at the position of 'h' -- good.  But the end offset is surprisingly plus one 
> to the adjacent </em>.  I argue that it should be plus one to the last 
> character of the token (following 'o').
> FYI it behaves as I expect if after hello is an XML entity such as in this 
> example: {noformat}hello&nbsp;{noformat} The end offset immediately follows 
> the 'o'.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to