ICU-2292 rbbiapts all test passing

X-SVN-Rev: 13613
This commit is contained in:
Syn Wee Quek 2003-11-07 00:04:13 +00:00
parent cc21ef7ba4
commit 1ef0ff982e
2 changed files with 39 additions and 39 deletions

View file

@ -59,6 +59,10 @@ $Format = [[:Cf:]];
$Hiragana = [:Hiragana:];
$Ideographic = [:IDEOGRAPHIC:];
## -------------------------------------------------
!!forward;
$CR $LF;
# rule 3 and 4
@ -92,13 +96,17 @@ $ALetterSeq
$NumericEx ($Format* $NumericEx)* {100};
# rule 9, 10
# rule 9
($ALetterEx | $NumericEx) ($Format* ($ALetterEx | $NumericEx))* {200};
$ALetterEx ($Format* ($ALetterEx | $NumericEx))* {200};
# rule 10
$NumericEx + ($Format* $ALetterEx)+ ($Format* $NumericEx)* {200};
# rule 11 and 12
$NumericEx $Format* ($MidNumEx | $MidNumLetEx) $Format* $NumericEx {100};
$NumericEx ($Format* ($MidNumEx | $MidNumLetEx) $Format* $NumericEx)+ {100};
# rule 13
@ -106,7 +114,8 @@ $KatakanaEx ($Format* $KatakanaEx)* {300};
$Hiragana $Extend* {300};
$Ideographic $Extend* {400};
# reverse rules!!
## -------------------------------------------------
!!reverse;
$BackALetterEx = $Extend* $ALetter;
@ -118,25 +127,25 @@ $BackMidNumLetEx = $Extend* $MidNumLet;
$BackMidLetterEx = $Extend* $MidLetter;
$BackKatakanaEx = $Extend* $Katakana;
! $LF $CR;
$LF $CR;
! $Extend* [^$Format];
$Extend* [^$Format];
# rule 5
! ($BackALetterEx $Format*)* $BackABaseLetterEx;
! ($BackALetterEx $Format*)* $BackACMLetterEx / $Format;
($BackALetterEx $Format*)* $BackABaseLetterEx;
($BackALetterEx $Format*)* $BackACMLetterEx / $Format;
# rule 6 and 7
! (
(
($BackALetterEx $Format*)*
($BackABaseLetterEx | $BackACMLetterEx $Format)
($Format* ($BackMidLetterEx | $BackMidNumLetEx))
)+
$Format* ($BackALetterEx $Format*)* $BackABaseLetterEx;
! (
(
($BackALetterEx $Format*)*
($BackABaseLetterEx | $BackACMLetterEx $Format)
($Format* ($BackMidLetterEx | $BackMidNumLetEx))
@ -145,17 +154,24 @@ $BackKatakanaEx = $Extend* $Katakana;
# rule 8
! $BackNumericEx $Format* $BackNumericEx;
$BackNumericEx $Format* $BackNumericEx;
# rule 9, 10
! (($BackALetterEx | $BackNumericEx) $Format*)+ ($BackABaseLetterEx | $BackNumericEx);
! (($BackALetterEx | $BackNumericEx) $Format*)+ $BackACMLetterEx / $Format;
(($BackALetterEx | $BackNumericEx) $Format*)+ ($BackABaseLetterEx | $BackNumericEx);
(($BackALetterEx | $BackNumericEx) $Format*)+ $BackACMLetterEx / $Format;
# rule 11 and 12
! $BackNumericEx $Format* ($BackMidNumEx | $BackMidNumLetEx) $Format* $BackNumericEx;
$BackNumericEx $Format* ($BackMidNumEx | $BackMidNumLetEx) $Format* $BackNumericEx;
# rule 13
! $BackKatakanaEx $Format* $BackKatakanaEx;
$BackKatakanaEx $Format* $BackKatakanaEx;
## -------------------------------------------------
!!safe_reverse;
$Extend* [^$Extend];
$BackACMLetterEx / $Format;

View file

@ -20,6 +20,7 @@
#include "rbbiapts.h"
#include "rbbidata.h"
#include "cstring.h"
#include "unicode/ustring.h"
/**
* API Test the RuleBasedBreakIterator class
@ -557,12 +558,13 @@ void RBBIAPITest::TestQuoteGrouping() {
// Test word break rule status constants.
//
void RBBIAPITest::TestRuleStatus() {
UnicodeString testString1 = // Ideographic Katakana Hiragana
CharsToUnicodeString("plain word 123.45 \\u9160\\u9161 \\u30a1\\u30a2 \\u3041\\u3094");
// 012345678901234567 8 9 0 1 2 3 4 5 6
int32_t bounds1[] = { 0, 5,6, 10,11, 17,18, 19, 20,21, 23,24, 25, 26};
UChar str[30];
u_unescape("plain word 123.45 \\u9160\\u9161 \\u30a1\\u30a2 \\u3041\\u3094",
// 012345678901234567 8 9 0 1 2 3 4 5 6
// Ideographic Katakana Hiragana
str, 30);
UnicodeString testString1(str);
int32_t bounds1[] = {0, 5, 6, 10, 11, 17, 18, 19, 20, 21, 23, 24, 25, 26};
int32_t tag_lo[] = {UBRK_WORD_NONE, UBRK_WORD_LETTER, UBRK_WORD_NONE, UBRK_WORD_LETTER,
UBRK_WORD_NONE, UBRK_WORD_NUMBER, UBRK_WORD_NONE,
UBRK_WORD_IDEO, UBRK_WORD_IDEO, UBRK_WORD_NONE,
@ -839,23 +841,6 @@ void RBBIAPITest::TestRoundtripRules() {
void RBBIAPITest::runIndexedTest( int32_t index, UBool exec, const char* &name, char* /*par*/ )
{
if (exec) logln((UnicodeString)"TestSuite RuleBasedBreakIterator API ");
switch (index) {
// case 0: name = "TestConstruction"; if (exec) TestConstruction(); break;
case 0: name = "TestCloneEquals"; if (exec) TestCloneEquals(); break;
case 1: name = "TestgetRules"; if (exec) TestgetRules(); break;
case 2: name = "TestHashCode"; if (exec) TestHashCode(); break;
case 3: name = "TestGetSetAdoptText"; if (exec) TestGetSetAdoptText(); break;
case 4: name = "extra"; break; /* Extra */
case 5: name = "TestBuilder"; if (exec) TestBuilder(); break;
case 6: name = "TestQuoteGrouping"; if (exec) TestQuoteGrouping(); break;
case 7: name = "TestRuleStatus"; if (exec) TestRuleStatus(); break;
case 8: name = "TestBug2190"; if (exec) TestBug2190(); break;
case 9: name = "TestRegistration"; if (exec) TestRegistration(); break;
case 10: name = "TestBoilerPlate"; if (exec) TestBoilerPlate(); break;
default: name = ""; break; /*needed to end loop*/
}
/*** TODO synwee
switch (index) {
// case 0: name = "TestConstruction"; if (exec) TestConstruction(); break;
case 0: name = "TestCloneEquals"; if (exec) TestCloneEquals(); break;
@ -875,7 +860,6 @@ void RBBIAPITest::runIndexedTest( int32_t index, UBool exec, const char* &name,
default: name = ""; break; // needed to end loop
}
***/
}
//---------------------------------------------