[
https://issues.apache.org/jira/browse/LUCENE-2498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12878963#action_12878963
]
Steven Rowe commented on LUCENE-2498:
-------------------------------------
{quote}
bq. I wonder if it would be possible/make sense to make this a tokenizer
instead of a charfilter: one token per sentence. Then token production would be
in a filter stage.
well maybe we should reword the issue, it doesnt have to be a charfilter or
even use a special string to mark the sentence boundaries. But I thought as a
charfilter it would allow you to use your own tokenizer, such as
StandardTokenizer along with sentence boundaries.
{quote}
Using "special" tokens to carry token stream metadata feels like a fragile hack
to me.
Maybe we need a new kind of analysis component to chunk input and then call a
tokenizer for each chunk. It could be called a segmenter. So e.g.
SentenceSegmenter would detect sentence boundaries, then send each sentence to
the user's choice of tokenizer, fixing up offsets and maybe also adding in an
attribute for beginning/end of sentence. Analysis chains could use a
segmenter+tokenizer in the same way that a tokenizer is now used. I think
segmenters could be nested, too, e.g. a ParagraphSegmenter could take in a
SentenceSegmenter as its tokenizer.
> add sentence boundary charfilter
> --------------------------------
>
> Key: LUCENE-2498
> URL: https://issues.apache.org/jira/browse/LUCENE-2498
> Project: Lucene - Java
> Issue Type: New Feature
> Components: contrib/analyzers
> Reporter: Robert Muir
>
> From the discussion of LUCENE-2167:
> It would be nice to have a CharFilter? to mark sentence boundaries.
> Such functionality would be useful for:
> * prevent phrase queries with 0 slop from matching across sentences
> * inhibiting multiword synonyms, or shingles, etc.
> For sentence boundary detection we could use Jflex's support for the Unicode
> Sentence_Break property etc,
> and the UAX#29 definition as a default grammar.
> One idea is to just mark the boundaries with a user-provided String.
> As a simple use-case, a user could then add this string to a stopfilter, and
> it would introduce a position increment.
> This would inhibit phrase queries, etc.
> a user could use the sentence-markers to do more advanced processing
> downstream.
--
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]