lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (Commented) (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3940) When Japanese (Kuromoji) tokenizer removes a punctuation token it should leave a hole
Date Mon, 02 Apr 2012 11:15:21 GMT


Robert Muir commented on LUCENE-3940:

This is certainly useful in the case of information extraction. For example, if we'd like
to extract noun-phrases based on part-of-speech tags, we don't want to conjoin tokens in case
there's a punctuation character between two nouns (unless that punctuation character is a
middle dot).

The option still exists in kuromoji (discardPunctuation=false) if you want to use it for this.
I added this option because it originally kept the punctuation (for downstream filters to

lucene-gosen worked the same way, and after some time i saw *numerous* examples across the
where people simply configured the tokenizer without any filters, which means huge amounts
punctuation being indexed by default. People don't pay attention to documentation or details,
so all these people were getting bad performance.

Based on this experience, I didn't want keeping punctuation to be the default, nor even achievable
via things like solr factories here. But i added the (expert) option to Kuromoji because its
a more general purpose things for japanese analysis, because its already being used for other
and because allowing a boolean was not expensive or complex to support.

But I don't consider this a bonafied option from the lucene apis, i would be strongly against
this to the solr factories, or as an option to KuromojiAnalyzer. And, I don't think we should
add such
a thing to other tokenizers either. 

Our general mission is search, if we want to decide we are expanding our analysis API to be
useful outside of information retrieval, thats a much bigger decision with more complex tradeoffs
everyone should vote on (e.g. moving analyzers outside of and everything).

> When Japanese (Kuromoji) tokenizer removes a punctuation token it should leave a hole
> -------------------------------------------------------------------------------------
>                 Key: LUCENE-3940
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 4.0
>         Attachments: LUCENE-3940.patch, LUCENE-3940.patch, LUCENE-3940.patch, LUCENE-3940.patch
> I modified BaseTokenStreamTestCase to assert that the start/end
> offsets match for graph (posLen > 1) tokens, and this caught a bug in
> Kuromoji when the decompounding of a compound token has a punctuation
> token that's dropped.
> In this case we should leave hole(s) so that the graph is intact, ie,
> the graph should look the same as if the punctuation tokens were not
> initially removed, but then a StopFilter had removed them.
> This also affects tokens that have no compound over them, ie we fail
> to leave a hole today when we remove the punctuation tokens.
> I'm not sure this is serious enough to warrant fixing in 3.6 at the
> last minute...

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message