[
https://issues.apache.org/jira/browse/LUCENE-5999?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14162870#comment-14162870
]
Robert Muir commented on LUCENE-5999:
-------------------------------------
Instead of:
{code}
final AbstractStandardTokenizer src;
if (getVersion().onOrAfter(Version.LUCENE_4_7_0)) {
src = new StandardTokenizer();
} else {
src = new StandardTokenizer40();
}
src.setMaxTokenLength(maxTokenLength);
{code}
you can do:
{code}
final Tokenizer src;
if (getVersion().onOrAfter(Version.LUCENE_4_7_0)) {
StandardTokenizer t = new StandardTokenizer();
t.setMaxTokenLength(maxTokenLength);
src = t;
} else {
StandardTokenizer40 t = new StandardTokenizer();
t.setMaxTokenLength(maxTokenLength);
src = t;
}
{code}
> Add backcompat support for StandardTokenizer before 4.7
> -------------------------------------------------------
>
> Key: LUCENE-5999
> URL: https://issues.apache.org/jira/browse/LUCENE-5999
> Project: Lucene - Core
> Issue Type: Bug
> Reporter: Ryan Ernst
> Attachments: LUCENE-5999.patch
>
>
> The merge from trunk for branch_5x remove the backcompat support in
> StandardTokenizer for previous unicode versions. With 5x, we only need to
> add support back for 4.0-4.6 (unicode 6.1).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]