mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-14 17:24:01 +00:00
ICU-9379 J: Update BreakIterator createInstance to handle linebreak variant files; update tests
X-SVN-Rev: 37060
This commit is contained in:
parent
43f62124cd
commit
33de7d60b8
2 changed files with 45 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2002-2014, International Business Machines Corporation and
|
||||
* Copyright (C) 2002-2015, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
@ -121,8 +121,15 @@ final class BreakIteratorFactory extends BreakIterator.BreakIteratorServiceShim
|
|||
// Get the binary rules.
|
||||
//
|
||||
ByteBuffer bytes = null;
|
||||
String typeKeyExt = null;
|
||||
if (kind == BreakIterator.KIND_LINE) {
|
||||
String lbKeyValue = locale.getKeywordValue("lb");
|
||||
if ( lbKeyValue != null && (lbKeyValue.equals("strict") || lbKeyValue.equals("normal") || lbKeyValue.equals("loose")) ) {
|
||||
typeKeyExt = "_" + lbKeyValue;
|
||||
}
|
||||
}
|
||||
try {
|
||||
String typeKey = KIND_NAMES[kind];
|
||||
String typeKey = (typeKeyExt == null)? KIND_NAMES[kind]: KIND_NAMES[kind] + typeKeyExt;
|
||||
String brkfname = rb.getStringWithFallback("boundaries/" + typeKey);
|
||||
String rulesFileName = ICUData.ICU_BRKITR_NAME+ '/' + brkfname;
|
||||
bytes = ICUBinary.getData(rulesFileName);
|
||||
|
|
|
@ -899,3 +899,39 @@ Bangkok)•</data>
|
|||
<data>•abc/\u05D9 •def•</data>
|
||||
<data>•\u05E7\u05D7/\u05D9 •\u05DE\u05E2\u05D9\u05DC•</data>
|
||||
<data>•\u05D3\u05E8\u05D5\u05E9\u05D9\u05DD •\u05E9\u05D7\u05E7\u05E0\u05D9\u05DD/\u05D9\u05D5\u05EA•</data>
|
||||
|
||||
####################################################################################
|
||||
#
|
||||
# Test CSS line break variants: strict, normal, loose
|
||||
#
|
||||
####################################################################################
|
||||
|
||||
<locale ja@lb=strict>
|
||||
<line>
|
||||
# •no brk before 3063 •no brk before 301C•no brk btw 2026 •no brk before FF01•
|
||||
<data>•\u3084\u3063•\u3071•\u308A\u0020•\u0031\u301C\u0020•\u2026\u2026\u0020•\u30A2\uFF01\u0020•</data>
|
||||
|
||||
<locale ja@lb=normal>
|
||||
<line>
|
||||
# •brk OK before 3063 •brk OK before 301C •no brk btw 2026 •no brk before FF01•
|
||||
<data>•\u3084•\u3063•\u3071•\u308A\u0020•\u0031•\u301C\u0020•\u2026\u2026\u0020•\u30A2\uFF01\u0020•</data>
|
||||
|
||||
<locale ja@lb=loose>
|
||||
<line>
|
||||
# •brk OK before 3063 •brk OK before 301C •brk OK btw 2026 •brk OK before FF01•
|
||||
<data>•\u3084•\u3063•\u3071•\u308A\u0020•\u0031•\u301C\u0020•\u2026•\u2026\u0020•u30A2•\uFF01\u0020•</data>
|
||||
|
||||
<locale en@lb=strict>
|
||||
<line>
|
||||
# •no brk before 3063 •no brk before 301C•no brk btw 2026 •no brk before FF01•
|
||||
<data>•\u3084\u3063•\u3071•\u308A\u0020•\u0031\u301C\u0020•\u2026\u2026\u0020•\u30A2\uFF01\u0020•</data>
|
||||
|
||||
<locale en@lb=normal>
|
||||
<line>
|
||||
# •brk OK before 3063 •no brk before 301C •no brk btw 2026 •no brk before FF01•
|
||||
<data>•\u3084•\u3063•\u3071•\u308A\u0020•\u0031\u301C\u0020•\u2026\u2026\u0020•\u30A2\uFF01\u0020•</data>
|
||||
|
||||
<locale en@lb=loose>
|
||||
<line>
|
||||
# •brk OK before 3063 •no brk before 301C •brk OK btw 2026 •no brk before FF01•
|
||||
<data>•\u3084•\u3063•\u3071•\u308A\u0020•\u0031\u301C\u0020•\u2026•\u2026\u0020•u30A2\uFF01\u0020•</data>
|
||||
|
|
Loading…
Add table
Reference in a new issue