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

Uwe Schindler commented on LUCENE-6874:
---------------------------------------

I would be fine to remove WhitespaceTokenizer in Lucene trunk. In that case I 
would also like to move the abstract CharTokenizer class out of 
oal.analysis.util to oal.analysis.core. This is not a big deal, but the util 
package is not fine for a first class citizen.

I also have another idea about this issue; I would prefer to not have the large 
java code with jflex involved. Wouldn't it be possible to save the isWhitespace 
data of Unicode in a compressible Lucene bitset and save it to disk as resource 
file? We could then load the bitset (like deleted documents) from a resource 
file and wrap a simple {{CharTokenizer.fromSeparatorCharPredicate(c -> 
compressedBitset.get(c))}} on top? The bitset could be generated from Unicode 
data on "ant regenerate".

> WhitespaceTokenizer should tokenize on NBSP
> -------------------------------------------
>
>                 Key: LUCENE-6874
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6874
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/analysis
>            Reporter: David Smiley
>            Priority: Minor
>         Attachments: LUCENE-6874-jflex.patch, LUCENE-6874.patch, 
> LUCENE_6874_jflex.patch
>
>
> WhitespaceTokenizer uses [Character.isWhitespace 
> |http://docs.oracle.com/javase/8/docs/api/java/lang/Character.html#isWhitespace-int-]
>  to decide what is whitespace.  Here's a pertinent excerpt:
> bq. It is a Unicode space character (SPACE_SEPARATOR, LINE_SEPARATOR, or 
> PARAGRAPH_SEPARATOR) but is not also a non-breaking space ('\u00A0', 
> '\u2007', '\u202F')
> Perhaps Character.isWhitespace should have been called 
> isLineBreakableWhitespace?
> I think WhitespaceTokenizer should tokenize on this.  I am aware it's easy to 
> work around but why leave this trap in by default?



--
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