mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 15:05:53 +00:00
ICU-80 support [:<script>:] syntax
X-SVN-Rev: 6169
This commit is contained in:
parent
98fd3aa1c6
commit
ebb8f2d396
4 changed files with 46 additions and 18 deletions
|
@ -5,8 +5,8 @@
|
|||
*******************************************************************************
|
||||
*
|
||||
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/dev/test/translit/UnicodeSetTest.java,v $
|
||||
* $Date: 2001/09/24 19:56:41 $
|
||||
* $Revision: 1.12 $
|
||||
* $Date: 2001/10/10 21:35:33 $
|
||||
* $Revision: 1.13 $
|
||||
*
|
||||
*****************************************************************************************
|
||||
*/
|
||||
|
@ -246,6 +246,16 @@ public class UnicodeSetTest extends TestFmwk {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the [:Latin:] syntax.
|
||||
*/
|
||||
public void TestScriptSet() {
|
||||
UnicodeSet set = new UnicodeSet("[:Latin:]");
|
||||
expectContainment(set, "aA", "\u0391\u03B1");
|
||||
set = new UnicodeSet("[:Greek:]");
|
||||
expectContainment(set, "\u0391\u03B1", "aA");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the indexOf() and charAt() methods.
|
||||
*/
|
||||
|
@ -429,6 +439,10 @@ public class UnicodeSetTest extends TestFmwk {
|
|||
return pairs.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Expect the given set to contain the characters in charsIn and
|
||||
* to not contain those in charsOut.
|
||||
*/
|
||||
void expectContainment(UnicodeSet set, String charsIn, String charsOut) {
|
||||
StringBuffer bad = new StringBuffer();
|
||||
if (charsIn != null) {
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
*******************************************************************************
|
||||
*
|
||||
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/text/UnicodeSet.java,v $
|
||||
* $Date: 2001/10/08 17:31:08 $
|
||||
* $Revision: 1.38 $
|
||||
* $Date: 2001/10/10 21:35:05 $
|
||||
* $Revision: 1.39 $
|
||||
*
|
||||
*****************************************************************************************
|
||||
*/
|
||||
|
@ -255,7 +255,7 @@ import com.ibm.util.Utility;
|
|||
* *Unsupported by Java (and hence unsupported by UnicodeSet).
|
||||
*
|
||||
* @author Alan Liu
|
||||
* @version $RCSfile: UnicodeSet.java,v $ $Revision: 1.38 $ $Date: 2001/10/08 17:31:08 $ */
|
||||
* @version $RCSfile: UnicodeSet.java,v $ $Revision: 1.39 $ $Date: 2001/10/10 21:35:05 $ */
|
||||
public class UnicodeSet extends UnicodeFilter {
|
||||
|
||||
/* Implementation Notes.
|
||||
|
@ -1660,14 +1660,14 @@ public class UnicodeSet extends UnicodeFilter {
|
|||
end = i;
|
||||
} else {
|
||||
if (start >= 0) {
|
||||
add((char) start, (char) end);
|
||||
add(start, end);
|
||||
}
|
||||
start = end = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (start >= 0) {
|
||||
add((char) start, (char) end);
|
||||
add(start, end);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1702,14 +1702,14 @@ public class UnicodeSet extends UnicodeFilter {
|
|||
end = i;
|
||||
} else {
|
||||
if (start >= 0) {
|
||||
set.add((char) start, (char) end);
|
||||
set.add(start, end);
|
||||
}
|
||||
start = end = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (start >= 0) {
|
||||
set.add((char) start, (char) end);
|
||||
set.add(start, end);
|
||||
}
|
||||
CATEGORY_CACHE[cat] = set;
|
||||
}
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
*******************************************************************************
|
||||
*
|
||||
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/translit/Attic/UnicodeSetTest.java,v $
|
||||
* $Date: 2001/09/24 19:56:41 $
|
||||
* $Revision: 1.12 $
|
||||
* $Date: 2001/10/10 21:35:33 $
|
||||
* $Revision: 1.13 $
|
||||
*
|
||||
*****************************************************************************************
|
||||
*/
|
||||
|
@ -246,6 +246,16 @@ public class UnicodeSetTest extends TestFmwk {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the [:Latin:] syntax.
|
||||
*/
|
||||
public void TestScriptSet() {
|
||||
UnicodeSet set = new UnicodeSet("[:Latin:]");
|
||||
expectContainment(set, "aA", "\u0391\u03B1");
|
||||
set = new UnicodeSet("[:Greek:]");
|
||||
expectContainment(set, "\u0391\u03B1", "aA");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the indexOf() and charAt() methods.
|
||||
*/
|
||||
|
@ -429,6 +439,10 @@ public class UnicodeSetTest extends TestFmwk {
|
|||
return pairs.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Expect the given set to contain the characters in charsIn and
|
||||
* to not contain those in charsOut.
|
||||
*/
|
||||
void expectContainment(UnicodeSet set, String charsIn, String charsOut) {
|
||||
StringBuffer bad = new StringBuffer();
|
||||
if (charsIn != null) {
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
*******************************************************************************
|
||||
*
|
||||
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/UnicodeSet.java,v $
|
||||
* $Date: 2001/10/08 17:31:08 $
|
||||
* $Revision: 1.38 $
|
||||
* $Date: 2001/10/10 21:35:05 $
|
||||
* $Revision: 1.39 $
|
||||
*
|
||||
*****************************************************************************************
|
||||
*/
|
||||
|
@ -255,7 +255,7 @@ import com.ibm.util.Utility;
|
|||
* *Unsupported by Java (and hence unsupported by UnicodeSet).
|
||||
*
|
||||
* @author Alan Liu
|
||||
* @version $RCSfile: UnicodeSet.java,v $ $Revision: 1.38 $ $Date: 2001/10/08 17:31:08 $ */
|
||||
* @version $RCSfile: UnicodeSet.java,v $ $Revision: 1.39 $ $Date: 2001/10/10 21:35:05 $ */
|
||||
public class UnicodeSet extends UnicodeFilter {
|
||||
|
||||
/* Implementation Notes.
|
||||
|
@ -1660,14 +1660,14 @@ public class UnicodeSet extends UnicodeFilter {
|
|||
end = i;
|
||||
} else {
|
||||
if (start >= 0) {
|
||||
add((char) start, (char) end);
|
||||
add(start, end);
|
||||
}
|
||||
start = end = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (start >= 0) {
|
||||
add((char) start, (char) end);
|
||||
add(start, end);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1702,14 +1702,14 @@ public class UnicodeSet extends UnicodeFilter {
|
|||
end = i;
|
||||
} else {
|
||||
if (start >= 0) {
|
||||
set.add((char) start, (char) end);
|
||||
set.add(start, end);
|
||||
}
|
||||
start = end = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (start >= 0) {
|
||||
set.add((char) start, (char) end);
|
||||
set.add(start, end);
|
||||
}
|
||||
CATEGORY_CACHE[cat] = set;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue