[
https://issues.apache.org/jira/browse/LUCENE-2183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12805974#action_12805974
]
Robert Muir commented on LUCENE-2183:
-------------------------------------
hello, a few very minor nitpicks:
* it seems the javadoc for isTokenChar()/isTokenInt() is backwards, the
int-based api refers to 'character' but the char-based api refers to codepoint
(which is wrong). perhaps it would be best to refer to all char-based methods
as working on 'utf-16 code unit' and int-based apis as 'codepoint'.
* we might want to insert a note/warning on the char-based methods, consistent
with the JDK javadocs, "Note this method cannot handle supplementary
characters..." for example, like:
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Character.html#getType%28char%29
I think its important to include the link to the JDK explanation of what a
supplementary character is, also.
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Character.html#supplementary
* if possible we might want to include some class-level wordage on how the
whole thing works. If you implement the int-based API, you can use your class
with all Lucene Versions, and bw layer will make it work correctly with old
indexes. If you only stay with the char-based API, then you can only use your
CharTokenizer for Version <= 3.0. We can also mention it is unnecessary to
implement both, only the int-based api!!!
sorry for being picky about the javadocs, trying to think of ways to prevent
confusion on the user list, as i anticipate a bunch of people probably just use
Version.LUCENE_CURRENT and have no idea what a supplementary character is.
great work.
> Supplementary Character Handling in CharTokenizer
> -------------------------------------------------
>
> Key: LUCENE-2183
> URL: https://issues.apache.org/jira/browse/LUCENE-2183
> Project: Lucene - Java
> Issue Type: Improvement
> Components: Analysis
> Reporter: Simon Willnauer
> Assignee: Uwe Schindler
> Fix For: 3.1
>
> Attachments: LUCENE-2183.patch, LUCENE-2183.patch, LUCENE-2183.patch,
> LUCENE-2183.patch, LUCENE-2183.patch
>
>
> CharTokenizer is an abstract base class for all Tokenizers operating on a
> character level. Yet, those tokenizers still use char primitives instead of
> int codepoints. CharTokenizer should operate on codepoints and preserve bw
> compatibility.
--
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]