Home
last modified time | relevance | path

Searched refs:trie (Results 1 – 25 of 106) sorted by relevance

12345

/external/icu/icu4c/source/common/
Dutrie.cpp51 UNewTrie *trie; in utrie_open() local
61 trie=fillIn; in utrie_open()
63 trie=(UNewTrie *)uprv_malloc(sizeof(UNewTrie)); in utrie_open()
64 if(trie==NULL) { in utrie_open()
68 uprv_memset(trie, 0, sizeof(UNewTrie)); in utrie_open()
69 trie->isAllocated= (UBool)(fillIn==NULL); in utrie_open()
72 trie->data=aliasData; in utrie_open()
73 trie->isDataAllocated=FALSE; in utrie_open()
75 trie->data=(uint32_t *)uprv_malloc(maxDataLength*4); in utrie_open()
76 if(trie->data==NULL) { in utrie_open()
[all …]
Dutrie2_builder.cpp104 allocIndex2Block(UNewTrie2 *trie);
108 UTrie2 *trie; in utrie2_open() local
117 trie=(UTrie2 *)uprv_malloc(sizeof(UTrie2)); in utrie2_open()
120 if(trie==NULL || newTrie==NULL || data==NULL) { in utrie2_open()
121 uprv_free(trie); in utrie2_open()
128 uprv_memset(trie, 0, sizeof(UTrie2)); in utrie2_open()
129 trie->initialValue=initialValue; in utrie2_open()
130 trie->errorValue=errorValue; in utrie2_open()
131 trie->highStart=0x110000; in utrie2_open()
132 trie->newTrie=newTrie; in utrie2_open()
[all …]
Dutrie2.cpp41 get32(const UNewTrie2 *trie, UChar32 c, UBool fromLSCP) { in get32() argument
44 if(c>=trie->highStart && (!U_IS_LEAD(c) || fromLSCP)) { in get32()
45 return trie->data[trie->dataLength-UTRIE2_DATA_GRANULARITY]; in get32()
52 i2=trie->index1[c>>UTRIE2_SHIFT_1]+ in get32()
55 block=trie->index2[i2]; in get32()
56 return trie->data[block+(c&UTRIE2_DATA_MASK)]; in get32()
60 utrie2_get32(const UTrie2 *trie, UChar32 c) { in utrie2_get32() argument
61 if(trie->data16!=NULL) { in utrie2_get32()
62 return UTRIE2_GET16(trie, c); in utrie2_get32()
63 } else if(trie->data32!=NULL) { in utrie2_get32()
[all …]
Dutrie2.h140 utrie2_get32(const UTrie2 *trie, UChar32 c);
190 utrie2_enum(const UTrie2 *trie,
238 utrie2_close(UTrie2 *trie);
250 utrie2_set32(UTrie2 *trie, UChar32 c, uint32_t value, UErrorCode *pErrorCode);
266 utrie2_setRange32(UTrie2 *trie,
291 utrie2_freeze(UTrie2 *trie, UTrie2ValueBits valueBits, UErrorCode *pErrorCode);
301 utrie2_isFrozen(const UTrie2 *trie);
322 utrie2_serialize(const UTrie2 *trie,
390 #define UTRIE2_GET16(trie, c) _UTRIE2_GET((trie), index, (trie)->indexLength, (c)) argument
400 #define UTRIE2_GET32(trie, c) _UTRIE2_GET((trie), data32, 0, (c)) argument
[all …]
Dutrie.h177 #define _UTRIE_GET_RAW(trie, data, offset, c16) \ argument
178 (trie)->data[ \
179 ((int32_t)((trie)->index[(offset)+((c16)>>UTRIE_SHIFT)])<<UTRIE_INDEX_SHIFT)+ \
184 #define _UTRIE_GET_FROM_PAIR(trie, data, c, c2, result, resultType) { \ argument
188 (result)=_UTRIE_GET_RAW((trie), data, 0, (c)); \
189 __offset=(trie)->getFoldingOffset(result); \
193 (result)=_UTRIE_GET_RAW((trie), data, __offset, (c2)&0x3ff); \
195 (result)=(resultType)((trie)->initialValue); \
200 #define _UTRIE_GET_FROM_BMP(trie, data, c16) \ argument
201 _UTRIE_GET_RAW(trie, data, 0xd800<=(c16) && (c16)<=0xdbff ? UTRIE_LEAD_INDEX_DISP : 0, c16);
[all …]
Ducol_swp.cpp38 UTrieHeader trie; in utrie_swap() local
57 trie.signature=ds->readUInt32(inTrie->signature); in utrie_swap()
58 trie.options=ds->readUInt32(inTrie->options); in utrie_swap()
59 trie.indexLength=udata_readInt32(ds, inTrie->indexLength); in utrie_swap()
60 trie.dataLength=udata_readInt32(ds, inTrie->dataLength); in utrie_swap()
62 if( trie.signature!=0x54726965 || in utrie_swap()
63 (trie.options&UTRIE_OPTIONS_SHIFT_MASK)!=UTRIE_SHIFT || in utrie_swap()
64 ((trie.options>>UTRIE_OPTIONS_INDEX_SHIFT)&UTRIE_OPTIONS_SHIFT_MASK)!=UTRIE_INDEX_SHIFT || in utrie_swap()
65 trie.indexLength<UTRIE_BMP_INDEX_LENGTH || in utrie_swap()
66 (trie.indexLength&(UTRIE_SURROGATE_BLOCK_COUNT-1))!=0 || in utrie_swap()
[all …]
Dubidi_props.c37 UTrie2 trie; member
75 utrie2_enum(&bdp->trie, NULL, _enumPropertyStartsRange, sa); in ubidi_addPropertyStarts()
144 uint16_t props=UTRIE2_GET16(&bdp->trie, c); in ubidi_getClass()
150 uint16_t props=UTRIE2_GET16(&bdp->trie, c); in ubidi_isMirrored()
188 uint16_t props=UTRIE2_GET16(&bdp->trie, c); in ubidi_getMirror()
194 uint16_t props=UTRIE2_GET16(&bdp->trie, c); in ubidi_isBidiControl()
200 uint16_t props=UTRIE2_GET16(&bdp->trie, c); in ubidi_isJoinControl()
206 uint16_t props=UTRIE2_GET16(&bdp->trie, c); in ubidi_getJoiningType()
229 uint16_t props=UTRIE2_GET16(&bdp->trie, c); in ubidi_getPairedBracketType()
235 uint16_t props=UTRIE2_GET16(&bdp->trie, c); in ubidi_getPairedBracket()
/external/icu/icu4c/source/test/intltest/
Ducharstrietest.cpp68 void checkFirst(UCharsTrie &trie, const StringAndValue data[], int32_t dataLength);
69 void checkNext(UCharsTrie &trie, const StringAndValue data[], int32_t dataLength);
70 void checkNextWithState(UCharsTrie &trie, const StringAndValue data[], int32_t dataLength);
71 void checkNextString(UCharsTrie &trie, const StringAndValue data[], int32_t dataLength);
72 void checkIterator(UCharsTrie &trie, const StringAndValue data[], int32_t dataLength);
295 LocalPointer<UCharsTrie> trie(buildTrie(data, UPRV_LENGTHOF(data), USTRINGTRIE_BUILD_FAST)); in TestNextForCodePoint() local
296 if(trie.isNull()) { in TestNextForCodePoint()
300 if( (result=trie->nextForCodePoint(0x4dff))!=USTRINGTRIE_NO_VALUE || result!=trie->current() || in TestNextForCodePoint()
301 (result=trie->nextForCodePoint(0x10000))!=USTRINGTRIE_NO_VALUE || result!=trie->current() || in TestNextForCodePoint()
302 (result=trie->nextForCodePoint(0x9999))!=USTRINGTRIE_NO_VALUE || result!=trie->current() || in TestNextForCodePoint()
[all …]
Dbytestrietest.cpp61 void checkFirst(BytesTrie &trie, const StringAndValue data[], int32_t dataLength);
62 void checkNext(BytesTrie &trie, const StringAndValue data[], int32_t dataLength);
63 void checkNextWithState(BytesTrie &trie, const StringAndValue data[], int32_t dataLength);
64 void checkNextString(BytesTrie &trie, const StringAndValue data[], int32_t dataLength);
65 void checkIterator(const BytesTrie &trie, const StringAndValue data[], int32_t dataLength);
306 LocalPointer<BytesTrie> trie(buildMonthsTrie(USTRINGTRIE_BUILD_FAST)); in TestHasUniqueValue() local
307 if(trie.isNull()) { in TestHasUniqueValue()
311 if(trie->hasUniqueValue(uniqueValue)) { in TestHasUniqueValue()
314 trie->next('j'); in TestHasUniqueValue()
315 trie->next('a'); in TestHasUniqueValue()
[all …]
/external/icu/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/
DCharsTrieTest.java228 CharsTrie trie=buildTrie(data, data.length, StringTrieBuilder.Option.FAST); in Test32NextForCodePoint() local
230 … if( (result=trie.nextForCodePoint(0x4dff))!=BytesTrie.Result.NO_VALUE || result!=trie.current() || in Test32NextForCodePoint()
231 … (result=trie.nextForCodePoint(0x10000))!=BytesTrie.Result.NO_VALUE || result!=trie.current() || in Test32NextForCodePoint()
232 … (result=trie.nextForCodePoint(0x9999))!=BytesTrie.Result.NO_VALUE || result!=trie.current() || in Test32NextForCodePoint()
233 … (result=trie.nextForCodePoint(0x20000))!=BytesTrie.Result.NO_VALUE || result!=trie.current() || in Test32NextForCodePoint()
234 … (result=trie.nextForCodePoint(0xdfff))!=BytesTrie.Result.NO_VALUE || result!=trie.current() || in Test32NextForCodePoint()
235 …(result=trie.nextForCodePoint(0x10ffff))!=BytesTrie.Result.FINAL_VALUE || result!=trie.current() || in Test32NextForCodePoint()
236 trie.getValue()!=2000000000 in Test32NextForCodePoint()
240 …if( (result=trie.firstForCodePoint(0x4dff))!=BytesTrie.Result.NO_VALUE || result!=trie.current() || in Test32NextForCodePoint()
241 … (result=trie.nextForCodePoint(0x10000))!=BytesTrie.Result.NO_VALUE || result!=trie.current() || in Test32NextForCodePoint()
[all …]
DBytesTrieTest.java250 BytesTrie trie=buildMonthsTrie(StringTrieBuilder.Option.FAST); in Test40GetUniqueValue() local
252 if((uniqueValue=trie.getUniqueValue())!=0) { in Test40GetUniqueValue()
255 trie.next('j'); in Test40GetUniqueValue()
256 trie.next('a'); in Test40GetUniqueValue()
257 trie.next('n'); in Test40GetUniqueValue()
259 if((uniqueValue=trie.getUniqueValue())!=((1<<1)|1)) { in Test40GetUniqueValue()
262 trie.first('j'); in Test40GetUniqueValue()
263 trie.next('u'); in Test40GetUniqueValue()
264 if((uniqueValue=trie.getUniqueValue())!=0) { in Test40GetUniqueValue()
267 if(trie.next('n')!=BytesTrie.Result.INTERMEDIATE_VALUE || 6!=trie.getValue()) { in Test40GetUniqueValue()
[all …]
DTrie2Test.java57 Trie2Writable trie = new Trie2Writable(0,0); in TestTrie2API() local
59 trie.toTrie2_16().serialize(os); in TestTrie2API()
91 Trie2Writable trie = new Trie2Writable(17,0); in TestTrie2API() local
93 it = trie.iterator(); in TestTrie2API()
109 for (Trie2.Range rr: trie) { in TestTrie2API()
133 Trie2Writable trie = new Trie2Writable(0xbadfeed, 0); in TestTrie2API() local
134 trie.set(0x10123, 42); in TestTrie2API()
144 Iterator<Trie2.Range> it = trie.iterator(vm); in TestTrie2API()
156 Trie2Writable trie = new Trie2Writable(0xdefa17, 0); in TestTrie2API() local
157 trie.set(0x2f810, 10); in TestTrie2API()
[all …]
DTrieTest.java139 private void _testTrieIteration(IntTrie trie, CheckRange checkRanges[], in _testTrieIteration() argument
161 int value = trie.getCodePointValue(c); in _testTrieIteration()
181 value = trie.getLeadValue(lead); in _testTrieIteration()
182 value = trie.getTrailValue(value, trail); in _testTrieIteration()
183 if (value != trie.getSurrogateValue(lead, trail) in _testTrieIteration()
241 IntTrie trie = newTrie.serialize(new _testFoldedValue(newTrie), in _testTrieRanges() local
252 if (value != trie.getLatin1LinearValue((char)start)) { in _testTrieRanges()
256 trie.getLatin1LinearValue((char) start)) in _testTrieRanges()
264 if (latin1Linear != trie.isLatin1Linear()) { in _testTrieRanges()
283 int value2 = trie.getBMPValue((char)start); in _testTrieRanges()
[all …]
/external/icu/android_icu4j/src/main/tests/android/icu/dev/test/util/
DCharsTrieTest.java232 CharsTrie trie=buildTrie(data, data.length, StringTrieBuilder.Option.FAST); in Test32NextForCodePoint() local
234 … if( (result=trie.nextForCodePoint(0x4dff))!=BytesTrie.Result.NO_VALUE || result!=trie.current() || in Test32NextForCodePoint()
235 … (result=trie.nextForCodePoint(0x10000))!=BytesTrie.Result.NO_VALUE || result!=trie.current() || in Test32NextForCodePoint()
236 … (result=trie.nextForCodePoint(0x9999))!=BytesTrie.Result.NO_VALUE || result!=trie.current() || in Test32NextForCodePoint()
237 … (result=trie.nextForCodePoint(0x20000))!=BytesTrie.Result.NO_VALUE || result!=trie.current() || in Test32NextForCodePoint()
238 … (result=trie.nextForCodePoint(0xdfff))!=BytesTrie.Result.NO_VALUE || result!=trie.current() || in Test32NextForCodePoint()
239 …(result=trie.nextForCodePoint(0x10ffff))!=BytesTrie.Result.FINAL_VALUE || result!=trie.current() || in Test32NextForCodePoint()
240 trie.getValue()!=2000000000 in Test32NextForCodePoint()
244 …if( (result=trie.firstForCodePoint(0x4dff))!=BytesTrie.Result.NO_VALUE || result!=trie.current() || in Test32NextForCodePoint()
245 … (result=trie.nextForCodePoint(0x10000))!=BytesTrie.Result.NO_VALUE || result!=trie.current() || in Test32NextForCodePoint()
[all …]
DBytesTrieTest.java254 BytesTrie trie=buildMonthsTrie(StringTrieBuilder.Option.FAST); in Test40GetUniqueValue() local
256 if((uniqueValue=trie.getUniqueValue())!=0) { in Test40GetUniqueValue()
259 trie.next('j'); in Test40GetUniqueValue()
260 trie.next('a'); in Test40GetUniqueValue()
261 trie.next('n'); in Test40GetUniqueValue()
263 if((uniqueValue=trie.getUniqueValue())!=((1<<1)|1)) { in Test40GetUniqueValue()
266 trie.first('j'); in Test40GetUniqueValue()
267 trie.next('u'); in Test40GetUniqueValue()
268 if((uniqueValue=trie.getUniqueValue())!=0) { in Test40GetUniqueValue()
271 if(trie.next('n')!=BytesTrie.Result.INTERMEDIATE_VALUE || 6!=trie.getValue()) { in Test40GetUniqueValue()
[all …]
DTrie2Test.java61 Trie2Writable trie = new Trie2Writable(0,0); in TestTrie2API() local
63 trie.toTrie2_16().serialize(os); in TestTrie2API()
95 Trie2Writable trie = new Trie2Writable(17,0); in TestTrie2API() local
97 it = trie.iterator(); in TestTrie2API()
113 for (Trie2.Range rr: trie) { in TestTrie2API()
137 Trie2Writable trie = new Trie2Writable(0xbadfeed, 0); in TestTrie2API() local
138 trie.set(0x10123, 42); in TestTrie2API()
148 Iterator<Trie2.Range> it = trie.iterator(vm); in TestTrie2API()
160 Trie2Writable trie = new Trie2Writable(0xdefa17, 0); in TestTrie2API() local
161 trie.set(0x2f810, 10); in TestTrie2API()
[all …]
DTrieTest.java143 private void _testTrieIteration(IntTrie trie, CheckRange checkRanges[], in _testTrieIteration() argument
165 int value = trie.getCodePointValue(c); in _testTrieIteration()
185 value = trie.getLeadValue(lead); in _testTrieIteration()
186 value = trie.getTrailValue(value, trail); in _testTrieIteration()
187 if (value != trie.getSurrogateValue(lead, trail) in _testTrieIteration()
245 IntTrie trie = newTrie.serialize(new _testFoldedValue(newTrie), in _testTrieRanges() local
256 if (value != trie.getLatin1LinearValue((char)start)) { in _testTrieRanges()
260 trie.getLatin1LinearValue((char) start)) in _testTrieRanges()
268 if (latin1Linear != trie.isLatin1Linear()) { in _testTrieRanges()
287 int value2 = trie.getBMPValue((char)start); in _testTrieRanges()
[all …]
/external/icu/icu4c/source/test/cintltst/
Dtrie2test.c96 const UTrie2 *trie, in testTrieEnum() argument
103 utrie2_enum(trie, testEnumValue, testEnumRange, &checkRanges); in testTrieEnum()
109 const UTrie2 *trie, UTrie2ValueBits valueBits, in testTrieGetters() argument
116 UBool isFrozen=utrie2_isFrozen(trie); in testTrieGetters()
131 value2=UTRIE2_GET16_FROM_U16_SINGLE_LEAD(trie, start); in testTrieGetters()
133 value2=UTRIE2_GET32_FROM_U16_SINGLE_LEAD(trie, start); in testTrieGetters()
142 value2=UTRIE2_GET16_FROM_SUPP(trie, start); in testTrieGetters()
144 value2=UTRIE2_GET32_FROM_SUPP(trie, start); in testTrieGetters()
152 value2=UTRIE2_GET16(trie, start); in testTrieGetters()
154 value2=UTRIE2_GET32(trie, start); in testTrieGetters()
[all …]
Dtrietest.c56 _testFoldedValue32(UNewTrie *trie, UChar32 start, int32_t offset) { in _testFoldedValue32() argument
65 value=utrie_get32(trie, start, &inBlockZero); in _testFoldedValue32()
87 _testFoldedValue16(UNewTrie *trie, UChar32 start, int32_t offset) { in _testFoldedValue16() argument
96 value=utrie_get32(trie, start, &inBlockZero); in _testFoldedValue16()
142 const UTrie *trie, in testTrieIteration() argument
171 if(trie->data32!=NULL) { in testTrieIteration()
172 UTRIE_NEXT32(trie, p, limit, c, c2, value); in testTrieIteration()
174 UTRIE_NEXT16(trie, p, limit, c, c2, value); in testTrieIteration()
192 if(trie->data32==NULL) { in testTrieIteration()
193 value=UTRIE_GET16_FROM_LEAD(trie, c); in testTrieIteration()
[all …]
/external/icu/icu4c/source/test/perf/unisetperf/draft/
Dtrieset.cpp23 #define UTRIE_GET8_LATIN1(trie) ((const uint8_t *)(trie)->data32+UTRIE_DATA_BLOCK_LENGTH) argument
25 #define UTRIE_GET8_FROM_LEAD(trie, c16) \ argument
26 ((const uint8_t *)(trie)->data32)[ \
27 ((int32_t)((trie)->index[(c16)>>UTRIE_SHIFT])<<UTRIE_INDEX_SHIFT)+ \
77 utrie_unserialize(&trie, trieData, length, &errorCode); // TODO: Implement for 8-bit UTrie! in TrieSet()
82 uprv_memcpy((uint16_t *)trie.index+(0xd800>>UTRIE_SHIFT), in TrieSet()
83 trie.index+UTRIE_BMP_INDEX_LENGTH, in TrieSet()
85 latin1=UTRIE_GET8_LATIN1(&trie); in TrieSet()
100 return (UBool)UTRIE_GET8_FROM_LEAD(&trie, c); in contains()
109 UTrie trie; member in TrieSet
/external/icu/icu4j/main/classes/core/src/com/ibm/icu/impl/
DUBiDiProps.java58 trie=Trie2_16.createFromSerialized(bytes); in readData()
60 int trieLength=trie.getSerializedLength(); in readData()
100 Iterator<Trie2.Range> trieIterator=trie.iterator(); in addPropertyStarts()
168 return getClassFromProps(trie.get(c)); in getClass()
172 return getFlagFromProps(trie.get(c), IS_MIRRORED_SHIFT); in isMirrored()
205 int props=trie.get(c); in getMirror()
210 return getFlagFromProps(trie.get(c), BIDI_CONTROL_SHIFT); in isBidiControl()
214 return getFlagFromProps(trie.get(c), JOIN_CONTROL_SHIFT); in isJoinControl()
218 return (trie.get(c)&JT_MASK)>>JT_SHIFT; in getJoiningType()
238 return (trie.get(c)&BPT_MASK)>>BPT_SHIFT; in getPairedBracketType()
[all …]
/external/icu/android_icu4j/src/main/java/android/icu/impl/
DUBiDiProps.java62 trie=Trie2_16.createFromSerialized(bytes); in readData()
64 int trieLength=trie.getSerializedLength(); in readData()
104 Iterator<Trie2.Range> trieIterator=trie.iterator(); in addPropertyStarts()
172 return getClassFromProps(trie.get(c)); in getClass()
176 return getFlagFromProps(trie.get(c), IS_MIRRORED_SHIFT); in isMirrored()
209 int props=trie.get(c); in getMirror()
214 return getFlagFromProps(trie.get(c), BIDI_CONTROL_SHIFT); in isBidiControl()
218 return getFlagFromProps(trie.get(c), JOIN_CONTROL_SHIFT); in isJoinControl()
222 return (trie.get(c)&JT_MASK)>>JT_SHIFT; in getJoiningType()
242 return (trie.get(c)&BPT_MASK)>>BPT_SHIFT; in getPairedBracketType()
[all …]
/external/icu/icu4c/source/test/perf/dicttrieperf/
Ddicttrieperf.cpp262 BytesTrie trie(nameTrieBytes); in bytesTrieLookup() local
263 if(USTRINGTRIE_HAS_VALUE(trie.next(s, -1))) { in bytesTrieLookup()
264 return trie.getValue(); in bytesTrieLookup()
345 ucharsTrieMatches(UCharsTrie &trie, in ucharsTrieMatches() argument
357 UStringTrieResult result=trie.first(c); in ucharsTrieMatches()
386 result=trie.next(c); in ucharsTrieMatches()
405 : DictLookup(perfTest), trie(NULL) { in UCharsTrieDictLookup()
420 trie=builder->build(USTRINGTRIE_BUILD_SMALL, errorCode); in UCharsTrieDictLookup()
425 delete trie; in ~UCharsTrieDictLookup()
430 UCharsTrie *trie; member in UCharsTrieDictLookup
[all …]
/external/chromium-trace/catapult/third_party/vinn/third_party/parse5/tools/
Dnamed_entity_trie_generator.js7 var trie = Object.keys(entitiesData).reduce(function (trie, entity) { argument
13 leaf = trie;
35 return trie;
44 'module.exports = ' + JSON.stringify(trie).replace(/"/g, '') + ';\n';
/external/icu/icu4c/source/i18n/
Dcollationdatabuilder.cpp185 uint32_t ce32 = utrie2_get32(builder.trie, c); in fetchCEs()
251 return utrie2_get32(builder.trie, c); in getDataCE32()
259 return utrie2_get32(builder.trie, jamo); in getCE32FromBuilderData()
281 trie(NULL), in CollationDataBuilder()
292 utrie2_close(trie); in ~CollationDataBuilder()
300 if(trie != NULL) { in initForTailoring()
311 trie = utrie2_open(Collation::FALLBACK_CE32, Collation::FFFD_CE32, &errorCode); in initForTailoring()
319 utrie2_set32(trie, c, Collation::FALLBACK_CE32, &errorCode); in initForTailoring()
327 utrie2_setRange32(trie, Hangul::HANGUL_BASE, Hangul::HANGUL_END, hangulCE32, TRUE, &errorCode); in initForTailoring()
365 utrie2_setRange32(trie, start, end, offsetCE32, TRUE, &errorCode); in maybeSetPrimaryRange()
[all …]

12345