mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-21 12:40:02 +00:00
ICU-199 create icu/data/translit/index.txt
X-SVN-Rev: 564
This commit is contained in:
parent
8dd3eab784
commit
8171577fca
2 changed files with 52 additions and 4 deletions
46
icu4c/data/translit/index.txt
Normal file
46
icu4c/data/translit/index.txt
Normal file
|
@ -0,0 +1,46 @@
|
|||
//--------------------------------------------------------------------
|
||||
// Copyright (c) 2000, International Business Machines
|
||||
// Corporation and others. All Rights Reserved.
|
||||
//--------------------------------------------------------------------
|
||||
// Date Name Description
|
||||
// 01/13/2000 aliu Creation.
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
index {
|
||||
// Map transliterator names to resource file names. This
|
||||
// mapping is required because transliterator names typically
|
||||
// exceed the limits of 8.3 file names.
|
||||
|
||||
RuleBasedTransliteratorIDs {
|
||||
// This is an n x 3 array of strings that serves as an index
|
||||
// to the system rule-based transliterator resource bundle
|
||||
// data files. If RBT files are installed or removed from the
|
||||
// system this table must be updated. For each of the n rows,
|
||||
// the first item is the ID of the forward transliterator for
|
||||
// the rule. The second item is the ID of the reverse
|
||||
// transliterator for the rule. Some rule files only contain
|
||||
// forward direction rules; for those, the second item is a
|
||||
// zero-length string. The third item is the name of the
|
||||
// resource bundle file, a string of 8 or fewer lowercase
|
||||
// letters or digits. This file will be sought in the data
|
||||
// directory within the subdirectory "translit". IDs must
|
||||
// have the form "From-To" or "SingleName" to work properly
|
||||
// with the Transliterator code.
|
||||
|
||||
// Basic language rules
|
||||
{ "Fullwidth-Halfwidth", "Halfwidth-Fullwidth", "fullhalf" }
|
||||
{ "Latin-Arabic", "Arabic-Latin", "larabic" }
|
||||
{ "Latin-Cyrillic", "Cyrillic-Latin", "lcyril" }
|
||||
{ "Latin-Devanagari", "Devanagari-Latin", "ldevan" }
|
||||
{ "Latin-Greek", "Greek-Latin", "lgreek" }
|
||||
{ "Latin-Hebrew", "Hebrew-Latin", "lhebrew" }
|
||||
{ "Latin-Jamo", "Jamo-Latin", "ljamo" }
|
||||
{ "Latin-Kana", "Kana-Latin", "lkana" }
|
||||
|
||||
// Other miscellaneous rules
|
||||
{ "StraightQuotes-CurlyQuotes", "CurlyQuotes-StraightQuotes",
|
||||
"quotes" }
|
||||
{ "KeyboardEscape-Latin1", "", "kbdescl1" }
|
||||
{ "UnicodeName-UnicodeChar", "", "ucname" }
|
||||
}
|
||||
}
|
|
@ -832,7 +832,8 @@ void Transliterator::initializeCache(void) {
|
|||
cache = uhash_open(uhash_hashUString, &status);
|
||||
cacheIDs.setComparer(compareIDs);
|
||||
|
||||
/* The following code is assuming an n x 3 table
|
||||
/* The following code parses the index table located in
|
||||
* icu/data/translit/index.txt. The index is an n x 3 table
|
||||
* that looks like this:
|
||||
*
|
||||
* RuleBasedTransliteratorIDs {
|
||||
|
@ -842,9 +843,10 @@ void Transliterator::initializeCache(void) {
|
|||
* }
|
||||
*/
|
||||
|
||||
ResourceBundle bundle(Locale::getDataDirectory(),
|
||||
Locale::getDefault(),
|
||||
status);
|
||||
Locale indexLoc(UNICODE_STRING("index", 5));
|
||||
ResourceBundle bundle(Transliterator::getDataDirectory(),
|
||||
indexLoc, status);
|
||||
|
||||
int32_t rows, cols;
|
||||
const UnicodeString** ruleBasedIDs =
|
||||
bundle.get2dArray(RB_RULE_BASED_IDS, rows, cols, status);
|
||||
|
|
Loading…
Add table
Reference in a new issue