From 2be586c40cff830a7cbaf0e99c4a420cf5cff807 Mon Sep 17 00:00:00 2001 From: Andy Heninger Date: Wed, 22 Feb 2012 01:51:25 +0000 Subject: [PATCH] ICU-9099 Fix break iterarator problem that was causing Finnish line break tests to fail. X-SVN-Rev: 31479 --- .../core/src/com/ibm/icu/text/RuleBasedBreakIterator.java | 1 + .../src/com/ibm/icu/dev/test/rbbi/RBBITestExtended.java | 6 +++--- .../tests/core/src/com/ibm/icu/dev/test/rbbi/rbbitst.txt | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/icu4j/main/classes/core/src/com/ibm/icu/text/RuleBasedBreakIterator.java b/icu4j/main/classes/core/src/com/ibm/icu/text/RuleBasedBreakIterator.java index af15abc5467..59c74e28425 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/text/RuleBasedBreakIterator.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/text/RuleBasedBreakIterator.java @@ -1125,6 +1125,7 @@ public int getRuleStatusVec(int[] fillInArray) { lookaheadStatus = 0; // TODO: make a standalone hard break in a rule work. if (lookAheadHardBreak) { + fText.setIndex(result); return result; } // Look-ahead completed, but other rules may match further. Continue on. diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/RBBITestExtended.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/RBBITestExtended.java index f0e938b345a..4ac00e98799 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/RBBITestExtended.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/RBBITestExtended.java @@ -1,7 +1,7 @@ /* * Created on May 5, 2004 * - * Copyright (C) 2004-2010 International Business Machines Corporation and others. + * Copyright (C) 2004-2012 International Business Machines Corporation and others. * All Rights Reserved. * */ @@ -446,7 +446,7 @@ void executeTest(TestParams t) { break; } - // Check that there were we didn't miss an expected break between the last one + // Check that we didn't miss an expected break between the last one // and this one. (UVector returns zeros for index out of bounds.) for (i=prevBP-1; i>bp; i--) { if (t.expectedBreaks[i] != 0) { @@ -481,7 +481,7 @@ void executeTest(TestParams t) { // Verify that there were no missed breaks prior to the last one found for (i=prevBP-1; i>=0; i--) { if (t.expectedBreaks[i] != 0) { - errln("Forward Itertion, break expected, but not found. Pos=" + i + + errln("Reverse Itertion, break expected, but not found. Pos=" + i + " File line,col= " + t.srcLine[i] + ", " + t.srcCol[i]); } } diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/rbbitst.txt b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/rbbitst.txt index a72eefac1be..1d00e528285 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/rbbitst.txt +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/rbbitst.txt @@ -799,6 +799,6 @@ What is the proper use of the abbreviation pp.? •Yes, I am definatelly 12" tal -#•abc •- •def •abc •-def •abc- •def •abc-•def• # With ASCII hyphen -#•abc •‐ •def •abc •‐def •abc‐ •def •abc‐•def• # With Unicode u2010 hyphen +•abc •- •def •abc •-def •abc- •def •abc-•def• # With ASCII hyphen +•abc •‐ •def •abc •‐def •abc‐ •def •abc‐•def• # With Unicode u2010 hyphen -- 2.40.0