ICU-6530 add UTrie2 and improve upvec_ via svn merge -r 24551:24849 icu/branches/markus/utf8

X-SVN-Rev: 24862
This commit is contained in:
Markus Scherer 2008-10-22 19:50:07 +00:00
parent 6280be2fa5
commit 9be9a82b08
52 changed files with 10473 additions and 4338 deletions

1
.gitattributes vendored
View File

@ -51,7 +51,6 @@ README text !eol
icu4c/source/common/dtintrv.cpp -text
icu4c/source/common/mutex.cpp -text
icu4c/source/common/unicode/dtintrv.h -text
icu4c/source/configure -text
icu4c/source/data/coll/bn_IN.txt -text
icu4c/source/data/coll/pa_Arab.txt -text
icu4c/source/data/coll/pa_Arab_PK.txt -text

View File

@ -80,7 +80,7 @@ utf_impl.o ustring.o ustrcase.o ucasemap.o cstring.o ustrfmt.o ustrtrns.o ustr_w
normlzr.o unorm.o unormcmp.o unorm_it.o chariter.o schriter.o uchriter.o uiter.o \
uchar.o uprops.o ucase.o propname.o ubidi_props.o ubidi.o ubidiwrt.o ubidiln.o ushape.o \
uscript.o usc_impl.o unames.o \
utrie.o bmpset.o unisetspan.o uset_props.o uniset_props.o uset.o uniset.o usetiter.o ruleiter.o caniter.o unifilt.o unifunct.o \
utrie.o utrie2.o utrie2_builder.o bmpset.o unisetspan.o uset_props.o uniset_props.o uset.o uniset.o usetiter.o ruleiter.o caniter.o unifilt.o unifunct.o \
uarrsort.o brkiter.o ubrk.o brkeng.o dictbe.o triedict.o \
rbbi.o rbbidata.o rbbinode.o rbbirb.o rbbiscan.o rbbisetb.o rbbistbl.o rbbitblb.o \
serv.o servnotf.o servls.o servlk.o servlkf.o servrbf.o servslkf.o \

View File

@ -953,6 +953,22 @@
RelativePath=".\utrie.h"
>
</File>
<File
RelativePath=".\utrie2.c"
>
</File>
<File
RelativePath=".\utrie2.h"
>
</File>
<File
RelativePath=".\utrie2_builder.c"
>
</File>
<File
RelativePath=".\utrie2_impl.h"
>
</File>
<File
RelativePath=".\uvector.cpp"
>

View File

@ -20,6 +20,7 @@
#include "unicode/utypes.h"
#include "cmemory.h"
#include "utrie.h"
#include "utrie2.h"
#include "uarrsort.h"
#include "propsvec.h"
@ -77,6 +78,7 @@ _findRow(uint32_t *pv, UChar32 rangeStart) {
U_CAPI uint32_t * U_EXPORT2
upvec_open(int32_t columns, int32_t maxRows) {
uint32_t *pv, *row;
uint32_t cp;
int32_t length;
if(columns<1 || maxRows<1) {
@ -90,17 +92,20 @@ upvec_open(int32_t columns, int32_t maxRows) {
/* set header */
pv[UPVEC_COLUMNS]=(uint32_t)columns;
pv[UPVEC_MAXROWS]=(uint32_t)maxRows;
pv[UPVEC_ROWS]=1;
pv[UPVEC_ROWS]=2+(UPVEC_MAX_CP-UPVEC_FIRST_SPECIAL_CP);
pv[UPVEC_PREV_ROW]=0;
/* set initial row */
/* set the all-Unicode row and the special-value rows */
row=pv+UPVEC_HEADER_LENGTH;
*row++=0;
*row++=0x110000;
columns-=2;
do {
*row++=0;
} while(--columns>0);
uprv_memset(row, 0, pv[UPVEC_ROWS]*columns*4);
row[0]=0;
row[1]=0x110000;
row+=columns;
for(cp=UPVEC_FIRST_SPECIAL_CP; cp<=UPVEC_MAX_CP; ++cp) {
row[0]=cp;
row[1]=cp+1;
row+=columns;
}
}
return pv;
}
@ -114,12 +119,13 @@ upvec_close(uint32_t *pv) {
U_CAPI UBool U_EXPORT2
upvec_setValue(uint32_t *pv,
UChar32 start, UChar32 limit,
UChar32 start, UChar32 end,
int32_t column,
uint32_t value, uint32_t mask,
UErrorCode *pErrorCode) {
uint32_t *firstRow, *lastRow;
int32_t columns;
UChar32 limit;
UBool splitFirstRow, splitLastRow;
/* argument checking */
@ -128,16 +134,13 @@ upvec_setValue(uint32_t *pv,
}
if( pv==NULL ||
start<0 || start>limit || limit>0x110000 ||
start<0 || start>end || end>UPVEC_MAX_CP ||
column<0 || (uint32_t)(column+1)>=pv[UPVEC_COLUMNS]
) {
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
return FALSE;
}
if(start==limit) {
/* empty range, nothing to do */
return TRUE;
}
limit=end+1;
/* initialize */
columns=(int32_t)pv[UPVEC_COLUMNS];
@ -151,8 +154,25 @@ upvec_setValue(uint32_t *pv,
/* find the last row, always successful */
lastRow=firstRow;
while(limit>(UChar32)lastRow[1]) {
/*
* Start searching with an unrolled loop:
* start and limit are often in a single range, or in adjacent ranges.
*/
if(limit>(UChar32)lastRow[1]) {
lastRow+=columns;
if(limit>(UChar32)lastRow[1]) {
lastRow+=columns;
if(limit>(UChar32)lastRow[1]) {
if((limit-(UChar32)lastRow[1])<10) {
/* we are close, continue looping */
do {
lastRow+=columns;
} while(limit>(UChar32)lastRow[1]);
} else {
lastRow=_findRow(pv, limit-1);
}
}
}
}
/*
@ -226,7 +246,7 @@ U_CAPI uint32_t U_EXPORT2
upvec_getValue(uint32_t *pv, UChar32 c, int32_t column) {
uint32_t *row;
if(pv==NULL || c<0 || c>=0x110000) {
if(pv==NULL || c<0 || c>UPVEC_MAX_CP) {
return 0;
}
row=_findRow(pv, c);
@ -235,7 +255,7 @@ upvec_getValue(uint32_t *pv, UChar32 c, int32_t column) {
U_CAPI uint32_t * U_EXPORT2
upvec_getRow(uint32_t *pv, int32_t rowIndex,
UChar32 *pRangeStart, UChar32 *pRangeLimit) {
UChar32 *pRangeStart, UChar32 *pRangeEnd) {
uint32_t *row;
int32_t columns;
@ -248,8 +268,8 @@ upvec_getRow(uint32_t *pv, int32_t rowIndex,
if(pRangeStart!=NULL) {
*pRangeStart=row[0];
}
if(pRangeLimit!=NULL) {
*pRangeLimit=row[1];
if(pRangeEnd!=NULL) {
*pRangeEnd=row[1]-1;
}
return row+2;
}
@ -279,7 +299,7 @@ upvec_compareRows(const void *context, const void *l, const void *r) {
U_CAPI int32_t U_EXPORT2
upvec_compact(uint32_t *pv, UPVecCompactHandler *handler, void *context, UErrorCode *pErrorCode) {
uint32_t *row;
int32_t columns, valueColumns, rows, count;
int32_t i, columns, valueColumns, rows, count;
UChar32 start, limit;
/* argument checking */
@ -292,23 +312,58 @@ upvec_compact(uint32_t *pv, UPVecCompactHandler *handler, void *context, UErrorC
return 0;
}
row=pv+UPVEC_HEADER_LENGTH;
columns=(int32_t)pv[UPVEC_COLUMNS];
rows=(int32_t)pv[UPVEC_ROWS];
if(rows==0) {
return 0;
}
row=pv+UPVEC_HEADER_LENGTH;
columns=(int32_t)pv[UPVEC_COLUMNS];
valueColumns=columns-2; /* not counting start & limit */
/* sort the properties vectors to find unique vector values */
if(rows>1) {
uprv_sortArray(pv+UPVEC_HEADER_LENGTH, rows, columns*4,
uprv_sortArray(row, rows, columns*4,
upvec_compareRows, pv, FALSE, pErrorCode);
}
if(U_FAILURE(*pErrorCode)) {
return 0;
}
/*
* Find and set the special values.
* This has to do almost the same work as the compaction below,
* to find the indexes where the special-value rows will move.
*/
count=-valueColumns;
for(i=0; i<rows; ++i) {
start=(UChar32)row[0];
/* count a new values vector if it is different from the current one */
if(count<0 || 0!=uprv_memcmp(row+2, row-valueColumns, valueColumns*4)) {
count+=valueColumns;
}
if(start>=UPVEC_FIRST_SPECIAL_CP) {
handler(context, start, start, count, row+2, valueColumns, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
return 0;
}
}
row+=columns;
}
/* count is at the beginning of the last vector, add valueColumns to include that last vector */
count+=valueColumns;
/* Call the handler once more to signal the start of delivering real values. */
handler(context, UPVEC_START_REAL_VALUES_CP, UPVEC_START_REAL_VALUES_CP,
count, row-valueColumns, valueColumns, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
return 0;
}
/*
* Move vector contents up to a contiguous array with only unique
* vector values, and call the handler function for each vector.
@ -316,10 +371,9 @@ upvec_compact(uint32_t *pv, UPVecCompactHandler *handler, void *context, UErrorC
* This destroys the Properties Vector structure and replaces it
* with an array of just vector values.
*/
valueColumns=columns-2; /* not counting start & limit */
row=pv+UPVEC_HEADER_LENGTH;
count=-valueColumns;
do {
for(i=0; i<rows; ++i) {
/* fetch these first before memmove() may overwrite them */
start=(UChar32)row[0];
limit=(UChar32)row[1];
@ -330,24 +384,90 @@ upvec_compact(uint32_t *pv, UPVecCompactHandler *handler, void *context, UErrorC
uprv_memmove(pv+count, row+2, valueColumns*4);
}
handler(context, start, limit, count, pv+count, valueColumns, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
return 0;
if(start<UPVEC_FIRST_SPECIAL_CP) {
handler(context, start, limit-1, count, pv+count, valueColumns, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
return 0;
}
}
row+=columns;
} while(--rows>0);
}
/* count is at the beginning of the last vector, add valueColumns to include that last vector */
return count+valueColumns;
}
/*
* TODO(markus): Add upvec_compactToUTrie2WithRowIndexes() function that returns
* a UTrie2 and does not require the caller to pass in a callback function.
*
* Add upvec_16BitsToUTrie2() function that enumerates all rows, extracts
* some 16-bit field and builds and returns a UTrie2.
*/
U_CAPI void U_CALLCONV
upvec_compactToTrieHandler(void *context,
UChar32 start, UChar32 limit,
int32_t rowIndex, uint32_t *row, int32_t columns,
UErrorCode *pErrorCode) {
if(!utrie_setRange32((UNewTrie *)context, start, limit, (uint32_t)rowIndex, FALSE)) {
*pErrorCode=U_BUFFER_OVERFLOW_ERROR;
upvec_compactToUTrieHandler(void *context,
UChar32 start, UChar32 end,
int32_t rowIndex, uint32_t *row, int32_t columns,
UErrorCode *pErrorCode) {
UPVecToUTrieContext *toUTrie=(UPVecToUTrieContext *)context;
if(start<UPVEC_FIRST_SPECIAL_CP) {
if(!utrie_setRange32(toUTrie->newTrie, start, end+1, (uint32_t)rowIndex, TRUE)) {
*pErrorCode=U_BUFFER_OVERFLOW_ERROR;
}
} else {
switch(start) {
case UPVEC_INITIAL_VALUE_CP:
toUTrie->initialValue=rowIndex;
break;
case UPVEC_START_REAL_VALUES_CP:
if(rowIndex>0xffff) {
/* too many rows for a 16-bit trie */
*pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR;
} else {
toUTrie->newTrie=utrie_open(NULL, NULL, toUTrie->capacity,
toUTrie->initialValue, toUTrie->initialValue,
toUTrie->latin1Linear);
if(toUTrie->newTrie==NULL) {
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
}
}
break;
default:
break;
}
}
}
U_CAPI void U_CALLCONV
upvec_compactToUTrie2Handler(void *context,
UChar32 start, UChar32 end,
int32_t rowIndex, uint32_t *row, int32_t columns,
UErrorCode *pErrorCode) {
UPVecToUTrie2Context *toUTrie2=(UPVecToUTrie2Context *)context;
if(start<UPVEC_FIRST_SPECIAL_CP) {
utrie2_setRange32(toUTrie2->trie, start, end, (uint32_t)rowIndex, TRUE, pErrorCode);
} else {
switch(start) {
case UPVEC_INITIAL_VALUE_CP:
toUTrie2->initialValue=rowIndex;
break;
case UPVEC_ERROR_VALUE_CP:
toUTrie2->errorValue=rowIndex;
break;
case UPVEC_START_REAL_VALUES_CP:
toUTrie2->maxValue=rowIndex;
if(rowIndex>0xffff) {
/* too many rows for a 16-bit trie */
*pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR;
} else {
toUTrie2->trie=utrie2_open(toUTrie2->initialValue,
toUTrie2->errorValue, pErrorCode);
}
break;
default:
break;
}
}
}

View File

@ -21,6 +21,9 @@
#include "unicode/utypes.h"
#include "utrie.h"
#include "utrie2.h"
U_CDECL_BEGIN
/*
* Unicode Properties Vectors associated with code point ranges.
@ -48,6 +51,22 @@ enum {
UPVEC_HEADER_LENGTH
};
/*
* Special pseudo code points for storing the initialValue and the errorValue,
* which are used to initialize a UTrie2 or similar.
*/
#define UPVEC_FIRST_SPECIAL_CP 0x110000
#define UPVEC_INITIAL_VALUE_CP 0x110000
#define UPVEC_ERROR_VALUE_CP 0x110001
#define UPVEC_MAX_CP 0x110001
/*
* Special pseudo code point used in upvec_compact() signalling the end of
* delivering special values and the beginning of delivering real ones.
* Stable value, unlike UPVEC_MAX_CP which might grow over time.
*/
#define UPVEC_START_REAL_VALUES_CP 0x200000
U_CAPI uint32_t * U_EXPORT2
upvec_open(int32_t columns, int32_t maxRows);
@ -56,7 +75,7 @@ upvec_close(uint32_t *pv);
U_CAPI UBool U_EXPORT2
upvec_setValue(uint32_t *pv,
UChar32 start, UChar32 limit,
UChar32 start, UChar32 end,
int32_t column,
uint32_t value, uint32_t mask,
UErrorCode *pErrorCode);
@ -65,12 +84,12 @@ U_CAPI uint32_t U_EXPORT2
upvec_getValue(uint32_t *pv, UChar32 c, int32_t column);
/*
* pRangeStart and pRangeLimit can be NULL.
* pRangeStart and pRangeEnd can be NULL.
* @return NULL if rowIndex out of range and for illegal arguments
*/
U_CAPI uint32_t * U_EXPORT2
upvec_getRow(uint32_t *pv, int32_t rowIndex,
UChar32 *pRangeStart, UChar32 *pRangeLimit);
UChar32 *pRangeStart, UChar32 *pRangeEnd);
/*
* Compact the vectors:
@ -82,13 +101,20 @@ upvec_getRow(uint32_t *pv, int32_t rowIndex,
* The handler's rowIndex is the uint32_t index of the row in the compacted
* memory block.
* (Therefore, it starts at 0 increases in increments of the columns value.)
*
* In a first phase, only special values are delivered (each exactly once),
* with start==end both equalling a special pseudo code point.
* Then the handler is called once more with start==end==UPVEC_START_REAL_VALUES_CP
* where rowIndex is the length of the compacted array,
* and the row is arbitrary (but not NULL).
* Then, in the second phase, the handler is called for each row of real values.
*/
U_CDECL_BEGIN
typedef void U_CALLCONV
UPVecCompactHandler(void *context,
UChar32 start, UChar32 limit,
UChar32 start, UChar32 end,
int32_t rowIndex, uint32_t *row, int32_t columns,
UErrorCode *pErrorCode);
@ -97,11 +123,36 @@ U_CDECL_END
U_CAPI int32_t U_EXPORT2
upvec_compact(uint32_t *pv, UPVecCompactHandler *handler, void *context, UErrorCode *pErrorCode);
/* context=UNewTrie, stores the rowIndex values into the trie */
struct UPVecToUTrieContext {
UNewTrie *newTrie;
int32_t capacity;
int32_t initialValue;
UBool latin1Linear;
};
typedef struct UPVecToUTrieContext UPVecToUTrieContext;
/* context=UPVecToUTrieContext, creates the trie and stores the rowIndex values */
U_CAPI void U_CALLCONV
upvec_compactToTrieHandler(void *context,
UChar32 start, UChar32 limit,
int32_t rowIndex, uint32_t *row, int32_t columns,
UErrorCode *pErrorCode);
upvec_compactToUTrieHandler(void *context,
UChar32 start, UChar32 end,
int32_t rowIndex, uint32_t *row, int32_t columns,
UErrorCode *pErrorCode);
struct UPVecToUTrie2Context {
UTrie2 *trie;
int32_t initialValue;
int32_t errorValue;
int32_t maxValue;
};
typedef struct UPVecToUTrie2Context UPVecToUTrie2Context;
/* context=UPVecToUTrie2Context, creates the trie and stores the rowIndex values */
U_CAPI void U_CALLCONV
upvec_compactToUTrie2Handler(void *context,
UChar32 start, UChar32 end,
int32_t rowIndex, uint32_t *row, int32_t columns,
UErrorCode *pErrorCode);
U_CDECL_END
#endif

View File

@ -24,7 +24,7 @@
#include "umutex.h"
#include "uassert.h"
#include "cmemory.h"
#include "utrie.h"
#include "utrie2.h"
#include "ubidi_props.h"
#include "ucln_cmn.h"
@ -34,7 +34,7 @@ struct UBiDiProps {
const uint32_t *mirrors;
const uint8_t *jgArray;
UTrie trie;
UTrie2 trie;
uint8_t formatVersion[4];
};
@ -321,7 +321,7 @@ ubidi_getDummy(UErrorCode *pErrorCode) {
/* set of property starts for UnicodeSet ------------------------------------ */
static UBool U_CALLCONV
_enumPropertyStartsRange(const void *context, UChar32 start, UChar32 limit, uint32_t value) {
_enumPropertyStartsRange(const void *context, UChar32 start, UChar32 end, uint32_t value) {
/* add the start code point to the USet */
const USetAdder *sa=(const USetAdder *)context;
sa->add(sa->set, start);
@ -341,7 +341,7 @@ ubidi_addPropertyStarts(const UBiDiProps *bdp, const USetAdder *sa, UErrorCode *
}
/* add the start code point of each same-value range of the trie */
utrie_enum(&bdp->trie, NULL, _enumPropertyStartsRange, sa);
utrie2_enum(&bdp->trie, NULL, _enumPropertyStartsRange, sa);
/* add the code points from the bidi mirroring table */
length=bdp->indexes[UBIDI_IX_MIRROR_LENGTH];
@ -373,12 +373,6 @@ ubidi_addPropertyStarts(const UBiDiProps *bdp, const USetAdder *sa, UErrorCode *
/* (none right now) */
}
/* data access primitives --------------------------------------------------- */
/* UTRIE_GET16() itself validates c */
#define GET_PROPS(bdp, c, result) \
UTRIE_GET16(&(bdp)->trie, c, result);
/* property access functions ------------------------------------------------ */
U_CFUNC int32_t
@ -404,25 +398,20 @@ ubidi_getMaxValue(const UBiDiProps *bdp, UProperty which) {
U_CAPI UCharDirection
ubidi_getClass(const UBiDiProps *bdp, UChar32 c) {
uint32_t props;
GET_PROPS(bdp, c, props);
uint16_t props=UTRIE2_GET16(&bdp->trie, c);
return (UCharDirection)UBIDI_GET_CLASS(props);
}
U_CFUNC UBool
ubidi_isMirrored(const UBiDiProps *bdp, UChar32 c) {
uint32_t props;
GET_PROPS(bdp, c, props);
uint16_t props=UTRIE2_GET16(&bdp->trie, c);
return (UBool)UBIDI_GET_FLAG(props, UBIDI_IS_MIRRORED_SHIFT);
}
U_CFUNC UChar32
ubidi_getMirror(const UBiDiProps *bdp, UChar32 c) {
uint32_t props;
int32_t delta;
GET_PROPS(bdp, c, props);
delta=((int16_t)props)>>UBIDI_MIRROR_DELTA_SHIFT;
uint16_t props=UTRIE2_GET16(&bdp->trie, c);
int32_t delta=((int16_t)props)>>UBIDI_MIRROR_DELTA_SHIFT;
if(delta!=UBIDI_ESC_MIRROR_DELTA) {
return c+delta;
} else {
@ -454,22 +443,19 @@ ubidi_getMirror(const UBiDiProps *bdp, UChar32 c) {
U_CFUNC UBool
ubidi_isBidiControl(const UBiDiProps *bdp, UChar32 c) {
uint32_t props;
GET_PROPS(bdp, c, props);
uint16_t props=UTRIE2_GET16(&bdp->trie, c);
return (UBool)UBIDI_GET_FLAG(props, UBIDI_BIDI_CONTROL_SHIFT);
}
U_CFUNC UBool
ubidi_isJoinControl(const UBiDiProps *bdp, UChar32 c) {
uint32_t props;
GET_PROPS(bdp, c, props);
uint16_t props=UTRIE2_GET16(&bdp->trie, c);
return (UBool)UBIDI_GET_FLAG(props, UBIDI_JOIN_CONTROL_SHIFT);
}
U_CFUNC UJoiningType
ubidi_getJoiningType(const UBiDiProps *bdp, UChar32 c) {
uint32_t props;
GET_PROPS(bdp, c, props);
uint16_t props=UTRIE2_GET16(&bdp->trie, c);
return (UJoiningType)((props&UBIDI_JT_MASK)>>UBIDI_JT_SHIFT);
}

View File

@ -4,208 +4,258 @@
*
* file name: ubidi_props_data.c
*
* machine-generated on: 2008-03-20
* machine-generated on: 2008-10-14
*/
static const UVersionInfo ubidi_props_dataVersion={5,1,0,0};
static const int32_t ubidi_props_indexes[UBIDI_IX_TOP]={0x10,0x4340,0x4138,0x1a,0x622,0x782,0,0,0,0,0,0,0,0,0,0x3600b2};
static const uint16_t ubidi_props_trieIndex[8340]={
0x258,0x260,0x268,0x270,0x278,0x280,0x288,0x290,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x296,0x29e,0x2a6,0x2ae,0x2ae,0x2ae,0x2b2,0x2ba,0x250,0x250,0x2bd,
0x250,0x250,0x250,0x250,0x2c5,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x2cb,0x2d0,0x2d8,0x2da,
0x2e2,0x2ea,0x2f2,0x2fa,0x300,0x307,0x30f,0x317,0x31f,0x327,0x32d,0x334,0x33c,0x343,0x34b,0x351,
0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x359,0x35a,0x362,0x36a,0x372,0x35a,0x37a,0x382,
0x359,0x35a,0x38a,0x38f,0x359,0x35a,0x397,0x39f,0x372,0x3a4,0x3ac,0x36a,0x3b1,0x250,0x3b9,0x3bd,
0x250,0x3c4,0x3cc,0x3d4,0x250,0x3dc,0x3e4,0x3ec,0x250,0x250,0x37a,0x36a,0x250,0x250,0x3f2,0x250,
0x250,0x3f8,0x400,0x250,0x250,0x404,0x40c,0x250,0x410,0x417,0x250,0x41f,0x427,0x42e,0x3b0,0x250,
0x250,0x436,0x43e,0x446,0x44e,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x452,0x250,0x45a,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x462,0x250,0x250,0x250,0x46a,0x46a,0x37e,0x37e,0x250,0x470,0x478,0x45a,
0x480,0x250,0x250,0x250,0x250,0x370,0x250,0x250,0x250,0x488,0x490,0x250,0x250,0x250,0x492,0x49a,
0x4a2,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x4aa,0x4ad,0x3b1,0x4b5,0x4bd,0x4c5,0x250,0x250,
0x250,0x4ca,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x2ae,0x4d2,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x4da,0x4e2,0x4e6,
0x4ee,0x4f4,0x4fb,0x503,0x50b,0x513,0x519,0x431,0x521,0x529,0x531,0x250,0x539,0x49a,0x49a,0x49a,
0x541,0x549,0x551,0x559,0x55e,0x566,0x56e,0x574,0x57c,0x584,0x250,0x58a,0x591,0x49a,0x49a,0x597,
0x49a,0x3da,0x59f,0x49a,0x5a7,0x250,0x250,0x497,0x49a,0x49a,0x49a,0x49a,0x49a,0x49a,0x49a,0x49a,
0x49a,0x49a,0x49a,0x49a,0x5af,0x5b7,0x5bf,0x250,0x5c7,0x5cd,0x5d2,0x5da,0x5e0,0x5e6,0x5ee,0x5f6,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x49a,0x49a,0x49a,0x49a,0x5fe,0x605,0x60d,0x615,
0x61d,0x625,0x62d,0x634,0x63c,0x644,0x64b,0x653,0x49a,0x49a,0x65b,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x662,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x2ae,
0x66a,0x672,0x250,0x250,0x67a,0x49a,0x49a,0x49d,0x49a,0x49a,0x49a,0x49a,0x49a,0x49a,0x681,0x687,
0x68f,0x697,0x250,0x250,0x69f,0x6a6,0x250,0x28f,0x250,0x250,0x250,0x250,0x250,0x250,0x49a,0x5bf,
0x6a7,0x250,0x539,0x6af,0x250,0x6b7,0x6bf,0x250,0x250,0x250,0x250,0x6c3,0x250,0x250,0x492,0x28e,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x49a,0x49a,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x539,0x49a,0x3da,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x6ca,0x250,0x250,0x6cf,0x250,0x250,0x250,0x250,0x49a,0x491,0x250,0x250,0x6d7,0x250,0x250,0x250,
0x6df,0x6e6,0x250,0x6e9,0x250,0x250,0x6f0,0x250,0x250,0x6f7,0x6fe,0x250,0x250,0x250,0x250,0x250,
0x250,0x704,0x70c,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x80a,0x80d,0x250,0x815,0x250,0x815,0x250,0x815,0x250,0x815,0x250,0x815,0x250,0x815,0x250,0x815,
0x250,0x815,0x250,0x815,0x250,0x815,0x250,0x815,0x250,0x815,0x81d,0x815,0x250,0x815,0x250,0x815,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x710,0x718,0x71c,0x33c,0x33c,0x33c,0x33c,0x33c,
0x33c,0x33c,0x33c,0x33c,0x33c,0x33c,0x33c,0x33c,0x33c,0x720,0x33c,0x33c,0x33c,0x33c,0x728,0x72c,
0x734,0x73c,0x740,0x748,0x33c,0x33c,0x33c,0x74c,0x754,0x268,0x75c,0x764,0x250,0x250,0x250,0x76c,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x774,0x250,0x49a,0x49a,0x77c,0x250,0x250,0x36b,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x784,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,
0x78c,0x790,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,
0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,
0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,0x2da,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x798,0x7a0,0x7a6,0x250,0x250,
0x49a,0x49a,0x7ae,0x250,0x250,0x250,0x250,0x250,0x49a,0x49a,0x7b6,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x7bc,0x250,0x7c3,0x250,0x7bf,0x250,0x7c6,0x250,0x7ce,0x7d2,
0x49a,0x7da,0x49a,0x49a,0x49d,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,
0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x250,0x7e2,
0x7ea,0x7f2,0x7f2,0x7f2,0x7fa,0x7fa,0x7fa,0x7fa,0x2ae,0x2ae,0x2ae,0x2ae,0x2ae,0x2ae,0x2ae,0x802,
0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,
0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,
0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,0x7fa,
static const uint16_t ubidi_props_trieIndex[8988]={
0x2e6,0x2ee,0x2f6,0x2fe,0x316,0x31e,0x326,0x32e,0x306,0x30e,0x306,0x30e,0x306,0x30e,0x306,0x30e,
0x306,0x30e,0x306,0x30e,0x334,0x33c,0x344,0x34c,0x354,0x35c,0x358,0x360,0x368,0x370,0x36b,0x373,
0x306,0x30e,0x306,0x30e,0x37b,0x383,0x306,0x30e,0x306,0x30e,0x306,0x30e,0x389,0x391,0x399,0x3a1,
0x3a9,0x3b1,0x3b9,0x3c1,0x3c7,0x3cf,0x3d7,0x3df,0x3e7,0x3ef,0x3f5,0x3fd,0x405,0x40d,0x415,0x41d,
0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x425,0x426,0x42e,0x436,0x43e,0x426,0x446,0x44e,
0x425,0x426,0x456,0x45b,0x425,0x426,0x463,0x46b,0x43e,0x470,0x478,0x436,0x47d,0x306,0x485,0x489,
0x306,0x490,0x498,0x4a0,0x306,0x4a8,0x4b0,0x4b8,0x306,0x306,0x446,0x436,0x306,0x306,0x4be,0x306,
0x306,0x4c4,0x4cc,0x306,0x306,0x4d0,0x4d8,0x306,0x4dc,0x4e3,0x306,0x4eb,0x4f3,0x4fa,0x47c,0x306,
0x306,0x502,0x50a,0x512,0x51a,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x51e,0x306,0x526,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x52e,0x306,0x306,0x306,0x536,0x536,0x44a,0x44a,0x306,0x53c,0x544,0x526,
0x54c,0x306,0x306,0x306,0x306,0x43c,0x306,0x306,0x306,0x554,0x55c,0x306,0x306,0x306,0x55e,0x566,
0x56e,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x576,0x579,0x47d,0x581,0x37d,0x589,0x306,0x306,
0x306,0x58e,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x354,0x596,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x59e,0x5a6,0x5aa,
0x5b2,0x5b8,0x5bf,0x5c7,0x5cf,0x5d7,0x5dd,0x4fd,0x5e5,0x5ed,0x5f5,0x306,0x5fd,0x566,0x566,0x566,
0x605,0x60d,0x615,0x61d,0x622,0x62a,0x632,0x638,0x640,0x648,0x306,0x64e,0x655,0x566,0x566,0x65b,
0x566,0x4a6,0x663,0x566,0x66b,0x306,0x306,0x563,0x566,0x566,0x566,0x566,0x566,0x566,0x566,0x566,
0x566,0x566,0x566,0x566,0x673,0x67b,0x683,0x306,0x68b,0x691,0x696,0x69e,0x6a4,0x6aa,0x6b2,0x6ba,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x566,0x566,0x566,0x566,0x6c2,0x6c9,0x6d1,0x6d9,
0x6e1,0x6e9,0x6f1,0x6f8,0x700,0x708,0x70f,0x717,0x566,0x566,0x71f,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x726,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x354,
0x72e,0x736,0x306,0x306,0x73e,0x566,0x566,0x569,0x566,0x566,0x566,0x566,0x566,0x566,0x745,0x74b,
0x753,0x75b,0x306,0x306,0x763,0x76a,0x306,0x32d,0x306,0x306,0x306,0x306,0x306,0x306,0x566,0x683,
0x33b,0x306,0x5fd,0x76b,0x306,0x773,0x77b,0x306,0x306,0x306,0x306,0x77f,0x306,0x306,0x55e,0x32c,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x566,0x566,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x5fd,0x566,0x4a6,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x786,0x306,0x306,0x78b,0x306,0x306,0x306,0x306,0x566,0x55d,0x306,0x306,0x793,0x306,0x306,0x306,
0x79b,0x7a2,0x306,0x7a5,0x306,0x306,0x7ac,0x306,0x306,0x7b3,0x7ba,0x306,0x306,0x306,0x306,0x306,
0x306,0x7c0,0x7c8,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x7cc,0x7d4,0x7d8,0x405,0x405,0x405,0x405,0x405,
0x405,0x405,0x405,0x405,0x405,0x405,0x405,0x405,0x405,0x7dc,0x405,0x405,0x405,0x405,0x7e4,0x7e8,
0x7f0,0x7f8,0x7fc,0x804,0x405,0x405,0x405,0x808,0x810,0x2f6,0x818,0x820,0x306,0x306,0x306,0x828,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0xc18,0xc18,0xc58,0xc98,0xc18,0xc18,0xc18,0xc18,0xc18,0xc18,0xcd0,0xd10,0xd50,0xd60,0xda0,0xdac,
0xc18,0xc18,0xdec,0xc18,0xc18,0xc18,0xe24,0xe64,0xea4,0xee4,0xf1c,0xf5c,0xf9c,0xfd4,0x1014,0x1054,
0xa40,0xa80,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,
0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0x1a0,0xac0,0x1a0,0x1a0,0x1a0,0xb00,0x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x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x840,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,
0x848,0x84c,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,
0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,
0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,0x39b,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x854,0x85c,0x862,0x306,0x306,
0x566,0x566,0x86a,0x306,0x306,0x306,0x306,0x306,0x566,0x566,0x872,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x878,0x306,0x87f,0x306,0x87b,0x306,0x882,0x306,0x88a,0x88e,
0x566,0x896,0x566,0x566,0x569,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,0x306,
0x306,0x306,0x306,0x306,0x89e,0x8a6,0x8ae,0x8ae,0x8ae,0x8b6,0x8b6,0x8b6,0x8b6,0x354,0x354,0x354,
0x354,0x354,0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ubidi_props_trieIndex[8340]={
0,0,0,0,0,0,0,0,0xb1,0,0xb1,0xb1,0xb1,0xb1,0xb1,0,
0xb1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xb1,
0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0,0,0,0,0,0,
0,0,0,0,0xb1,0xb1,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0xb1,0xb1,0xb1,0xb1,0,0,0xb1,0xb1,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0,0,0xb1,0xb1,
@ -439,8 +488,6 @@ static const uint16_t ubidi_props_trieIndex[8340]={
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0xb1,0xb1,0xa,0xa,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0xa,0xa,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0xa,0xa,0xa,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0xa,0xa,0xa,
0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0,0,0,0,
@ -526,14 +573,7 @@ static const uint16_t ubidi_props_trieIndex[8340]={
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,
0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0xb1,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x820,0,0x840,0x860,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0x880,0x8a0,0,0,0,0,0,0,
0x8c0,0,0,0x8e0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0x8e0,0x900,0x920,0x920,0x920,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0,0,0,0
};
static const uint32_t ubidi_props_mirrors[26]={
@ -573,12 +613,16 @@ static const UBiDiProps ubidi_props_singleton={
ubidi_props_jgArray,
{
ubidi_props_trieIndex,
ubidi_props_trieIndex+2968,
NULL,
utrie_defaultGetFoldingOffset,
2368,
5972,
0,
TRUE
2968,
6020,
0x1a0,
0xc18,
0x0,
0x0,
0x110000,
0x2318,
},
{ 1,0,5,2 }
{ 2,0,0,0 }
};

View File

@ -25,7 +25,7 @@
#include "umutex.h"
#include "uassert.h"
#include "cmemory.h"
#include "utrie.h"
#include "utrie2.h"
#include "ucase.h"
#include "ucln_cmn.h"
@ -35,7 +35,7 @@ struct UCaseProps {
const uint16_t *exceptions;
const UChar *unfold;
UTrie trie;
UTrie2 trie;
uint8_t formatVersion[4];
};
@ -327,7 +327,7 @@ ucase_getDummy(UErrorCode *pErrorCode) {
/* set of property starts for UnicodeSet ------------------------------------ */
static UBool U_CALLCONV
_enumPropertyStartsRange(const void *context, UChar32 start, UChar32 limit, uint32_t value) {
_enumPropertyStartsRange(const void *context, UChar32 start, UChar32 end, uint32_t value) {
/* add the start code point to the USet */
const USetAdder *sa=(const USetAdder *)context;
sa->add(sa->set, start);
@ -341,7 +341,7 @@ ucase_addPropertyStarts(const UCaseProps *csp, const USetAdder *sa, UErrorCode *
}
/* add the start code point of each same-value range of the trie */
utrie_enum(&csp->trie, NULL, _enumPropertyStartsRange, sa);
utrie2_enum(&csp->trie, NULL, _enumPropertyStartsRange, sa);
/* add code points with hardcoded properties, plus the ones following them */
@ -355,10 +355,6 @@ ucase_addPropertyStarts(const UCaseProps *csp, const USetAdder *sa, UErrorCode *
/* data access primitives --------------------------------------------------- */
/* UTRIE_GET16() itself validates c */
#define GET_PROPS(csp, c, result) \
UTRIE_GET16(&(csp)->trie, c, result);
#define GET_EXCEPTIONS(csp, props) ((csp)->exceptions+((props)>>UCASE_EXC_SHIFT))
#define PROPS_HAS_EXCEPTION(props) ((props)&UCASE_EXCEPTION)
@ -409,8 +405,7 @@ static const uint8_t flagsOffset[256]={
U_CAPI UChar32 U_EXPORT2
ucase_tolower(const UCaseProps *csp, UChar32 c) {
uint16_t props;
GET_PROPS(csp, c, props);
uint16_t props=UTRIE2_GET16(&csp->trie, c);
if(!PROPS_HAS_EXCEPTION(props)) {
if(UCASE_GET_TYPE(props)>=UCASE_UPPER) {
c+=UCASE_GET_DELTA(props);
@ -427,8 +422,7 @@ ucase_tolower(const UCaseProps *csp, UChar32 c) {
U_CAPI UChar32 U_EXPORT2
ucase_toupper(const UCaseProps *csp, UChar32 c) {
uint16_t props;
GET_PROPS(csp, c, props);
uint16_t props=UTRIE2_GET16(&csp->trie, c);
if(!PROPS_HAS_EXCEPTION(props)) {
if(UCASE_GET_TYPE(props)==UCASE_LOWER) {
c+=UCASE_GET_DELTA(props);
@ -445,8 +439,7 @@ ucase_toupper(const UCaseProps *csp, UChar32 c) {
U_CAPI UChar32 U_EXPORT2
ucase_totitle(const UCaseProps *csp, UChar32 c) {
uint16_t props;
GET_PROPS(csp, c, props);
uint16_t props=UTRIE2_GET16(&csp->trie, c);
if(!PROPS_HAS_EXCEPTION(props)) {
if(UCASE_GET_TYPE(props)==UCASE_LOWER) {
c+=UCASE_GET_DELTA(props);
@ -507,7 +500,7 @@ ucase_addCaseClosure(const UCaseProps *csp, UChar32 c, const USetAdder *sa) {
break;
}
GET_PROPS(csp, c, props);
props=UTRIE2_GET16(&csp->trie, c);
if(!PROPS_HAS_EXCEPTION(props)) {
if(UCASE_GET_TYPE(props)!=UCASE_NONE) {
/* add the one simple case mapping, no matter what type it is */
@ -676,18 +669,15 @@ ucase_addStringCaseClosure(const UCaseProps *csp, const UChar *s, int32_t length
/** @return UCASE_NONE, UCASE_LOWER, UCASE_UPPER, UCASE_TITLE */
U_CAPI int32_t U_EXPORT2
ucase_getType(const UCaseProps *csp, UChar32 c) {
uint16_t props;
GET_PROPS(csp, c, props);
uint16_t props=UTRIE2_GET16(&csp->trie, c);
return UCASE_GET_TYPE(props);
}
/** @return same as ucase_getType(), or <0 if c is case-ignorable */
U_CAPI int32_t U_EXPORT2
ucase_getTypeOrIgnorable(const UCaseProps *csp, UChar32 c) {
int32_t type;
uint16_t props;
GET_PROPS(csp, c, props);
type=UCASE_GET_TYPE(props);
uint16_t props=UTRIE2_GET16(&csp->trie, c);
int32_t type=UCASE_GET_TYPE(props);
if(type!=UCASE_NONE) {
return type;
} else if(
@ -703,8 +693,7 @@ ucase_getTypeOrIgnorable(const UCaseProps *csp, UChar32 c) {
/** @return UCASE_NO_DOT, UCASE_SOFT_DOTTED, UCASE_ABOVE, UCASE_OTHER_ACCENT */
static U_INLINE int32_t
getDotType(const UCaseProps *csp, UChar32 c) {
uint16_t props;
GET_PROPS(csp, c, props);
uint16_t props=UTRIE2_GET16(&csp->trie, c);
if(!PROPS_HAS_EXCEPTION(props)) {
return props&UCASE_DOT_MASK;
} else {
@ -720,8 +709,7 @@ ucase_isSoftDotted(const UCaseProps *csp, UChar32 c) {
U_CAPI UBool U_EXPORT2
ucase_isCaseSensitive(const UCaseProps *csp, UChar32 c) {
uint16_t props;
GET_PROPS(csp, c, props);
uint16_t props=UTRIE2_GET16(&csp->trie, c);
return (UBool)((props&UCASE_SENSITIVE)!=0);
}
@ -912,7 +900,7 @@ isFollowedByCasedLetter(const UCaseProps *csp, UCaseContextIterator *iter, void
}
for(/* dir!=0 sets direction */; (c=iter(context, dir))>=0; dir=0) {
GET_PROPS(csp, c, props);
props=UTRIE2_GET16(&csp->trie, c);
if(UCASE_GET_TYPE(props)!=UCASE_NONE) {
return TRUE; /* followed by cased letter */
} else if(c==0x307 || (props&(UCASE_EXCEPTION|UCASE_CASE_IGNORABLE))==UCASE_CASE_IGNORABLE) {
@ -1059,11 +1047,8 @@ ucase_toFullLower(const UCaseProps *csp, UChar32 c,
const UChar **pString,
const char *locale, int32_t *locCache)
{
UChar32 result;
uint16_t props;
result=c;
GET_PROPS(csp, c, props);
UChar32 result=c;
uint16_t props=UTRIE2_GET16(&csp->trie, c);
if(!PROPS_HAS_EXCEPTION(props)) {
if(UCASE_GET_TYPE(props)>=UCASE_UPPER) {
result=c+UCASE_GET_DELTA(props);
@ -1206,11 +1191,8 @@ toUpperOrTitle(const UCaseProps *csp, UChar32 c,
const UChar **pString,
const char *locale, int32_t *locCache,
UBool upperNotTitle) {
UChar32 result;
uint16_t props;
result=c;
GET_PROPS(csp, c, props);
UChar32 result=c;
uint16_t props=UTRIE2_GET16(&csp->trie, c);
if(!PROPS_HAS_EXCEPTION(props)) {
if(UCASE_GET_TYPE(props)==UCASE_LOWER) {
result=c+UCASE_GET_DELTA(props);
@ -1356,8 +1338,7 @@ ucase_toFullTitle(const UCaseProps *csp, UChar32 c,
/* return the simple case folding mapping for c */
U_CAPI UChar32 U_EXPORT2
ucase_fold(const UCaseProps *csp, UChar32 c, uint32_t options) {
uint16_t props;
GET_PROPS(csp, c, props);
uint16_t props=UTRIE2_GET16(&csp->trie, c);
if(!PROPS_HAS_EXCEPTION(props)) {
if(UCASE_GET_TYPE(props)>=UCASE_UPPER) {
c+=UCASE_GET_DELTA(props);
@ -1420,11 +1401,8 @@ ucase_toFullFolding(const UCaseProps *csp, UChar32 c,
const UChar **pString,
uint32_t options)
{
UChar32 result;
uint16_t props;
result=c;
GET_PROPS(csp, c, props);
UChar32 result=c;
uint16_t props=UTRIE2_GET16(&csp->trie, c);
if(!PROPS_HAS_EXCEPTION(props)) {
if(UCASE_GET_TYPE(props)>=UCASE_UPPER) {
result=c+UCASE_GET_DELTA(props);

View File

@ -4,168 +4,198 @@
*
* file name: ucase_props_data.c
*
* machine-generated on: 2008-04-04
* machine-generated on: 2008-10-14
*/
static const UVersionInfo ucase_props_dataVersion={5,1,0,0};
static const int32_t ucase_props_indexes[UCASE_IX_TOP]={0x10,0x4b10,0x3df8,0x4fa,0x172,0,0,0,0,0,0,0,0,0,0,3};
static const uint16_t ucase_props_trieIndex[7924]={
0x240,0x248,0x250,0x258,0x260,0x268,0x270,0x278,0x280,0x286,0x28d,0x290,0x298,0x2a0,0x2a8,0x2b0,
0x280,0x2b8,0x2c0,0x2c8,0x2d0,0x2d8,0x2e0,0x2e8,0x2f0,0x2f6,0x2fe,0x306,0x30e,0x316,0x31e,0x324,
0x32c,0x330,0x334,0x280,0x33c,0x280,0x344,0x280,0x280,0x34b,0x350,0x358,0x35f,0x367,0x36f,0x372,
0x37a,0x238,0x382,0x38a,0x238,0x238,0x38f,0x397,0x39c,0x3a1,0x3a9,0x238,0x238,0x3b0,0x238,0x3b6,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x3be,0x3bf,0x3c7,0x3cf,0x3d3,0x3bf,0x3db,0x3e3,
0x3be,0x3bf,0x3eb,0x3f0,0x3be,0x3bf,0x3f8,0x3e3,0x3d3,0x3fc,0x404,0x3e3,0x409,0x238,0x411,0x238,
0x238,0x415,0x41d,0x3e3,0x238,0x3fc,0x424,0x3e3,0x238,0x238,0x3db,0x3e3,0x238,0x238,0x42a,0x238,
0x238,0x430,0x437,0x238,0x238,0x43b,0x443,0x238,0x447,0x44e,0x238,0x455,0x45d,0x464,0x46c,0x238,
0x238,0x471,0x479,0x481,0x489,0x491,0x499,0x40a,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x49b,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x4a3,0x4a3,0x3df,0x3df,0x238,0x4a9,0x4b1,0x238,
0x4b9,0x238,0x4c1,0x238,0x238,0x412,0x238,0x238,0x238,0x4c9,0x238,0x238,0x238,0x238,0x238,0x238,
0x4d0,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x4d8,0x4db,0x4e3,0x4e9,0x4f1,0x4f9,0x238,0x238,
0x238,0x4fe,0x238,0x504,0x238,0x238,0x238,0x238,0x50c,0x50c,0x50c,0x514,0x50f,0x51c,0x524,0x52b,
0x280,0x533,0x280,0x53b,0x53e,0x280,0x546,0x280,0x54e,0x556,0x55e,0x566,0x56e,0x576,0x57e,0x586,
0x58e,0x595,0x238,0x59d,0x5a5,0x238,0x5ab,0x5b3,0x5bb,0x5c3,0x5cb,0x5d3,0x5db,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x5de,0x5e4,0x5ea,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x5f2,0x5f7,0x5fb,0x603,0x280,0x280,0x280,0x60b,0x613,0x61b,0x238,0x4be,0x238,0x238,0x238,0x623,
0x238,0x4be,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x3d2,0x62b,0x238,0x238,0x632,0x238,0x238,0x4c2,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x63a,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x640,0x238,0x280,0x648,0x650,0x238,0x238,0x238,0x658,0x660,0x280,0x665,0x66d,0x238,0x238,0x238,
0x675,0x3bd,0x238,0x238,0x238,0x238,0x67c,0x238,0x238,0x683,0x68a,0x238,0x238,0x238,0x238,0x238,
0x238,0x690,0x698,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x7aa,0x7ad,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x7b5,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x6a0,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x6a8,0x6b0,0x6b4,0x238,0x238,0x238,0x238,0x242,0x248,0x6bc,0x6c4,0x6cb,0x415,0x238,0x238,0x6d3,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x6da,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x6e2,0x6e8,0x6ec,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x6f4,0x6f8,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x700,0x708,0x70e,0x238,0x238,
0x238,0x238,0x716,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
0x71e,0x726,0x72b,0x731,0x739,0x741,0x749,0x722,0x751,0x759,0x761,0x768,0x723,0x71e,0x726,0x721,
0x731,0x724,0x71f,0x770,0x722,0x778,0x780,0x788,0x78f,0x77b,0x783,0x78b,0x792,0x77e,0x79a,0x238,
0x3d3,0x658,0x658,0x658,0x238,0x238,0x238,0x238,0x658,0x658,0x658,0x658,0x658,0x658,0x658,0x7a2,
0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,0x238,
static const uint16_t ucase_props_trieIndex[8592]={
0x2b2,0x2ba,0x2c2,0x2ca,0x2d8,0x2e0,0x2e8,0x2f0,0x2f8,0x300,0x307,0x30f,0x317,0x31f,0x327,0x32f,
0x335,0x33d,0x345,0x34d,0x355,0x35d,0x365,0x36d,0x375,0x37d,0x385,0x38d,0x395,0x39d,0x3a5,0x3ad,
0x3b5,0x3bd,0x3c1,0x3c9,0x3d1,0x3d9,0x3e1,0x3e9,0x3e8,0x3f0,0x3f5,0x3fd,0x404,0x40c,0x414,0x41c,
0x424,0x42c,0x434,0x43c,0x2d1,0x2d9,0x441,0x449,0x44e,0x456,0x45e,0x466,0x465,0x46d,0x472,0x47a,
0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x482,0x483,0x48b,0x493,0x497,0x483,0x49f,0x4a7,
0x482,0x483,0x4af,0x4b4,0x482,0x483,0x4bc,0x4a7,0x497,0x4c0,0x4c8,0x4a7,0x4cd,0x2d1,0x4d5,0x2d1,
0x2d1,0x467,0x4dd,0x4a7,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,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,
0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,
0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x760,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,
0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,
0x768,0x770,0x774,0x2d1,0x2d1,0x2d1,0x2d1,0x2b4,0x2ba,0x77c,0x784,0x78b,0x467,0x2d1,0x2d1,0x793,
0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,
0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,
0xb48,0xb48,0xb60,0xba0,0xbe0,0xc1c,0xc5c,0xc9c,0xcd4,0xd14,0xd54,0xd94,0xdd4,0xe14,0xe54,0xe94,
0xed4,0xf04,0xf44,0xf84,0xfa0,0xfd4,0x1010,0x1050,0x1090,0x10d0,0xb44,0x1104,0x1138,0x1178,0x1194,0x11c8,
0x9e1,0xa11,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0xa46,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,0x188,
0xa86,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,
0x57c,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,
0x2d1,0x79b,0x7a1,0x7a5,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,
0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,
0x2d1,0x7ad,0x7b1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,
0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,
0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,
0x2d1,0x7b9,0x7c1,0x7c7,0x2d1,0x2d1,0x2d1,0x2d1,0x7cf,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,
0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x7d7,0x7df,0x7e4,0x7ea,0x7f2,0x7fa,0x802,0x7db,0x80a,0x812,
0x81a,0x821,0x7dc,0x7d7,0x7df,0x7da,0x7ea,0x7dd,0x7d8,0x829,0x7db,0x831,0x839,0x841,0x848,0x834,
0x83c,0x844,0x84b,0x837,0x853,0x2d1,0x497,0x718,0x718,0x718,0x2d1,0x2d1,0x2d1,0x2d1,0x718,0x718,
0x718,0x718,0x718,0x718,0x718,0x85b,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,
0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,
0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,
0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2d1,0x2b1,0x2b1,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x40,
0,0,0,0,0,0,0x40,0,0,0,0,0,0,0,0,0,
0,0,0x40,0,0,0,0,0,0,0x806,0x806,0x806,0x806,0x806,0x806,0x806,
0x806,0xe,0x5e,0x7e,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0xbe,0x806,0x806,0x806,0x806,
0x806,0x806,0x806,0,0,0,0x40,0,0x40,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,
0xf805,0xfd,0xf815,0x14d,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0x18d,0xf805,0xf805,0xf805,0xf805,
0xf805,0xf805,0xf805,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0x40,0,0,0,0,0,0,0x40,0,
0,0,0,0,0,0,0,0,0,0,0x40,0,0,0,0,0,
0,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0xe,0x5e,0x7e,0x806,0x806,0x806,0x806,
0x806,0x806,0x806,0xbe,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0,0,0,0x40,0,
0x40,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xfd,0xf815,0x14d,0xf805,0xf805,0xf805,0xf805,
0xf805,0xf805,0xf805,0x18d,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0x40,0,1,0,0,0x40,0,0x40,
0,0,0,0,0x40,0x1cd,0,0x40,0x40,0,1,0,0,0,0,0,
0x806,0x806,0x806,0x806,0x806,0x1fe,0x806,0x806,0x806,0x806,0x806,0x806,0x23e,0x25e,0x806,0x806,
@ -174,82 +204,101 @@ static const uint16_t ucase_props_trieIndex[7924]={
0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0x1e45,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x35e,0xffc5,0x46,0xffc5,0x46,0xffc5,0x37e,0xffd5,0x39e,0x3ed,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
1,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x43d,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x35e,0xffc5,0x46,0xffc5,0x46,0xffc5,0x37e,0xffd5,
0x39e,0x3ed,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,1,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,
0xffc5,0x46,0xffc5,0x46,0xffc5,0x43d,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0xe1c6,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x4bd,
0x30c5,0x3486,0x46,0xffc5,0x46,0xffc5,0x3386,0x46,0xffc5,0x3346,0x3346,0x46,0xffc5,1,0x13c6,0x3286,
0x32c6,0x46,0xffc5,0x3346,0x33c6,0x1845,0x34c6,0x3446,0x46,0xffc5,0x28c5,1,0x34c6,0x3546,0x2085,0x3586,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x3686,0x46,0xffc5,0x3686,1,1,0x46,0xffc5,0x3686,0x46,
0xffc5,0x3646,0x3646,0x46,0xffc5,0x46,0xffc5,0x36c6,0x46,0xffc5,1,0,0x46,0xffc5,1,0xe05,
0,0,0,0,0x4ee,0x51f,0x55d,0x58e,0x5bf,0x5fd,0x62e,0x65f,0x69d,0x46,0xffc5,0x46,
0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0xec45,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x6cd,0x74e,0x77f,0x7bd,0x46,0xffc5,0xe7c6,0xf206,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0xdf86,1,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,1,1,1,1,1,1,0x7ee,0x46,0xffc5,0xd746,0x80e,1,
1,0x46,0xffc5,0xcf46,0x1146,0x11c6,0x46,0xffc5,0x46,0xffd5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x82d,0x84d,1,0xcb85,0xcc85,1,0xccc5,0xccc5,1,0xcd85,1,0xcd45,1,1,1,1,
0xccc5,1,1,0xcc45,1,1,1,1,0xcbd5,0xcb45,1,0x86d,1,1,1,0xcb45,
1,0x88d,0xcac5,1,1,0xca85,1,1,1,1,1,1,1,0x8ad,1,1,
0xc985,1,1,0xc985,1,1,1,1,0xc985,0xeec5,0xc9c5,0xc9c5,0xee45,1,1,1,
1,1,0xc945,1,0,1,1,1,1,1,1,1,1,0x11,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,0x11,1,1,1,1,1,1,0x40,0x40,0x40,0x44,0x40,0x44,0x40,
1,1,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x46,0xffc5,0x46,0xffc5,0xe1c6,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x4bd,0x30c5,0x3486,0x46,0xffc5,
0x46,0xffc5,0x3386,0x46,0xffc5,0x3346,0x3346,0x46,0xffc5,1,0x13c6,0x3286,0x32c6,0x46,0xffc5,0x3346,
0x33c6,0x1845,0x34c6,0x3446,0x46,0xffc5,0x28c5,1,0x34c6,0x3546,0x2085,0x3586,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x3686,0x46,0xffc5,0x3686,1,1,0x46,0xffc5,0x3686,0x46,0xffc5,0x3646,0x3646,0x46,
0xffc5,0x46,0xffc5,0x36c6,0x46,0xffc5,1,0,0x46,0xffc5,1,0xe05,0,0,0,0,
0x4ee,0x51f,0x55d,0x58e,0x5bf,0x5fd,0x62e,0x65f,0x69d,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,
0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0xec45,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x6cd,0x74e,0x77f,0x7bd,
0x46,0xffc5,0xe7c6,0xf206,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0xdf86,1,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,1,1,1,1,1,1,0x7ee,0x46,
0xffc5,0xd746,0x80e,1,1,0x46,0xffc5,0xcf46,0x1146,0x11c6,0x46,0xffc5,0x46,0xffd5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x82d,0x84d,1,0xcb85,0xcc85,1,0xccc5,0xccc5,1,0xcd85,1,0xcd45,
1,1,1,1,0xccc5,1,1,0xcc45,1,1,1,1,0xcbd5,0xcb45,1,0x86d,
1,1,1,0xcb45,1,0x88d,0xcac5,1,1,0xca85,1,1,1,1,1,1,
1,0x8ad,1,1,0xc985,1,1,0xc985,1,1,1,1,0xc985,0xeec5,0xc9c5,0xc9c5,
0xee45,1,1,1,1,1,0xc945,1,0,1,1,1,1,1,1,1,
1,0x11,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,0x11,1,1,1,1,1,1,0x40,0x40,0x40,
0x44,0x40,0x44,0x40,1,1,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
1,1,1,1,1,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0x40,0x40,0x40,1,1,1,1,1,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x64,0x64,0x60,0x60,0x60,0x60,0x60,0x8cc,0x64,0x60,0x64,0x60,0x64,0x60,0x60,0x60,
0x60,0x60,0x60,0x64,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,
0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x74,0x70,0x70,0x70,0x70,0x70,0x70,
0x70,0x70,0x70,0x70,0x70,0x60,0x60,0x60,0x60,0x60,0x64,0x60,0x60,0x8dd,0x60,0x70,
0x70,0x70,0x60,0x60,0x60,0x70,0x70,0x40,0x60,0x60,0x60,0x70,0x70,0x70,0x70,0x60,
0x70,0x70,0x70,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x60,0x60,0x60,0x60,0x60,
0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x46,0xffc5,0x46,0xffc5,0x40,0x40,0x46,0xffc5,
0,0,1,0x2085,0x2085,0x2085,0,0,0,0,0,0,0x40,0x40,0x986,0x40,
0x946,0x946,0x946,0,0x1006,0,0xfc6,0xfc6,0x92d,0x806,0x9fe,0x806,0x806,0xa3e,0x806,0x806,
0xa7e,0xace,0xb1e,0x806,0xb5e,0x806,0x806,0x806,0xb9e,0xbde,0,0xc1e,0x806,0x806,0xc5e,0x806,
0x806,0xc9e,0x806,0x806,0xf685,0xf6c5,0xf6c5,0xf6c5,0xcdd,0xf805,0xdad,0xf805,0xf805,0xded,0xf805,0xf805,
0xe2d,0xe7d,0xecd,0xf805,0xf0d,0xf805,0xf805,0xf805,0xf4d,0xf8d,0xfcd,0xffd,0xf805,0xf805,0x103d,0xf805,
0xf805,0x107d,0xf805,0xf805,0xf005,0xf045,0xf045,0x206,0x10bd,0x10ed,2,2,2,0x113d,0x116d,0xfe05,
0x40,0x40,0x40,0x40,0x64,0x64,0x60,0x60,0x60,0x60,0x60,0x8cc,0x64,0x60,0x64,0x60,
0x64,0x60,0x60,0x60,0x60,0x60,0x60,0x64,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x70,
0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,
0x70,0x70,0x70,0x70,0x70,0x74,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,
0x70,0x60,0x60,0x60,0x60,0x60,0x64,0x60,0x60,0x8dd,0x60,0x70,0x70,0x70,0x60,0x60,
0x60,0x70,0x70,0x40,0x60,0x60,0x60,0x70,0x70,0x70,0x70,0x60,0x70,0x70,0x70,0x60,
0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
0x60,0x60,0x60,0x60,0x46,0xffc5,0x46,0xffc5,0x40,0x40,0x46,0xffc5,0,0,1,0x2085,
0x2085,0x2085,0,0,0,0,0,0,0x40,0x40,0x986,0x40,0x946,0x946,0x946,0,
0x1006,0,0xfc6,0xfc6,0x92d,0x806,0x9fe,0x806,0x806,0xa3e,0x806,0x806,0xa7e,0xace,0xb1e,0x806,
0xb5e,0x806,0x806,0x806,0xb9e,0xbde,0,0xc1e,0x806,0x806,0xc5e,0x806,0x806,0xc9e,0x806,0x806,
0xf685,0xf6c5,0xf6c5,0xf6c5,0xcdd,0xf805,0xdad,0xf805,0xf805,0xded,0xf805,0xf805,0xe2d,0xe7d,0xecd,0xf805,
0xf0d,0xf805,0xf805,0xf805,0xf4d,0xf8d,0xfcd,0xffd,0xf805,0xf805,0x103d,0xf805,0xf805,0x107d,0xf805,0xf805,
0xf005,0xf045,0xf045,0x206,0x10bd,0x10ed,2,2,2,0x113d,0x116d,0xfe05,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x119d,0x11cd,0x1c5,0x11,0x11fe,0x124d,0,0x46,0xffc5,0xfe46,0x46,0xffc5,1,0xdf86,0xdf86,0xdf86,
0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,
0x46,0xffc5,0x46,0xffc5,0x119d,0x11cd,0x1c5,0x11,0x11fe,0x124d,0,0x46,0xffc5,0xfe46,0x46,0xffc5,
1,0xdf86,0xdf86,0xdf86,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,0x1406,
0x1406,0x1406,0x1406,0x1406,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,
0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,0x806,
0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,
0xec05,0xec05,0xec05,0xec05,0xec05,0xec05,0xec15,0xec05,0xec15,0xec05,0xec05,0xec05,0xec05,0xec05,0xec05,0xec05,
0x46,0xffc5,0,0x60,0x60,0x60,0x60,0x60,0x40,0x40,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x806,0x806,0x806,0x806,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,0xf805,
0xf805,0xf805,0xf805,0xf805,0xec05,0xec05,0xec05,0xec05,0xec05,0xec05,0xec15,0xec05,0xec15,0xec05,0xec05,0xec05,
0xec05,0xec05,0xec05,0xec05,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x3c6,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0xfc45,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0,0x60,0x60,0x60,0x60,0x60,0x40,0x40,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0,0,0,0,0,0,0,0,0,0,0,0,0,0xc06,0xc06,0xc06,
0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,
0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0,0,0x40,0,0,0,0,0,0,
0,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x3c6,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,
0xffc5,0x46,0xffc5,0xfc45,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0,0,0,0,0,0,0,0,0,0,0,0,
0,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,
0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0xc06,0,0,0x40,0,0,
0,0,0,0,0,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,
0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,
0xf405,0xf405,0xf405,0x127d,0,0,0,0,0,0,0,0,0,0x70,0x60,0x60,
0x60,0x60,0x70,0x60,0x60,0x60,0x70,0x70,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x70,
0x70,0x70,0x70,0x70,0x60,0x60,0x70,0x60,0x60,0x70,0x70,0x60,0x70,0x70,0x70,0x70,
0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0,0x70,0,0x70,0x70,0,
0x60,0x70,0,0x70,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0x40,0,0,0,
0,0,0,0,0,0,0,0,0x40,0x40,0x40,0x40,0,0,0,0,
0,0,0,0,0,0,0,0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
0x70,0x70,0x70,0,0,0,0,0,0x40,0,0,0,0,0,0,0,
0,0,0,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x60,0x60,0x70,0x70,0x60,
0x60,0x60,0x60,0x60,0x70,0x60,0x60,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0x70,0,0,0,0,0,0,0,
0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0xf405,0x127d,0,0,0,0,0,0,0,0,
0,0x70,0x60,0x60,0x60,0x60,0x70,0x60,0x60,0x60,0x70,0x70,0x60,0x60,0x60,0x60,
0x60,0x60,0x70,0x70,0x70,0x70,0x70,0x70,0x60,0x60,0x70,0x60,0x60,0x70,0x70,0x60,
0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0,0x70,
0,0x70,0x70,0,0x60,0x70,0,0x70,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0x40,0,0,0,0,0,0,0,0,0,0,0,
0x40,0x40,0x40,0x40,0,0,0,0,0,0,0,0,0,0,0,0,
0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x70,0x70,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0x40,0,0,0,0,0,0,0,0,0,0,0x70,0x70,0x70,0x70,0x70,
0x70,0x70,0x70,0x60,0x60,0x70,0x70,0x60,0x60,0x60,0x60,0x60,0x70,0x60,0x60,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0x70,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0x60,0x60,0x60,0x60,0x60,0x60,
0x60,0x40,0x40,0x60,0x60,0x60,0x60,0x70,0x60,0x40,0x40,0x60,0x60,0,0x70,0x60,
0x60,0x70,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0x40,0,0x70,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0x60,0x70,0x60,0x60,0x70,0x60,0x60,0x70,
0x70,0x70,0x60,0x70,0x70,0x60,0x70,0x60,0x60,0x60,0x70,0x60,0x70,0x60,0x70,0x60,
0x70,0x60,0x60,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0x40,0x40,0x40,0x40,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x40,0x40,0x60,0x60,0x60,0x60,0x70,
0x60,0x40,0x40,0x60,0x60,0,0x70,0x60,0x60,0x70,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x40,
0,0x70,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0x60,0x70,0x60,0x60,0x70,0x60,0x60,0x70,0x70,0x70,0x60,0x70,
0x70,0x60,0x70,0x60,0x60,0x60,0x70,0x60,0x70,0x60,0x70,0x60,0x70,0x60,0x60,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0x60,0x40,0x40,0,0,
0,0,0x40,0,0,0,0,0,0,0x40,0x40,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@ -274,8 +323,7 @@ static const uint16_t ucase_props_trieIndex[7924]={
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0x40,0,0,0,0,0,0,0,0,0,0,0,
0,0x70,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0x40,0x40,0x40,0,0,0,0,0,0x40,0x40,0x40,0,0x40,0x40,
0,0,0,0,0x40,0,0,0,0,0,0x40,0x40,0x40,0,0x40,0x40,
0x40,0x70,0,0,0,0,0,0,0,0x70,0x70,0,0,0,0,0,
0,0,0,0,0,0,0x40,0,0,0,0,0,0x40,0x70,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@ -308,15 +356,15 @@ static const uint16_t ucase_props_trieIndex[7924]={
0x147e,0x149e,0x14be,0x14de,0x14fe,0x151e,0x153e,0x155e,0x157e,0x159e,0x15be,0x15de,0x15fe,0x161e,0x163e,0x165e,
0x167e,0x169e,0x16be,0x16de,0x16fe,0x171e,0x173e,0x175e,0x177e,0x179e,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0x60,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x40,0x40,
0x70,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0x40,0x40,0,0x40,0x40,0x40,0x40,0x40,
0x40,0x40,0,0,0,0,0,0,0,0,0x40,0,0,0x40,0x40,0x40,
0x40,0x40,0x40,0x40,0x40,0x40,0x70,0x40,0,0,0,0x40,0,0,0,0,
0,0x60,0,0,0,0,0,0,0,0,0,0,0,0,0,0x40,
0x40,0x40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0x40,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0x40,0x40,0x70,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0x40,0x40,0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0,0,0,0,0,0,
0,0,0x40,0,0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x70,0x40,
0,0,0,0x40,0,0,0,0,0,0x60,0,0,0,0,0,0,
0,0,0,0,0,0,0,0x40,0x40,0x40,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x40,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0x70,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0x40,0x40,0x40,0,0,0,0,0x40,0x40,0,0,0,
0,0,0,0,0,0,0x40,0,0,0,0,0,0,0x70,0x60,0x70,
@ -411,13 +459,13 @@ static const uint16_t ucase_props_trieIndex[7924]={
0x40,0x40,0,0,0,0,0,0x40,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0x70,0x70,0x40,0x40,0x40,0x40,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0x40,0x40,0x40,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0x40,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0x40,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0,0x60,
0x40,0x40,0x40,0,0,0,0,0,0,0,0,0,0x60,0x60,0,0x40,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0,0,0,0,0,0,0,0,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
0x40,0x40,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,0x46,0xffc5,
@ -450,64 +498,57 @@ static const uint16_t ucase_props_trieIndex[7924]={
0,0,0,0,0,0,0,0,0,0,0,0,0x40,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x40,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0x40,0x40,0x40,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0x70,0,0,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,
0,0,0,0,0,0x40,0x40,0x40,0,0,0,0,0xa06,0xa06,0xa06,0xa06,
0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,
0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,
0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xa06,0xf605,0xf605,0xf605,0xf605,
0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,0xf605,
0xf605,0xf605,0xf605,0xf605,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0x40,0x40,0x40,0,0x40,0x40,0,0,0,0,0,
0x40,0x70,0x40,0x60,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0x60,0x70,0x70,0,
0,0,0,0x70,0,0,0,0,0,0x30,0x30,0x70,0x70,0x70,0,0,
0,0x30,0x30,0x30,0x30,0x30,0x30,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x70,
0x70,0x70,0x70,0x70,0x70,0x70,0x70,0,0,0x60,0x60,0x60,0x60,0x60,0x70,0x70,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0x40,0x40,0x40,0,0x40,0x40,0,0,0,0,0,0x40,0x70,0x40,0x60,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0x60,0x70,0x70,0,0,0,0,0x70,
0,0,0,0,0,0x30,0x30,0x70,0x70,0x70,0,0,0,0x30,0x30,0x30,
0x30,0x30,0x30,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x70,0x70,0x70,0x70,0x70,
0x70,0x70,0x70,0,0,0x60,0x60,0x60,0x60,0x60,0x70,0x70,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0x60,0x60,0x60,0x60,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0x60,0x60,0x60,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
2,2,1,1,1,1,1,1,1,1,0x11,0x11,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,
1,0,0x11,0x11,1,1,1,1,1,1,1,1,2,2,2,2,
0,0,0,0,0,0,0x60,0x60,0x60,0x60,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x60,0x60,
0x60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,
2,2,2,2,2,2,2,2,2,2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0x40,0x40,0x40,0x40,0x40,0x40,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
};
static const uint16_t ucase_props_exceptions[1274]={
@ -627,12 +668,16 @@ static const UCaseProps ucase_props_singleton={
ucase_props_unfold,
{
ucase_props_trieIndex,
ucase_props_trieIndex+2760,
NULL,
utrie_defaultGetFoldingOffset,
2272,
5652,
0,
TRUE
2760,
5832,
0x188,
0xb44,
0x0,
0x0,
0xe0800,
0x218c,
},
{ 1,1,5,2 }
{ 2,1,0,0 }
};

View File

@ -26,7 +26,7 @@
#include "umutex.h"
#include "cmemory.h"
#include "ucln_cmn.h"
#include "utrie.h"
#include "utrie2.h"
#include "udataswp.h"
#include "unormimp.h" /* JAMO_L_BASE etc. */
#include "uprops.h"
@ -225,7 +225,7 @@ loadPropsData(void) {
/* getting a uint32_t properties word from the data */
#if UCHAR_HARDCODE_DATA
#define GET_PROPS(c, result) UTRIE_GET16(&propsTrie, c, result);
#define GET_PROPS(c, result) ((result)=UTRIE2_GET16(&propsTrie, c));
#else
@ -280,11 +280,11 @@ _enumTypeValue(const void *context, uint32_t value) {
}
static UBool U_CALLCONV
_enumTypeRange(const void *context, UChar32 start, UChar32 limit, uint32_t value) {
_enumTypeRange(const void *context, UChar32 start, UChar32 end, uint32_t value) {
/* just cast the value to UCharCategory */
return ((struct _EnumTypeCallback *)context)->
enumRange(((struct _EnumTypeCallback *)context)->context,
start, limit, (UCharCategory)value);
start, end+1, (UCharCategory)value);
}
U_CAPI void U_EXPORT2
@ -301,7 +301,7 @@ u_enumCharTypes(UCharEnumTypeRange *enumRange, const void *context) {
callback.enumRange=enumRange;
callback.context=context;
utrie_enum(&propsTrie, _enumTypeValue, _enumTypeRange, &callback);
utrie2_enum(&propsTrie, _enumTypeValue, _enumTypeRange, &callback);
}
/* Checks if ch is a lower case letter.*/
@ -724,7 +724,7 @@ u_getUnicodeProperties(UChar32 c, int32_t column) {
) {
return 0;
} else {
UTRIE_GET16(&propsVectorsTrie, c, vecIndex);
vecIndex=UTRIE2_GET16(&propsVectorsTrie, c);
return propsVectors[vecIndex+column];
}
}
@ -882,7 +882,7 @@ uhst_addPropertyStarts(const USetAdder *sa, UErrorCode *pErrorCode) {
}
static UBool U_CALLCONV
_enumPropertyStartsRange(const void *context, UChar32 start, UChar32 limit, uint32_t value) {
_enumPropertyStartsRange(const void *context, UChar32 start, UChar32 end, uint32_t value) {
/* add the start code point to the USet */
const USetAdder *sa=(const USetAdder *)context;
sa->add(sa->set, start);
@ -905,7 +905,7 @@ uchar_addPropertyStarts(const USetAdder *sa, UErrorCode *pErrorCode) {
#endif
/* add the start code point of each same-value range of the main trie */
utrie_enum(&propsTrie, NULL, _enumPropertyStartsRange, sa);
utrie2_enum(&propsTrie, NULL, _enumPropertyStartsRange, sa);
/* add code points with hardcoded properties, plus the ones following them */
@ -974,6 +974,6 @@ upropsvec_addPropertyStarts(const USetAdder *sa, UErrorCode *pErrorCode) {
/* add the start code point of each same-value range of the properties vectors trie */
if(propsVectorsColumns>0) {
/* if propsVectorsColumns==0 then the properties vectors trie may not be there at all */
utrie_enum(&propsVectorsTrie, NULL, _enumPropertyStartsRange, sa);
utrie2_enum(&propsVectorsTrie, NULL, _enumPropertyStartsRange, sa);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -33,7 +33,7 @@
#include "unicode/ucnv.h"
#include "unicode/ustring.h"
#include "unicode/uchriter.h"
#include "utrie.h"
#include "utrie2.h"
#include "propsvec.h"
#include "uenumimp.h"
#include "cmemory.h"
@ -53,9 +53,7 @@ U_NAMESPACE_USE
struct UConverterSelector {
uint8_t* serializedTrie;
uint32_t serializedTrieSize;
UTrie constructedTrie; // 16 bit trie containing offsets into pv
UTrie2 *trie; // 16 bit trie containing offsets into pv
uint32_t* pv; // table of bits!
int32_t pvCount;
char** encodings; // which encodings did user ask to use?
@ -64,10 +62,10 @@ struct UConverterSelector {
/* internal function */
void generateSelectorData(UConverterSelector* result,
const USet* excludedEncodings,
const UConverterUnicodeSet whichSet,
UErrorCode* status);
static void generateSelectorData(UConverterSelector* result,
const USet* excludedCodePoints,
const UConverterUnicodeSet whichSet,
UErrorCode* status);
U_CAPI int32_t ucnvsel_swap(const UDataSwapper *ds,
@ -116,6 +114,7 @@ U_CAPI UConverterSelector* ucnvsel_open(const char* const* converterList,
// make a backup copy of the list of converters
if (converterList != NULL && converterListSize > 0) {
// TODO: reduce code duplication, combine the explicit-list and all-converters handling
newSelector->encodings =
(char**)uprv_malloc(converterListSize*sizeof(char*));
// out of memory. Give user back the 100 bytes or so
@ -131,6 +130,12 @@ U_CAPI UConverterSelector* ucnvsel_open(const char* const* converterList,
for (i = 0 ; i < converterListSize ; i++) {
totalSize += uprv_strlen(converterList[i])+1;
}
// 4-align the totalSize to 4-align the trie in the serialized form
int32_t encodingStrPadding = totalSize & 3;
if (encodingStrPadding != 0) {
encodingStrPadding = 4 - encodingStrPadding;
}
totalSize += encodingStrPadding;
allStrings = (char*) uprv_malloc(totalSize);
//out of memory :(
if (!allStrings) {
@ -147,6 +152,10 @@ U_CAPI UConverterSelector* ucnvsel_open(const char* const* converterList,
// twice per string is probably faster than allocating memory to
// cache the lengths!
}
while (encodingStrPadding > 0) {
*allStrings++ = (char)0xff;
--encodingStrPadding;
}
} else {
int32_t count = ucnv_countAvailable();
newSelector->encodings =
@ -164,6 +173,12 @@ U_CAPI UConverterSelector* ucnvsel_open(const char* const* converterList,
const char* conv_moniker = ucnv_getAvailableName(i);
totalSize += uprv_strlen(conv_moniker)+1;
}
// 4-align the totalSize to 4-align the trie in the serialized form
int32_t encodingStrPadding = totalSize & 3;
if (encodingStrPadding != 0) {
encodingStrPadding = 4 - encodingStrPadding;
}
totalSize += encodingStrPadding;
allStrings = (char*) uprv_malloc(totalSize);
//out of memory :(
if (!allStrings) {
@ -180,6 +195,10 @@ U_CAPI UConverterSelector* ucnvsel_open(const char* const* converterList,
// string is probably faster than allocating memory to cache the
// lengths!
}
while (encodingStrPadding > 0) {
*allStrings++ = (char)0xff;
--encodingStrPadding;
}
converterListSize = ucnv_countAvailable();
}
@ -205,11 +224,7 @@ U_CAPI void ucnvsel_close(UConverterSelector *sel) {
uprv_free(sel->encodings[0]);
uprv_free(sel->encodings);
upvec_close(sel->pv);
if (sel->serializedTrie) { // this can be reached when
// generateSelectorData() has failed, and
// the trie is not serialized yet!
uprv_free(sel->serializedTrie);
}
utrie2_close(sel->trie);
uprv_free(sel);
}
@ -227,6 +242,10 @@ U_CAPI UConverterSelector* ucnvsel_unserialize(const char* buffer,
return NULL;
}
// TODO: check and document data alignment as usual
// TODO: require that the input memory remains valid while this selector
// is in use, and don't copy the memory?
// TODO: propose renaming to ucnvsel_openFromSerialized()
UConverterSelector* sel;
int32_t i = 0; // for the for loop
// check length!
@ -284,6 +303,8 @@ U_CAPI UConverterSelector* ucnvsel_unserialize(const char* buffer,
length -= 3 * sizeof(int32_t); //sig, Asciiness, and pvCount
// end of check length!
// TODO: fix screwed-up length counting and checking --
// at the end, the trie size should be exactly the remaining length
sel = (UConverterSelector*)uprv_malloc(sizeof(UConverterSelector));
//out of memory :(
@ -297,7 +318,7 @@ U_CAPI UConverterSelector* ucnvsel_unserialize(const char* buffer,
buffer+=sizeof(int32_t);
// check length
if (length < (sel->pvCount+1)*sizeof(uint32_t)) {
if (length < (int32_t)((sel->pvCount+1)*sizeof(uint32_t))) {
uprv_free(sel);
*status = U_INVALID_FORMAT_ERROR;
return NULL;
@ -318,7 +339,7 @@ U_CAPI UConverterSelector* ucnvsel_unserialize(const char* buffer,
int32_t encodingsLength;
memcpy(&encodingsLength, buffer, sizeof(int32_t));
buffer += sizeof(int32_t);
char* tempEncodings = (char*) uprv_malloc(encodingsLength+1);
char* tempEncodings = (char*) uprv_malloc(encodingsLength);
if(!tempEncodings) {
*status = U_MEMORY_ALLOCATION_ERROR;
uprv_free(sel);
@ -327,11 +348,10 @@ U_CAPI UConverterSelector* ucnvsel_unserialize(const char* buffer,
}
memcpy(tempEncodings, buffer, encodingsLength);
tempEncodings[encodingsLength] = 0;
buffer += encodingsLength;
// count how many strings are there!
int32_t numStrings = 0;
for (int32_t i = 0 ; i < encodingsLength + 1 ; i++) {
for (int32_t i = 0 ; i < encodingsLength; i++) {
if (tempEncodings[i] == 0) {
numStrings++;
}
@ -346,11 +366,11 @@ U_CAPI UConverterSelector* ucnvsel_unserialize(const char* buffer,
return NULL;
}
int32_t curString = 0;
sel->encodings[0] = tempEncodings;
for (i = 0 ; i < encodingsLength ; i++) {
int32_t curString = 1;
for (i = 0; curString < numStrings; i++) {
if (tempEncodings[i] == 0) {
sel->encodings[++curString] = tempEncodings+i+1;
sel->encodings[curString++] = tempEncodings+i+1;
}
}
@ -367,11 +387,12 @@ U_CAPI UConverterSelector* ucnvsel_unserialize(const char* buffer,
// end of check length
// the trie
memcpy(&sel->serializedTrieSize, buffer, sizeof(uint32_t));
buffer += sizeof(uint32_t);
int32_t serializedTrieSize;
memcpy(&serializedTrieSize, buffer, sizeof(int32_t));
buffer += sizeof(int32_t);
// check length
if (length < sel->serializedTrieSize) {
if (length < serializedTrieSize) {
uprv_free(sel->pv);
uprv_free(tempEncodings);
uprv_free(sel->encodings);
@ -382,20 +403,14 @@ U_CAPI UConverterSelector* ucnvsel_unserialize(const char* buffer,
length -= sizeof(uint32_t);
// end of check length
sel->serializedTrie = (uint8_t*) uprv_malloc(sel->serializedTrieSize);
if(!sel->serializedTrie) {
uprv_free(sel->pv);
uprv_free(tempEncodings);
uprv_free(sel->encodings);
uprv_free(sel);
*status = U_MEMORY_ALLOCATION_ERROR;
return NULL;
}
memcpy(sel->serializedTrie, buffer, sel->serializedTrieSize);
// unserialize!
utrie_unserialize(&sel->constructedTrie, sel->serializedTrie,
sel->serializedTrieSize, status);
sel->trie = utrie2_openFromSerialized(UTRIE2_16_VALUE_BITS,
buffer, serializedTrieSize, NULL,
status);
if (U_FAILURE(*status)) {
ucnvsel_close(sel);
sel = NULL;
}
return sel;
}
@ -417,20 +432,23 @@ U_CAPI int32_t ucnvsel_serialize(const UConverterSelector* sel,
*status = U_ILLEGAL_ARGUMENT_ERROR;
return 0;
}
//utrie_swap(ds, inDa
// TODO: call utrie2_swap()?
// TODO: rethink this serialization; use UDataHeader?! require alignment as usual
UErrorCode localStatus = U_ZERO_ERROR;
int32_t serializedTrieSize = utrie2_serialize(sel->trie, NULL, 0, &localStatus);
totalSize = sizeof(uint32_t) /*signature*/+sizeof(uint32_t) /*ASCIIness*/+
sizeof(uint32_t)*sel->pvCount /*pv*/+ sizeof(uint32_t) /*pvCount*/+
sizeof(uint32_t) /*serializedTrieSize*/+ sel->serializedTrieSize /*trie*/;
sizeof(uint32_t) /*serializedTrieSize*/+ serializedTrieSize /*trie*/;
// this is a multi-string! strlen() will stop at the first one
encodingStrLength =
uprv_strlen(sel->encodings[sel->encodingsCount-1]) +
uprv_strlen(sel->encodings[sel->encodingsCount-1]) + 1 +
(sel->encodings[sel->encodingsCount-1] - sel->encodings[0]);
encodingStrLength = (encodingStrLength + 3) & ~3; // round up to 4-alignment
totalSize += encodingStrLength + sizeof(uint32_t);
if (totalSize > bufferCapacity) {
*status = U_INDEX_OUTOFBOUNDS_ERROR;
*status = U_BUFFER_OVERFLOW_ERROR;
return totalSize;
}
// ok, save!
@ -454,28 +472,33 @@ U_CAPI int32_t ucnvsel_serialize(const UConverterSelector* sel,
buffer += encodingStrLength;
// the trie
memcpy(buffer, &sel->serializedTrieSize, sizeof(uint32_t));
memcpy(buffer, &serializedTrieSize, sizeof(uint32_t));
buffer+=sizeof(uint32_t);
memcpy(buffer, sel->serializedTrie, sel->serializedTrieSize);
utrie2_serialize(sel->trie, buffer, serializedTrieSize, status);
return totalSize;
}
/* internal function! */
void generateSelectorData(UConverterSelector* result,
const USet* excludedEncodings,
const UConverterUnicodeSet whichSet,
UErrorCode* status) {
const uint32_t encodingsSize = result->encodingsCount;
static void generateSelectorData(UConverterSelector* result,
const USet* excludedCodePoints,
const UConverterUnicodeSet whichSet,
UErrorCode* status) {
int32_t columns = (result->encodingsCount+31)/32;
// 66000 as suggested by Markus [I suggest something like 66000 which
// exceeds the number of BMP code points. There will be fewer ranges of
// combinations of encodings. (I believe there are no encodings that have
// interesting mappings for supplementary code points. All encodings either
// support all of them or none of them.)]
result->pv = upvec_open((encodingsSize+31)/32, 66000); // create for all
result->pv = upvec_open(columns, 66000); // create for all
// unicode codepoints, and have space for all those bits needed!
// set errorValue to all-ones
for (int32_t col = 0 ; col < columns; col++) {
upvec_setValue(result->pv, UPVEC_ERROR_VALUE_CP, UPVEC_ERROR_VALUE_CP,
col, ~0, ~0, status);
}
for (uint32_t i = 0; i < encodingsSize; ++i) {
for (int32_t i = 0; i < result->encodingsCount; ++i) {
uint32_t mask;
uint32_t column;
int32_t item_count;
@ -506,10 +529,7 @@ void generateSelectorData(UConverterSelector* result,
// this will be reached for the converters that fill the set with
// strings. Those should be ignored by our system
} else {
// IMPORTANT: the intervals for usets are INCLUSIVE. However, the
// intervals for upvec are NOT INCLUSIVE. This is why we need
// end_char+1 here!
upvec_setValue(result->pv, start_char, end_char + 1, column, ~0, mask,
upvec_setValue(result->pv, start_char, end_char, column, ~0, mask,
status);
if (U_FAILURE(*status)) {
return;
@ -522,19 +542,19 @@ void generateSelectorData(UConverterSelector* result,
// handle excluded encodings! Simply set their values to all 1's in the upvec
if (excludedEncodings) {
int32_t item_count = uset_getItemCount(excludedEncodings);
if (excludedCodePoints) {
int32_t item_count = uset_getItemCount(excludedCodePoints);
for (int32_t j = 0; j < item_count; ++j) {
UChar32 start_char;
UChar32 end_char;
uset_getItem(excludedEncodings, j, &start_char, &end_char, NULL, 0,
uset_getItem(excludedCodePoints, j, &start_char, &end_char, NULL, 0,
status);
if (U_FAILURE(*status)) {
return;
} else {
for (uint32_t col = 0 ; col < (encodingsSize+31)/32 ; col++) {
upvec_setValue(result->pv, start_char, end_char + 1, col, ~0, ~0,
for (int32_t col = 0 ; col < columns; col++) {
upvec_setValue(result->pv, start_char, end_char, col, ~0, ~0,
status);
}
}
@ -543,17 +563,13 @@ void generateSelectorData(UConverterSelector* result,
// alright. Now, let's put things in the same exact form you'd get when you
// unserialize things.
UNewTrie* trie = utrie_open(NULL, NULL, CAPACITY, 0, 0, TRUE);
result->pvCount = upvec_compact(result->pv, upvec_compactToTrieHandler,
trie, status);
uint32_t length = utrie_serialize(trie, NULL, 0, NULL, TRUE, status);
result->serializedTrie = (uint8_t*) uprv_malloc(length);
length = utrie_serialize(trie, result->serializedTrie, length, NULL, TRUE,
status);
result->serializedTrieSize = length;
utrie_unserialize(&result->constructedTrie, result->serializedTrie, length,
status);
utrie_close(trie);
UPVecToUTrie2Context toUTrie2={ NULL };
result->pvCount = upvec_compact(result->pv, upvec_compactToUTrie2Handler,
&toUTrie2, status);
if (U_SUCCESS(*status)) {
result->trie = toUTrie2.trie;
utrie2_freeze(result->trie, UTRIE2_16_VALUE_BITS, status);
}
}
@ -660,17 +676,59 @@ int16_t countOnes(uint32_t* mask, int32_t len) {
/* internal function! */
UEnumeration *ucnvsel_select(const UConverterSelector* sel, const void *s,
int32_t length, UErrorCode *status, UBool isUTF16) {
const UChar* utf16buffer = (UChar*) s;
const char* utf8buffer = (char*) s;
static UEnumeration *selectForMask(const UConverterSelector* sel,
uint32_t *mask, UErrorCode *status) {
// this is the context we will use. Store a table of indices to which
// encodings are legit.
struct Enumerator* result = (Enumerator*)uprv_malloc(sizeof(Enumerator));
if (result == NULL) {
uprv_free(mask);
*status = U_MEMORY_ALLOCATION_ERROR;
return NULL;
}
result->index = NULL; // this will be allocated later!
result->length = result->cur = 0;
result->sel = sel;
UEnumeration *en = NULL;
uint32_t* mask;
UChar32 next = 0;
int32_t offset = 0;
int32_t i, j;
UEnumeration *en = (UEnumeration *)uprv_malloc(sizeof(UEnumeration));
if (en == NULL) {
// TODO(markus): Combine Enumerator and UEnumeration into one struct.
uprv_free(mask);
uprv_free(result);
*status = U_MEMORY_ALLOCATION_ERROR;
return NULL;
}
memcpy(en, &defaultEncodings, sizeof(UEnumeration));
en->context = result;
int32_t columns = (sel->encodingsCount+31)/32;
int16_t numOnes = countOnes(mask, columns);
// now, we know the exact space we need for index
if (numOnes > 0) {
result->index = (int16_t*) uprv_malloc(numOnes * sizeof(int16_t));
int32_t i, j;
int16_t k = 0;
for (j = 0 ; j < columns; j++) {
uint32_t v = mask[j];
for (i = 0 ; i < 32 && k < sel->encodingsCount; i++, k++) {
if ((v & 1) != 0) {
result->index[result->length++] = k;
}
v >>= 1;
}
}
} //otherwise, index will remain NULL (and will never be touched by
//the enumerator code anyway)
uprv_free(mask);
return en;
}
/* check a string against the selector - UTF16 version */
U_CAPI UEnumeration *ucnvsel_selectForString(const UConverterSelector* sel,
const UChar *s,
int32_t length,
UErrorCode *status) {
// check if already failed
if (U_FAILURE(*status)) {
return NULL;
@ -681,80 +739,68 @@ int32_t length, UErrorCode *status, UBool isUTF16) {
return NULL;
}
// this is the context we will use. Store a table of indices to which
// encodings are legit.
struct Enumerator* result = (Enumerator*)uprv_malloc(sizeof(Enumerator));
result->index = NULL; // this will be allocated later!
result->length = result->cur = 0;
result->sel = sel;
int32_t columns = (sel->encodingsCount+31)/32;
uint32_t* mask = (uint32_t*) uprv_malloc(columns * 4);
if (mask == NULL) {
*status = U_MEMORY_ALLOCATION_ERROR;
return NULL;
}
uprv_memset(mask, ~0, columns *4);
en = (UEnumeration *)uprv_malloc(sizeof(UEnumeration));
memcpy(en, &defaultEncodings, sizeof(UEnumeration));
en->context = result;
mask = (uint32_t*) uprv_malloc((sel->encodingsCount+31)/32 *
sizeof(uint32_t));
uprv_memset(mask, ~0, (sel->encodingsCount+31)/32 * sizeof(uint32_t));
if(length == -1) {
if(isUTF16)
length = u_strlen(utf16buffer);
else
length = uprv_strlen(utf8buffer);
const UChar *limit;
if (length >= 0) {
limit = s + length;
} else {
limit = NULL;
}
if(s) {
while (offset < length) {
uint16_t result = 0;
if (isUTF16)
U16_NEXT(utf16buffer, offset, length, next)
else
U8_NEXT(utf8buffer, offset, length, next)
if (next != -1) {
UTRIE_GET16((&sel->constructedTrie), next, result)
if (intersectMasks(mask, sel->pv+result, (sel->encodingsCount+31)/32)) {
break;
}
}
while (limit == NULL ? *s != 0 : s != limit) {
UChar32 c;
uint16_t pvIndex;
UTRIE2_U16_NEXT16(sel->trie, s, limit, c, pvIndex);
if (intersectMasks(mask, sel->pv+pvIndex, columns)) {
break;
}
}
int16_t numOnes = countOnes(mask, (sel->encodingsCount+31)/32);
// now, we know the exact space we need for index
if (numOnes > 0) {
result->index = (int16_t*) uprv_malloc(numOnes * sizeof(int16_t));
} //otherwise, index will remain NULL (and will never be touched by
//the enumerator code anyway)
for (j = 0 ; j < (sel->encodingsCount+31)/32 ; j++) {
for (i = 0 ; i < 32 ; i++) {
uint32_t v = mask[j] & 1;
if (v && j*32+i < sel->encodingsCount) {
result->index[result->length++] = j*32+i;
}
mask[j] >>= 1;
}
}
uprv_free(mask);
return en;
}
/* check a string against the selector - UTF16 version */
U_CAPI UEnumeration *ucnvsel_selectForString(const UConverterSelector* sel,
const UChar *s,
int32_t length,
UErrorCode *status) {
return ucnvsel_select(sel, s, length, status, TRUE);
return selectForMask(sel, mask, status);
}
/* check a string against the selector - UTF8 version */
U_CAPI UEnumeration *ucnvsel_selectForUTF8(const UConverterSelector* sel,
const char *utf8str,
const char *s,
int32_t length,
UErrorCode *status) {
return ucnvsel_select(sel, utf8str, length, status, FALSE);
// check if already failed
if (U_FAILURE(*status)) {
return NULL;
}
// ensure args make sense!
if (sel == NULL || (s == NULL && length != 0)) {
*status = U_ILLEGAL_ARGUMENT_ERROR;
return NULL;
}
int32_t columns = (sel->encodingsCount+31)/32;
uint32_t* mask = (uint32_t*) uprv_malloc(columns * 4);
if (mask == NULL) {
*status = U_MEMORY_ALLOCATION_ERROR;
return NULL;
}
uprv_memset(mask, ~0, columns *4);
if (length < 0) {
length = uprv_strlen(s);
}
const char *limit = s + length;
while (s != limit) {
uint16_t pvIndex;
UTRIE2_U8_NEXT16(sel->trie, s, limit, pvIndex);
if (intersectMasks(mask, sel->pv+pvIndex, columns)) {
break;
}
}
return selectForMask(sel, mask, status);
}
@ -811,7 +857,7 @@ U_CAPI int32_t ucnvsel_swap(const UDataSwapper *ds,
outDataC += 3 * sizeof(uint32_t);
if(length < pvCount * sizeof(uint32_t)) {
if(length < (int32_t)(pvCount * sizeof(uint32_t))) {
* status = U_INDEX_OUTOFBOUNDS_ERROR;
return 0;
}
@ -853,7 +899,7 @@ U_CAPI int32_t ucnvsel_swap(const UDataSwapper *ds,
* status = U_INDEX_OUTOFBOUNDS_ERROR;
return 0;
}
utrie_swap(ds, inDataC, trieSize, outDataC, status);
utrie2_swap(ds, inDataC, trieSize, outDataC, status);
length -= trieSize;
return passedLength - length;
}

View File

@ -1,7 +1,7 @@
/*
*******************************************************************************
*
* Copyright (C) 1999-2007, International Business Machines
* Copyright (C) 1999-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@ -216,6 +216,15 @@
*/
#define U_IS_SURROGATE_LEAD(c) (((c)&0x400)==0)
/**
* Assuming c is a surrogate code point (U_IS_SURROGATE(c)),
* is it a trail surrogate?
* @param c 32-bit code point
* @return TRUE or FALSE
* @draft ICU 4.2
*/
#define U_IS_SURROGATE_TRAIL(c) (((c)&0x400)!=0)
/* include the utfXX.h ------------------------------------------------------ */
#include "unicode/utf8.h"

View File

@ -1,7 +1,7 @@
/*
*******************************************************************************
*
* Copyright (C) 1999-2007, International Business Machines
* Copyright (C) 1999-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@ -82,6 +82,15 @@
*/
#define U16_IS_SURROGATE_LEAD(c) (((c)&0x400)==0)
/**
* Assuming c is a surrogate code point (U16_IS_SURROGATE(c)),
* is it a trail surrogate?
* @param c 16-bit code unit
* @return TRUE or FALSE
* @draft ICU 4.2
*/
#define U16_IS_SURROGATE_TRAIL(c) (((c)&0x400)!=0)
/**
* Helper constant for U16_GET_SUPPLEMENTARY.
* @internal

View File

@ -1,6 +1,6 @@
/*
******************************************************************************
* Copyright (c) 1996-2007, International Business Machines
* Copyright (c) 1996-2008, International Business Machines
* Corporation and others. All Rights Reserved.
******************************************************************************
* File unorm.cpp
@ -38,7 +38,7 @@
#include "ucase.h"
#include "cmemory.h"
#include "umutex.h"
#include "utrie.h"
#include "utrie2.h"
#include "unicode/uset.h"
#include "udataswp.h"
#include "putilimp.h"
@ -134,11 +134,13 @@ isNorm32Regular(uint32_t norm32) {
return norm32<_NORM_MIN_SPECIAL;
}
#if 0 // Code changed to use U16_IS_LEAD(c) instead.
/* is this a norm32 with a special index for a lead surrogate? */
static inline UBool
isNorm32LeadSurrogate(uint32_t norm32) {
return _NORM_MIN_SPECIAL<=norm32 && norm32<_NORM_SURROGATES_TOP;
}
#endif
/* is this a norm32 with a special index for a Hangul syllable or a Jamo? */
static inline UBool
@ -163,29 +165,10 @@ static inline UBool
isJamoVTNorm32JamoV(uint32_t norm32) {
return norm32<_NORM_JAMO_V_TOP;
}
U_CDECL_END
/* load unorm.dat ----------------------------------------------------------- */
/* normTrie: 32-bit trie result may contain a special extraData index with the folding offset */
static int32_t U_CALLCONV
getFoldingNormOffset(uint32_t norm32) {
if(isNorm32LeadSurrogate(norm32)) {
return
UTRIE_BMP_INDEX_LENGTH+
(((int32_t)norm32>>(_NORM_EXTRA_SHIFT-UTRIE_SURROGATE_BLOCK_BITS))&
(0x3ff<<UTRIE_SURROGATE_BLOCK_BITS));
} else {
return 0;
}
}
/* auxTrie: the folding offset is in bits 9..0 of the 16-bit trie result */
static int32_t U_CALLCONV
getFoldingAuxOffset(uint32_t data) {
return (int32_t)(data&_NORM_AUX_FNC_MASK)<<UTRIE_SURROGATE_BLOCK_BITS;
}
U_CDECL_END
#define UNORM_HARDCODE_DATA 1
#if UNORM_HARDCODE_DATA
@ -279,7 +262,7 @@ isAcceptable(void * /* context */,
#endif
static UBool U_CALLCONV
_enumPropertyStartsRange(const void *context, UChar32 start, UChar32 /*limit*/, uint32_t /*value*/) {
_enumPropertyStartsRange(const void *context, UChar32 start, UChar32 /*end*/, uint32_t /*value*/) {
/* add the start code point to the USet */
const USetAdder *sa=(const USetAdder *)context;
sa->add(sa->set, start);
@ -411,8 +394,9 @@ unorm_haveData(UErrorCode *pErrorCode) {
}
U_CAPI const uint16_t * U_EXPORT2
unorm_getFCDTrie(UErrorCode *pErrorCode) {
unorm_getFCDTrieIndex(UChar32 &fcdHighStart, UErrorCode *pErrorCode) {
if(_haveData(*pErrorCode)) {
fcdHighStart=fcdTrie.highStart;
return fcdTrie.index;
} else {
return NULL;
@ -423,20 +407,13 @@ unorm_getFCDTrie(UErrorCode *pErrorCode) {
static inline uint32_t
_getNorm32(UChar c) {
return UTRIE_GET32_FROM_LEAD(&normTrie, c);
return UTRIE2_GET32_FROM_U16_SINGLE_LEAD(&normTrie, c);
}
static inline uint32_t
_getNorm32FromSurrogatePair(uint32_t norm32, UChar c2) {
/*
* the surrogate index in norm32 stores only the number of the surrogate index block
* see gennorm/store.c/getFoldedNormValue()
*/
norm32=
UTRIE_BMP_INDEX_LENGTH+
((norm32>>(_NORM_EXTRA_SHIFT-UTRIE_SURROGATE_BLOCK_BITS))&
(0x3ff<<UTRIE_SURROGATE_BLOCK_BITS));
return UTRIE_GET32_FROM_OFFSET_TRAIL(&normTrie, norm32, c2);
_getNorm32FromSurrogatePair(UChar c, UChar c2) {
UChar32 cp=U16_GET_SUPPLEMENTARY(c, c2);
return UTRIE2_GET32_FROM_SUPP(&normTrie, cp);
}
/*
@ -445,23 +422,24 @@ _getNorm32FromSurrogatePair(uint32_t norm32, UChar c2) {
*/
static inline uint32_t
_getNorm32(const UChar *p, uint32_t mask) {
uint32_t norm32=_getNorm32(*p);
if((norm32&mask) && isNorm32LeadSurrogate(norm32)) {
/* *p is a lead surrogate, get the real norm32 */
norm32=_getNorm32FromSurrogatePair(norm32, *(p+1));
UChar c=*p;
uint32_t norm32=_getNorm32(c);
if((norm32&mask) && U16_IS_LEAD(c)) {
/* c is a lead surrogate, get the real norm32 */
norm32=_getNorm32FromSurrogatePair(c, *(p+1));
}
return norm32;
}
static inline uint16_t
_getFCD16(UChar c) {
return UTRIE_GET16_FROM_LEAD(&fcdTrie, c);
return UTRIE2_GET16_FROM_U16_SINGLE_LEAD(&fcdTrie, c);
}
static inline uint16_t
_getFCD16FromSurrogatePair(uint16_t fcd16, UChar c2) {
/* the surrogate index in fcd16 is an absolute offset over the start of stage 1 */
return UTRIE_GET16_FROM_OFFSET_TRAIL(&fcdTrie, fcd16, c2);
_getFCD16FromSurrogatePair(UChar c, UChar c2) {
UChar32 cp=U16_GET_SUPPLEMENTARY(c, c2);
return UTRIE2_GET16_FROM_SUPP(&fcdTrie, cp);
}
static inline const uint16_t *
@ -469,6 +447,12 @@ _getExtraData(uint32_t norm32) {
return extraData+(norm32>>_NORM_EXTRA_SHIFT);
}
/*
* TODO(markus): Revisit if it makes sense for functions like _getNextCC()
* and their call sites, and a fair bit of other code here, to work with UTF-16 code units,
* or whether code simplification would suggest just using UChar32 and maybe UTRIE2_NEXT32().
*/
#if 0
/*
* It is possible to get the FCD data from the main trie if unorm.icu
@ -785,7 +769,7 @@ unorm_getCanonicalDecomposition(UChar32 c, UChar buffer[4], int32_t *pLength) {
return NULL;
}
UTRIE_GET32(&normTrie, c, norm32);
norm32=UTRIE2_GET32(&normTrie, c);
if(norm32&_NORM_QC_NFD) {
if(isNorm32HangulOrJamo(norm32)) {
/* Hangul syllable: decompose algorithmically */
@ -825,26 +809,21 @@ _getNextCC(const UChar *&p, const UChar *limit, UChar &c, UChar &c2) {
uint32_t norm32;
c=*p++;
c2=0;
norm32=_getNorm32(c);
if((norm32&_NORM_CC_MASK)==0) {
c2=0;
return 0;
} else {
if(!isNorm32LeadSurrogate(norm32)) {
c2=0;
} else if(U16_IS_LEAD(c)) {
/* c is a lead surrogate, get the real norm32 */
if(p!=limit && U16_IS_TRAIL(c2=*p)) {
++p;
norm32=_getNorm32FromSurrogatePair(c, c2);
} else {
/* c is a lead surrogate, get the real norm32 */
if(p!=limit && UTF_IS_SECOND_SURROGATE(c2=*p)) {
++p;
norm32=_getNorm32FromSurrogatePair(norm32, c2);
} else {
c2=0;
return 0;
}
c2=0;
return 0;
}
return (uint8_t)(norm32>>_NORM_CC_SHIFT);
}
return (uint8_t)(norm32>>_NORM_CC_SHIFT);
}
/*
@ -856,32 +835,19 @@ static inline uint32_t
_getPrevNorm32(const UChar *start, const UChar *&src,
uint32_t minC, uint32_t mask,
UChar &c, UChar &c2) {
uint32_t norm32;
c=*--src;
c2=0;
/* check for a surrogate before getting norm32 to see if we need to predecrement further */
if(c<minC) {
return 0;
} else if(!UTF_IS_SURROGATE(c)) {
} else if(!U_IS_SURROGATE(c)) {
return _getNorm32(c);
} else if(UTF_IS_SURROGATE_FIRST(c)) {
/* unpaired first surrogate */
return 0;
} else if(src!=start && UTF_IS_FIRST_SURROGATE(c2=*(src-1))) {
} else if(U16_IS_SURROGATE_TRAIL(c) && src!=start && U16_IS_LEAD(c2=*(src-1))) {
--src;
norm32=_getNorm32(c2);
if((norm32&mask)==0) {
/* all surrogate pairs with this lead surrogate have only irrelevant data */
return 0;
} else {
/* norm32 must be a surrogate special */
return _getNorm32FromSurrogatePair(norm32, c);
}
return _getNorm32FromSurrogatePair(c2, c);
} else {
/* unpaired second surrogate */
/* unpaired surrogate */
c2=0;
return 0;
}
@ -960,9 +926,7 @@ u_getCombiningClass(UChar32 c) {
UErrorCode errorCode=U_ZERO_ERROR;
if(_haveData(errorCode)) {
#endif
uint32_t norm32;
UTRIE_GET32(&normTrie, c, norm32);
uint32_t norm32=UTRIE2_GET32(&normTrie, c);
return (uint8_t)(norm32>>_NORM_CC_SHIFT);
#if !UNORM_HARDCODE_DATA
} else {
@ -979,9 +943,7 @@ unorm_internalIsFullCompositionExclusion(UChar32 c) {
UErrorCode errorCode=U_ZERO_ERROR;
if(_haveData(errorCode) && auxTrie.index!=NULL) {
#endif
uint16_t aux;
UTRIE_GET16(&auxTrie, c, aux);
uint16_t aux=UTRIE2_GET16(&auxTrie, c);
return (UBool)((aux&_NORM_AUX_COMP_EX_MASK)!=0);
} else {
return FALSE;
@ -996,9 +958,7 @@ unorm_isCanonSafeStart(UChar32 c) {
UErrorCode errorCode=U_ZERO_ERROR;
if(_haveData(errorCode) && auxTrie.index!=NULL) {
#endif
uint16_t aux;
UTRIE_GET16(&auxTrie, c, aux);
uint16_t aux=UTRIE2_GET16(&auxTrie, c);
return (UBool)((aux&_NORM_AUX_UNSAFE_MASK)==0);
} else {
return FALSE;
@ -1122,12 +1082,12 @@ u_getFC_NFKC_Closure(UChar32 c, UChar *dest, int32_t destCapacity, UErrorCode *p
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
return 0;
}
if(!_haveData(*pErrorCode) || auxTrie.index==NULL) {
return 0;
if(_haveData(*pErrorCode) && auxTrie.index!=NULL) {
aux=UTRIE2_GET16(&auxTrie, c);
aux&=_NORM_AUX_FNC_MASK;
} else {
aux=0;
}
UTRIE_GET16(&auxTrie, c, aux);
aux&=_NORM_AUX_FNC_MASK;
if(aux!=0) {
const UChar *s;
int32_t length;
@ -1153,7 +1113,7 @@ u_getFC_NFKC_Closure(UChar32 c, UChar *dest, int32_t destCapacity, UErrorCode *p
U_CAPI UBool U_EXPORT2
unorm_isNFSkippable(UChar32 c, UNormalizationMode mode) {
uint32_t norm32, mask;
uint16_t aux, fcd;
uint16_t aux;
#if !UNORM_HARDCODE_DATA
UErrorCode errorCode=U_ZERO_ERROR;
@ -1181,18 +1141,13 @@ unorm_isNFSkippable(UChar32 c, UNormalizationMode mode) {
break;
case UNORM_FCD:
/* FCD: skippable if lead cc==0 and trail cc<=1 */
if(fcdTrie.index!=NULL) {
UTRIE_GET16(&fcdTrie, c, fcd);
return fcd<=1;
} else {
return FALSE;
}
return fcdTrie.index!=NULL && UTRIE2_GET16(&fcdTrie, c)<=1;
default:
return FALSE;
}
/* check conditions (a)..(e), see unormimp.h */
UTRIE_GET32(&normTrie, c, norm32);
norm32=UTRIE2_GET32(&normTrie, c);
if((norm32&mask)!=0) {
return FALSE; /* fails (a)..(e), not skippable */
}
@ -1218,7 +1173,7 @@ unorm_isNFSkippable(UChar32 c, UNormalizationMode mode) {
return FALSE; /* no (f) data, say not skippable to be safe */
}
UTRIE_GET16(&auxTrie, c, aux);
aux=UTRIE2_GET16(&auxTrie, c);
return (aux&_NORM_AUX_NFC_SKIP_F_MASK)==0; /* TRUE=skippable if the (f) flag is not set */
/* } else { FCC, test fcd<=1 instead of the above } */
@ -1233,12 +1188,12 @@ unorm_addPropertyStarts(const USetAdder *sa, UErrorCode *pErrorCode) {
}
/* add the start code point of each same-value range of each trie */
utrie_enum(&normTrie, NULL, _enumPropertyStartsRange, sa);
utrie2_enum(&normTrie, NULL, _enumPropertyStartsRange, sa);
if(fcdTrie.index!=NULL) {
utrie_enum(&fcdTrie, NULL, _enumPropertyStartsRange, sa);
utrie2_enum(&fcdTrie, NULL, _enumPropertyStartsRange, sa);
}
if(auxTrie.index!=NULL) {
utrie_enum(&auxTrie, NULL, _enumPropertyStartsRange, sa);
utrie2_enum(&auxTrie, NULL, _enumPropertyStartsRange, sa);
}
/* add Hangul LV syllables and LV+1 because of skippables */
@ -1264,7 +1219,7 @@ unorm_getQuickCheck(UChar32 c, UNormalizationMode mode) {
}
#endif
UTRIE_GET32(&normTrie, c, norm32);
norm32=UTRIE2_GET32(&normTrie, c);
norm32&=qcMask[mode];
if(norm32==0) {
@ -1278,7 +1233,6 @@ unorm_getQuickCheck(UChar32 c, UNormalizationMode mode) {
U_CFUNC uint16_t U_EXPORT2
unorm_getFCD16FromCodePoint(UChar32 c) {
uint16_t fcd;
#if !UNORM_HARDCODE_DATA
UErrorCode errorCode;
errorCode=U_ZERO_ERROR;
@ -1292,9 +1246,7 @@ unorm_getFCD16FromCodePoint(UChar32 c) {
) {
return 0;
}
UTRIE_GET16(&fcdTrie, c, fcd);
return fcd;
return UTRIE2_GET16(&fcdTrie, c);
}
/* reorder UTF-16 in-place -------------------------------------------------- */
@ -1481,12 +1433,12 @@ _findNextStarter(const UChar *src, const UChar *limit,
break; /* true starter */
}
if(isNorm32LeadSurrogate(norm32)) {
if(U16_IS_LEAD(c)) {
/* c is a lead surrogate, get the real norm32 */
if((src+1)==limit || !UTF_IS_SECOND_SURROGATE(c2=*(src+1))) {
if((src+1)==limit || !U16_IS_TRAIL(c2=*(src+1))) {
break; /* unmatched first surrogate: counts as a true starter */
}
norm32=_getNorm32FromSurrogatePair(norm32, c2);
norm32=_getNorm32FromSurrogatePair(c, c2);
if((norm32&ccOrQCMask)==0) {
break; /* true starter */
@ -1548,7 +1500,7 @@ unorm_getDecomposition(UChar32 c, UBool compat,
}
/* data lookup */
UTRIE_GET32(&normTrie, c, norm32);
norm32=UTRIE2_GET32(&normTrie, c);
if((norm32&qcMask)==0) {
/* simple case: no decomposition */
if(c<=0xffff) {
@ -1725,7 +1677,7 @@ _decompose(UChar *dest, int32_t destCapacity,
if(src!=limit && UTF_IS_SECOND_SURROGATE(c2=*src)) {
++src;
length=2;
norm32=_getNorm32FromSurrogatePair(norm32, c2);
norm32=_getNorm32FromSurrogatePair(c, c2);
} else {
c2=0;
length=1;
@ -1857,7 +1809,7 @@ _getNextCombining(UChar *&p, const UChar *limit,
/* c is a lead surrogate, get the real norm32 */
if(p!=limit && UTF_IS_SECOND_SURROGATE(c2=*p)) {
++p;
norm32=_getNorm32FromSurrogatePair(norm32, c2);
norm32=_getNorm32FromSurrogatePair(c, c2);
} else {
c2=0;
return 0;
@ -1890,9 +1842,10 @@ static inline uint16_t
_getCombiningIndexFromStarter(UChar c, UChar c2) {
uint32_t norm32;
norm32=_getNorm32(c);
if(c2!=0) {
norm32=_getNorm32FromSurrogatePair(norm32, c2);
if(c2==0) {
norm32=_getNorm32(c);
} else {
norm32=_getNorm32FromSurrogatePair(c, c2);
}
return *(_getExtraData(norm32)-1);
}
@ -2462,7 +2415,7 @@ _compose(UChar *dest, int32_t destCapacity,
if(src!=limit && UTF_IS_SECOND_SURROGATE(c2=*src)) {
++src;
length=2;
norm32=_getNorm32FromSurrogatePair(norm32, c2);
norm32=_getNorm32FromSurrogatePair(c, c2);
} else {
/* c is an unpaired lead surrogate, nothing to do */
c2=0;
@ -2646,7 +2599,7 @@ _findSafeFCD(const UChar *src, const UChar *limit, uint16_t fcd16) {
++src;
} else if((src+1)!=limit && (c2=*(src+1), UTF_IS_SECOND_SURROGATE(c2))) {
/* c is a lead surrogate, get the real fcd16 */
fcd16=_getFCD16FromSurrogatePair(fcd16, c2);
fcd16=_getFCD16FromSurrogatePair(c, c2);
if(fcd16<=0xff) {
break;
}
@ -2700,7 +2653,7 @@ _decomposeFCD(const UChar *src, const UChar *decompLimit,
if(src!=decompLimit && UTF_IS_SECOND_SURROGATE(c2=*src)) {
++src;
length=2;
norm32=_getNorm32FromSurrogatePair(norm32, c2);
norm32=_getNorm32FromSurrogatePair(c, c2);
} else {
c2=0;
length=1;
@ -2896,7 +2849,7 @@ unorm_makeFCD(UChar *dest, int32_t destCapacity,
/* c is a lead surrogate, get the real fcd16 */
if(src!=limit && UTF_IS_SECOND_SURROGATE(c2=*src)) {
++src;
fcd16=_getFCD16FromSurrogatePair(fcd16, c2);
fcd16=_getFCD16FromSurrogatePair(c, c2);
} else {
c2=0;
fcd16=0;
@ -3021,7 +2974,7 @@ unorm_checkFCD(const UChar *src, int32_t srcLength, const UnicodeSet *nx) {
/* c is a lead surrogate, get the real fcd16 */
if(src!=limit && UTF_IS_SECOND_SURROGATE(c2=*src)) {
++src;
fcd16=_getFCD16FromSurrogatePair(fcd16, c2);
fcd16=_getFCD16FromSurrogatePair(c, c2);
} else {
c2=0;
fcd16=0;
@ -3173,11 +3126,11 @@ _quickCheck(const UChar *src,
}
/* check one above-minimum, relevant code unit */
if(isNorm32LeadSurrogate(norm32)) {
if(U16_IS_LEAD(c)) {
/* c is a lead surrogate, get the real norm32 */
if(src!=limit && UTF_IS_SECOND_SURROGATE(c2=*src)) {
if(src!=limit && U16_IS_TRAIL(c2=*src)) {
++src;
norm32=_getNorm32FromSurrogatePair(norm32, c2);
norm32=_getNorm32FromSurrogatePair(c, c2);
} else {
c2=0;
norm32=0;
@ -3479,7 +3432,7 @@ _getPrevNorm32(UCharIterator &src, uint32_t minC, uint32_t mask, UChar &c, UChar
return 0;
} else {
/* norm32 must be a surrogate special */
return _getNorm32FromSurrogatePair(norm32, c);
return _getNorm32FromSurrogatePair(c2, c);
}
} else {
/* unpaired second surrogate, undo the c2=src.previous() movement */
@ -3721,7 +3674,7 @@ _getNextNorm32(UCharIterator &src, uint32_t minC, uint32_t mask, UChar &c, UChar
return 0;
} else {
/* norm32 must be a surrogate special */
return _getNorm32FromSurrogatePair(norm32, c2);
return _getNorm32FromSurrogatePair(c, c2);
}
} else {
/* unmatched surrogate */

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/*
*******************************************************************************
*
* Copyright (C) 2001-2007, International Business Machines
* Copyright (C) 2001-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@ -28,7 +28,7 @@
#include "unicode/uiter.h"
#include "unicode/unorm.h"
#include "unicode/uset.h"
#include "utrie.h"
#include "utrie2.h"
#include "ustr_imp.h"
#include "udataswp.h"
@ -313,18 +313,19 @@ unorm_internalQuickCheck(const UChar *src,
U_CFUNC uint16_t U_EXPORT2
unorm_getFCD16FromCodePoint(UChar32 c);
#ifdef XP_CPLUSPLUS
/**
* Internal API, used by collation code.
* Get access to the internal FCD trie table to be able to perform
* incremental, per-code unit, FCD checks in collation.
* One pointer is sufficient because the trie index values are offset
* by the index size, so that the same pointer is used to access the trie data.
* Code points at fcdHighStart and above have a zero FCD value.
* @internal
*/
U_CAPI const uint16_t * U_EXPORT2
unorm_getFCDTrie(UErrorCode *pErrorCode);
#ifdef XP_CPLUSPLUS
unorm_getFCDTrieIndex(UChar32 &fcdHighStart, UErrorCode *pErrorCode);
/**
* Internal API, used by collation code.
@ -333,45 +334,76 @@ unorm_getFCDTrie(UErrorCode *pErrorCode);
* bits 7..0 trail combining class
*
* If c is a lead surrogate and the value is not 0,
* then instead of combining classes the value
* is used in unorm_getFCD16FromSurrogatePair() to get the real value
* of the supplementary code point.
* then some of c's associated supplementary code points have a non-zero FCD value.
*
* @internal
*/
static inline uint16_t
unorm_getFCD16(const uint16_t *fcdTrieIndex, UChar c) {
return
fcdTrieIndex[
(fcdTrieIndex[
c>>UTRIE_SHIFT
]<<UTRIE_INDEX_SHIFT)+
(c&UTRIE_MASK)
];
return fcdTrieIndex[_UTRIE2_INDEX_FROM_U16_SINGLE_LEAD(fcdTrieIndex, c)];
}
/**
* Internal API, used by collation code.
* Get the FCD value for a supplementary code point, with
* Get the FCD value of the next code point (post-increment), with
* bits 15..8 lead combining class
* bits 7..0 trail combining class
*
* @param fcd16 The FCD value for the lead surrogate, not 0.
* @param c2 The trail surrogate code unit.
*
* @internal
*/
static inline uint16_t
unorm_getFCD16FromSurrogatePair(const uint16_t *fcdTrieIndex, uint16_t fcd16, UChar c2) {
return
fcdTrieIndex[
(fcdTrieIndex[
(int32_t)fcd16+((c2&0x3ff)>>UTRIE_SHIFT)
]<<UTRIE_INDEX_SHIFT)+
(c2&UTRIE_MASK)
];
unorm_nextFCD16(const uint16_t *fcdTrieIndex, UChar32 fcdHighStart,
const UChar *&s, const UChar *limit) {
UChar32 c=*s++;
uint16_t fcd=fcdTrieIndex[_UTRIE2_INDEX_FROM_U16_SINGLE_LEAD(fcdTrieIndex, c)];
if(fcd!=0 && U16_IS_LEAD(c)) {
UChar c2;
if(s!=limit && U16_IS_TRAIL(c2=*s)) {
++s;
c=U16_GET_SUPPLEMENTARY(c, c2);
if(c<fcdHighStart) {
fcd=fcdTrieIndex[_UTRIE2_INDEX_FROM_SUPP(fcdTrieIndex, c)];
} else {
fcd=0;
}
} else /* unpaired lead surrogate */ {
fcd=0;
}
}
return fcd;
}
/**
* Internal API, used by collation code.
* Get the FCD value of the previous code point (pre-decrement), with
* bits 15..8 lead combining class
* bits 7..0 trail combining class
*
* @internal
*/
static inline uint16_t
unorm_prevFCD16(const uint16_t *fcdTrieIndex, UChar32 fcdHighStart,
const UChar *start, const UChar *&s) {
UChar32 c=*--s;
uint16_t fcd;
if(!U16_IS_SURROGATE(c)) {
fcd=fcdTrieIndex[_UTRIE2_INDEX_FROM_U16_SINGLE_LEAD(fcdTrieIndex, c)];
} else {
UChar c2;
if(U16_IS_SURROGATE_TRAIL(c) && s!=start && U16_IS_LEAD(c2=*(s-1))) {
--s;
c=U16_GET_SUPPLEMENTARY(c2, c);
if(c<fcdHighStart) {
fcd=fcdTrieIndex[_UTRIE2_INDEX_FROM_SUPP(fcdTrieIndex, c)];
} else {
fcd=0;
}
} else /* unpaired surrogate */ {
fcd=0;
}
}
return fcd;
}
#endif

View File

@ -406,6 +406,9 @@ utrie_fold(UNewTrie *trie, UNewTrieGetFoldedValue *getFoldedValue, UErrorCode *p
uint32_t value;
UChar32 c;
int32_t indexLength, block;
#ifdef UTRIE_DEBUG
int countLeadCUWithData=0;
#endif
index=trie->index;
@ -455,7 +458,8 @@ utrie_fold(UNewTrie *trie, UNewTrieGetFoldedValue *getFoldedValue, UErrorCode *p
c&=~0x3ff;
#ifdef UTRIE_DEBUG
printf("supplementary data for lead surrogate U+%04lx\n", (long)(0xd7c0+(c>>10)));
++countLeadCUWithData;
/* printf("supplementary data for lead surrogate U+%04lx\n", (long)(0xd7c0+(c>>10))); */
#endif
/* is there an identical index block? */
@ -488,6 +492,11 @@ utrie_fold(UNewTrie *trie, UNewTrieGetFoldedValue *getFoldedValue, UErrorCode *p
c+=UTRIE_DATA_BLOCK_LENGTH;
}
}
#ifdef UTRIE_DEBUG
if(countLeadCUWithData>0) {
printf("supplementary data for %d lead surrogates\n", countLeadCUWithData);
}
#endif
/*
* index array overflow?
@ -785,6 +794,11 @@ utrie_serialize(UNewTrie *trie, void *dt, int32_t capacity,
return length; /* preflighting */
}
#ifdef UTRIE_DEBUG
printf("**UTrieLengths(serialize)** index:%6ld data:%6ld serialized:%6ld\n",
(long)trie->indexLength, (long)trie->dataLength, (long)length);
#endif
/* set the header fields */
header=(UTrieHeader *)data;
data+=sizeof(UTrieHeader);

View File

@ -1,7 +1,7 @@
/*
******************************************************************************
*
* Copyright (C) 2001-2006, International Business Machines
* Copyright (C) 2001-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@ -168,7 +168,9 @@ struct UTrie {
UBool isLatin1Linear;
};
#ifndef __UTRIE2_H__
typedef struct UTrie UTrie;
#endif
/** Internal trie getter from an offset (0 if c16 is a BMP/lead units) and a 16-bit unit */
#define _UTRIE_GET_RAW(trie, data, offset, c16) \

View File

@ -0,0 +1,698 @@
/*
******************************************************************************
*
* Copyright (C) 2001-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
* file name: utrie2.c
* encoding: US-ASCII
* tab size: 8 (not used)
* indentation:4
*
* created on: 2008aug16 (starting from a copy of utrie.c)
* created by: Markus W. Scherer
*
* This is a common implementation of a Unicode trie.
* It is a kind of compressed, serializable table of 16- or 32-bit values associated with
* Unicode code points (0..0x10ffff).
* This is the second common version of a Unicode trie (hence the name UTrie2).
* See utrie2.h for a comparison.
*
* This file contains only the runtime and enumeration code, for read-only access.
* See utrie2_builder.c for the builder code.
*/
#ifdef UTRIE2_DEBUG
# include <stdio.h>
#endif
#include "unicode/utypes.h"
#include "cmemory.h"
#include "utrie2.h"
#include "utrie2_impl.h"
/* Public UTrie2 API implementation ----------------------------------------- */
static uint32_t
get32(const UNewTrie2 *trie, UChar32 c, UBool fromLSCP) {
int32_t i2, block;
if(c>=trie->highStart && (!U_IS_LEAD(c) || fromLSCP)) {
return trie->data[trie->dataLength-UTRIE2_DATA_GRANULARITY];
}
if(U_IS_LEAD(c) && fromLSCP) {
i2=(UTRIE2_LSCP_INDEX_2_OFFSET-(0xd800>>UTRIE2_SHIFT_2))+
(c>>UTRIE2_SHIFT_2);
} else {
i2=trie->index1[c>>UTRIE2_SHIFT_1]+
((c>>UTRIE2_SHIFT_2)&UTRIE2_INDEX_2_MASK);
}
block=trie->index2[i2];
return trie->data[block+(c&UTRIE2_DATA_MASK)];
}
U_CAPI uint32_t U_EXPORT2
utrie2_get32(const UTrie2 *trie, UChar32 c) {
if(trie->data16!=NULL) {
return UTRIE2_GET16(trie, c);
} else if(trie->data32!=NULL) {
return UTRIE2_GET32(trie, c);
} else if((uint32_t)c>0x10ffff) {
return trie->errorValue;
} else {
return get32(trie->newTrie, c, TRUE);
}
}
U_CAPI uint32_t U_EXPORT2
utrie2_get32FromLeadSurrogateCodeUnit(const UTrie2 *trie, UChar32 c) {
if(!U_IS_LEAD(c)) {
return trie->errorValue;
}
if(trie->data16!=NULL) {
return UTRIE2_GET16_FROM_U16_SINGLE_LEAD(trie, c);
} else if(trie->data32!=NULL) {
return UTRIE2_GET32_FROM_U16_SINGLE_LEAD(trie, c);
} else {
return get32(trie->newTrie, c, FALSE);
}
}
static U_INLINE int32_t
u8Index(const UTrie2 *trie, UChar32 c, int32_t i) {
int32_t index=
_UTRIE2_INDEX_FROM_CP(
trie,
trie->data32==NULL ? trie->indexLength : 0,
c);
return (index<<3)|i;
}
U_CAPI int32_t U_EXPORT2
utrie2_internalU8NextIndex(const UTrie2 *trie, UChar32 c,
const uint8_t *src, const uint8_t *limit) {
int32_t i, length;
i=0;
/* support 64-bit pointers by avoiding cast of arbitrary difference */
if((limit-src)<=7) {
length=(int32_t)(limit-src);
} else {
length=7;
}
c=utf8_nextCharSafeBody(src, &i, length, c, -1);
return u8Index(trie, c, i);
}
U_CAPI int32_t U_EXPORT2
utrie2_internalU8PrevIndex(const UTrie2 *trie, UChar32 c,
const uint8_t *start, const uint8_t *src) {
int32_t i, length;
/* support 64-bit pointers by avoiding cast of arbitrary difference */
if((src-start)<=7) {
i=length=(int32_t)(src-start);
} else {
i=length=7;
start=src-7;
}
c=utf8_prevCharSafeBody(start, 0, &i, c, -1);
i=length-i; /* number of bytes read backward from src */
return u8Index(trie, c, i);
}
U_CAPI UTrie2 * U_EXPORT2
utrie2_openFromSerialized(UTrie2ValueBits valueBits,
const void *data, int32_t length, int32_t *pActualLength,
UErrorCode *pErrorCode) {
const UTrie2Header *header;
const uint16_t *p16;
int32_t actualLength;
UTrie2 tempTrie={ NULL };
UTrie2 *trie;
if(U_FAILURE(*pErrorCode)) {
return 0;
}
if( length<=0 || (((int32_t)data&3)!=0) ||
valueBits<0 || UTRIE2_COUNT_VALUE_BITS<=valueBits
) {
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
return 0;
}
/* enough data for a trie header? */
if(length<sizeof(UTrie2Header)) {
*pErrorCode=U_INVALID_FORMAT_ERROR;
return 0;
}
/* check the signature */
header=(const UTrie2Header *)data;
if(header->signature!=UTRIE2_SIG) {
*pErrorCode=U_INVALID_FORMAT_ERROR;
return 0;
}
/* get the options */
if(valueBits!=(UTrie2ValueBits)(header->options&UTRIE2_OPTIONS_VALUE_BITS_MASK)) {
*pErrorCode=U_INVALID_FORMAT_ERROR;
return 0;
}
/* get the length values and offsets */
tempTrie.indexLength=header->indexLength;
tempTrie.dataLength=header->shiftedDataLength<<UTRIE2_INDEX_SHIFT;
tempTrie.index2NullOffset=header->index2NullOffset;
tempTrie.dataNullOffset=header->dataNullOffset;
tempTrie.highStart=header->shiftedHighStart<<UTRIE2_SHIFT_1;
tempTrie.highValueIndex=tempTrie.dataLength-UTRIE2_DATA_GRANULARITY;
if(valueBits==UTRIE2_16_VALUE_BITS) {
tempTrie.highValueIndex+=tempTrie.indexLength;
}
/* calculate the actual length */
actualLength=(int32_t)sizeof(UTrie2Header)+tempTrie.indexLength*2;
if(valueBits==UTRIE2_16_VALUE_BITS) {
actualLength+=tempTrie.dataLength*2;
} else {
actualLength+=tempTrie.dataLength*4;
}
if(length<actualLength) {
*pErrorCode=U_INVALID_FORMAT_ERROR; /* not enough bytes */
return 0;
}
/* allocate the trie */
trie=(UTrie2 *)uprv_malloc(sizeof(UTrie2));
if(trie==NULL) {
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
return 0;
}
uprv_memcpy(trie, &tempTrie, sizeof(tempTrie));
trie->memory=(uint32_t *)data;
trie->length=actualLength;
trie->isMemoryOwned=FALSE;
/* set the pointers to its index and data arrays */
p16=(const uint16_t *)(header+1);
trie->index=p16;
p16+=trie->indexLength;
/* get the data */
switch(valueBits) {
case UTRIE2_16_VALUE_BITS:
trie->data16=p16;
trie->data32=NULL;
trie->initialValue=trie->index[trie->dataNullOffset];
trie->errorValue=trie->data16[UTRIE2_BAD_UTF8_DATA_OFFSET];
break;
case UTRIE2_32_VALUE_BITS:
trie->data16=NULL;
trie->data32=(const uint32_t *)p16;
trie->initialValue=trie->data32[trie->dataNullOffset];
trie->errorValue=trie->data32[UTRIE2_BAD_UTF8_DATA_OFFSET];
break;
default:
*pErrorCode=U_INVALID_FORMAT_ERROR;
return 0;
}
if(pActualLength!=NULL) {
*pActualLength=actualLength;
}
return trie;
}
U_CAPI UTrie2 * U_EXPORT2
utrie2_openDummy(UTrie2ValueBits valueBits,
uint32_t initialValue, uint32_t errorValue,
UErrorCode *pErrorCode) {
UTrie2 *trie;
UTrie2Header *header;
uint32_t *p;
uint16_t *dest16;
int32_t indexLength, dataLength, length, i;
int32_t dataMove; /* >0 if the data is moved to the end of the index array */
if(U_FAILURE(*pErrorCode)) {
return 0;
}
if(valueBits<0 || UTRIE2_COUNT_VALUE_BITS<=valueBits) {
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
return 0;
}
/* calculate the total length of the dummy trie data */
indexLength=UTRIE2_INDEX_1_OFFSET;
dataLength=UTRIE2_DATA_START_OFFSET+UTRIE2_DATA_GRANULARITY;
length=(int32_t)sizeof(UTrie2Header)+indexLength*2;
if(valueBits==UTRIE2_16_VALUE_BITS) {
length+=dataLength*2;
} else {
length+=dataLength*4;
}
/* allocate the trie */
trie=(UTrie2 *)uprv_malloc(sizeof(UTrie2));
if(trie==NULL) {
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
return 0;
}
uprv_memset(trie, 0, sizeof(UTrie2));
trie->memory=uprv_malloc(length);
if(trie->memory==NULL) {
uprv_free(trie);
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
return 0;
}
trie->length=length;
trie->isMemoryOwned=TRUE;
/* set the UTrie2 fields */
if(valueBits==UTRIE2_16_VALUE_BITS) {
dataMove=indexLength;
} else {
dataMove=0;
}
trie->indexLength=indexLength;
trie->dataLength=dataLength;
trie->index2NullOffset=UTRIE2_INDEX_2_OFFSET;
trie->dataNullOffset=(uint16_t)dataMove;
trie->initialValue=initialValue;
trie->errorValue=errorValue;
trie->highStart=0;
trie->highValueIndex=dataMove+UTRIE2_DATA_START_OFFSET;
/* set the header fields */
header=(UTrie2Header *)trie->memory;
header->signature=UTRIE2_SIG; /* "Tri2" */
header->options=(uint16_t)valueBits;
header->indexLength=(uint16_t)indexLength;
header->shiftedDataLength=(uint16_t)(dataLength>>UTRIE2_INDEX_SHIFT);
header->index2NullOffset=(uint16_t)UTRIE2_INDEX_2_OFFSET;
header->dataNullOffset=(uint16_t)dataMove;
header->shiftedHighStart=0;
/* fill the index and data arrays */
dest16=(uint16_t *)(header+1);
trie->index=dest16;
/* write the index-2 array values shifted right by UTRIE2_INDEX_SHIFT */
for(i=0; i<UTRIE2_INDEX_2_BMP_LENGTH; ++i) {
*dest16++=(uint16_t)(dataMove>>UTRIE2_INDEX_SHIFT); /* null data block */
}
/* write UTF-8 2-byte index-2 values, not right-shifted */
for(i=0; i<(0xc2-0xc0); ++i) { /* C0..C1 */
*dest16++=(uint16_t)(dataMove+UTRIE2_BAD_UTF8_DATA_OFFSET);
}
for(; i<(0xe0-0xc0); ++i) { /* C2..DF */
*dest16++=(uint16_t)dataMove;
}
/* write the 16/32-bit data array */
switch(valueBits) {
case UTRIE2_16_VALUE_BITS:
/* write 16-bit data values */
trie->data16=dest16;
trie->data32=NULL;
for(i=0; i<0x80; ++i) {
*dest16++=(uint16_t)initialValue;
}
for(; i<0xc0; ++i) {
*dest16++=(uint16_t)errorValue;
}
/* highValue and reserved values */
for(i=0; i<UTRIE2_DATA_GRANULARITY; ++i) {
*dest16++=(uint16_t)initialValue;
}
break;
case UTRIE2_32_VALUE_BITS:
/* write 32-bit data values */
p=(uint32_t *)dest16;
trie->data16=NULL;
trie->data32=p;
for(i=0; i<0x80; ++i) {
*p++=initialValue;
}
for(; i<0xc0; ++i) {
*p++=errorValue;
}
/* highValue and reserved values */
for(i=0; i<UTRIE2_DATA_GRANULARITY; ++i) {
*p++=initialValue;
}
break;
default:
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
return 0;
}
return trie;
}
U_CAPI void U_EXPORT2
utrie2_close(UTrie2 *trie) {
if(trie!=NULL) {
if(trie->isMemoryOwned) {
uprv_free(trie->memory);
}
if(trie->newTrie!=NULL) {
uprv_free(trie->newTrie->data);
uprv_free(trie->newTrie);
}
uprv_free(trie);
}
}
U_CAPI int32_t U_EXPORT2
utrie2_getVersion(const void *data, int32_t length, UBool anyEndianOk) {
uint32_t signature;
if(length<16 || data==NULL || (((int32_t)data&3)!=0)) {
return 0;
}
signature=*(const uint32_t *)data;
if(signature==UTRIE2_SIG) {
return 2;
}
if(anyEndianOk && signature==UTRIE2_OE_SIG) {
return 2;
}
if(signature==UTRIE_SIG) {
return 1;
}
if(anyEndianOk && signature==UTRIE_OE_SIG) {
return 1;
}
return 0;
}
U_CAPI int32_t U_EXPORT2
utrie2_swap(const UDataSwapper *ds,
const void *inData, int32_t length, void *outData,
UErrorCode *pErrorCode) {
const UTrie2Header *inTrie;
UTrie2Header trie;
int32_t dataLength, size;
UTrie2ValueBits valueBits;
if(U_FAILURE(*pErrorCode)) {
return 0;
}
if(ds==NULL || inData==NULL || (length>=0 && outData==NULL)) {
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
return 0;
}
/* setup and swapping */
if(length>=0 && length<sizeof(UTrie2Header)) {
*pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR;
return 0;
}
inTrie=(const UTrie2Header *)inData;
trie.signature=ds->readUInt32(inTrie->signature);
trie.options=ds->readUInt16(inTrie->options);
trie.indexLength=ds->readUInt16(inTrie->indexLength);
trie.shiftedDataLength=ds->readUInt16(inTrie->shiftedDataLength);
valueBits=trie.options&UTRIE2_OPTIONS_VALUE_BITS_MASK;
dataLength=(int32_t)trie.shiftedDataLength<<UTRIE2_INDEX_SHIFT;
if( trie.signature!=UTRIE2_SIG ||
valueBits<0 || UTRIE2_COUNT_VALUE_BITS<=valueBits ||
trie.indexLength<UTRIE2_INDEX_1_OFFSET ||
dataLength<UTRIE2_DATA_START_OFFSET
) {
*pErrorCode=U_INVALID_FORMAT_ERROR; /* not a UTrie */
return 0;
}
size=sizeof(UTrie2Header)+trie.indexLength*2;
switch(valueBits) {
case UTRIE2_16_VALUE_BITS:
size+=dataLength*2;
break;
case UTRIE2_32_VALUE_BITS:
size+=dataLength*4;
break;
default:
*pErrorCode=U_INVALID_FORMAT_ERROR;
return 0;
}
if(length>=0) {
UTrie2Header *outTrie;
if(length<size) {
*pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR;
return 0;
}
outTrie=(UTrie2Header *)outData;
/* swap the header */
ds->swapArray32(ds, &inTrie->signature, 4, &outTrie->signature, pErrorCode);
ds->swapArray16(ds, &inTrie->options, 12, &outTrie->options, pErrorCode);
/* swap the index and the data */
switch(valueBits) {
case UTRIE2_16_VALUE_BITS:
ds->swapArray16(ds, inTrie+1, (trie.indexLength+dataLength)*2, outTrie+1, pErrorCode);
break;
case UTRIE2_32_VALUE_BITS:
ds->swapArray16(ds, inTrie+1, trie.indexLength*2, outTrie+1, pErrorCode);
ds->swapArray32(ds, (const uint16_t *)(inTrie+1)+trie.indexLength, dataLength*4,
(uint16_t *)(outTrie+1)+trie.indexLength, pErrorCode);
break;
default:
*pErrorCode=U_INVALID_FORMAT_ERROR;
return 0;
}
}
return size;
}
/* enumeration -------------------------------------------------------------- */
#define MIN(a, b) ((a)<(b) ? (a) : (b))
/* default UTrie2EnumValue() returns the input value itself */
static uint32_t U_CALLCONV
enumSameValue(const void *context, uint32_t value) {
return value;
}
/**
* Enumerate all ranges of code points with the same relevant values.
* The values are transformed from the raw trie entries by the enumValue function.
*
* Currently requires start<limit and both start and limit must be multiples
* of UTRIE2_DATA_BLOCK_LENGTH.
*
* Optimizations:
* - Skip a whole block if we know that it is filled with a single value,
* and it is the same as we visited just before.
* - Handle the null block specially because we know a priori that it is filled
* with a single value.
*/
static void
enumEitherTrie(const UTrie2 *trie,
UChar32 start, UChar32 limit,
UTrie2EnumValue *enumValue, UTrie2EnumRange *enumRange, const void *context) {
const uint32_t *data32;
const uint16_t *index;
uint32_t value, prevValue, initialValue;
UChar32 c, prev, highStart;
int32_t j, i2Block, prevI2Block, index2NullOffset, block, prevBlock, nullBlock;
if(enumRange==NULL) {
return;
}
if(enumValue==NULL) {
enumValue=enumSameValue;
}
if(trie->newTrie==NULL) {
/* frozen trie */
index=trie->index;
data32=trie->data32;
index2NullOffset=trie->index2NullOffset;
nullBlock=trie->dataNullOffset;
} else {
/* unfrozen, mutable trie */
index=NULL;
data32=trie->newTrie->data;
index2NullOffset=trie->newTrie->index2NullOffset;
nullBlock=trie->newTrie->dataNullOffset;
}
highStart=trie->highStart;
/* get the enumeration value that corresponds to an initial-value trie data entry */
initialValue=enumValue(context, trie->initialValue);
/* set variables for previous range */
prevI2Block=-1;
prevBlock=-1;
prev=start;
prevValue=0;
/* enumerate index-2 blocks */
for(c=start; c<limit && c<highStart;) {
/* Code point limit for iterating inside this i2Block. */
UChar32 tempLimit=c+UTRIE2_CP_PER_INDEX_1_ENTRY;
if(limit<tempLimit) {
tempLimit=limit;
}
if(c<=0xffff) {
if(!U_IS_SURROGATE(c)) {
i2Block=c>>UTRIE2_SHIFT_2;
} else if(U_IS_SURROGATE_LEAD(c)) {
/*
* Enumerate values for lead surrogate code points, not code units:
* This special block has half the normal length.
*/
i2Block=UTRIE2_LSCP_INDEX_2_OFFSET;
tempLimit=MIN(0xdc00, limit);
} else {
/*
* Switch back to the normal part of the index-2 table.
* Enumerate the second half of the surrogates block.
*/
i2Block=0xd800>>UTRIE2_SHIFT_2;
tempLimit=MIN(0xe000, limit);
}
} else {
/* supplementary code points */
if(index!=NULL) {
i2Block=index[(UTRIE2_INDEX_1_OFFSET-UTRIE2_OMITTED_BMP_INDEX_1_LENGTH)+
(c>>UTRIE2_SHIFT_1)];
} else {
i2Block=trie->newTrie->index1[c>>UTRIE2_SHIFT_1];
}
if(i2Block==prevI2Block && (c-prev)>=UTRIE2_CP_PER_INDEX_1_ENTRY) {
/*
* The index-2 block is the same as the previous one, and filled with prevValue.
* Only possible for supplementary code points because the linear-BMP index-2
* table creates unique i2Block values.
*/
c+=UTRIE2_CP_PER_INDEX_1_ENTRY;
continue;
}
}
prevI2Block=i2Block;
if(i2Block==index2NullOffset) {
/* this is the null index-2 block */
if(prevValue!=initialValue) {
if(prev<c && !enumRange(context, prev, c-1, prevValue)) {
return;
}
prevBlock=nullBlock;
prev=c;
prevValue=initialValue;
}
c+=UTRIE2_CP_PER_INDEX_1_ENTRY;
} else {
/* enumerate data blocks for one index-2 block */
int32_t i2, i2Limit;
i2=(c>>UTRIE2_SHIFT_2)&UTRIE2_INDEX_2_MASK;
if((c>>UTRIE2_SHIFT_1)==(tempLimit>>UTRIE2_SHIFT_1)) {
i2Limit=(tempLimit>>UTRIE2_SHIFT_2)&UTRIE2_INDEX_2_MASK;
} else {
i2Limit=UTRIE2_INDEX_2_BLOCK_LENGTH;
}
for(; i2<i2Limit; ++i2) {
if(index!=NULL) {
block=(int32_t)index[i2Block+i2]<<UTRIE2_INDEX_SHIFT;
} else {
block=trie->newTrie->index2[i2Block+i2];
}
if(block==prevBlock && (c-prev)>=UTRIE2_DATA_BLOCK_LENGTH) {
/* the block is the same as the previous one, and filled with prevValue */
c+=UTRIE2_DATA_BLOCK_LENGTH;
continue;
}
prevBlock=block;
if(block==nullBlock) {
/* this is the null data block */
if(prevValue!=initialValue) {
if(prev<c && !enumRange(context, prev, c-1, prevValue)) {
return;
}
prev=c;
prevValue=initialValue;
}
c+=UTRIE2_DATA_BLOCK_LENGTH;
} else {
for(j=0; j<UTRIE2_DATA_BLOCK_LENGTH; ++j) {
value=enumValue(context, data32!=NULL ? data32[block+j] : index[block+j]);
if(value!=prevValue) {
if(prev<c && !enumRange(context, prev, c-1, prevValue)) {
return;
}
prev=c;
prevValue=value;
}
++c;
}
}
}
}
}
if(c>limit) {
c=limit; /* could be higher if in the index2NullOffset */
} else if(c<limit) {
/* c==highStart<limit */
uint32_t highValue;
if(index!=NULL) {
highValue=
data32!=NULL ?
data32[trie->highValueIndex] :
index[trie->highValueIndex];
} else {
highValue=trie->newTrie->data[trie->newTrie->dataLength-UTRIE2_DATA_GRANULARITY];
}
value=enumValue(context, highValue);
if(value!=prevValue) {
if(prev<c && !enumRange(context, prev, c-1, prevValue)) {
return;
}
prev=c;
prevValue=value;
}
c=limit;
}
/* deliver last range */
enumRange(context, prev, c-1, prevValue);
}
U_CAPI void U_EXPORT2
utrie2_enum(const UTrie2 *trie,
UTrie2EnumValue *enumValue, UTrie2EnumRange *enumRange, const void *context) {
enumEitherTrie(trie, 0, 0x110000, enumValue, enumRange, context);
}
U_CAPI void U_EXPORT2
utrie2_enumForLeadSurrogate(const UTrie2 *trie, UChar32 lead,
UTrie2EnumValue *enumValue, UTrie2EnumRange *enumRange,
const void *context) {
if(!U16_IS_LEAD(lead)) {
return;
}
lead=(lead-0xd7c0)<<10; /* start code point */
enumEitherTrie(trie, lead, lead+0x400, enumValue, enumRange, context);
}

View File

@ -0,0 +1,921 @@
/*
******************************************************************************
*
* Copyright (C) 2001-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
* file name: utrie2.h
* encoding: US-ASCII
* tab size: 8 (not used)
* indentation:4
*
* created on: 2008aug16 (starting from a copy of utrie.h)
* created by: Markus W. Scherer
*/
#ifndef __UTRIE2_H__
#define __UTRIE2_H__
#include "unicode/utypes.h"
#include "udataswp.h"
U_CDECL_BEGIN
struct UTrie; /* forward declaration */
#ifndef __UTRIE_H__
typedef struct UTrie UTrie;
#endif
/**
* \file
*
* This is a common implementation of a Unicode trie.
* It is a kind of compressed, serializable table of 16- or 32-bit values associated with
* Unicode code points (0..0x10ffff). (A map from code points to integers.)
*
* This is the second common version of a Unicode trie (hence the name UTrie2).
* Compared with UTrie version 1:
* - Still splitting BMP code points 11:5 bits for index and data table lookups.
* - Still separate data for lead surrogate code _units_ vs. code _points_,
* but the lead surrogate code unit values are not required any more
* for data lookup for supplementary code points.
* - The "folding" mechanism is removed. In UTrie version 1, this somewhat
* hard-to-explain mechanism was meant to be used for optimized UTF-16
* processing, with application-specific encoding of indexing bits
* in the lead surrogate data for the associated supplementary code points.
* - For the last single-value code point range (ending with U+10ffff),
* the starting code point ("highStart") and the value are stored.
* - For supplementary code points U+10000..highStart-1 a three-table lookup
* (two index tables and one data table) is used. The first index
* is truncated, omitting both the BMP portion and the high range.
* - There is a special small index for 2-byte UTF-8, and the initial data
* entries are designed for fast 1/2-byte UTF-8 lookup.
*/
/**
* Trie structure.
* Use only with public API macros and functions.
*/
struct UTrie2;
typedef struct UTrie2 UTrie2;
/* Public UTrie2 API functions: read-only access ---------------------------- */
/**
* Selectors for the width of a UTrie2 data value.
*/
enum UTrie2ValueBits {
/** 16 bits per UTrie2 data value. */
UTRIE2_16_VALUE_BITS,
/** 32 bits per UTrie2 data value. */
UTRIE2_32_VALUE_BITS,
/** Number of selectors for the width of UTrie2 data values. */
UTRIE2_COUNT_VALUE_BITS
};
typedef enum UTrie2ValueBits UTrie2ValueBits;
/**
* Open a frozen trie from its serialized from, stored in 32-bit-aligned memory.
* Inverse of utrie2_serialize().
* The memory must remain valid and unchanged as long as the trie is used.
* You must utrie2_close() the trie once you are done using it.
*
* @param valueBits selects the data entry size; results in an
* U_INVALID_FORMAT_ERROR if it does not match the serialized form
* @param data a pointer to 32-bit-aligned memory containing the serialized form of a UTrie2
* @param length the number of bytes available at data;
* can be more than necessary
* @param pActualLength receives the actual number of bytes at data taken up by the trie data;
* can be NULL
* @param pErrorCode an in/out ICU UErrorCode
* @return the unserialized trie
*
* @see utrie2_open
* @see utrie2_serialize
*/
U_CAPI UTrie2 * U_EXPORT2
utrie2_openFromSerialized(UTrie2ValueBits valueBits,
const void *data, int32_t length, int32_t *pActualLength,
UErrorCode *pErrorCode);
/**
* Open a frozen, empty "dummy" trie.
* A dummy trie is an empty trie, used when a real data trie cannot
* be loaded. Equivalent to calling utrie2_open() and utrie2_freeze(),
* but without internally creating and compacting/serializing the
* builder data structure.
*
* The trie always returns the initialValue,
* or the errorValue for out-of-range code points and illegal UTF-8.
*
* You must utrie2_close() the trie once you are done using it.
*
* @param valueBits selects the data entry size
* @param initialValue the initial value that is set for all code points
* @param errorValue the value for out-of-range code points and illegal UTF-8
* @param pErrorCode an in/out ICU UErrorCode
* @return the dummy trie
*
* @see utrie2_openFromSerialized
* @see utrie2_open
*/
U_CAPI UTrie2 * U_EXPORT2
utrie2_openDummy(UTrie2ValueBits valueBits,
uint32_t initialValue, uint32_t errorValue,
UErrorCode *pErrorCode);
/**
* Get a value from a code point as stored in the trie.
* Easier to use than UTRIE2_GET16() and UTRIE2_GET32() but slower.
* Easier to use because, unlike the macros, this function works on all UTrie2
* objects, frozen or not, holding 16-bit or 32-bit data values.
*
* @param trie the trie
* @param c the code point
* @return the value
*/
U_CAPI uint32_t U_EXPORT2
utrie2_get32(const UTrie2 *trie, UChar32 c);
/* enumeration callback types */
/**
* Callback from utrie2_enum(), extracts a uint32_t value from a
* trie value. This value will be passed on to the UTrie2EnumRange function.
*
* @param context an opaque pointer, as passed into utrie2_enum()
* @param value a value from the trie
* @return the value that is to be passed on to the UTrie2EnumRange function
*/
typedef uint32_t U_CALLCONV
UTrie2EnumValue(const void *context, uint32_t value);
/**
* Callback from utrie2_enum(), is called for each contiguous range
* of code points with the same value as retrieved from the trie and
* transformed by the UTrie2EnumValue function.
*
* The callback function can stop the enumeration by returning FALSE.
*
* @param context an opaque pointer, as passed into utrie2_enum()
* @param start the first code point in a contiguous range with value
* @param end the last code point in a contiguous range with value (inclusive)
* @param value the value that is set for all code points in [start..end]
* @return FALSE to stop the enumeration
*/
typedef UBool U_CALLCONV
UTrie2EnumRange(const void *context, UChar32 start, UChar32 end, uint32_t value);
/**
* Enumerate efficiently all values in a trie.
* Do not modify the trie during the enumeration.
*
* For each entry in the trie, the value to be delivered is passed through
* the UTrie2EnumValue function.
* The value is unchanged if that function pointer is NULL.
*
* For each contiguous range of code points with a given (transformed) value,
* the UTrie2EnumRange function is called.
*
* @param trie a pointer to the trie
* @param enumValue a pointer to a function that may transform the trie entry value,
* or NULL if the values from the trie are to be used directly
* @param enumRange a pointer to a function that is called for each contiguous range
* of code points with the same (transformed) value
* @param context an opaque pointer that is passed on to the callback functions
*/
U_CAPI void U_EXPORT2
utrie2_enum(const UTrie2 *trie,
UTrie2EnumValue *enumValue, UTrie2EnumRange *enumRange, const void *context);
/* Building a trie ---------------------------------------------------------- */
/**
* Open an empty, writable trie. At build time, 32-bit data values are used.
* utrie2_freeze() takes a valueBits parameter
* which determines the data value width in the serialized and frozen forms.
* You must utrie2_close() the trie once you are done using it.
*
* @param initialValue the initial value that is set for all code points
* @param errorValue the value for out-of-range code points and illegal UTF-8
* @param pErrorCode an in/out ICU UErrorCode
* @return a pointer to the allocated and initialized new trie
*/
U_CAPI UTrie2 * U_EXPORT2
utrie2_open(uint32_t initialValue, uint32_t errorValue, UErrorCode *pErrorCode);
/**
* Clone a trie.
* You must utrie2_close() the clone once you are done using it.
*
* @param other the trie to clone
* @param pErrorCode an in/out ICU UErrorCode
* @return a pointer to the new trie clone
*/
U_CAPI UTrie2 * U_EXPORT2
utrie2_clone(const UTrie2 *other, UErrorCode *pErrorCode);
/**
* Clone a trie. The clone will be mutable/writable even if the other trie
* is frozen. (See utrie2_freeze().)
* You must utrie2_close() the clone once you are done using it.
*
* @param other the trie to clone
* @param pErrorCode an in/out ICU UErrorCode
* @return a pointer to the new trie clone
*/
U_CAPI UTrie2 * U_EXPORT2
utrie2_cloneAsThawed(const UTrie2 *other, UErrorCode *pErrorCode);
/**
* Close a trie and release associated memory.
*
* @param trie the trie
*/
U_CAPI void U_EXPORT2
utrie2_close(UTrie2 *trie);
/**
* Set a value for a code point.
*
* @param trie the unfrozen trie
* @param c the code point
* @param value the value
* @param pErrorCode an in/out ICU UErrorCode; among other possible error codes:
* - U_NO_WRITE_PERMISSION if the trie is frozen
*/
U_CAPI void U_EXPORT2
utrie2_set32(UTrie2 *trie, UChar32 c, uint32_t value, UErrorCode *pErrorCode);
/**
* Set a value in a range of code points [start..end].
* All code points c with start<=c<=end will get the value if
* overwrite is TRUE or if the old value is the initial value.
*
* @param trie the unfrozen trie
* @param start the first code point to get the value
* @param end the last code point to get the value (inclusive)
* @param value the value
* @param overwrite flag for whether old non-initial values are to be overwritten
* @param pErrorCode an in/out ICU UErrorCode; among other possible error codes:
* - U_NO_WRITE_PERMISSION if the trie is frozen
*/
U_CAPI void U_EXPORT2
utrie2_setRange32(UTrie2 *trie,
UChar32 start, UChar32 end,
uint32_t value, UBool overwrite,
UErrorCode *pErrorCode);
/**
* Freeze a trie. Make it immutable (read-only) and compact it,
* ready for serialization and for use with fast macros.
* Functions to set values will fail after serializing.
*
* A trie can be frozen only once. If this function is called again with different
* valueBits then it will set a U_ILLEGAL_ARGUMENT_ERROR.
*
* @param trie the trie
* @param valueBits selects the data entry size; if smaller than 32 bits, then
* the values stored in the trie will be truncated
* @param pErrorCode an in/out ICU UErrorCode; among other possible error codes:
* - U_INDEX_OUTOFBOUNDS_ERROR if the compacted index or data arrays are too long
* for serialization
* (the trie will be immutable and usable,
* but not frozen and not usable with the fast macros)
*
* @see utrie2_cloneAsThawed
*/
U_CAPI void U_EXPORT2
utrie2_freeze(UTrie2 *trie, UTrie2ValueBits valueBits, UErrorCode *pErrorCode);
/**
* Test if the trie is frozen. (See utrie2_freeze().)
*
* @param trie the trie
* @return TRUE if the trie is frozen, that is, immutable, ready for serialization
* and for use with fast macros
*/
U_CAPI UBool U_EXPORT2
utrie2_isFrozen(const UTrie2 *trie);
/**
* Serialize a frozen trie into 32-bit aligned memory.
* If the trie is not frozen, then the function returns with a U_ILLEGAL_ARGUMENT_ERROR.
* A trie can be serialized multiple times.
*
* @param trie the frozen trie
* @param data a pointer to 32-bit-aligned memory to be filled with the trie data,
* can be NULL if capacity==0
* @param capacity the number of bytes available at data,
* or 0 for preflighting
* @param pErrorCode an in/out ICU UErrorCode; among other possible error codes:
* - U_BUFFER_OVERFLOW_ERROR if the data storage block is too small for serialization
* - U_ILLEGAL_ARGUMENT_ERROR if the trie is not frozen or the data and capacity
* parameters are bad
* @return the number of bytes written or needed for the trie
*
* @see utrie2_openFromSerialized()
*/
U_CAPI int32_t U_EXPORT2
utrie2_serialize(UTrie2 *trie,
void *data, int32_t capacity,
UErrorCode *pErrorCode);
/* Public UTrie2 API: miscellaneous functions ------------------------------- */
/**
* Get the UTrie version from 32-bit-aligned memory containing the serialized form
* of either a UTrie (version 1) or a UTrie2 (version 2).
*
* @param data a pointer to 32-bit-aligned memory containing the serialized form
* of a UTrie, version 1 or 2
* @param length the number of bytes available at data;
* can be more than necessary (see return value)
* @param anyEndianOk If FALSE, only platform-endian serialized forms are recognized.
* If TRUE, opposite-endian serialized forms are recognized as well.
* @return the UTrie version of the serialized form, or 0 if it is not
* recognized as a serialized UTrie
*/
U_CAPI int32_t U_EXPORT2
utrie2_getVersion(const void *data, int32_t length, UBool anyEndianOk);
/**
* Swap a serialized UTrie2.
* @internal
*/
U_CAPI int32_t U_EXPORT2
utrie2_swap(const UDataSwapper *ds,
const void *inData, int32_t length, void *outData,
UErrorCode *pErrorCode);
/**
* Build a UTrie2 (version 2) from a UTrie (version 1).
* Enumerates all values in the UTrie and builds a UTrie2 with the same values.
* The resulting UTrie2 will be frozen.
*
* @param trie1 the runtime UTrie structure to be enumerated
* @param errorValue the value for out-of-range code points and illegal UTF-8
* @param pErrorCode an in/out ICU UErrorCode
* @return The frozen UTrie2 with the same values as the UTrie.
*/
U_CAPI UTrie2 * U_EXPORT2
utrie2_fromUTrie(const UTrie *trie1, uint32_t errorValue, UErrorCode *pErrorCode);
/* Public UTrie2 API macros ------------------------------------------------- */
/*
* These macros provide fast data lookup from a frozen trie.
* They will crash when used on an unfrozen trie.
*/
/**
* Return a 16-bit trie value from a code point, with range checking.
* Returns trie->errorValue if c is not in the range 0..U+10ffff.
*
* @param trie (const UTrie2 *, in) a frozen trie
* @param c (UChar32, in) the input code point
* @return (uint16_t) The code point's trie value.
*/
#define UTRIE2_GET16(trie, c) _UTRIE2_GET((trie), index, (trie)->indexLength, (c))
/**
* Return a 32-bit trie value from a code point, with range checking.
* Returns trie->errorValue if c is not in the range 0..U+10ffff.
*
* @param trie (const UTrie2 *, in) a frozen trie
* @param c (UChar32, in) the input code point
* @return (uint32_t) The code point's trie value.
*/
#define UTRIE2_GET32(trie, c) _UTRIE2_GET((trie), data32, 0, (c))
/**
* UTF-16: Get the next code point (UChar32 c, out), post-increment src,
* and get a 16-bit value from the trie.
*
* @param trie (const UTrie2 *, in) a frozen trie
* @param src (const UChar *, in/out) the source text pointer
* @param limit (const UChar *, in) the limit pointer for the text, or NULL if NUL-terminated
* @param c (UChar32, out) variable for the code point
* @param result (uint16_t, out) uint16_t variable for the trie lookup result
*/
#define UTRIE2_U16_NEXT16(trie, src, limit, c, result) _UTRIE2_U16_NEXT(trie, index, src, limit, c, result)
/**
* UTF-16: Get the next code point (UChar32 c, out), post-increment src,
* and get a 32-bit value from the trie.
*
* @param trie (const UTrie2 *, in) a frozen trie
* @param src (const UChar *, in/out) the source text pointer
* @param limit (const UChar *, in) the limit pointer for the text, or NULL if NUL-terminated
* @param c (UChar32, out) variable for the code point
* @param result (uint32_t, out) uint32_t variable for the trie lookup result
*/
#define UTRIE2_U16_NEXT32(trie, src, limit, c, result) _UTRIE2_U16_NEXT(trie, data32, src, limit, c, result)
/**
* UTF-16: Get the previous code point (UChar32 c, out), pre-decrement src,
* and get a 16-bit value from the trie.
*
* @param trie (const UTrie2 *, in) a frozen trie
* @param start (const UChar *, in) the start pointer for the text
* @param src (const UChar *, in/out) the source text pointer
* @param c (UChar32, out) variable for the code point
* @param result (uint16_t, out) uint16_t variable for the trie lookup result
*/
#define UTRIE2_U16_PREV16(trie, start, src, c, result) _UTRIE2_U16_PREV(trie, index, start, src, c, result)
/**
* UTF-16: Get the previous code point (UChar32 c, out), pre-decrement src,
* and get a 32-bit value from the trie.
*
* @param trie (const UTrie2 *, in) a frozen trie
* @param start (const UChar *, in) the start pointer for the text
* @param src (const UChar *, in/out) the source text pointer
* @param c (UChar32, out) variable for the code point
* @param result (uint32_t, out) uint32_t variable for the trie lookup result
*/
#define UTRIE2_U16_PREV32(trie, start, src, c, result) _UTRIE2_U16_PREV(trie, data32, start, src, c, result)
/**
* UTF-8: Post-increment src and get a 16-bit value from the trie.
*
* @param trie (const UTrie2 *, in) a frozen trie
* @param src (const char *, in/out) the source text pointer
* @param limit (const char *, in) the limit pointer for the text (must not be NULL)
* @param result (uint16_t, out) uint16_t variable for the trie lookup result
*/
#define UTRIE2_U8_NEXT16(trie, src, limit, result)\
_UTRIE2_U8_NEXT(trie, data16, index, src, limit, result)
/**
* UTF-8: Post-increment src and get a 32-bit value from the trie.
*
* @param trie (const UTrie2 *, in) a frozen trie
* @param src (const char *, in/out) the source text pointer
* @param limit (const char *, in) the limit pointer for the text (must not be NULL)
* @param result (uint16_t, out) uint32_t variable for the trie lookup result
*/
#define UTRIE2_U8_NEXT32(trie, src, limit, result) \
_UTRIE2_U8_NEXT(trie, data32, data32, src, limit, result)
/**
* UTF-8: Pre-decrement src and get a 16-bit value from the trie.
*
* @param trie (const UTrie2 *, in) a frozen trie
* @param start (const char *, in) the start pointer for the text
* @param src (const char *, in/out) the source text pointer
* @param result (uint16_t, out) uint16_t variable for the trie lookup result
*/
#define UTRIE2_U8_PREV16(trie, start, src, result) \
_UTRIE2_U8_PREV(trie, data16, index, start, src, result)
/**
* UTF-8: Pre-decrement src and get a 32-bit value from the trie.
*
* @param trie (const UTrie2 *, in) a frozen trie
* @param start (const char *, in) the start pointer for the text
* @param src (const char *, in/out) the source text pointer
* @param result (uint16_t, out) uint32_t variable for the trie lookup result
*/
#define UTRIE2_U8_PREV32(trie, start, src, result) \
_UTRIE2_U8_PREV(trie, data32, data32, start, src, result)
/* Public UTrie2 API: optimized UTF-16 access ------------------------------- */
/*
* The following functions and macros are used for highly optimized UTF-16
* text processing. The UTRIE2_U16_NEXTxy() macros do not depend on these.
*
* A UTrie2 stores separate values for lead surrogate code _units_ vs. code _points_.
* UTF-16 text processing can be optimized by detecting surrogate pairs and
* assembling supplementary code points only when there is non-trivial data
* available.
*
* At build-time, use utrie2_enumForLeadSurrogate() to see if there
* is non-trivial (non-initialValue) data for any of the supplementary
* code points associated with a lead surrogate.
* If so, then set a special (application-specific) value for the
* lead surrogate code _unit_, with utrie2_set32ForLeadSurrogateCodeUnit().
*
* At runtime, use UTRIE2_GET16_FROM_U16_SINGLE_LEAD() or
* UTRIE2_GET32_FROM_U16_SINGLE_LEAD() per code unit. If there is non-trivial
* data and the code unit is a lead surrogate, then check if a trail surrogate
* follows. If so, assemble the supplementary code point with
* U16_GET_SUPPLEMENTARY() and look up its value with UTRIE2_GET16_FROM_SUPP()
* or UTRIE2_GET32_FROM_SUPP(); otherwise reset the lead
* surrogate's value or do a code point lookup for it.
*
* If there is only trivial data for lead and trail surrogates, then processing
* can often skip them. For example, in normalization or case mapping
* all characters that do not have any mappings are simply copied as is.
*/
/**
* Get a value from a lead surrogate code unit as stored in the trie.
*
* @param trie the trie
* @param c the code unit (U+D800..U+DBFF)
* @return the value
*/
U_CAPI uint32_t U_EXPORT2
utrie2_get32FromLeadSurrogateCodeUnit(const UTrie2 *trie, UChar32 c);
/**
* Enumerate the trie values for the 1024=0x400 code points
* corresponding to a given lead surrogate.
* For example, for the lead surrogate U+D87E it will enumerate the values
* for [U+2F800..U+2FC00[.
* Used by data builder code that sets special lead surrogate code unit values
* for optimized UTF-16 string processing.
*
* Do not modify the trie during the enumeration.
*
* Except for the limited code point range, this functions just like utrie2_enum():
* For each entry in the trie, the value to be delivered is passed through
* the UTrie2EnumValue function.
* The value is unchanged if that function pointer is NULL.
*
* For each contiguous range of code points with a given (transformed) value,
* the UTrie2EnumRange function is called.
*
* @param trie a pointer to the trie
* @param enumValue a pointer to a function that may transform the trie entry value,
* or NULL if the values from the trie are to be used directly
* @param enumRange a pointer to a function that is called for each contiguous range
* of code points with the same (transformed) value
* @param context an opaque pointer that is passed on to the callback functions
*/
U_CAPI void U_EXPORT2
utrie2_enumForLeadSurrogate(const UTrie2 *trie, UChar32 lead,
UTrie2EnumValue *enumValue, UTrie2EnumRange *enumRange,
const void *context);
/**
* Set a value for a lead surrogate code unit.
*
* @param trie the unfrozen trie
* @param lead the lead surrogate code unit (U+D800..U+DBFF)
* @param value the value
* @param pErrorCode an in/out ICU UErrorCode; among other possible error codes:
* - U_NO_WRITE_PERMISSION if the trie is frozen
*/
U_CAPI void U_EXPORT2
utrie2_set32ForLeadSurrogateCodeUnit(UTrie2 *trie,
UChar32 lead, uint32_t value,
UErrorCode *pErrorCode);
/**
* Return a 16-bit trie value from a UTF-16 single/lead code unit (<=U+ffff).
* Same as UTRIE2_GET16() if c is a BMP code point except for lead surrogates,
* but smaller and faster.
*
* @param trie (const UTrie2 *, in) a frozen trie
* @param c (UChar32, in) the input code unit, must be 0<=c<=U+ffff
* @return (uint16_t) The code unit's trie value.
*/
#define UTRIE2_GET16_FROM_U16_SINGLE_LEAD(trie, c) _UTRIE2_GET_FROM_U16_SINGLE_LEAD((trie), index, c)
/**
* Return a 32-bit trie value from a UTF-16 single/lead code unit (<=U+ffff).
* Same as UTRIE2_GET32() if c is a BMP code point except for lead surrogates,
* but smaller and faster.
*
* @param trie (const UTrie2 *, in) a frozen trie
* @param c (UChar32, in) the input code unit, must be 0<=c<=U+ffff
* @return (uint32_t) The code unit's trie value.
*/
#define UTRIE2_GET32_FROM_U16_SINGLE_LEAD(trie, c) _UTRIE2_GET_FROM_U16_SINGLE_LEAD((trie), data32, c)
/**
* Return a 16-bit trie value from a supplementary code point (U+10000..U+10ffff).
*
* @param trie (const UTrie2 *, in) a frozen trie
* @param c (UChar32, in) the input code point, must be U+10000<=c<=U+10ffff
* @return (uint16_t) The code point's trie value.
*/
#define UTRIE2_GET16_FROM_SUPP(trie, c) _UTRIE2_GET_FROM_SUPP((trie), index, c)
/**
* Return a 32-bit trie value from a supplementary code point (U+10000..U+10ffff).
*
* @param trie (const UTrie2 *, in) a frozen trie
* @param c (UChar32, in) the input code point, must be U+10000<=c<=U+10ffff
* @return (uint32_t) The code point's trie value.
*/
#define UTRIE2_GET32_FROM_SUPP(trie, c) _UTRIE2_GET_FROM_SUPP((trie), data32, c)
/* Internal definitions ----------------------------------------------------- */
/** Build-time trie structure. */
struct UNewTrie2;
typedef struct UNewTrie2 UNewTrie2;
/*
* Trie structure definition.
*
* Either the data table is 16 bits wide and accessed via the index
* pointer, with each index item increased by indexLength;
* in this case, data32==NULL, and data16 is used for direct ASCII access.
*
* Or the data table is 32 bits wide and accessed via the data32 pointer.
*/
struct UTrie2 {
/* protected: used by macros and functions for reading values */
const uint16_t *index;
const uint16_t *data16; /* for fast UTF-8 ASCII access, if 16b data */
const uint32_t *data32; /* NULL if 16b data is used via index */
int32_t indexLength, dataLength;
uint16_t index2NullOffset; /* 0xffff if there is no dedicated index-2 null block */
uint16_t dataNullOffset;
uint32_t initialValue;
/** Value returned for out-of-range code points and illegal UTF-8. */
uint32_t errorValue;
/* Start of the last range which ends at U+10ffff, and its value. */
UChar32 highStart;
int32_t highValueIndex;
/* private: used by builder and unserialization functions */
void *memory; /* serialized bytes; NULL if not frozen yet */
int32_t length; /* number of serialized bytes at memory; 0 if not frozen yet */
UBool isMemoryOwned; /* TRUE if the trie owns the memory */
UBool padding1;
int16_t padding2;
UNewTrie2 *newTrie; /* builder object; NULL when frozen */
};
/**
* Trie constants, defining shift widths, index array lengths, etc.
*
* These are needed for the runtime macros but users can treat these as
* implementation details and skip to the actual public API further below.
*/
enum {
/** Shift size for getting the index-1 table offset. */
UTRIE2_SHIFT_1=6+5,
/** Shift size for getting the index-2 table offset. */
UTRIE2_SHIFT_2=5,
/**
* Difference between the two shift sizes,
* for getting an index-1 offset from an index-2 offset. 6=11-5
*/
UTRIE2_SHIFT_1_2=UTRIE2_SHIFT_1-UTRIE2_SHIFT_2,
/**
* Number of index-1 entries for the BMP. 32=0x20
* This part of the index-1 table is omitted from the serialized form.
*/
UTRIE2_OMITTED_BMP_INDEX_1_LENGTH=0x10000>>UTRIE2_SHIFT_1,
/** Number of code points per index-1 table entry. 2048=0x800 */
UTRIE2_CP_PER_INDEX_1_ENTRY=1<<UTRIE2_SHIFT_1,
/** Number of entries in an index-2 block. 64=0x40 */
UTRIE2_INDEX_2_BLOCK_LENGTH=1<<UTRIE2_SHIFT_1_2,
/** Mask for getting the lower bits for the in-index-2-block offset. */
UTRIE2_INDEX_2_MASK=UTRIE2_INDEX_2_BLOCK_LENGTH-1,
/** Number of entries in a data block. 32=0x20 */
UTRIE2_DATA_BLOCK_LENGTH=1<<UTRIE2_SHIFT_2,
/** Mask for getting the lower bits for the in-data-block offset. */
UTRIE2_DATA_MASK=UTRIE2_DATA_BLOCK_LENGTH-1,
/**
* Shift size for shifting left the index array values.
* Increases possible data size with 16-bit index values at the cost
* of compactability.
* This requires data blocks to be aligned by UTRIE2_DATA_GRANULARITY.
*/
UTRIE2_INDEX_SHIFT=2,
/** The alignment size of a data block. Also the granularity for compaction. */
UTRIE2_DATA_GRANULARITY=1<<UTRIE2_INDEX_SHIFT,
/* Fixed layout of the first part of the index array. ------------------- */
/**
* The BMP part of the index-2 table is fixed and linear and starts at offset 0.
* Length=2048=0x800=0x10000>>UTRIE2_SHIFT_2.
*/
UTRIE2_INDEX_2_OFFSET=0,
/**
* The part of the index-2 table for U+D800..U+DBFF stores values for
* lead surrogate code _units_ not code _points_.
* Values for lead surrogate code _points_ are indexed with this portion of the table.
* Length=32=0x20=0x400>>UTRIE2_SHIFT_2. (There are 1024=0x400 lead surrogates.)
*/
UTRIE2_LSCP_INDEX_2_OFFSET=0x10000>>UTRIE2_SHIFT_2,
UTRIE2_LSCP_INDEX_2_LENGTH=0x400>>UTRIE2_SHIFT_2,
/** Count the lengths of both BMP pieces. 2080=0x820 */
UTRIE2_INDEX_2_BMP_LENGTH=UTRIE2_LSCP_INDEX_2_OFFSET+UTRIE2_LSCP_INDEX_2_LENGTH,
/**
* The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820.
* Length 32=0x20 for lead bytes C0..DF, regardless of UTRIE2_SHIFT_2.
*/
UTRIE2_UTF8_2B_INDEX_2_OFFSET=UTRIE2_INDEX_2_BMP_LENGTH,
UTRIE2_UTF8_2B_INDEX_2_LENGTH=0x800>>6, /* U+0800 is the first code point after 2-byte UTF-8 */
/**
* The index-1 table, only used for supplementary code points, at offset 2112=0x840.
* Variable length, for code points up to highStart, where the last single-value range starts.
* Maximum length 512=0x200=0x100000>>UTRIE2_SHIFT_1.
* (For 0x100000 supplementary code points U+10000..U+10ffff.)
*
* The part of the index-2 table for supplementary code points starts
* after this index-1 table.
*
* Both the index-1 table and the following part of the index-2 table
* are omitted completely if there is only BMP data.
*/
UTRIE2_INDEX_1_OFFSET=UTRIE2_UTF8_2B_INDEX_2_OFFSET+UTRIE2_UTF8_2B_INDEX_2_LENGTH,
UTRIE2_MAX_INDEX_1_LENGTH=0x100000>>UTRIE2_SHIFT_1,
/*
* Fixed layout of the first part of the data array. -----------------------
* Starts with 4 blocks (128=0x80 entries) for ASCII.
*/
/**
* The illegal-UTF-8 data block follows the ASCII block, at offset 128=0x80.
* Used with linear access for single bytes 0..0xbf for simple error handling.
* Length 64=0x40, not UTRIE2_DATA_BLOCK_LENGTH.
*/
UTRIE2_BAD_UTF8_DATA_OFFSET=0x80,
/** The start of non-linear-ASCII data blocks, at offset 192=0xc0. */
UTRIE2_DATA_START_OFFSET=0xc0
};
/* Internal functions and macros -------------------------------------------- */
/**
* Internal function for part of the UTRIE2_U8_NEXTxx() macro implementations.
* Do not call directly.
* @internal
*/
U_INTERNAL int32_t U_EXPORT2
utrie2_internalU8NextIndex(const UTrie2 *trie, UChar32 c,
const uint8_t *src, const uint8_t *limit);
/**
* Internal function for part of the UTRIE2_U8_PREVxx() macro implementations.
* Do not call directly.
* @internal
*/
U_INTERNAL int32_t U_EXPORT2
utrie2_internalU8PrevIndex(const UTrie2 *trie, UChar32 c,
const uint8_t *start, const uint8_t *src);
/** Internal low-level trie getter. Returns a data index. */
#define _UTRIE2_INDEX_RAW(offset, trieIndex, c) \
(((int32_t)((trieIndex)[(offset)+((c)>>UTRIE2_SHIFT_2)]) \
<<UTRIE2_INDEX_SHIFT)+ \
((c)&UTRIE2_DATA_MASK))
/** Internal trie getter from a UTF-16 single/lead code unit. Returns the data index. */
#define _UTRIE2_INDEX_FROM_U16_SINGLE_LEAD(trieIndex, c) _UTRIE2_INDEX_RAW(0, trieIndex, c)
/** Internal trie getter from a lead surrogate code point (D800..DBFF). Returns the data index. */
#define _UTRIE2_INDEX_FROM_LSCP(trieIndex, c) \
_UTRIE2_INDEX_RAW(UTRIE2_LSCP_INDEX_2_OFFSET-(0xd800>>UTRIE2_SHIFT_2), trieIndex, c)
/** Internal trie getter from a BMP code point. Returns the data index. */
#define _UTRIE2_INDEX_FROM_BMP(trieIndex, c) \
_UTRIE2_INDEX_RAW(U_IS_LEAD(c) ? UTRIE2_LSCP_INDEX_2_OFFSET-(0xd800>>UTRIE2_SHIFT_2) : 0, \
trieIndex, c)
/** Internal trie getter from a supplementary code point below highStart. Returns the data index. */
#define _UTRIE2_INDEX_FROM_SUPP(trieIndex, c) \
(((int32_t)((trieIndex)[ \
(trieIndex)[(UTRIE2_INDEX_1_OFFSET-UTRIE2_OMITTED_BMP_INDEX_1_LENGTH)+ \
((c)>>UTRIE2_SHIFT_1)]+ \
(((c)>>UTRIE2_SHIFT_2)&UTRIE2_INDEX_2_MASK)]) \
<<UTRIE2_INDEX_SHIFT)+ \
((c)&UTRIE2_DATA_MASK))
/**
* Internal trie getter from a code point, with checking that c is in 0..10FFFF.
* Returns the data index.
*/
#define _UTRIE2_INDEX_FROM_CP(trie, asciiOffset, c) \
((uint32_t)(c)<0xd800 ? \
_UTRIE2_INDEX_RAW(0, (trie)->index, c) : \
(uint32_t)(c)<=0xffff ? \
_UTRIE2_INDEX_RAW( \
(c)<=0xdbff ? UTRIE2_LSCP_INDEX_2_OFFSET-(0xd800>>UTRIE2_SHIFT_2) : 0, \
(trie)->index, c) : \
(uint32_t)(c)>0x10ffff ? \
(asciiOffset)+UTRIE2_BAD_UTF8_DATA_OFFSET : \
(c)>=(trie)->highStart ? \
(trie)->highValueIndex : \
_UTRIE2_INDEX_FROM_SUPP((trie)->index, c))
/** Internal trie getter from a UTF-16 single/lead code unit. Returns the data. */
#define _UTRIE2_GET_FROM_U16_SINGLE_LEAD(trie, data, c) \
(trie)->data[_UTRIE2_INDEX_FROM_U16_SINGLE_LEAD((trie)->index, c)]
/** Internal trie getter from a supplementary code point. Returns the data. */
#define _UTRIE2_GET_FROM_SUPP(trie, data, c) \
(trie)->data[(c)>=(trie)->highStart ? (trie)->highValueIndex : \
_UTRIE2_INDEX_FROM_SUPP((trie)->index, c)]
/**
* Internal trie getter from a code point, with checking that c is in 0..10FFFF.
* Returns the data.
*/
#define _UTRIE2_GET(trie, data, asciiOffset, c) \
(trie)->data[_UTRIE2_INDEX_FROM_CP(trie, asciiOffset, c)]
/** Internal next-post-increment: get the next code point (c) and its data. */
#define _UTRIE2_U16_NEXT(trie, data, src, limit, c, result) { \
{ \
uint16_t __c2; \
(c)=*(src)++; \
if(!U16_IS_LEAD(c)) { \
(result)=_UTRIE2_GET_FROM_U16_SINGLE_LEAD(trie, data, c); \
} else if((src)==(limit) || !U16_IS_TRAIL(__c2=*(src))) { \
(result)=(trie)->data[_UTRIE2_INDEX_FROM_LSCP((trie)->index, c)]; \
} else { \
++(src); \
(c)=U16_GET_SUPPLEMENTARY((c), __c2); \
(result)=_UTRIE2_GET_FROM_SUPP((trie), data, (c)); \
} \
} \
}
/** Internal pre-decrement-previous: get the previous code point (c) and its data */
#define _UTRIE2_U16_PREV(trie, data, start, src, c, result) { \
{ \
uint16_t __c2; \
(c)=*--(src); \
if(!U16_IS_TRAIL(c) || (src)==(start) || !U16_IS_LEAD(__c2=*((src)-1))) { \
(result)=(trie)->data[_UTRIE2_INDEX_FROM_BMP((trie)->index, c)]; \
} else { \
--(src); \
(c)=U16_GET_SUPPLEMENTARY(__c2, (c)); \
(result)=_UTRIE2_GET_FROM_SUPP((trie), data, (c)); \
} \
} \
}
/** Internal UTF-8 next-post-increment: get the next code point's data. */
#define _UTRIE2_U8_NEXT(trie, ascii, data, src, limit, result) { \
uint8_t __lead=(uint8_t)*(src)++; \
if(__lead<0xc0) { \
(result)=(trie)->ascii[__lead]; \
} else { \
uint8_t __t1, __t2; \
if( /* handle U+0000..U+07FF inline */ \
__lead<0xe0 && (src)<(limit) && \
(__t1=(uint8_t)(*(src)-0x80))<=0x3f \
) { \
++(src); \
(result)=(trie)->data[ \
(trie)->index[(UTRIE2_UTF8_2B_INDEX_2_OFFSET-0xc0)+__lead]+ \
__t1]; \
} else if( /* handle U+0000..U+CFFF inline */ \
__lead<0xed && ((src)+1)<(limit) && \
(__t1=(uint8_t)(*(src)-0x80))<=0x3f && (__lead>0xe0 || __t1>=0x20) && \
(__t2=(uint8_t)(*((src)+1)-0x80))<= 0x3f \
) { \
(src)+=2; \
(result)=(trie)->data[ \
((int32_t)((trie)->index[((__lead-0xe0)<<(12-UTRIE2_SHIFT_2))+ \
(__t1<<(6-UTRIE2_SHIFT_2))+(__t2>>UTRIE2_SHIFT_2)]) \
<<UTRIE2_INDEX_SHIFT)+ \
(__t2&UTRIE2_DATA_MASK)]; \
} else { \
int32_t __index=utrie2_internalU8NextIndex((trie), __lead, (const uint8_t *)(src), \
(const uint8_t *)(limit)); \
(src)+=__index&7; \
(result)=(trie)->data[__index>>3]; \
} \
} \
}
/** Internal UTF-8 pre-decrement-previous: get the previous code point's data. */
#define _UTRIE2_U8_PREV(trie, ascii, data, start, src, result) { \
uint8_t __b=(uint8_t)*--(src); \
if(__b<0x80) { \
(result)=(trie)->ascii[__b]; \
} else { \
int32_t __index=utrie2_internalU8PrevIndex((trie), __b, (const uint8_t *)(start), \
(const uint8_t *)(src)); \
(src)-=__index&7; \
(result)=(trie)->data[__index>>3]; \
} \
}
U_CDECL_END
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,172 @@
/*
******************************************************************************
*
* Copyright (C) 2001-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
* file name: utrie2_impl.h
* encoding: US-ASCII
* tab size: 8 (not used)
* indentation:4
*
* created on: 2008sep26 (split off from utrie2.c)
* created by: Markus W. Scherer
*
* Definitions needed for both runtime and builder code for UTrie2,
* used by utrie2.c and utrie2_builder.c.
*/
#ifndef __UTRIE2_IMPL_H__
#define __UTRIE2_IMPL_H__
#include "utrie2.h"
/* Public UTrie2 API implementation ----------------------------------------- */
/*
* These definitions are mostly needed by utrie2.c,
* but also by utrie2_serialize() and utrie2_swap().
*/
/*
* UTrie and UTrie2 signature values,
* in platform endianness and opposite endianness.
*/
#define UTRIE_SIG 0x54726965
#define UTRIE_OE_SIG 0x65697254
#define UTRIE2_SIG 0x54726932
#define UTRIE2_OE_SIG 0x32697254
/**
* Trie data structure in serialized form:
*
* UTrie2Header header;
* uint16_t index[header.index2Length];
* uint16_t data[header.shiftedDataLength<<2]; -- or uint32_t data[...]
* @internal
*/
typedef struct UTrie2Header {
/** "Tri2" in big-endian US-ASCII (0x54726932) */
uint32_t signature;
/**
* options bit field:
* 15.. 4 reserved (0)
* 3.. 0 UTrie2ValueBits valueBits
*/
uint16_t options;
/** UTRIE2_INDEX_1_OFFSET..UTRIE2_MAX_INDEX_LENGTH */
uint16_t indexLength;
/** (UTRIE2_DATA_START_OFFSET..UTRIE2_MAX_DATA_LENGTH)>>UTRIE2_INDEX_SHIFT */
uint16_t shiftedDataLength;
/** Null index and data blocks, not shifted. */
uint16_t index2NullOffset, dataNullOffset;
/**
* First code point of the single-value range ending with U+10ffff,
* rounded up and then shifted right by UTRIE2_SHIFT_1.
*/
uint16_t shiftedHighStart;
} UTrie2Header;
/**
* Constants for use with UTrie2Header.options.
* @internal
*/
enum {
/** Mask to get the UTrie2ValueBits valueBits from options. */
UTRIE2_OPTIONS_VALUE_BITS_MASK=0xf
};
/* Building a trie ---------------------------------------------------------- */
/*
* These definitions are mostly needed by utrie2_builder.c, but also by
* utrie2_get32() and utrie2_enum().
*/
enum {
/**
* At build time, leave a gap in the index-2 table,
* at least as long as the maximum lengths of the 2-byte UTF-8 index-2 table
* and the supplementary index-1 table.
* Round up to UTRIE2_INDEX_2_BLOCK_LENGTH for proper compacting.
*/
UNEWTRIE2_INDEX_GAP_OFFSET=UTRIE2_INDEX_2_BMP_LENGTH,
UNEWTRIE2_INDEX_GAP_LENGTH=
((UTRIE2_UTF8_2B_INDEX_2_LENGTH+UTRIE2_MAX_INDEX_1_LENGTH)+UTRIE2_INDEX_2_MASK)&
~UTRIE2_INDEX_2_MASK,
/**
* Maximum length of the build-time index-2 array.
* Maximum number of Unicode code points (0x110000) shifted right by UTRIE2_SHIFT_2,
* plus the part of the index-2 table for lead surrogate code points,
* plus the build-time index gap,
* plus the null index-2 block.
*/
UNEWTRIE2_MAX_INDEX_2_LENGTH=
(0x110000>>UTRIE2_SHIFT_2)+
UTRIE2_LSCP_INDEX_2_LENGTH+
UNEWTRIE2_INDEX_GAP_LENGTH+
UTRIE2_INDEX_2_BLOCK_LENGTH,
UNEWTRIE2_INDEX_1_LENGTH=0x110000>>UTRIE2_SHIFT_1,
};
/**
* Maximum length of the build-time data array.
* One entry per 0x110000 code points, plus the illegal-UTF-8 block and the null block,
* plus values for the 0x400 surrogate code units.
*/
#define UNEWTRIE2_MAX_DATA_LENGTH (0x110000+0x40+0x40+0x400)
/*
* Build-time trie structure.
*
* Just using a boolean flag for "repeat use" could lead to data array overflow
* because we would not be able to detect when a data block becomes unused.
* It also leads to orphan data blocks that are kept through serialization.
*
* Need to use reference counting for data blocks,
* and allocDataBlock() needs to look for a free block before increasing dataLength.
*
* This scheme seems like overkill for index-2 blocks since the whole index array is
* preallocated anyway (unlike the growable data array).
* Just allocating multiple index-2 blocks as needed.
*/
struct UNewTrie2 {
int32_t index1[UNEWTRIE2_INDEX_1_LENGTH];
int32_t index2[UNEWTRIE2_MAX_INDEX_2_LENGTH];
uint32_t *data;
uint32_t initialValue, errorValue;
int32_t index2Length, dataCapacity, dataLength;
int32_t firstFreeBlock;
int32_t index2NullOffset, dataNullOffset;
UChar32 highStart;
UBool isCompacted;
/**
* Multi-purpose per-data-block table.
*
* Before compacting:
*
* Per-data-block reference counters/free-block list.
* 0: unused
* >0: reference counter (number of index-2 entries pointing here)
* <0: next free data block in free-block list
*
* While compacting:
*
* Map of adjusted indexes, used in compactData() and compactIndex2().
* Maps from original indexes to new ones.
*/
int32_t map[UNEWTRIE2_MAX_DATA_LENGTH>>UTRIE2_SHIFT_2];
};
#endif

View File

@ -10078,7 +10078,7 @@ then
fi
# output the Makefiles
ac_config_files="$ac_config_files icudefs.mk Makefile data/icupkg.inc config/Makefile.inc data/Makefile stubdata/Makefile common/Makefile i18n/Makefile layout/Makefile layoutex/Makefile io/Makefile extra/Makefile extra/uconv/Makefile extra/scrptrun/Makefile tools/Makefile tools/ctestfw/Makefile tools/toolutil/Makefile tools/makeconv/Makefile tools/genrb/Makefile tools/genuca/Makefile tools/genccode/Makefile tools/gencmn/Makefile tools/gencnval/Makefile tools/genctd/Makefile tools/gennames/Makefile tools/gentest/Makefile tools/gennorm/Makefile tools/genprops/Makefile tools/gencase/Makefile tools/genbidi/Makefile tools/genpname/Makefile tools/genbrk/Makefile tools/gensprep/Makefile tools/icupkg/Makefile tools/icuswap/Makefile tools/pkgdata/Makefile tools/tzcode/Makefile test/Makefile test/compat/Makefile test/testdata/Makefile test/testdata/pkgdata.inc test/hdrtst/Makefile test/intltest/Makefile test/cintltst/Makefile test/iotest/Makefile test/letest/Makefile test/perf/Makefile test/perf/collationperf/Makefile test/perf/ubrkperf/Makefile test/perf/charperf/Makefile test/perf/convperf/Makefile test/perf/normperf/Makefile test/perf/strsrchperf/Makefile test/perf/unisetperf/Makefile test/perf/usetperf/Makefile test/perf/ustrperf/Makefile test/perf/utfperf/Makefile samples/Makefile samples/date/Makefile samples/cal/Makefile samples/layout/Makefile common/unicode/platform.h"
ac_config_files="$ac_config_files icudefs.mk Makefile data/icupkg.inc config/Makefile.inc data/Makefile stubdata/Makefile common/Makefile i18n/Makefile layout/Makefile layoutex/Makefile io/Makefile extra/Makefile extra/uconv/Makefile extra/scrptrun/Makefile tools/Makefile tools/ctestfw/Makefile tools/toolutil/Makefile tools/makeconv/Makefile tools/genrb/Makefile tools/genuca/Makefile tools/genccode/Makefile tools/gencmn/Makefile tools/gencnval/Makefile tools/genctd/Makefile tools/gennames/Makefile tools/gentest/Makefile tools/gennorm/Makefile tools/genprops/Makefile tools/gencase/Makefile tools/genbidi/Makefile tools/genpname/Makefile tools/genbrk/Makefile tools/gensprep/Makefile tools/icupkg/Makefile tools/icuswap/Makefile tools/pkgdata/Makefile tools/tzcode/Makefile test/Makefile test/compat/Makefile test/testdata/Makefile test/testdata/pkgdata.inc test/hdrtst/Makefile test/intltest/Makefile test/cintltst/Makefile test/iotest/Makefile test/letest/Makefile test/perf/Makefile test/perf/collationperf/Makefile test/perf/ubrkperf/Makefile test/perf/charperf/Makefile test/perf/convperf/Makefile test/perf/normperf/Makefile test/perf/strsrchperf/Makefile test/perf/unisetperf/Makefile test/perf/usetperf/Makefile test/perf/ustrperf/Makefile test/perf/utfperf/Makefile test/perf/utrie2perf/Makefile samples/Makefile samples/date/Makefile samples/cal/Makefile samples/layout/Makefile common/unicode/platform.h"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@ -10733,6 +10733,7 @@ do
"test/perf/usetperf/Makefile") CONFIG_FILES="$CONFIG_FILES test/perf/usetperf/Makefile" ;;
"test/perf/ustrperf/Makefile") CONFIG_FILES="$CONFIG_FILES test/perf/ustrperf/Makefile" ;;
"test/perf/utfperf/Makefile") CONFIG_FILES="$CONFIG_FILES test/perf/utfperf/Makefile" ;;
"test/perf/utrie2perf/Makefile") CONFIG_FILES="$CONFIG_FILES test/perf/utrie2perf/Makefile" ;;
"samples/Makefile") CONFIG_FILES="$CONFIG_FILES samples/Makefile" ;;
"samples/date/Makefile") CONFIG_FILES="$CONFIG_FILES samples/date/Makefile" ;;
"samples/cal/Makefile") CONFIG_FILES="$CONFIG_FILES samples/cal/Makefile" ;;
@ -10790,7 +10791,8 @@ $debug ||
if test -n "$CONFIG_FILES"; then
ac_cr=' '
ac_cr='
'
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
ac_cs_awk_cr='\\r'

View File

@ -1096,6 +1096,7 @@ AC_CONFIG_FILES([icudefs.mk \
test/perf/usetperf/Makefile \
test/perf/ustrperf/Makefile \
test/perf/utfperf/Makefile \
test/perf/utrie2perf/Makefile \
samples/Makefile samples/date/Makefile \
samples/cal/Makefile samples/layout/Makefile \
common/unicode/platform.h])

View File

@ -44,11 +44,6 @@
U_NAMESPACE_USE
/* added by synwee for trie manipulation*/
#define STAGE_1_SHIFT_ 10
#define STAGE_2_SHIFT_ 4
#define STAGE_2_MASK_AFTER_SHIFT_ 0x3F
#define STAGE_3_MASK_ 0xF
#define LAST_BYTE_MASK_ 0xFF
#define SECOND_LAST_BYTE_SHIFT_ 8
@ -59,6 +54,8 @@ U_NAMESPACE_USE
// and therefore writing to it is not synchronized.
// It is cleaned in ucol_cleanup
static const uint16_t *fcdTrieIndex=NULL;
// Code points at fcdHighStart and above have a zero FCD value.
static UChar32 fcdHighStart = 0;
// These are values from UCA required for
// implicit generation and supressing sort key compression
@ -753,7 +750,7 @@ UCollator* ucol_initCollator(const UCATableHeader *image, UCollator *fillIn, con
// init FCD data
if (fcdTrieIndex == NULL) {
// The result is constant, until the library is reloaded.
fcdTrieIndex = unorm_getFCDTrie(status);
fcdTrieIndex = unorm_getFCDTrieIndex(fcdHighStart, status);
ucln_i18n_registerCleanup(UCLN_I18N_UCOL, ucol_cleanup);
}
@ -1291,7 +1288,6 @@ inline void normalizeIterator(collIterate *collationSource) {
/* that way, and we get called for every char where cc might be non-zero. */
static
inline UBool collIterFCD(collIterate *collationSource) {
UChar c, c2;
const UChar *srcP, *endP;
uint8_t leadingCC;
uint8_t prevTrailingCC = 0;
@ -1308,19 +1304,9 @@ inline UBool collIterFCD(collIterate *collationSource) {
// Get the trailing combining class of the current character. If it's zero,
// we are OK.
c = *srcP++;
/* trie access */
fcd = unorm_getFCD16(fcdTrieIndex, c);
fcd = unorm_nextFCD16(fcdTrieIndex, fcdHighStart, srcP, endP);
if (fcd != 0) {
if (U16_IS_LEAD(c)) {
if ((endP == NULL || srcP != endP) && U16_IS_TRAIL(c2=*srcP)) {
++srcP;
fcd = unorm_getFCD16FromSurrogatePair(fcdTrieIndex, fcd, c2);
} else {
fcd = 0;
}
}
prevTrailingCC = (uint8_t)(fcd & LAST_BYTE_MASK_);
if (prevTrailingCC != 0) {
@ -1330,17 +1316,8 @@ inline UBool collIterFCD(collIterate *collationSource) {
{
const UChar *savedSrcP = srcP;
c = *srcP++;
/* trie access */
fcd = unorm_getFCD16(fcdTrieIndex, c);
if (fcd != 0 && U16_IS_LEAD(c)) {
if ((endP == NULL || srcP != endP) && U16_IS_TRAIL(c2=*srcP)) {
++srcP;
fcd = unorm_getFCD16FromSurrogatePair(fcdTrieIndex, fcd, c2);
} else {
fcd = 0;
}
}
fcd = unorm_nextFCD16(fcdTrieIndex, fcdHighStart, srcP, endP);
leadingCC = (uint8_t)(fcd >> SECOND_LAST_BYTE_SHIFT_);
if (leadingCC == 0) {
srcP = savedSrcP; // Hit char that is not part of combining sequence.
@ -1699,7 +1676,6 @@ static
inline UBool collPrevIterFCD(collIterate *data)
{
const UChar *src, *start;
UChar c, c2;
uint8_t leadingCC;
uint8_t trailingCC = 0;
uint16_t fcd;
@ -1709,18 +1685,7 @@ inline UBool collPrevIterFCD(collIterate *data)
src = data->pos + 1;
/* Get the trailing combining class of the current character. */
c = *--src;
if (!U16_IS_SURROGATE(c)) {
fcd = unorm_getFCD16(fcdTrieIndex, c);
} else if (U16_IS_TRAIL(c) && start < src && U16_IS_LEAD(c2 = *(src - 1))) {
--src;
fcd = unorm_getFCD16(fcdTrieIndex, c2);
if (fcd != 0) {
fcd = unorm_getFCD16FromSurrogatePair(fcdTrieIndex, fcd, c);
}
} else /* unpaired surrogate */ {
fcd = 0;
}
fcd = unorm_prevFCD16(fcdTrieIndex, fcdHighStart, start, src);
leadingCC = (uint8_t)(fcd >> SECOND_LAST_BYTE_SHIFT_);
@ -1736,18 +1701,7 @@ inline UBool collPrevIterFCD(collIterate *data)
return result;
}
c = *--src;
if (!U16_IS_SURROGATE(c)) {
fcd = unorm_getFCD16(fcdTrieIndex, c);
} else if (U16_IS_TRAIL(c) && start < src && U16_IS_LEAD(c2 = *(src - 1))) {
--src;
fcd = unorm_getFCD16(fcdTrieIndex, c2);
if (fcd != 0) {
fcd = unorm_getFCD16FromSurrogatePair(fcdTrieIndex, fcd, c);
}
} else /* unpaired surrogate */ {
fcd = 0;
}
fcd = unorm_prevFCD16(fcdTrieIndex, fcdHighStart, start, src);
trailingCC = (uint8_t)(fcd & LAST_BYTE_MASK_);

View File

@ -837,7 +837,8 @@ U_CFUNC void ucol_createElements(UColTokenParser *src, tempUCATable *t, UColTokL
UColToken *tok = lh->first;
UColToken *expt = NULL;
uint32_t i = 0, j = 0;
const uint16_t *fcdTrieData = unorm_getFCDTrie(status);
UChar32 fcdHighStart;
const uint16_t *fcdTrieIndex = unorm_getFCDTrieIndex(fcdHighStart, status);
while(tok != NULL && U_SUCCESS(*status)) {
/* first, check if there are any expansions */
@ -925,25 +926,18 @@ U_CFUNC void ucol_createElements(UColTokenParser *src, tempUCATable *t, UColTokL
uprv_memcpy(el.uchars, (tok->source & 0x00FFFFFF) + src->source, el.cSize*sizeof(UChar));
}
if(src->UCA != NULL) {
UBool containCombinMarks = FALSE;
for(i = 0; i<el.cSize; i++) {
if(UCOL_ISJAMO(el.cPoints[i])) {
t->image->jamoSpecial = TRUE;
}
if ( !src->buildCCTabFlag ) {
// check combining class
int16_t fcd = unorm_getFCD16(fcdTrieData, el.cPoints[i]);
if ( (fcd && 0xff) == 0 ) {
// reset flag when current char is not combining mark.
containCombinMarks = FALSE;
}
else {
containCombinMarks = TRUE;
}
}
}
if ( !src->buildCCTabFlag && containCombinMarks ) {
src->buildCCTabFlag = TRUE;
if (!src->buildCCTabFlag && el.cSize > 0) {
// Check the trailing canonical combining class (tccc) of the last character.
const UChar *s = el.cPoints + el.cSize;
uint16_t fcd = unorm_prevFCD16(fcdTrieIndex, fcdHighStart, el.cPoints, s);
if ((fcd & 0xff) != 0) {
src->buildCCTabFlag = TRUE;
}
}
}

View File

@ -742,12 +742,13 @@ static void uprv_uca_unsafeCPAddCCNZ(tempUCATable *t, UErrorCode *status) {
UChar c;
uint16_t fcd; // Hi byte is lead combining class.
// lo byte is trailing combing class.
const uint16_t *fcdTrieData;
const uint16_t *fcdTrieIndex;
UChar32 fcdHighStart;
UBool buildCMTable = (t->cmLookup==NULL); // flag for building combining class table
UChar *cm=NULL;
uint16_t index[256];
int32_t count=0;
fcdTrieData = unorm_getFCDTrie(status);
fcdTrieIndex = unorm_getFCDTrieIndex(fcdHighStart, status);
if (U_FAILURE(*status)) {
return;
}
@ -763,7 +764,7 @@ static void uprv_uca_unsafeCPAddCCNZ(tempUCATable *t, UErrorCode *status) {
uprv_memset(index, 0, sizeof(index));
}
for (c=0; c<0xffff; c++) {
fcd = unorm_getFCD16(fcdTrieData, c);
fcd = unorm_getFCD16(fcdTrieIndex, c);
if (fcd >= 0x100 || // if the leading combining class(c) > 0 ||
(UTF_IS_LEAD(c) && fcd != 0)) {// c is a leading surrogate with some FCD data
if (buildCMTable) {
@ -1756,8 +1757,12 @@ uprv_uca_addMultiCMContractions(tempUCATable *t,
CombinClassTable *cmLookup = t->cmLookup;
UChar newDecomp[256];
int32_t maxComp, newDecLen;
const uint16_t *fcdTrieData = unorm_getFCDTrie(status);
int16_t curClass = (unorm_getFCD16(fcdTrieData, c->tailoringCM) & 0xff);
UChar32 fcdHighStart;
const uint16_t *fcdTrieIndex = unorm_getFCDTrieIndex(fcdHighStart, status);
if (U_FAILURE(*status)) {
return;
}
int16_t curClass = (unorm_getFCD16(fcdTrieIndex, c->tailoringCM) & 0xff);
CompData *precomp = c->precomp;
int32_t compLen = c->compLen;
UChar *comp = c->comp;
@ -1822,8 +1827,12 @@ uprv_uca_addTailCanonicalClosures(tempUCATable *t,
UCAElements *el,
UErrorCode *status) {
CombinClassTable *cmLookup = t->cmLookup;
const uint16_t *fcdTrieData = unorm_getFCDTrie(status);
int16_t maxIndex = (unorm_getFCD16(fcdTrieData, cMark) & 0xff );
UChar32 fcdHighStart;
const uint16_t *fcdTrieIndex = unorm_getFCDTrieIndex(fcdHighStart, status);
if (U_FAILURE(*status)) {
return;
}
int16_t maxIndex = (unorm_getFCD16(fcdTrieIndex, cMark) & 0xff );
UCAElements element;
uint16_t *index;
UChar decomp[256];
@ -1837,8 +1846,8 @@ uprv_uca_addTailCanonicalClosures(tempUCATable *t,
return;
}
index = cmLookup->index;
int32_t cClass=(unorm_getFCD16(fcdTrieData, cMark) & 0xff);
maxIndex = (int32_t)index[(unorm_getFCD16(fcdTrieData, cMark) & 0xff)-1];
int32_t cClass=(unorm_getFCD16(fcdTrieIndex, cMark) & 0xff);
maxIndex = (int32_t)index[(unorm_getFCD16(fcdTrieIndex, cMark) & 0xff)-1];
c.comp = comp;
c.decomp = decomp;
c.precomp = precomp;
@ -1861,7 +1870,7 @@ uprv_uca_addTailCanonicalClosures(tempUCATable *t,
// other combining mark combinations.
precomp[precompLen].cp=comp[0];
curClass = precomp[precompLen].cClass =
index[unorm_getFCD16(fcdTrieData, decomp[1]) & 0xff];
index[unorm_getFCD16(fcdTrieIndex, decomp[1]) & 0xff];
precompLen++;
replacedPos=0;
for (decompLen=0; decompLen< (int32_t)el->cSize; decompLen++) {
@ -1901,7 +1910,7 @@ uprv_uca_addTailCanonicalClosures(tempUCATable *t,
// This is a fix for tailoring contractions with accented
// character at the end of contraction string.
if ((len>2) &&
(unorm_getFCD16(fcdTrieData, comp[len-2]) & 0xff00)==0) {
(unorm_getFCD16(fcdTrieIndex, comp[len-2]) & 0xff00)==0) {
uprv_uca_addFCD4AccentedContractions(t, colEl, comp, len, &element, status);
}
@ -1928,9 +1937,10 @@ uprv_uca_canonicalClosure(tempUCATable *t,
UColToken *tok;
uint32_t i = 0, j = 0;
UChar baseChar, firstCM;
const uint16_t *fcdTrieData = unorm_getFCDTrie(status);
UChar32 fcdHighStart;
const uint16_t *fcdTrieIndex = unorm_getFCDTrieIndex(fcdHighStart, status);
if(!U_SUCCESS(*status)) {
if(U_FAILURE(*status)) {
return 0;
}
@ -1999,7 +2009,7 @@ uprv_uca_canonicalClosure(tempUCATable *t,
}
if(src->UCA != NULL) {
for(j = 0; j<el.cSize; j++) {
int16_t fcd = unorm_getFCD16(fcdTrieData, el.cPoints[j]);
int16_t fcd = unorm_getFCD16(fcdTrieIndex, el.cPoints[j]);
if ( (fcd & 0xff) == 0 ) {
baseChar = el.cPoints[j]; // last base character
firstCM=0; // reset combining mark value

View File

@ -34,7 +34,8 @@ U_NAMESPACE_USE
#define SECOND_LAST_BYTE_SHIFT_ 8
#define SUPPLEMENTARY_MIN_VALUE_ 0x10000
static const uint16_t *FCD_ = NULL;
static const uint16_t *fcdTrieIndex = NULL;
static UChar32 fcdHighStart = 0;
// internal methods -------------------------------------------------
@ -99,7 +100,7 @@ inline int hash(uint32_t ce)
U_CDECL_BEGIN
static UBool U_CALLCONV
usearch_cleanup(void) {
FCD_ = NULL;
fcdTrieIndex = NULL;
return TRUE;
}
U_CDECL_END
@ -113,8 +114,8 @@ U_CDECL_END
static
inline void initializeFCD(UErrorCode *status)
{
if (FCD_ == NULL) {
FCD_ = unorm_getFCDTrie(status);
if (fcdTrieIndex == NULL) {
fcdTrieIndex = unorm_getFCDTrieIndex(fcdHighStart, status);
ucln_i18n_registerCleanup(UCLN_I18N_USEARCH, usearch_cleanup);
}
}
@ -133,22 +134,9 @@ static
uint16_t getFCD(const UChar *str, int32_t *offset,
int32_t strlength)
{
int32_t temp = *offset;
uint16_t result;
UChar ch = str[temp];
result = unorm_getFCD16(FCD_, ch);
temp ++;
if (result && temp != strlength && UTF_IS_FIRST_SURROGATE(ch)) {
ch = str[temp];
if (UTF_IS_SECOND_SURROGATE(ch)) {
result = unorm_getFCD16FromSurrogatePair(FCD_, result, ch);
temp ++;
} else {
result = 0;
}
}
*offset = temp;
const UChar *temp = str + *offset;
uint16_t result = unorm_nextFCD16(fcdTrieIndex, fcdHighStart, temp, str + strlength);
*offset = (int32_t)(temp - str);
return result;
}

View File

@ -49,7 +49,7 @@ cnmdptst.o cnormtst.o cnumtst.o crestst.o creststn.o cturtst.o \
cucdapi.o cucdtst.o custrtst.o cstrcase.o cutiltst.o nucnvtst.o nccbtst.o bocu1tst.o \
cbiditst.o cbididat.o eurocreg.o udatatst.o utf16tst.o utransts.o \
ncnvfbts.o ncnvtst.o putiltst.o cstrtest.o udatpg_test.o utf8tst.o \
stdnmtst.o usrchtst.o custrtrn.o sorttest.o trietest.o usettest.o \
stdnmtst.o usrchtst.o custrtrn.o sorttest.o trietest.o trie2test.o usettest.o \
uenumtst.o utmstest.o currtest.o \
idnatest.o nfsprep.o spreptst.o sprpdata.o \
hpmufn.o tracetst.o reapits.o utexttst.o ucsdetst.o

View File

@ -555,6 +555,10 @@
RelativePath=".\sorttest.c"
>
</File>
<File
RelativePath=".\trie2test.c"
>
</File>
<File
RelativePath=".\trietest.c"
>

View File

@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
* Copyright (c) 1997-2006, International Business Machines Corporation and
* Copyright (c) 1997-2008, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/********************************************************************************
@ -24,6 +24,7 @@ void addNEWResourceBundleTest(TestNode**);
void addHashtableTest(TestNode** root);
void addCStringTest(TestNode** root);
void addTrieTest(TestNode** root);
void addTrie2Test(TestNode** root);
void addEnumerationTest(TestNode** root);
void addPosixTest(TestNode** root);
void addSortTest(TestNode** root);
@ -34,6 +35,7 @@ void addUtility(TestNode** root)
{
addCStringTest(root);
addTrieTest(root);
addTrie2Test(root);
addLocaleTest(root);
addCLDRTest(root);
addUnicodeTest(root);

File diff suppressed because it is too large Load Diff

View File

@ -765,15 +765,41 @@ static void TestSerializationAndUnserialization()
/* first time */
status = U_ZERO_ERROR;
sel = ucnvsel_open((const char**)encodings, testCaseIdx-prev, excluded_sets[excluded_set_id], UCNV_ROUNDTRIP_SET, &status);
if (U_FAILURE(status)) {
log_err("ucnvsel_open(test case %d) failed: %s\n", curCase, u_errorName(status));
uprv_free(encodings);
uprv_free(names);
return;
}
buffer = NULL;
ser_len = ucnvsel_serialize(sel, NULL, 0, &status);
status = U_ZERO_ERROR;
if (status != U_BUFFER_OVERFLOW_ERROR) {
log_err("ucnvsel_serialize(test case %d preflighting) failed: %s\n", curCase, u_errorName(status));
ucnvsel_close(sel);
uprv_free(encodings);
uprv_free(names);
return;
}
buffer = uprv_malloc(ser_len);
status = U_ZERO_ERROR;
ucnvsel_serialize(sel, buffer, ser_len, &status);
ucnvsel_close(sel);
if (U_FAILURE(status)) {
log_err("ucnvsel_serialize(test case %d) failed: %s\n", curCase, u_errorName(status));
uprv_free(encodings);
uprv_free(names);
uprv_free(buffer);
return;
}
sel = ucnvsel_unserialize( buffer, ser_len,&status);
if (U_FAILURE(status)) {
log_err("ucnvsel_unserialize(test case %d) failed: %s\n", curCase, u_errorName(status));
uprv_free(encodings);
uprv_free(names);
uprv_free(buffer);
return;
}
/* count how many bytes (Is there a portable function that is more efficient than this?) */
f1 = fopenOrError("ConverterSelectorTestUTF16.txt");
@ -805,11 +831,21 @@ static void TestSerializationAndUnserialization()
break;
/* test, both with length, and NULL terminated */
res1 = ucnvsel_selectForString(sel, text+i, -1, &status);
if (U_FAILURE(status)) {
log_err("ucnvsel_selectForString(test case %d, string %d with NUL) failed: %s\n",
curCase, curTestCase, u_errorName(status));
continue;
}
/* make sure result is correct! */
verifyResultUTF16(text+i, (const char**) encodings, num_rndm_encodings, res1, excluded_sets[excluded_set_id], UCNV_ROUNDTRIP_SET);
uenum_close(res1);
res1 = ucnvsel_selectForString(sel, text+i, u_strlen(text+i), &status);
if (U_FAILURE(status)) {
log_err("ucnvsel_selectForString(test case %d, string %d with length) failed: %s\n",
curCase, curTestCase, u_errorName(status));
continue;
}
/* make sure result is correct! */
verifyResultUTF16(text+i, (const char**)encodings, num_rndm_encodings, res1, excluded_sets[excluded_set_id], UCNV_ROUNDTRIP_SET);
uenum_close(res1);

View File

@ -18,7 +18,7 @@ subdir = test
## Files to remove for 'make clean'
CLEANFILES = *~
SUBDIRS = collationperf charperf normperf ubrkperf unisetperf usetperf ustrperf utfperf
SUBDIRS = collationperf charperf normperf ubrkperf unisetperf usetperf ustrperf utfperf utrie2perf
## List of phony targets
.PHONY : everything all all-local all-recursive install install-local \

View File

@ -1,5 +1,5 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
# Visual C++ Express 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "charperf", "charperf\charperf.vcproj", "{D850A4B6-7D94-476E-9392-E9272DA4EAAF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "normperf", "normperf\normperf.vcproj", "{56CCC661-8D33-4F0A-B62F-C619CE843C68}"
@ -20,6 +20,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unisetperf", "unisetperf\un
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "strsrchperf", "strsrchperf\strsrchperf.vcproj", "{241DED26-1635-45E6-9564-7742AC8043B5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "utrie2perf", "utrie2perf\utrie2perf.vcproj", "{B9458CB3-9B09-402A-8C4C-43B6D0EA9691}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@ -108,6 +110,12 @@ Global
{241DED26-1635-45E6-9564-7742AC8043B5}.Release|Win32.Build.0 = Release|Win32
{241DED26-1635-45E6-9564-7742AC8043B5}.Release|x64.ActiveCfg = Release|x64
{241DED26-1635-45E6-9564-7742AC8043B5}.Release|x64.Build.0 = Release|x64
{B9458CB3-9B09-402A-8C4C-43B6D0EA9691}.Debug|Win32.ActiveCfg = Debug|Win32
{B9458CB3-9B09-402A-8C4C-43B6D0EA9691}.Debug|Win32.Build.0 = Debug|Win32
{B9458CB3-9B09-402A-8C4C-43B6D0EA9691}.Debug|x64.ActiveCfg = Debug|Win32
{B9458CB3-9B09-402A-8C4C-43B6D0EA9691}.Release|Win32.ActiveCfg = Release|Win32
{B9458CB3-9B09-402A-8C4C-43B6D0EA9691}.Release|Win32.Build.0 = Release|Win32
{B9458CB3-9B09-402A-8C4C-43B6D0EA9691}.Release|x64.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -0,0 +1,79 @@
## Makefile.in for ICU - test/perf/utrie2perf
## Copyright (c) 2001-2008, International Business Machines Corporation and
## others. All Rights Reserved.
## Source directory information
srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = ../../..
include $(top_builddir)/icudefs.mk
## Build directory information
subdir = test/perf/utrie2perf
## Extra files to remove for 'make clean'
CLEANFILES = *~ $(DEPS)
## Target information
TARGET = utrie2perf
CPPFLAGS += -I$(top_builddir)/common -I$(top_srcdir)/common -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/tools/ctestfw
LIBS = $(LIBCTESTFW) $(LIBICUI18N) $(LIBICUUC) $(LIBICUTOOLUTIL) $(DEFAULT_LIBS) $(LIB_M)
OBJECTS = utrie2perf.o
DEPS = $(OBJECTS:.o=.d)
## List of phony targets
.PHONY : all all-local install install-local clean clean-local \
distclean distclean-local dist dist-local check check-local
## Clear suffix list
.SUFFIXES :
## List of standard targets
all: all-local
install: install-local
clean: clean-local
distclean : distclean-local
dist: dist-local
check: all check-local
all-local: $(TARGET)
install-local:
dist-local:
clean-local:
test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
$(RMV) $(OBJECTS) $(TARGET)
distclean-local: clean-local
$(RMV) Makefile
check-local: all-local
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
$(TARGET) : $(OBJECTS)
$(LINK.cc) -o $@ $^ $(LIBS)
$(POST_BUILD_STEP)
invoke:
ICU_DATA=$${ICU_DATA:-$(top_builddir)/data/} TZ=PST8PDT $(INVOKE) $(INVOCATION)
ifeq (,$(MAKECMDGOALS))
-include $(DEPS)
else
ifneq ($(patsubst %clean,,$(MAKECMDGOALS)),)
ifneq ($(patsubst %install,,$(MAKECMDGOALS)),)
-include $(DEPS)
endif
endif
endif

View File

@ -0,0 +1,19 @@
rem Copyright (C) 2008, International Business Machines Corporation and others.
rem All Rights Reserved.
set PERF=c:\svn\icuproj\icu\utf8\source\test\perf\utrie2perf\x86\Release\utrie2perf
for %%f in (udhr_eng.txt
udhr_deu.txt
udhr_fra.txt
udhr_rus.txt
udhr_tha.txt
udhr_jpn.txt
udhr_cmn.txt
udhr_jpn.html) do (
%PERF% CheckFCD -f \temp\udhr\%%f -v -e UTF-8 --passes 3 --iterations 30000
rem %PERF% CheckFCDAlwaysGet -f \temp\udhr\%%f -v -e UTF-8 --passes 3 --iterations 30000
rem %PERF% CheckFCDUTF8 -f \temp\udhr\%%f -v -e UTF-8 --passes 3 --iterations 30000
%PERF% ToNFC -f \temp\udhr\%%f -v -e UTF-8 --passes 3 --iterations 30000
%PERF% GetBiDiClass -f \temp\udhr\%%f -v -e UTF-8 --passes 3 --iterations 30000
)

View File

@ -0,0 +1,261 @@
/*
**********************************************************************
* Copyright (C) 2002-2008, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* file name: utrie2perf.cpp
* encoding: US-ASCII
* tab size: 8 (not used)
* indentation:4
*
* created on: 2008sep07
* created by: Markus W. Scherer
*
* Performance test program for UTrie2.
*/
#include <stdio.h>
#include <stdlib.h>
#include "unicode/uchar.h"
#include "unicode/unorm.h"
#include "unicode/uperf.h"
#include "uoptions.h"
#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
#if 0
// Left over from when icu/branches/markus/utf8 could use both old UTrie
// and new UTrie2, switched with #if in unorm.cpp and ubidi_props.c.
// Comparative benchmarks were done in that branch on revision r24630
// and earlier.
U_CAPI void U_EXPORT2
unorm_initUTrie2(UErrorCode *pErrorCode);
U_CAPI void U_EXPORT2
ubidi_initUTrie2(UErrorCode *pErrorCode);
#endif
U_NAMESPACE_BEGIN
class UnicodeSet;
U_NAMESPACE_END
// Test object.
class UTrie2PerfTest : public UPerfTest {
public:
UTrie2PerfTest(int32_t argc, const char *argv[], UErrorCode &status)
: UPerfTest(argc, argv, NULL, 0, "", status),
utf8(NULL), utf8Length(0), countInputCodePoints(0) {
if (U_SUCCESS(status)) {
#if 0 // See comment at unorm_initUTrie2() forward declaration.
unorm_initUTrie2(&status);
ubidi_initUTrie2(&status);
#endif
int32_t inputLength;
UPerfTest::getBuffer(inputLength, status);
if(U_SUCCESS(status) && inputLength>0) {
countInputCodePoints = u_countChar32(buffer, bufferLen);
// Preflight the UTF-8 length and allocate utf8.
u_strToUTF8(NULL, 0, &utf8Length, buffer, bufferLen, &status);
if(status==U_BUFFER_OVERFLOW_ERROR) {
utf8=(char *)malloc(utf8Length);
if(utf8!=NULL) {
status=U_ZERO_ERROR;
u_strToUTF8(utf8, utf8Length, NULL, buffer, bufferLen, &status);
} else {
status=U_MEMORY_ALLOCATION_ERROR;
}
}
if(verbose) {
printf("code points:%ld len16:%ld len8:%ld "
"B/cp:%.3g\n",
(long)countInputCodePoints, (long)bufferLen, (long)utf8Length,
(double)utf8Length/countInputCodePoints);
}
}
}
}
virtual UPerfFunction* runIndexedTest(int32_t index, UBool exec, const char* &name, char* par = NULL);
const UChar *getBuffer() const { return buffer; }
int32_t getBufferLen() const { return bufferLen; }
char *utf8;
int32_t utf8Length;
// Number of code points in the input text.
int32_t countInputCodePoints;
};
// Performance test function object.
class Command : public UPerfFunction {
protected:
Command(const UTrie2PerfTest &testcase) : testcase(testcase) {}
public:
virtual ~Command() {}
// virtual void call(UErrorCode* pErrorCode) { ... }
virtual long getOperationsPerIteration() {
// Number of code points tested.
return testcase.countInputCodePoints;
}
// virtual long getEventsPerIteration();
const UTrie2PerfTest &testcase;
UNormalizationCheckResult qcResult;
};
class CheckFCD : public Command {
protected:
CheckFCD(const UTrie2PerfTest &testcase) : Command(testcase) {}
public:
static UPerfFunction* get(const UTrie2PerfTest &testcase) {
return new CheckFCD(testcase);
}
virtual void call(UErrorCode* pErrorCode) {
UErrorCode errorCode=U_ZERO_ERROR;
qcResult=unorm_quickCheck(testcase.getBuffer(), testcase.getBufferLen(),
UNORM_FCD, &errorCode);
if(U_FAILURE(errorCode)) {
fprintf(stderr, "error: unorm_quickCheck(UNORM_FCD) failed: %s\n",
u_errorName(errorCode));
}
}
};
#if 0 // See comment at unorm_initUTrie2() forward declaration.
class CheckFCDAlwaysGet : public Command {
protected:
CheckFCDAlwaysGet(const UTrie2PerfTest &testcase) : Command(testcase) {}
public:
static UPerfFunction* get(const UTrie2PerfTest &testcase) {
return new CheckFCDAlwaysGet(testcase);
}
virtual void call(UErrorCode* pErrorCode) {
UErrorCode errorCode=U_ZERO_ERROR;
qcResult=unorm_quickCheck(testcase.getBuffer(), testcase.getBufferLen(),
UNORM_FCD_ALWAYS_GET, &errorCode);
if(U_FAILURE(errorCode)) {
fprintf(stderr, "error: unorm_quickCheck(UNORM_FCD) failed: %s\n",
u_errorName(errorCode));
}
}
};
U_CAPI UBool U_EXPORT2
unorm_checkFCDUTF8(const uint8_t *src, int32_t srcLength, const UnicodeSet *nx);
class CheckFCDUTF8 : public Command {
protected:
CheckFCDUTF8(const UTrie2PerfTest &testcase) : Command(testcase) {}
public:
static UPerfFunction* get(const UTrie2PerfTest &testcase) {
return new CheckFCDUTF8(testcase);
}
virtual void call(UErrorCode* pErrorCode) {
UBool isFCD=unorm_checkFCDUTF8((const uint8_t *)testcase.utf8, testcase.utf8Length, NULL);
if(isFCD>1) {
fprintf(stderr, "error: bogus result from unorm_checkFCDUTF8()\n");
}
}
};
#endif
class ToNFC : public Command {
protected:
ToNFC(const UTrie2PerfTest &testcase) : Command(testcase) {
UErrorCode errorCode=U_ZERO_ERROR;
destCapacity=unorm_normalize(testcase.getBuffer(), testcase.getBufferLen(),
UNORM_NFC, 0,
NULL, 0,
&errorCode);
dest=new UChar[destCapacity];
}
~ToNFC() {
delete [] dest;
}
public:
static UPerfFunction* get(const UTrie2PerfTest &testcase) {
return new ToNFC(testcase);
}
virtual void call(UErrorCode* pErrorCode) {
UErrorCode errorCode=U_ZERO_ERROR;
int32_t destLength=unorm_normalize(testcase.getBuffer(), testcase.getBufferLen(),
UNORM_NFC, 0,
dest, destCapacity,
&errorCode);
if(U_FAILURE(errorCode) || destLength!=destCapacity) {
fprintf(stderr, "error: unorm_normalize(UNORM_NFC) failed: %s\n",
u_errorName(errorCode));
}
}
private:
UChar *dest;
int32_t destCapacity;
};
class GetBiDiClass : public Command {
protected:
GetBiDiClass(const UTrie2PerfTest &testcase) : Command(testcase) {}
public:
static UPerfFunction* get(const UTrie2PerfTest &testcase) {
return new GetBiDiClass(testcase);
}
virtual void call(UErrorCode* pErrorCode) {
const UChar *buffer=testcase.getBuffer();
int32_t length=testcase.getBufferLen();
UChar32 c;
int32_t i;
uint32_t bitSet=0;
for(i=0; i<length;) {
U16_NEXT(buffer, i, length, c);
bitSet|=(uint32_t)1<<u_charDirection(c);
}
if(length>0 && bitSet==0) {
fprintf(stderr, "error: GetBiDiClass() did not collect bits\n");
}
}
};
UPerfFunction* UTrie2PerfTest::runIndexedTest(int32_t index, UBool exec, const char* &name, char* par) {
switch (index) {
case 0: name = "CheckFCD"; if (exec) return CheckFCD::get(*this); break;
case 1: name = "ToNFC"; if (exec) return ToNFC::get(*this); break;
case 2: name = "GetBiDiClass"; if (exec) return GetBiDiClass::get(*this); break;
#if 0 // See comment at unorm_initUTrie2() forward declaration.
case 3: name = "CheckFCDAlwaysGet"; if (exec) return CheckFCDAlwaysGet::get(*this); break;
case 4: name = "CheckFCDUTF8"; if (exec) return CheckFCDUTF8::get(*this); break;
#endif
default: name = ""; break;
}
return NULL;
}
int main(int argc, const char *argv[]) {
UErrorCode status = U_ZERO_ERROR;
UTrie2PerfTest test(argc, argv, status);
if (U_FAILURE(status)){
printf("The error is %s\n", u_errorName(status));
test.usage();
return status;
}
if (test.run() == FALSE){
fprintf(stderr, "FAILED: Tests could not be run please check the "
"arguments.\n");
return -1;
}
return 0;
}

View File

@ -0,0 +1,59 @@
#!/usr/bin/perl
# ********************************************************************
# * COPYRIGHT:
# * Copyright (c) 2005-2008, International Business Machines Corporation and
# * others. All Rights Reserved.
# ********************************************************************
#use strict;
require "../perldriver/Common.pl";
use lib '../perldriver';
use PerfFramework;
my $options = {
"title"=>"UTF performance: ICU (".$ICUPreviousVersion." and ".$ICULatestVersion.")",
"headers"=>"ICU".$ICUPreviousVersion." ICU".$ICULatestVersion,
"operationIs"=>"gb18030 encoding string",
"passes"=>"1",
"time"=>"2",
#"outputType"=>"HTML",
"dataDir"=>$ConversionDataPath,
"outputDir"=>"../results"
};
# programs
# tests will be done for all the programs. Results will be stored and connected
my $p1;
my $p2;
if ($OnWindows) {
$p1 = $ICUPathPrevious."/utfperf/$WindowsPlatform/Release/utfperf.exe -e gb18030"; # Previous
$p2 = $ICUPathLatest."/utfperf/$WindowsPlatform/Release/utfperf.exe -e gb18030"; # Latest
} else {
$p1 = $ICUPathPrevious."/utfperf/utfperf -e gb18030"; # Previous
$p2 = $ICUPathLatest."/utfperf/utfperf -e gb18030"; # Latest
}
my $tests = {
"Roundtrip", ["$p1 Roundtrip", "$p2 Roundtrip"],
"FromUnicode", ["$p1 FromUnicode", "$p2 FromUnicode"],
"FromUTF8", ["$p1 FromUTF8", "$p2 FromUTF8"],
#"UTF-8", ["$p UTF_8"],
#"UTF-8 small buffer", ["$p UTF_8_SB"],
#"SCSU", ["$p SCSU"],
#"SCSU small buffer", ["$p SCSU_SB"],
#"BOCU_1", ["$p BOCU_1"],
#"BOCU_1 small buffer", ["$p BOCU_1_SB"],
};
my $dataFiles = {
"",
[
"xuzhimo.txt"
]
};
runTests($options, $tests, $dataFiles);

View File

@ -0,0 +1,25 @@
#!/bin/sh
# Copyright (C) 2008, International Business Machines Corporation and others.
# All Rights Reserved.
# export LD_LIBRARY_PATH=/home/mscherer/svn.icu/utf8-dev/lib:/home/mscherer/svn.icu/utf8-dev/tools/ctestfw
# Echo shell script commands.
set -ex
PERF=~/svn.icu/utf8-dev/test/perf/utrie2perf/utrie2perf
for file in udhr_eng.txt \
udhr_deu.txt \
udhr_fra.txt \
udhr_rus.txt \
udhr_tha.txt \
udhr_jpn.txt \
udhr_cmn.txt \
udhr_jpn.html; do
$PERF CheckFCD -f ~/udhr/$file -v -e UTF-8 --passes 3 --iterations 30000
# $PERF CheckFCDAlwaysGet -f ~/udhr/$file -v -e UTF-8 --passes 3 --iterations 30000
# $PERF CheckFCDUTF8 -f ~/udhr/$file -v -e UTF-8 --passes 3 --iterations 30000
$PERF ToNFC -f ~/udhr/$file -v -e UTF-8 --passes 3 --iterations 30000
$PERF GetBiDiClass -f ~/udhr/$file -v -e UTF-8 --passes 3 --iterations 30000
done

View File

@ -0,0 +1,395 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="utrie2perf"
ProjectGUID="{B9458CB3-9B09-402A-8C4C-43B6D0EA9691}"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\x86\Debug"
IntermediateDirectory=".\x86\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\x86\Debug/utrie2perf.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\include;..\..\..\tools\toolutil;..\..\..\common;..\..\..\tools\ctestfw"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
PrecompiledHeaderFile=".\x86\Debug/utrie2perf.pch"
AssemblerListingLocation=".\x86\Debug/"
ObjectFile=".\x86\Debug/"
ProgramDataBaseFileName=".\x86\Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="icuucd.lib icutud.lib winmm.lib icutestd.lib"
OutputFile=".\x86\Debug/utrie2perf.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\..\..\lib\"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\x86\Debug/utrie2perf.pdb"
SubSystem="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\x86\Release"
IntermediateDirectory=".\x86\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\x86\Release/utrie2perf.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\include;..\..\..\tools\toolutil;..\..\..\common;..\..\..\tools\ctestfw"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile=".\x86\Release/utrie2perf.pch"
AssemblerListingLocation=".\x86\Release/"
ObjectFile=".\x86\Release/"
ProgramDataBaseFileName=".\x86\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="icuuc.lib icutu.lib icutest.lib winmm.lib"
OutputFile=".\x86\Release/utrie2perf.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\..\..\lib\"
ProgramDatabaseFile=".\x86\Release/utrie2perf.pdb"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory=".\x64\Debug"
IntermediateDirectory=".\x64\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
TypeLibraryName=".\x64\Debug/utrie2perf.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\include;..\..\..\tools\toolutil;..\..\..\common;..\..\..\tools\ctestfw"
PreprocessorDefinitions="WIN64;WIN32;_DEBUG;_CONSOLE"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
PrecompiledHeaderFile=".\x64\Debug/utrie2perf.pch"
AssemblerListingLocation=".\x64\Debug/"
ObjectFile=".\x64\Debug/"
ProgramDataBaseFileName=".\x64\Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="icuucd.lib icutud.lib winmm.lib icutestd.lib"
OutputFile=".\x64\Debug/utrie2perf.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\..\..\lib64\"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\x64\Debug/utrie2perf.pdb"
SubSystem="1"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory=".\x64\Release"
IntermediateDirectory=".\x64\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
TypeLibraryName=".\x64\Release/utrie2perf.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\..\include;..\..\..\tools\toolutil;..\..\..\common;..\..\..\tools\ctestfw"
PreprocessorDefinitions="WIN64;WIN32;NDEBUG;_CONSOLE"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile=".\x64\Release/utrie2perf.pch"
AssemblerListingLocation=".\x64\Release/"
ObjectFile=".\x64\Release/"
ProgramDataBaseFileName=".\x64\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="icuuc.lib icutu.lib icutest.lib winmm.lib"
OutputFile=".\x64\Release/utrie2perf.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\..\..\lib64\"
ProgramDatabaseFile=".\x64\Release/utrie2perf.pdb"
SubSystem="1"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath=".\utrie2perf.cpp"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,7 +1,7 @@
/*
*******************************************************************************
*
* Copyright (C) 2004-2006, International Business Machines
* Copyright (C) 2004-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@ -131,17 +131,16 @@ singleEnumLineFn(void *context,
UErrorCode *pErrorCode) {
const SingleEnum *sen;
char *s;
uint32_t start, limit, uv;
uint32_t start, end, uv;
int32_t value;
sen=(const SingleEnum *)context;
u_parseCodePointRange(fields[0][0], &start, &limit, pErrorCode);
u_parseCodePointRange(fields[0][0], &start, &end, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genbidi: syntax error in %s.txt field 0 at %s\n", sen->ucdFile, fields[0][0]);
exit(*pErrorCode);
}
++limit;
/* parse property alias */
s=trimTerminateField(fields[1][0], fields[1][1]);
@ -170,7 +169,7 @@ singleEnumLineFn(void *context,
exit(U_INTERNAL_PROGRAM_ERROR);
}
if(!upvec_setValue(pv, start, limit, sen->vecWord, uv, sen->vecMask, pErrorCode)) {
if(!upvec_setValue(pv, start, end, sen->vecWord, uv, sen->vecMask, pErrorCode)) {
fprintf(stderr, "genbidi error: unable to set %s code: %s\n",
sen->propName, u_errorName(*pErrorCode));
exit(*pErrorCode);
@ -232,17 +231,16 @@ binariesLineFn(void *context,
UErrorCode *pErrorCode) {
const Binaries *bin;
char *s;
uint32_t start, limit;
uint32_t start, end;
int32_t i;
bin=(const Binaries *)context;
u_parseCodePointRange(fields[0][0], &start, &limit, pErrorCode);
u_parseCodePointRange(fields[0][0], &start, &end, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genbidi: syntax error in %s.txt field 0 at %s\n", bin->ucdFile, fields[0][0]);
exit(*pErrorCode);
}
++limit;
/* parse binary property name */
s=(char *)u_skipWhitespace(fields[1][0]);
@ -262,7 +260,7 @@ binariesLineFn(void *context,
exit(U_INTERNAL_PROGRAM_ERROR);
}
if(!upvec_setValue(pv, start, limit, bin->binaries[i].vecWord, bin->binaries[i].vecValue, bin->binaries[i].vecMask, pErrorCode)) {
if(!upvec_setValue(pv, start, end, bin->binaries[i].vecWord, bin->binaries[i].vecValue, bin->binaries[i].vecMask, pErrorCode)) {
fprintf(stderr, "genbidi error: unable to set %s, code: %s\n",
bin->binaries[i].propName, u_errorName(*pErrorCode));
exit(*pErrorCode);
@ -524,7 +522,7 @@ unicodeDataLineFn(void *context,
/* get Mirrored flag, field 9 */
if(*fields[9][0]=='Y') {
if(!upvec_setValue(pv, c, c+1, 0, U_MASK(UBIDI_IS_MIRRORED_SHIFT), U_MASK(UBIDI_IS_MIRRORED_SHIFT), &errorCode)) {
if(!upvec_setValue(pv, c, c, 0, U_MASK(UBIDI_IS_MIRRORED_SHIFT), U_MASK(UBIDI_IS_MIRRORED_SHIFT), &errorCode)) {
fprintf(stderr, "genbidi error: unable to set 'is mirrored' for U+%04lx, code: %s\n",
(long)c, u_errorName(errorCode));
exit(errorCode);
@ -578,7 +576,7 @@ parseDB(const char *filename, UErrorCode *pErrorCode) {
for(i=0; i<LENGTHOF(defaultBidi); ++i) {
start=defaultBidi[i][0];
end=defaultBidi[i][1];
if(!upvec_setValue(pv, start, end+1, 0, (uint32_t)defaultBidi[i][2], UBIDI_CLASS_MASK, pErrorCode)) {
if(!upvec_setValue(pv, start, end, 0, (uint32_t)defaultBidi[i][2], UBIDI_CLASS_MASK, pErrorCode)) {
fprintf(stderr, "genbidi error: unable to set default bidi class for U+%04lx..U+%04lx, code: %s\n",
(long)start, (long)end, u_errorName(*pErrorCode));
exit(*pErrorCode);
@ -599,15 +597,14 @@ bidiClassLineFn(void *context,
char *fields[][2], int32_t fieldCount,
UErrorCode *pErrorCode) {
char *s;
uint32_t start, limit, value;
uint32_t start, end, value;
/* get the code point range */
u_parseCodePointRange(fields[0][0], &start, &limit, pErrorCode);
u_parseCodePointRange(fields[0][0], &start, &end, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genbidi: syntax error in DerivedBidiClass.txt field 0 at %s\n", fields[0][0]);
exit(*pErrorCode);
}
++limit;
/* parse bidi class */
s=trimTerminateField(fields[1][0], fields[1][1]);
@ -617,9 +614,9 @@ bidiClassLineFn(void *context,
exit(U_PARSE_ERROR);
}
if(!upvec_setValue(pv, start, limit, 0, value, UBIDI_CLASS_MASK, pErrorCode)) {
if(!upvec_setValue(pv, start, end, 0, value, UBIDI_CLASS_MASK, pErrorCode)) {
fprintf(stderr, "genbidi error: unable to set derived bidi class for U+%04x..U+%04x - %s\n",
(int)start, (int)limit-1, u_errorName(*pErrorCode));
(int)start, (int)end, u_errorName(*pErrorCode));
exit(*pErrorCode);
}
}

View File

@ -1,7 +1,7 @@
/*
*******************************************************************************
*
* Copyright (C) 2004-2005, International Business Machines
* Copyright (C) 2004-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@ -24,6 +24,7 @@
#include "cmemory.h"
#include "cstring.h"
#include "utrie.h"
#include "utrie2.h"
#include "uarrsort.h"
#include "unicode/udata.h"
#include "unewdata.h"
@ -184,7 +185,7 @@ addMirror(UChar32 src, UChar32 mirror) {
errorCode=U_ZERO_ERROR;
if(
!upvec_setValue(
pv, src, src+1, 0,
pv, src, src, 0,
(uint32_t)delta<<UBIDI_MIRROR_DELTA_SHIFT, (uint32_t)(-1)<<UBIDI_MIRROR_DELTA_SHIFT,
&errorCode)
) {
@ -293,7 +294,7 @@ generateData(const char *dataDir, UBool csource) {
static uint8_t jgArray[0x300]; /* at most for U+0600..U+08FF */
const uint32_t *row;
UChar32 start, limit, prev, jgStart;
UChar32 start, end, prev, jgStart;
int32_t i;
UNewDataMemory *pData;
@ -311,18 +312,18 @@ generateData(const char *dataDir, UBool csource) {
}
prev=jgStart=0;
for(i=0; (row=upvec_getRow(pv, i, &start, &limit))!=NULL; ++i) {
for(i=0; (row=upvec_getRow(pv, i, &start, &end))!=NULL && start<UPVEC_FIRST_SPECIAL_CP; ++i) {
/* store most values from vector column 0 in the trie */
if(!utrie_setRange32(pTrie, start, limit, *row, TRUE)) {
if(!utrie_setRange32(pTrie, start, end+1, *row, TRUE)) {
fprintf(stderr, "genbidi error: unable to set trie value (overflow)\n");
exit(U_BUFFER_OVERFLOW_ERROR);
}
/* store Joining_Group values from vector column 1 in a simple byte array */
if(row[1]!=0) {
if(start<0x600 || 0x900<=limit) {
if(start<0x600 || 0x8ff<end) {
fprintf(stderr, "genbidi error: Joining_Group for out-of-range code points U+%04lx..U+%04lx\n",
(long)start, (long)limit);
(long)start, (long)end);
exit(U_ILLEGAL_ARGUMENT_ERROR);
}
@ -336,8 +337,8 @@ generateData(const char *dataDir, UBool csource) {
}
}
/* set Joining_Group value for start..limit */
while(prev<limit) {
/* set Joining_Group value for start..end */
while(prev<=end) {
jgArray[prev++ -jgStart]=(uint8_t)row[1];
}
}
@ -379,6 +380,7 @@ generateData(const char *dataDir, UBool csource) {
if(csource) {
/* write .c file for hardcoded data */
UTrie trie={ NULL };
UTrie2 *trie2;
FILE *f;
utrie_unserialize(&trie, trieBlock, trieSize, &errorCode);
@ -387,7 +389,36 @@ generateData(const char *dataDir, UBool csource) {
stderr,
"genbidi error: failed to utrie_unserialize(ubidi.icu trie) - %s\n",
u_errorName(errorCode));
return;
exit(errorCode);
}
/* use UTrie2 */
dataInfo.formatVersion[0]=2;
dataInfo.formatVersion[2]=0;
dataInfo.formatVersion[3]=0;
trie2=utrie2_fromUTrie(&trie, 0, &errorCode);
if(U_FAILURE(errorCode)) {
fprintf(
stderr,
"genbidi error: utrie2_fromUTrie() failed - %s\n",
u_errorName(errorCode));
exit(errorCode);
}
{
/* delete lead surrogate code unit values */
UChar lead;
trie2=utrie2_cloneAsThawed(trie2, &errorCode);
for(lead=0xd800; lead<0xdc00; ++lead) {
utrie2_set32ForLeadSurrogateCodeUnit(trie2, lead, trie2->initialValue, &errorCode);
}
utrie2_freeze(trie2, UTRIE2_16_VALUE_BITS, &errorCode);
if(U_FAILURE(errorCode)) {
fprintf(
stderr,
"genbidi error: deleting lead surrogate code unit values failed - %s\n",
u_errorName(errorCode));
exit(errorCode);
}
}
f=usrc_create(dataDir, "ubidi_props_data.c");
@ -400,9 +431,9 @@ generateData(const char *dataDir, UBool csource) {
"static const int32_t ubidi_props_indexes[UBIDI_IX_TOP]={",
indexes, 32, UBIDI_IX_TOP,
"};\n\n");
usrc_writeUTrieArrays(f,
usrc_writeUTrie2Arrays(f,
"static const uint16_t ubidi_props_trieIndex[%ld]={\n", NULL,
&trie,
trie2,
"\n};\n\n");
usrc_writeArray(f,
"static const uint32_t ubidi_props_mirrors[%ld]={\n",
@ -419,14 +450,15 @@ generateData(const char *dataDir, UBool csource) {
" ubidi_props_mirrors,\n"
" ubidi_props_jgArray,\n",
f);
usrc_writeUTrieStruct(f,
usrc_writeUTrie2Struct(f,
" {\n",
&trie, "ubidi_props_trieIndex", NULL, NULL,
trie2, "ubidi_props_trieIndex", NULL,
" },\n");
usrc_writeArray(f, " { ", dataInfo.formatVersion, 8, 4, " }\n");
fputs("};\n", f);
fclose(f);
}
utrie2_close(trie2);
} else {
/* write the data */
pData=udata_create(dataDir, UBIDI_DATA_TYPE, UBIDI_DATA_NAME, &dataInfo,

View File

@ -126,17 +126,16 @@ binariesLineFn(void *context,
UErrorCode *pErrorCode) {
const Binaries *bin;
char *s;
uint32_t start, limit;
uint32_t start, end;
int32_t i;
bin=(const Binaries *)context;
u_parseCodePointRange(fields[0][0], &start, &limit, pErrorCode);
u_parseCodePointRange(fields[0][0], &start, &end, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "gencase: syntax error in %s.txt field 0 at %s\n", bin->ucdFile, fields[0][0]);
exit(*pErrorCode);
}
++limit;
/* parse binary property name */
s=(char *)u_skipWhitespace(fields[1][0]);
@ -156,7 +155,7 @@ binariesLineFn(void *context,
exit(U_INTERNAL_PROGRAM_ERROR);
}
if(!upvec_setValue(pv, start, limit, bin->binaries[i].vecWord, bin->binaries[i].vecValue, bin->binaries[i].vecMask, pErrorCode)) {
if(!upvec_setValue(pv, start, end, bin->binaries[i].vecWord, bin->binaries[i].vecValue, bin->binaries[i].vecMask, pErrorCode)) {
fprintf(stderr, "gencase error: unable to set %s, code: %s\n",
bin->binaries[i].propName, u_errorName(*pErrorCode));
exit(*pErrorCode);

View File

@ -26,6 +26,7 @@
#include "cstring.h"
#include "filestrm.h"
#include "utrie.h"
#include "utrie2.h"
#include "uarrsort.h"
#include "unicode/udata.h"
#include "unewdata.h"
@ -408,7 +409,7 @@ setProps(Props *p) {
errorCode=U_ZERO_ERROR;
if( value!=oldValue &&
!upvec_setValue(pv, p->code, p->code+1, 0, value, 0xffffffff, &errorCode)
!upvec_setValue(pv, p->code, p->code, 0, value, 0xffffffff, &errorCode)
) {
fprintf(stderr, "gencase error: unable to set case mapping values, code: %s\n",
u_errorName(errorCode));
@ -427,7 +428,7 @@ setProps(Props *p) {
extern void
addCaseSensitive(UChar32 first, UChar32 last) {
UErrorCode errorCode=U_ZERO_ERROR;
if(!upvec_setValue(pv, first, last+1, 0, UCASE_SENSITIVE, UCASE_SENSITIVE, &errorCode)) {
if(!upvec_setValue(pv, first, last, 0, UCASE_SENSITIVE, UCASE_SENSITIVE, &errorCode)) {
fprintf(stderr, "gencase error: unable to set UCASE_SENSITIVE, code: %s\n",
u_errorName(errorCode));
exit(errorCode);
@ -572,7 +573,7 @@ addClosureMapping(UChar32 src, UChar32 dest) {
}
errorCode=U_ZERO_ERROR;
if(!upvec_setValue(pv, src, src+1, 0, value, 0xffffffff, &errorCode)) {
if(!upvec_setValue(pv, src, src, 0, value, 0xffffffff, &errorCode)) {
fprintf(stderr, "gencase error: unable to set case mapping values, code: %s\n",
u_errorName(errorCode));
exit(errorCode);
@ -717,7 +718,7 @@ makeCaseClosure() {
UChar *p;
uint32_t *row;
uint32_t value;
UChar32 start, limit, c, c2;
UChar32 start, end, c, c2;
int32_t i, j;
UBool someMappingsAdded;
@ -751,10 +752,10 @@ makeCaseClosure() {
someMappingsAdded=FALSE;
i=0;
while((row=upvec_getRow(pv, i, &start, &limit))!=NULL) {
while((row=upvec_getRow(pv, i, &start, &end))!=NULL && start<UPVEC_FIRST_SPECIAL_CP) {
value=*row;
if(value!=0) {
while(start<limit) {
while(start<=end) {
if(addClosure(start, U_SENTINEL, U_SENTINEL, start, value)) {
someMappingsAdded=TRUE;
@ -762,7 +763,7 @@ makeCaseClosure() {
* stop this loop because pv was changed and row is not valid any more
* skip all rows below the current start
*/
while((row=upvec_getRow(pv, i, NULL, &limit))!=NULL && start>=limit) {
while((row=upvec_getRow(pv, i, NULL, &end))!=NULL && start>end) {
++i;
}
row=NULL; /* signal to continue with outer loop, without further ++i */
@ -1038,7 +1039,7 @@ generateData(const char *dataDir, UBool csource) {
static uint8_t trieBlock[40000];
const uint32_t *row;
UChar32 start, limit;
UChar32 start, end;
int32_t i;
UNewDataMemory *pData;
@ -1053,8 +1054,8 @@ generateData(const char *dataDir, UBool csource) {
exit(U_MEMORY_ALLOCATION_ERROR);
}
for(i=0; (row=upvec_getRow(pv, i, &start, &limit))!=NULL; ++i) {
if(!utrie_setRange32(pTrie, start, limit, *row, TRUE)) {
for(i=0; (row=upvec_getRow(pv, i, &start, &end))!=NULL; ++i) {
if(start<UPVEC_FIRST_SPECIAL_CP && !utrie_setRange32(pTrie, start, end+1, *row, TRUE)) {
fprintf(stderr, "gencase error: unable to set trie value (overflow)\n");
exit(U_BUFFER_OVERFLOW_ERROR);
}
@ -1084,6 +1085,7 @@ generateData(const char *dataDir, UBool csource) {
if(csource) {
/* write .c file for hardcoded data */
UTrie trie={ NULL };
UTrie2 *trie2;
FILE *f;
utrie_unserialize(&trie, trieBlock, trieSize, &errorCode);
@ -1092,7 +1094,36 @@ generateData(const char *dataDir, UBool csource) {
stderr,
"gencase error: failed to utrie_unserialize(ucase.icu trie) - %s\n",
u_errorName(errorCode));
return;
exit(errorCode);
}
/* use UTrie2 */
dataInfo.formatVersion[0]=2;
dataInfo.formatVersion[2]=0;
dataInfo.formatVersion[3]=0;
trie2=utrie2_fromUTrie(&trie, 0, &errorCode);
if(U_FAILURE(errorCode)) {
fprintf(
stderr,
"gencase error: utrie2_fromUTrie() failed - %s\n",
u_errorName(errorCode));
exit(errorCode);
}
{
/* delete lead surrogate code unit values */
UChar lead;
trie2=utrie2_cloneAsThawed(trie2, &errorCode);
for(lead=0xd800; lead<0xdc00; ++lead) {
utrie2_set32ForLeadSurrogateCodeUnit(trie2, lead, trie2->initialValue, &errorCode);
}
utrie2_freeze(trie2, UTRIE2_16_VALUE_BITS, &errorCode);
if(U_FAILURE(errorCode)) {
fprintf(
stderr,
"gencase error: deleting lead surrogate code unit values failed - %s\n",
u_errorName(errorCode));
exit(errorCode);
}
}
f=usrc_create(dataDir, "ucase_props_data.c");
@ -1105,9 +1136,9 @@ generateData(const char *dataDir, UBool csource) {
"static const int32_t ucase_props_indexes[UCASE_IX_TOP]={",
indexes, 32, UCASE_IX_TOP,
"};\n\n");
usrc_writeUTrieArrays(f,
usrc_writeUTrie2Arrays(f,
"static const uint16_t ucase_props_trieIndex[%ld]={\n", NULL,
&trie,
trie2,
"\n};\n\n");
usrc_writeArray(f,
"static const uint16_t ucase_props_exceptions[%ld]={\n",
@ -1124,14 +1155,15 @@ generateData(const char *dataDir, UBool csource) {
" ucase_props_exceptions,\n"
" ucase_props_unfold,\n",
f);
usrc_writeUTrieStruct(f,
usrc_writeUTrie2Struct(f,
" {\n",
&trie, "ucase_props_trieIndex", NULL, NULL,
trie2, "ucase_props_trieIndex", NULL,
" },\n");
usrc_writeArray(f, " { ", dataInfo.formatVersion, 8, 4, " }\n");
fputs("};\n", f);
fclose(f);
}
utrie2_close(trie2);
} else {
/* write the data */
pData=udata_create(dataDir, UCASE_DATA_TYPE, UCASE_DATA_NAME, &dataInfo,

View File

@ -26,6 +26,7 @@
#include "filestrm.h"
#include "unicode/udata.h"
#include "utrie.h"
#include "utrie2.h"
#include "unicode/uset.h"
#include "toolutil.h"
#include "unewdata.h"
@ -1787,6 +1788,31 @@ processData() {
}
}
/* is this a norm32 with a special index for a lead surrogate? */
static U_INLINE UBool
isNorm32LeadSurrogate(uint32_t norm32) {
return _NORM_MIN_SPECIAL<=norm32 && norm32<_NORM_SURROGATES_TOP;
}
/* normTrie: 32-bit trie result may contain a special extraData index with the folding offset */
static int32_t U_CALLCONV
getFoldingNormOffset(uint32_t norm32) {
if(isNorm32LeadSurrogate(norm32)) {
return
UTRIE_BMP_INDEX_LENGTH+
(((int32_t)norm32>>(_NORM_EXTRA_SHIFT-UTRIE_SURROGATE_BLOCK_BITS))&
(0x3ff<<UTRIE_SURROGATE_BLOCK_BITS));
} else {
return 0;
}
}
/* auxTrie: the folding offset is in bits 9..0 of the 16-bit trie result */
static int32_t U_CALLCONV
getFoldingAuxOffset(uint32_t data) {
return (int32_t)(data&_NORM_AUX_FNC_MASK)<<UTRIE_SURROGATE_BLOCK_BITS;
}
#endif /* #if !UCONFIG_NO_NORMALIZATION */
extern void
@ -1953,20 +1979,23 @@ generateData(const char *dataDir, UBool csource) {
if(csource) {
#if UCONFIG_NO_NORMALIZATION
/* no csource for dummy mode..? */
fprintf(stderr, "gennorm error: UCONFIG_NO_NORMALIZATION is on in csource mode.\n");
exit(1);
/* no csource for dummy mode..? */
fprintf(stderr, "gennorm error: UCONFIG_NO_NORMALIZATION is on in csource mode.\n");
exit(1);
#else
/* write .c file for hardcoded data */
UTrie normTrie2={ NULL }, fcdTrie2={ NULL }, auxTrie2={ NULL };
UTrie normRuntimeTrie={ NULL }, fcdRuntimeTrie={ NULL }, auxRuntimeTrie={ NULL };
UTrie2 *normRuntimeTrie2, *fcdRuntimeTrie2=NULL, *auxRuntimeTrie2=NULL;
FILE *f;
utrie_unserialize(&normTrie2, normTrieBlock, normTrieSize, &errorCode);
utrie_unserialize(&normRuntimeTrie, normTrieBlock, normTrieSize, &errorCode);
normRuntimeTrie.getFoldingOffset=getFoldingNormOffset;
if(fcdTrieSize>0) {
utrie_unserialize(&fcdTrie2, fcdTrieBlock, fcdTrieSize, &errorCode);
utrie_unserialize(&fcdRuntimeTrie, fcdTrieBlock, fcdTrieSize, &errorCode);
}
if(auxTrieSize>0) {
utrie_unserialize(&auxTrie2, auxTrieBlock, auxTrieSize, &errorCode);
utrie_unserialize(&auxRuntimeTrie, auxTrieBlock, auxTrieSize, &errorCode);
auxRuntimeTrie.getFoldingOffset=getFoldingAuxOffset;
}
if(U_FAILURE(errorCode)) {
fprintf(
@ -1976,6 +2005,41 @@ generateData(const char *dataDir, UBool csource) {
exit(errorCode);
}
/* use UTrie2 */
dataInfo.formatVersion[0]=3;
dataInfo.formatVersion[2]=0;
dataInfo.formatVersion[3]=0;
normRuntimeTrie2=utrie2_fromUTrie(&normRuntimeTrie, 0, &errorCode);
if(fcdTrieSize>0) {
fcdRuntimeTrie2=utrie2_fromUTrie(&fcdRuntimeTrie, 0, &errorCode);
}
if(auxTrieSize>0) {
auxRuntimeTrie2=utrie2_fromUTrie(&auxRuntimeTrie, 0, &errorCode);
}
if(U_FAILURE(errorCode)) {
fprintf(
stderr,
"gennorm error: utrie2_fromUTrie() failed - %s\n",
u_errorName(errorCode));
exit(errorCode);
}
if(auxTrieSize>0) {
/* delete lead surrogate code unit values */
UChar lead;
auxRuntimeTrie2=utrie2_cloneAsThawed(auxRuntimeTrie2, &errorCode);
for(lead=0xd800; lead<0xdc00; ++lead) {
utrie2_set32ForLeadSurrogateCodeUnit(auxRuntimeTrie2, lead, auxRuntimeTrie2->initialValue, &errorCode);
}
utrie2_freeze(auxRuntimeTrie2, UTRIE2_16_VALUE_BITS, &errorCode);
if(U_FAILURE(errorCode)) {
fprintf(
stderr,
"gennorm error: deleting lead surrogate code unit values failed - %s\n",
u_errorName(errorCode));
exit(errorCode);
}
}
f=usrc_create(dataDir, "unorm_props_data.c");
if(f!=NULL) {
usrc_writeArray(f,
@ -1990,14 +2054,14 @@ generateData(const char *dataDir, UBool csource) {
"static const int32_t indexes[_NORM_INDEX_TOP]={\n",
indexes, 32, _NORM_INDEX_TOP,
"\n};\n\n");
usrc_writeUTrieArrays(f,
usrc_writeUTrie2Arrays(f,
"static const uint16_t normTrie_index[%ld]={\n",
"static const uint32_t normTrie_data32[%ld]={\n",
&normTrie2,
normRuntimeTrie2,
"\n};\n\n");
usrc_writeUTrieStruct(f,
"static const UTrie normTrie={\n",
&normTrie2, "normTrie_index", "normTrie_data32", "getFoldingNormOffset",
usrc_writeUTrie2Struct(f,
"static const UTrie2 normTrie={\n",
normRuntimeTrie2, "normTrie_index", "normTrie_data32",
"};\n\n");
usrc_writeArray(f,
"static const uint16_t extraData[%ld]={\n",
@ -2008,28 +2072,28 @@ generateData(const char *dataDir, UBool csource) {
combiningTable, 16, combiningTableTop,
"\n};\n\n");
if(fcdTrieSize>0) {
usrc_writeUTrieArrays(f,
usrc_writeUTrie2Arrays(f,
"static const uint16_t fcdTrie_index[%ld]={\n", NULL,
&fcdTrie2,
fcdRuntimeTrie2,
"\n};\n\n");
usrc_writeUTrieStruct(f,
"static const UTrie fcdTrie={\n",
&fcdTrie2, "fcdTrie_index", NULL, NULL,
usrc_writeUTrie2Struct(f,
"static const UTrie2 fcdTrie={\n",
fcdRuntimeTrie2, "fcdTrie_index", NULL,
"};\n\n");
} else {
fputs( "static const UTrie fcdTrie={ NULL };\n\n", f);
fputs( "static const UTrie2 fcdTrie={ NULL };\n\n", f);
}
if(auxTrieSize>0) {
usrc_writeUTrieArrays(f,
usrc_writeUTrie2Arrays(f,
"static const uint16_t auxTrie_index[%ld]={\n", NULL,
&auxTrie2,
auxRuntimeTrie2,
"\n};\n\n");
usrc_writeUTrieStruct(f,
"static const UTrie auxTrie={\n",
&auxTrie2, "auxTrie_index", NULL, "getFoldingAuxOffset",
usrc_writeUTrie2Struct(f,
"static const UTrie2 auxTrie={\n",
auxRuntimeTrie2, "auxTrie_index", NULL,
"};\n\n");
} else {
fputs( "static const UTrie auxTrie={ NULL };\n\n", f);
fputs( "static const UTrie2 auxTrie={ NULL };\n\n", f);
}
usrc_writeArray(f,
"static const uint16_t canonStartSets[%ld]={\n",
@ -2037,6 +2101,9 @@ generateData(const char *dataDir, UBool csource) {
"\n};\n\n");
fclose(f);
}
utrie2_close(normRuntimeTrie2);
utrie2_close(fcdRuntimeTrie2);
utrie2_close(auxRuntimeTrie2);
#endif
} else {
/* write the data */

View File

@ -1,7 +1,7 @@
/*
*******************************************************************************
*
* Copyright (C) 1999-2005, International Business Machines
* Copyright (C) 1999-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@ -339,7 +339,7 @@ unicodeDataLineFn(void *context,
exit(U_PARSE_ERROR);
}
}
if(!upvec_setValue(pv, p.code, p.code+1, 2, (uint32_t)i, UPROPS_DT_MASK, pErrorCode)) {
if(!upvec_setValue(pv, p.code, p.code, 2, (uint32_t)i, UPROPS_DT_MASK, pErrorCode)) {
fprintf(stderr, "genprops error: unable to set decomposition type: %s\n", u_errorName(*pErrorCode));
exit(*pErrorCode);
}
@ -544,7 +544,7 @@ repeatAreaProps() {
/* Hangul have canonical decompositions */
errorCode=U_ZERO_ERROR;
if(!upvec_setValue(pv, 0xac00, 0xd7a4, 2, (uint32_t)U_DT_CANONICAL, UPROPS_DT_MASK, &errorCode)) {
if(!upvec_setValue(pv, 0xac00, 0xd7a3, 2, (uint32_t)U_DT_CANONICAL, UPROPS_DT_MASK, &errorCode)) {
fprintf(stderr, "genprops error: unable to set decomposition type: %s\n", u_errorName(errorCode));
exit(errorCode);
}

View File

@ -34,7 +34,7 @@
/* data --------------------------------------------------------------------- */
static UNewTrie *trie;
static UNewTrie *newTrie;
uint32_t *pv;
static int32_t pvCount;
@ -166,17 +166,16 @@ singleEnumLineFn(void *context,
UErrorCode *pErrorCode) {
const SingleEnum *sen;
char *s;
uint32_t start, limit, uv;
uint32_t start, end, uv;
int32_t value;
sen=(const SingleEnum *)context;
u_parseCodePointRange(fields[0][0], &start, &limit, pErrorCode);
u_parseCodePointRange(fields[0][0], &start, &end, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genprops: syntax error in %s.txt field 0 at %s\n", sen->ucdFile, fields[0][0]);
exit(*pErrorCode);
}
++limit;
/* parse property alias */
s=trimTerminateField(fields[1][0], fields[1][1]);
@ -205,7 +204,11 @@ singleEnumLineFn(void *context,
exit(U_INTERNAL_PROGRAM_ERROR);
}
if(!upvec_setValue(pv, start, limit, sen->vecWord, uv, sen->vecMask, pErrorCode)) {
if(start==0 && end==0x10ffff) {
/* Also set bits for initialValue and errorValue. */
end=UPVEC_MAX_CP;
}
if(!upvec_setValue(pv, start, end, sen->vecWord, uv, sen->vecMask, pErrorCode)) {
fprintf(stderr, "genprops error: unable to set %s code: %s\n",
sen->propName, u_errorName(*pErrorCode));
exit(*pErrorCode);
@ -330,17 +333,16 @@ binariesLineFn(void *context,
UErrorCode *pErrorCode) {
const Binaries *bin;
char *s;
uint32_t start, limit, uv;
uint32_t start, end, uv;
int32_t i;
bin=(const Binaries *)context;
u_parseCodePointRange(fields[0][0], &start, &limit, pErrorCode);
u_parseCodePointRange(fields[0][0], &start, &end, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genprops: syntax error in %s.txt field 0 at %s\n", bin->ucdFile, fields[0][0]);
exit(*pErrorCode);
}
++limit;
/* parse binary property name */
s=(char *)u_skipWhitespace(fields[1][0]);
@ -364,7 +366,11 @@ binariesLineFn(void *context,
}
uv=U_MASK(bin->binaries[i].vecShift);
if(!upvec_setValue(pv, start, limit, bin->binaries[i].vecWord, uv, uv, pErrorCode)) {
if(start==0 && end==0x10ffff) {
/* Also set bits for initialValue and errorValue. */
end=UPVEC_MAX_CP;
}
if(!upvec_setValue(pv, start, end, bin->binaries[i].vecWord, uv, uv, pErrorCode)) {
fprintf(stderr, "genprops error: unable to set %s code: %s\n",
bin->binaries[i].propName, u_errorName(*pErrorCode));
exit(*pErrorCode);
@ -407,7 +413,7 @@ initAdditionalProperties() {
U_CFUNC void
exitAdditionalProperties() {
utrie_close(trie);
utrie_close(newTrie);
upvec_close(pv);
}
@ -478,10 +484,10 @@ generateAdditionalProperties(char *filename, const char *suffix, UErrorCode *pEr
* W for plane 2
*/
*pErrorCode=U_ZERO_ERROR;
if( !upvec_setValue(pv, 0xe000, 0xf900, 0, (uint32_t)(U_EA_AMBIGUOUS<<UPROPS_EA_SHIFT), UPROPS_EA_MASK, pErrorCode) ||
!upvec_setValue(pv, 0xf0000, 0xffffe, 0, (uint32_t)(U_EA_AMBIGUOUS<<UPROPS_EA_SHIFT), UPROPS_EA_MASK, pErrorCode) ||
!upvec_setValue(pv, 0x100000, 0x10fffe, 0, (uint32_t)(U_EA_AMBIGUOUS<<UPROPS_EA_SHIFT), UPROPS_EA_MASK, pErrorCode) ||
!upvec_setValue(pv, 0x20000, 0x2fffe, 0, (uint32_t)(U_EA_WIDE<<UPROPS_EA_SHIFT), UPROPS_EA_MASK, pErrorCode)
if( !upvec_setValue(pv, 0xe000, 0xf8ff, 0, (uint32_t)(U_EA_AMBIGUOUS<<UPROPS_EA_SHIFT), UPROPS_EA_MASK, pErrorCode) ||
!upvec_setValue(pv, 0xf0000, 0xffffd, 0, (uint32_t)(U_EA_AMBIGUOUS<<UPROPS_EA_SHIFT), UPROPS_EA_MASK, pErrorCode) ||
!upvec_setValue(pv, 0x100000, 0x10fffd, 0, (uint32_t)(U_EA_AMBIGUOUS<<UPROPS_EA_SHIFT), UPROPS_EA_MASK, pErrorCode) ||
!upvec_setValue(pv, 0x20000, 0x2fffd, 0, (uint32_t)(U_EA_WIDE<<UPROPS_EA_SHIFT), UPROPS_EA_MASK, pErrorCode)
) {
fprintf(stderr, "genprops: unable to set default East Asian Widths: %s\n", u_errorName(*pErrorCode));
exit(*pErrorCode);
@ -490,17 +496,15 @@ generateAdditionalProperties(char *filename, const char *suffix, UErrorCode *pEr
/* parse EastAsianWidth.txt */
parseSingleEnumFile(filename, basename, suffix, &eawSingleEnum, pErrorCode);
trie=utrie_open(NULL, NULL, 50000, 0, 0, TRUE);
if(trie==NULL) {
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
upvec_close(pv);
return;
}
pvCount=upvec_compact(pv, upvec_compactToTrieHandler, trie, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genprops error: unable to build trie for additional properties: %s\n", u_errorName(*pErrorCode));
exit(*pErrorCode);
{
UPVecToUTrieContext toUTrie={ NULL, 50000 /* capacity */, 0, TRUE /* latin1Linear */ };
pvCount=upvec_compact(pv, upvec_compactToUTrieHandler, &toUTrie, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genprops error: unable to build trie for additional properties: %s\n",
u_errorName(*pErrorCode));
exit(*pErrorCode);
}
newTrie=toUTrie.newTrie;
}
}
@ -510,15 +514,14 @@ static void U_CALLCONV
ageLineFn(void *context,
char *fields[][2], int32_t fieldCount,
UErrorCode *pErrorCode) {
char *s, *end;
uint32_t value, start, limit, version;
char *s, *numberLimit;
uint32_t value, start, end, version;
u_parseCodePointRange(fields[0][0], &start, &limit, pErrorCode);
u_parseCodePointRange(fields[0][0], &start, &end, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genprops: syntax error in DerivedAge.txt field 0 at %s\n", fields[0][0]);
exit(*pErrorCode);
}
++limit;
/* ignore "unassigned" (the default is already set to 0.0) */
s=(char *)u_skipWhitespace(fields[1][0]);
@ -527,8 +530,8 @@ ageLineFn(void *context,
}
/* parse version number */
value=(uint32_t)uprv_strtoul(s, &end, 10);
if(s==end || value==0 || value>15 || (*end!='.' && *end!=' ' && *end!='\t' && *end!=0)) {
value=(uint32_t)uprv_strtoul(s, &numberLimit, 10);
if(s==numberLimit || value==0 || value>15 || (*numberLimit!='.' && *numberLimit!=' ' && *numberLimit!='\t' && *numberLimit!=0)) {
fprintf(stderr, "genprops: syntax error in DerivedAge.txt field 1 at %s\n", fields[1][0]);
*pErrorCode=U_PARSE_ERROR;
exit(U_PARSE_ERROR);
@ -536,10 +539,10 @@ ageLineFn(void *context,
version=value<<4;
/* parse minor version number */
if(*end=='.') {
s=(char *)u_skipWhitespace(end+1);
value=(uint32_t)uprv_strtoul(s, &end, 10);
if(s==end || value>15 || (*end!=' ' && *end!='\t' && *end!=0)) {
if(*numberLimit=='.') {
s=(char *)u_skipWhitespace(numberLimit+1);
value=(uint32_t)uprv_strtoul(s, &numberLimit, 10);
if(s==numberLimit || value>15 || (*numberLimit!=' ' && *numberLimit!='\t' && *numberLimit!=0)) {
fprintf(stderr, "genprops: syntax error in DerivedAge.txt field 1 at %s\n", fields[1][0]);
*pErrorCode=U_PARSE_ERROR;
exit(U_PARSE_ERROR);
@ -547,7 +550,11 @@ ageLineFn(void *context,
version|=value;
}
if(!upvec_setValue(pv, start, limit, 0, version<<UPROPS_AGE_SHIFT, UPROPS_AGE_MASK, pErrorCode)) {
if(start==0 && end==0x10ffff) {
/* Also set bits for initialValue and errorValue. */
end=UPVEC_MAX_CP;
}
if(!upvec_setValue(pv, start, end, 0, version<<UPROPS_AGE_SHIFT, UPROPS_AGE_MASK, pErrorCode)) {
fprintf(stderr, "genprops error: unable to set character age: %s\n", u_errorName(*pErrorCode));
exit(*pErrorCode);
}
@ -560,19 +567,18 @@ numericLineFn(void *context,
char *fields[][2], int32_t fieldCount,
UErrorCode *pErrorCode) {
Props newProps={ 0 };
char *s, *end;
uint32_t start, limit, value, oldProps32;
char *s, *numberLimit;
uint32_t start, end, value, oldProps32;
int32_t oldType;
char c;
UBool isFraction;
/* get the code point range */
u_parseCodePointRange(fields[0][0], &start, &limit, pErrorCode);
u_parseCodePointRange(fields[0][0], &start, &end, pErrorCode);
if(U_FAILURE(*pErrorCode)) {
fprintf(stderr, "genprops: syntax error in DerivedNumericValues.txt field 0 at %s\n", fields[0][0]);
exit(*pErrorCode);
}
++limit;
/*
* Ignore the
@ -582,7 +588,7 @@ numericLineFn(void *context,
* the numeric values for all characters after reading most
* from UnicodeData.txt already.
*/
if(start==0 && limit==0x110000) {
if(start==0 && end==0x10ffff) {
return;
}
@ -590,8 +596,8 @@ numericLineFn(void *context,
isFraction=FALSE;
s=uprv_strchr(fields[1][0], '.');
if(s!=NULL) {
end=s+1;
while('0'<=(c=*end++) && c<='9') {
numberLimit=s+1;
while('0'<=(c=*numberLimit++) && c<='9') {
if(c!='0') {
isFraction=TRUE;
break;
@ -610,17 +616,17 @@ numericLineFn(void *context,
/* large powers of 10 are encoded in a special way, see store.c */
uint8_t exp=0;
end=s;
while(*(++end)=='0') {
numberLimit=s;
while(*(++numberLimit)=='0') {
++exp;
}
value=1;
newProps.exponent=exp;
} else {
/* normal number parsing */
value=(uint32_t)uprv_strtoul(s, &end, 10);
value=(uint32_t)uprv_strtoul(s, &numberLimit, 10);
}
if(end<=s || (*end!='.' && u_skipWhitespace(end)!=fields[1][1]) || value>=0x80000000) {
if(numberLimit<=s || (*numberLimit!='.' && u_skipWhitespace(numberLimit)!=fields[1][1]) || value>=0x80000000) {
fprintf(stderr, "genprops: syntax error in DerivedNumericValues.txt field 1 at %s\n", fields[0][0]);
exit(U_PARSE_ERROR);
}
@ -641,7 +647,7 @@ numericLineFn(void *context,
/* the exponent may have been set above */
value=makeProps(&newProps);
for(; start<limit; ++start) {
for(; start<=end; ++start) {
oldProps32=getProps(start);
oldType=(int32_t)GET_NUMERIC_TYPE(oldProps32);
@ -691,7 +697,7 @@ writeAdditionalData(FILE *f, uint8_t *p, int32_t capacity, int32_t indexes[UPROP
UErrorCode errorCode;
errorCode=U_ZERO_ERROR;
length=utrie_serialize(trie, p, capacity, NULL, TRUE, &errorCode);
length=utrie_serialize(newTrie, p, capacity, NULL, TRUE, &errorCode);
if(U_FAILURE(errorCode)) {
fprintf(stderr, "genprops error: unable to serialize trie for additional properties: %s\n", u_errorName(errorCode));
exit(errorCode);
@ -701,8 +707,10 @@ writeAdditionalData(FILE *f, uint8_t *p, int32_t capacity, int32_t indexes[UPROP
printf("size in bytes of additional props trie:%5u\n", (int)length);
}
if(f!=NULL) {
UTrie trie2={ NULL };
utrie_unserialize(&trie2, p, length, &errorCode);
UTrie trie={ NULL };
UTrie2 *trie2;
utrie_unserialize(&trie, p, length, &errorCode);
if(U_FAILURE(errorCode)) {
fprintf(
stderr,
@ -710,14 +718,43 @@ writeAdditionalData(FILE *f, uint8_t *p, int32_t capacity, int32_t indexes[UPROP
u_errorName(errorCode));
exit(errorCode);
}
usrc_writeUTrieArrays(f,
/* use UTrie2 */
trie2=utrie2_fromUTrie(&trie, trie.initialValue, &errorCode);
if(U_FAILURE(errorCode)) {
fprintf(
stderr,
"genprops error: utrie2_fromUTrie() failed - %s\n",
u_errorName(errorCode));
exit(errorCode);
}
{
/* delete lead surrogate code unit values */
UChar lead;
trie2=utrie2_cloneAsThawed(trie2, &errorCode);
for(lead=0xd800; lead<0xdc00; ++lead) {
utrie2_set32ForLeadSurrogateCodeUnit(trie2, lead, trie2->initialValue, &errorCode);
}
utrie2_freeze(trie2, UTRIE2_16_VALUE_BITS, &errorCode);
if(U_FAILURE(errorCode)) {
fprintf(
stderr,
"genbidi error: deleting lead surrogate code unit values failed - %s\n",
u_errorName(errorCode));
exit(errorCode);
}
}
usrc_writeUTrie2Arrays(f,
"static const uint16_t propsVectorsTrie_index[%ld]={\n", NULL,
&trie2,
trie2,
"\n};\n\n");
usrc_writeUTrieStruct(f,
"static const UTrie propsVectorsTrie={\n",
&trie2, "propsVectorsTrie_index", NULL, NULL,
usrc_writeUTrie2Struct(f,
"static const UTrie2 propsVectorsTrie={\n",
trie2, "propsVectorsTrie_index", NULL,
"};\n\n");
utrie2_close(trie2);
}
p+=length;

View File

@ -430,6 +430,7 @@ generateData(const char *dataDir, UBool csource) {
if(csource) {
/* write .c file for hardcoded data */
UTrie trie={ NULL };
UTrie2 *trie2;
FILE *f;
utrie_unserialize(&trie, trieBlock, trieSize, &errorCode);
@ -438,7 +439,36 @@ generateData(const char *dataDir, UBool csource) {
stderr,
"genprops error: failed to utrie_unserialize(uprops.icu main trie) - %s\n",
u_errorName(errorCode));
return;
exit(errorCode);
}
/* use UTrie2 */
dataInfo.formatVersion[0]=6;
dataInfo.formatVersion[2]=0;
dataInfo.formatVersion[3]=0;
trie2=utrie2_fromUTrie(&trie, 0, &errorCode);
if(U_FAILURE(errorCode)) {
fprintf(
stderr,
"genprops error: utrie2_fromUTrie() failed - %s\n",
u_errorName(errorCode));
exit(errorCode);
}
{
/* delete lead surrogate code unit values */
UChar lead;
trie2=utrie2_cloneAsThawed(trie2, &errorCode);
for(lead=0xd800; lead<0xdc00; ++lead) {
utrie2_set32ForLeadSurrogateCodeUnit(trie2, lead, trie2->initialValue, &errorCode);
}
utrie2_freeze(trie2, UTRIE2_16_VALUE_BITS, &errorCode);
if(U_FAILURE(errorCode)) {
fprintf(
stderr,
"genprops error: deleting lead surrogate code unit values failed - %s\n",
u_errorName(errorCode));
exit(errorCode);
}
}
f=usrc_create(dataDir, "uchar_props_data.c");
@ -451,13 +481,13 @@ generateData(const char *dataDir, UBool csource) {
"static const UVersionInfo dataVersion={",
dataInfo.dataVersion, 8, 4,
"};\n\n");
usrc_writeUTrieArrays(f,
usrc_writeUTrie2Arrays(f,
"static const uint16_t propsTrie_index[%ld]={\n", NULL,
&trie,
trie2,
"\n};\n\n");
usrc_writeUTrieStruct(f,
"static const UTrie propsTrie={\n",
&trie, "propsTrie_index", NULL, NULL,
usrc_writeUTrie2Struct(f,
"static const UTrie2 propsTrie={\n",
trie2, "propsTrie_index", NULL,
"};\n\n");
additionalPropsSize=writeAdditionalData(f, additionalProps, sizeof(additionalProps), indexes);
@ -469,6 +499,7 @@ generateData(const char *dataDir, UBool csource) {
"};\n\n");
fclose(f);
}
utrie2_close(trie2);
} else {
/* write the data */
pData=udata_create(dataDir, DATA_TYPE, DATA_NAME, &dataInfo,

View File

@ -1,7 +1,7 @@
/*
*******************************************************************************
*
* Copyright (C) 2005-2007, International Business Machines
* Copyright (C) 2005-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@ -20,7 +20,7 @@
#include <time.h>
#include "unicode/utypes.h"
#include "unicode/putil.h"
#include "utrie.h"
#include "utrie2.h"
#include "cstring.h"
#include "writesrc.h"
@ -139,51 +139,63 @@ usrc_writeArray(FILE *f,
}
U_CAPI void U_EXPORT2
usrc_writeUTrieArrays(FILE *f,
const char *indexPrefix, const char *dataPrefix,
const UTrie *pTrie,
const char *postfix) {
usrc_writeUTrie2Arrays(FILE *f,
const char *indexPrefix, const char *data32Prefix,
const UTrie2 *pTrie,
const char *postfix) {
if(pTrie->data32==NULL) {
/* 16-bit trie */
usrc_writeArray(f, indexPrefix, pTrie->index, 16, pTrie->indexLength+pTrie->dataLength, postfix);
} else {
/* 32-bit trie */
usrc_writeArray(f, indexPrefix, pTrie->index, 16, pTrie->indexLength, postfix);
usrc_writeArray(f, dataPrefix, pTrie->data32, 32, pTrie->dataLength, postfix);
usrc_writeArray(f, data32Prefix, pTrie->data32, 32, pTrie->dataLength, postfix);
}
}
U_CAPI void U_EXPORT2
usrc_writeUTrieStruct(FILE *f,
const char *prefix,
const UTrie *pTrie,
const char *indexName, const char *dataName,
const char *getFoldingOffsetName,
const char *postfix) {
usrc_writeUTrie2Struct(FILE *f,
const char *prefix,
const UTrie2 *pTrie,
const char *indexName, const char *data32Name,
const char *postfix) {
if(prefix!=NULL) {
fputs(prefix, f);
}
if(dataName==NULL) {
dataName="NULL";
}
if(getFoldingOffsetName==NULL) {
getFoldingOffsetName="utrie_defaultGetFoldingOffset";
if(pTrie->data32==NULL) {
/* 16-bit trie */
fprintf(
f,
" %s,\n" /* index */
" %s+%ld,\n" /* data16 */
" NULL,\n", /* data32 */
indexName,
indexName,
(long)pTrie->indexLength);
} else {
/* 32-bit trie */
fprintf(
f,
" %s,\n" /* index */
" NULL,\n" /* data16 */
" %s,\n", /* data32 */
indexName,
data32Name);
}
fprintf(
f,
" %s,\n"
" %s,\n"
" %s,\n"
" %ld,\n"
" %ld,\n"
" %lu,\n"
" %s\n",
indexName,
dataName,
getFoldingOffsetName,
" %ld,\n" /* indexLength */
" %ld,\n" /* dataLength */
" 0x%hx,\n" /* index2NullOffset */
" 0x%hx,\n" /* dataNullOffset */
" 0x%lx,\n" /* initialValue */
" 0x%lx,\n" /* errorValue */
" 0x%lx,\n" /* highStart */
" 0x%lx,\n", /* highValueIndex */
(long)pTrie->indexLength, (long)pTrie->dataLength,
(unsigned long)pTrie->initialValue,
pTrie->isLatin1Linear ? "TRUE" : "FALSE");
(short)pTrie->index2NullOffset, (short)pTrie->dataNullOffset,
(long)pTrie->initialValue, (long)pTrie->errorValue,
(long)pTrie->highStart, (long)pTrie->highValueIndex);
if(postfix!=NULL) {
fputs(postfix, f);
}

View File

@ -1,7 +1,7 @@
/*
*******************************************************************************
*
* Copyright (C) 2005, International Business Machines
* Copyright (C) 2005-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@ -21,7 +21,7 @@
#include <stdio.h>
#include "unicode/utypes.h"
#include "utrie.h"
#include "utrie2.h"
/**
* Create a source text file and write a header comment with the ICU copyright.
@ -43,28 +43,26 @@ usrc_writeArray(FILE *f,
const char *postfix);
/**
* Calls usrc_writeArray() for the index and data arrays of a runtime UTrie.
* Only the index array is written for a 16-bit UTrie. In this case, dataPrefix
* Calls usrc_writeArray() for the index and data arrays of a frozen UTrie2.
* Only the index array is written for a 16-bit UTrie2. In this case, dataPrefix
* is ignored and can be NULL.
*/
U_CAPI void U_EXPORT2
usrc_writeUTrieArrays(FILE *f,
const char *indexPrefix, const char *dataPrefix,
const UTrie *pTrie,
const char *postfix);
usrc_writeUTrie2Arrays(FILE *f,
const char *indexPrefix, const char *dataPrefix,
const UTrie2 *pTrie,
const char *postfix);
/**
* Writes the UTrie struct values.
* Writes the UTrie2 struct values.
* The {} and declaration etc. need to be included in prefix/postfix or
* printed before and after the array contents.
* If getFoldingOffsetName==NULL then "utrie_defaultGetFoldingOffset" is printed.
*/
U_CAPI void U_EXPORT2
usrc_writeUTrieStruct(FILE *f,
const char *prefix,
const UTrie *pTrie,
const char *indexName, const char *dataName,
const char *getFoldingOffsetName,
const char *postfix);
usrc_writeUTrie2Struct(FILE *f,
const char *prefix,
const UTrie2 *pTrie,
const char *indexName, const char *dataName,
const char *postfix);
#endif