Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 4471 invoked from network); 24 Feb 2010 23:32:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Feb 2010 23:32:49 -0000 Received: (qmail 45798 invoked by uid 500); 24 Feb 2010 23:32:49 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 45667 invoked by uid 500); 24 Feb 2010 23:32:49 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 45629 invoked by uid 99); 24 Feb 2010 23:32:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Feb 2010 23:32:49 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Feb 2010 23:25:48 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E822529A0012 for ; Wed, 24 Feb 2010 15:25:27 -0800 (PST) Message-ID: <105702868.510221267053927949.JavaMail.jira@brutus.apache.org> Date: Wed, 24 Feb 2010 23:25:27 +0000 (UTC) From: "Steven Rowe (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-2167) StandardTokenizer Javadoc does not correctly describe tokenization around punctuation characters In-Reply-To: <325154625.1260989418387.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LUCENE-2167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12838081#action_12838081 ] Steven Rowe commented on LUCENE-2167: ------------------------------------- I wrote word break rules grammar specifications for JFlex 1.5.0-SNAPSHOT and both Unicode versions 5.1 and 5.2 - you can see the files here: http://jflex.svn.sourceforge.net/viewvc/jflex/trunk/testsuite/testcases/src/test/cases/unicode-word-break/ The files are UnicodeWordBreakRules_5_*.* - these are written to: parse the Unicode test files; run the generated scanner against each composed test string; output the break opportunities/prohibitions in the same format as the test files; and then finally compare the output against the test file itself, looking for a match. (These tests currently pass.) The .flex files would need to be significantly changed to be used as a StandardTokenizer replacement, but you can get an idea from them how to implement the Unicode word break rules in (as yet unreleased version 1.5.0) JFlex syntax. > StandardTokenizer Javadoc does not correctly describe tokenization around punctuation characters > ------------------------------------------------------------------------------------------------ > > Key: LUCENE-2167 > URL: https://issues.apache.org/jira/browse/LUCENE-2167 > Project: Lucene - Java > Issue Type: Bug > Affects Versions: 2.4.1, 2.9, 2.9.1, 3.0 > Reporter: Shyamal Prasad > Priority: Minor > Attachments: LUCENE-2167.patch, LUCENE-2167.patch > > Original Estimate: 0.5h > Remaining Estimate: 0.5h > > The Javadoc for StandardTokenizer states: > {quote} > Splits words at punctuation characters, removing punctuation. > However, a dot that's not followed by whitespace is considered part of a token. > Splits words at hyphens, unless there's a number in the token, in which case the whole > token is interpreted as a product number and is not split. > {quote} > This is not accurate. The actual JFlex implementation treats hyphens interchangeably with > punctuation. So, for example "video,mp4,test" results in a *single* token and not three tokens > as the documentation would suggest. > Additionally, the documentation suggests that "video-mp4-test-again" would become a single > token, but in reality it results in two tokens: "video-mp4-test" and "again". > IMHO the parser implementation is fine as is since it is hard to keep everyone happy, but it is probably > worth cleaning up the documentation string. > The patch included here updates the documentation string and adds a few test cases to confirm the cases described above. -- 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: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org