lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Smiley (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-5734) HTMLStripCharFilter end offset should be left of closing tags
Date Thu, 05 Jun 2014 21:00:07 GMT

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

David Smiley commented on LUCENE-5734:
--------------------------------------

Simply re-stating my expectation of how it should work from IRC:
My expectation is that the startOffset and endOffset of a token should be directly adjacent
to the token text in the original text.  This is the case for startOffset, but with HTMLStripCharFilter
(and maybe others?) endOffset isn't; it follows elided (stripped) characters.

I don't think there's a rule it should be any which way, but I claim it should work this way
-- FWIW I think it's intuitive.  Never mind what I said about it being sensitive to an inner
opening tag; I can live without that complication.




> 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.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message