deps: update ICU to 70.1

Refs: https://github.com/unicode-org/icu/releases/tag/release-70-1

PR-URL: https://github.com/nodejs/node/pull/40658
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
This commit is contained in:
Michaël Zasso committed 2021-11-09 17:26:53 +01:00
1 parent dd601619d3
commit de6399c0c0
715 files changed
+21606 -18923

No files matched your search

+15 -17
View File
@@ -392,31 +392,29 @@ The externally maintained libraries used by Node.js are:
3. Lao Word Break Dictionary Data (laodict.txt)
# Copyright (c) 2013 International Business Machines Corporation
# and others. All Rights Reserved.
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
# Copyright (c) 2015 International Business Machines Corporation
# and others. All Rights Reserved.
#
# Project: https://github.com/veer66/lao-dictionary
# Dictionary: https://github.com/veer66/lao-dictionary/blob/master/Lao-Dictionary.txt
# License: https://github.com/veer66/lao-dictionary/blob/master/Lao-Dictionary-LICENSE.txt
# (copied below)
# Project: https://github.com/rober42539/lao-dictionary
# Dictionary: https://github.com/rober42539/lao-dictionary/laodict.txt
# License: https://github.com/rober42539/lao-dictionary/LICENSE.txt
# (copied below)
#
# This file is derived from the above dictionary, with slight
# modifications.
# This file is derived from the above dictionary version of Nov 22, 2020
# ----------------------------------------------------------------------
# Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification,
# are permitted provided that the following conditions are met:
#
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer. Redistributions in
# binary form must reproduce the above copyright notice, this list of
# conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer. Redistributions in binary
# form must reproduce the above copyright notice, this list of conditions and
# the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+15 -17
View File
@@ -281,31 +281,29 @@ property of their respective owners.
3. Lao Word Break Dictionary Data (laodict.txt)
# Copyright (c) 2013 International Business Machines Corporation
# and others. All Rights Reserved.
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
# Copyright (c) 2015 International Business Machines Corporation
# and others. All Rights Reserved.
#
# Project: https://github.com/veer66/lao-dictionary
# Dictionary: https://github.com/veer66/lao-dictionary/blob/master/Lao-Dictionary.txt
# License: https://github.com/veer66/lao-dictionary/blob/master/Lao-Dictionary-LICENSE.txt
# (copied below)
# Project: https://github.com/rober42539/lao-dictionary
# Dictionary: https://github.com/rober42539/lao-dictionary/laodict.txt
# License: https://github.com/rober42539/lao-dictionary/LICENSE.txt
# (copied below)
#
# This file is derived from the above dictionary, with slight
# modifications.
# This file is derived from the above dictionary version of Nov 22, 2020
# ----------------------------------------------------------------------
# Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification,
# are permitted provided that the following conditions are met:
#
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer. Redistributions in
# binary form must reproduce the above copyright notice, this list of
# conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer. Redistributions in binary
# form must reproduce the above copyright notice, this list of conditions and
# the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+3 -2
View File
@@ -1,8 +1,9 @@
ICU sources - auto generated by shrink-icu-src.py
This directory contains the ICU subset used by --with-intl=full-icu
It is a strict subset of ICU 69 source files with the following exception(s):
* deps/icu-small/source/data/in/icudt69l.dat.bz2 : compressed data file
It is a strict subset of ICU 70 source files with the following exception(s):
* deps/icu-small/source/data/in/icudt70l.dat.bz2 : compressed data file
To rebuild this directory, see ../../tools/icu/README.md
+2 -2
View File
@@ -6,6 +6,6 @@ Language: Cpp
BasedOnStyle: LLVM
IndentWidth: 4
ColumnLimit: 105
AllowShortBlocksOnASingleLine: false
AllowShortIfStatementsOnASingleLine: true
AllowShortBlocksOnASingleLine: false
AllowShortIfStatementsOnASingleLine: true
...
+1213
View File
File diff suppressed because it is too large. Load diff
+33 -14
View File
@@ -25,6 +25,7 @@
#include "brkeng.h"
#include "cmemory.h"
#include "dictbe.h"
#include "lstmbe.h"
#include "charstr.h"
#include "dictionarydata.h"
#include "mutex.h"
@@ -77,8 +78,10 @@ int32_t
UnhandledEngine::findBreaks( UText *text,
int32_t /* startPos */,
int32_t endPos,
UVector32 &/*foundBreaks*/ ) const {
UChar32 c = utext_current32(text);
UVector32 &/*foundBreaks*/,
UErrorCode &status) const {
if (U_FAILURE(status)) return 0;
UChar32 c = utext_current32(text);
while((int32_t)utext_getNativeIndex(text) < endPos && fHandled->contains(c)) {
utext_next32(text); // TODO: recast loop to work with post-increment operations.
c = utext_current32(text);
@@ -132,14 +135,13 @@ ICULanguageBreakFactory::getEngineFor(UChar32 c) {
static UMutex gBreakEngineMutex;
Mutex m(&gBreakEngineMutex);
if (fEngines == NULL) {
UStack *engines = new UStack(_deleteEngine, NULL, status);
if (U_FAILURE(status) || engines == NULL) {
if (fEngines == nullptr) {
LocalPointer<UStack> engines(new UStack(_deleteEngine, nullptr, status), status);
if (U_FAILURE(status) ) {
// Note: no way to return error code to caller.
delete engines;
return NULL;
return nullptr;
}
fEngines = engines;
fEngines = engines.orphan();
} else {
int32_t i = fEngines->size();
while (--i >= 0) {
@@ -149,13 +151,13 @@ ICULanguageBreakFactory::getEngineFor(UChar32 c) {
}
}
}
// We didn't find an engine. Create one.
lbe = loadEngineFor(c);
if (lbe != NULL) {
if (lbe != nullptr) {
fEngines->push((void *)lbe, status);
}
return lbe;
return U_SUCCESS(status) ? lbe : nullptr;
}
const LanguageBreakEngine *
@@ -163,9 +165,26 @@ ICULanguageBreakFactory::loadEngineFor(UChar32 c) {
UErrorCode status = U_ZERO_ERROR;
UScriptCode code = uscript_getScript(c, &status);
if (U_SUCCESS(status)) {
const LanguageBreakEngine *engine = nullptr;
// Try to use LSTM first
const LSTMData *data = CreateLSTMDataForScript(code, status);
if (U_SUCCESS(status)) {
if (data != nullptr) {
engine = CreateLSTMBreakEngine(code, data, status);
if (U_SUCCESS(status) && engine != nullptr) {
return engine;
}
if (engine != nullptr) {
delete engine;
engine = nullptr;
} else {
DeleteLSTMData(data);
}
}
}
status = U_ZERO_ERROR; // fallback to dictionary based
DictionaryMatcher *m = loadDictionaryMatcherFor(code);
if (m != NULL) {
const LanguageBreakEngine *engine = NULL;
switch(code) {
case USCRIPT_THAI:
engine = new ThaiBreakEngine(m, status);
@@ -224,7 +243,7 @@ ICULanguageBreakFactory::loadEngineFor(UChar32 c) {
}
DictionaryMatcher *
ICULanguageBreakFactory::loadDictionaryMatcherFor(UScriptCode script) {
ICULanguageBreakFactory::loadDictionaryMatcherFor(UScriptCode script) {
UErrorCode status = U_ZERO_ERROR;
// open root from brkitr tree.
UResourceBundle *b = ures_open(U_ICUDATA_BRKITR, "", &status);
@@ -265,7 +284,7 @@ ICULanguageBreakFactory::loadDictionaryMatcherFor(UScriptCode script) {
m = new UCharsDictionaryMatcher(characters, file);
}
if (m == NULL) {
// no matcher exists to take ownership - either we are an invalid
// no matcher exists to take ownership - either we are an invalid
// type or memory allocation failed
udata_close(file);
}
+8 -4
View File
@@ -68,12 +68,14 @@ class LanguageBreakEngine : public UMemory {
* @param startPos The start of the run within the supplied text.
* @param endPos The end of the run within the supplied text.
* @param foundBreaks A Vector of int32_t to receive the breaks.
* @param status Information on any errors encountered.
* @return The number of breaks found.
*/
virtual int32_t findBreaks( UText *text,
int32_t startPos,
int32_t endPos,
UVector32 &foundBreaks ) const = 0;
UVector32 &foundBreaks,
UErrorCode &status) const = 0;
};
@@ -174,7 +176,7 @@ class UnhandledEngine : public LanguageBreakEngine {
* @return true if this engine handles the particular character and break
* type.
*/
virtual UBool handles(UChar32 c) const;
virtual UBool handles(UChar32 c) const override;
/**
* <p>Find any breaks within a run in the supplied text.</p>
@@ -185,12 +187,14 @@ class UnhandledEngine : public LanguageBreakEngine {
* @param startPos The start of the run within the supplied text.
* @param endPos The end of the run within the supplied text.
* @param foundBreaks An allocated C array of the breaks found, if any
* @param status Information on any errors encountered.
* @return The number of breaks found.
*/
virtual int32_t findBreaks( UText *text,
int32_t startPos,
int32_t endPos,
UVector32 &foundBreaks ) const;
UVector32 &foundBreaks,
UErrorCode &status) const override;
/**
* <p>Tell the engine to handle a particular character and break type.</p>
@@ -243,7 +247,7 @@ class ICULanguageBreakFactory : public LanguageBreakFactory {
* sought.
* @return A LanguageBreakEngine with the desired characteristics, or 0.
*/
virtual const LanguageBreakEngine *getEngineFor(UChar32 c);
virtual const LanguageBreakEngine *getEngineFor(UChar32 c) override;
protected:
/**
+6 -6
View File
@@ -120,7 +120,7 @@ BreakIterator::buildInstance(const Locale& loc, const char *type, UErrorCode &st
// If there is a result, set the valid locale and actual locale, and the kind
if (U_SUCCESS(status) && result != NULL) {
U_LOCALE_BASED(locBased, *(BreakIterator*)result);
locBased.setLocaleIDs(ures_getLocaleByType(b, ULOC_VALID_LOCALE, &status),
locBased.setLocaleIDs(ures_getLocaleByType(b, ULOC_VALID_LOCALE, &status),
actualLocale.data());
}
@@ -234,7 +234,7 @@ class ICUBreakIteratorFactory : public ICUResourceBundleFactory {
public:
virtual ~ICUBreakIteratorFactory();
protected:
virtual UObject* handleCreate(const Locale& loc, int32_t kind, const ICUService* /*service*/, UErrorCode& status) const {
virtual UObject* handleCreate(const Locale& loc, int32_t kind, const ICUService* /*service*/, UErrorCode& status) const override {
return BreakIterator::makeInstance(loc, kind, status);
}
};
@@ -254,11 +254,11 @@ public:
virtual ~ICUBreakIteratorService();
virtual UObject* cloneInstance(UObject* instance) const {
virtual UObject* cloneInstance(UObject* instance) const override {
return ((BreakIterator*)instance)->clone();
}
virtual UObject* handleDefault(const ICUServiceKey& key, UnicodeString* /*actualID*/, UErrorCode& status) const {
virtual UObject* handleDefault(const ICUServiceKey& key, UnicodeString* /*actualID*/, UErrorCode& status) const override {
LocaleKey& lkey = (LocaleKey&)key;
int32_t kind = lkey.kind();
Locale loc;
@@ -266,7 +266,7 @@ public:
return BreakIterator::makeInstance(loc, kind, status);
}
virtual UBool isDefault() const {
virtual UBool isDefault() const override {
return countFactories() == 1;
}
};
@@ -300,7 +300,7 @@ static UBool U_CALLCONV breakiterator_cleanup(void) {
U_CDECL_END
U_NAMESPACE_BEGIN
static void U_CALLCONV
static void U_CALLCONV
initService(void) {
gService = new ICUBreakIteratorService();
ucln_common_registerCleanup(UCLN_COMMON_BREAKITERATOR, breakiterator_cleanup);
+3 -3
View File
@@ -343,13 +343,13 @@ BytesTrieBuilder::BTLinearMatchNode::BTLinearMatchNode(const char *bytes, int32_
static_cast<uint32_t>(hash)*37u + static_cast<uint32_t>(ustr_hashCharsN(bytes, len)));
}
UBool
bool
BytesTrieBuilder::BTLinearMatchNode::operator==(const Node &other) const {
if(this==&other) {
return TRUE;
return true;
}
if(!LinearMatchNode::operator==(other)) {
return FALSE;
return false;
}
const BTLinearMatchNode &o=(const BTLinearMatchNode &)other;
return 0==uprv_memcmp(s, o.s, length);
+8 -8
View File
@@ -208,12 +208,12 @@ void CanonicalIterator::setSource(const UnicodeString &newSource, UErrorCode &st
goto CleanPartialInitialization;
}
// i should initialy be the number of code units at the
// i should initially be the number of code units at the
// start of the string
i = U16_LENGTH(source.char32At(0));
//int32_t i = 1;
// int32_t i = 1;
// find the segments
// This code iterates through the source string and
// This code iterates through the source string and
// extracts segments that end up on a codepoint that
// doesn't start any decompositions. (Analysis is done
// on the NFD form - see above).
@@ -241,7 +241,7 @@ void CanonicalIterator::setSource(const UnicodeString &newSource, UErrorCode &st
for (i = 0; i < current_length; i++) {
current[i] = 0;
}
// for each segment, get all the combinations that can produce
// for each segment, get all the combinations that can produce
// it after NFD normalization
for (i = 0; i < pieces_length; ++i) {
//if (PROGRESS) printf("SEGMENT\n");
@@ -316,7 +316,7 @@ void U_EXPORT2 CanonicalIterator::permute(UnicodeString &source, UBool skipZeros
if(U_FAILURE(status)) {
return;
}
// The upper remove is destructive. The question is do we have to make a copy, or we don't care about the contents
// The upper remove is destructive. The question is do we have to make a copy, or we don't care about the contents
// of source at this point.
// prefix this character to all of them
@@ -493,9 +493,9 @@ Hashtable *CanonicalIterator::getEquivalents2(Hashtable *fillinResult, const UCh
}
/**
* See if the decomposition of cp2 is at segment starting at segmentPos
* (with canonical rearrangment!)
* If so, take the remainder, and return the equivalents
* See if the decomposition of cp2 is at segment starting at segmentPos
* (with canonical rearrangement!)
* If so, take the remainder, and return the equivalents
*/
Hashtable *CanonicalIterator::extract(Hashtable *fillinResult, UChar32 comp, const UChar *segment, int32_t segLen, int32_t segmentPos, UErrorCode &status) {
//Hashtable *CanonicalIterator::extract(UChar32 comp, const UnicodeString &segment, int32_t segLen, int32_t segmentPos, UErrorCode &status) {
+28
View File
@@ -14,6 +14,7 @@
#include "unicode/uscript.h"
#include "unicode/uset.h"
#include "cmemory.h"
#include "emojiprops.h"
#include "mutex.h"
#include "normalizer2impl.h"
#include "uassert.h"
@@ -170,6 +171,13 @@ void U_CALLCONV initInclusion(UPropertySource src, UErrorCode &errorCode) {
case UPROPS_SRC_VO:
uprops_addPropertyStarts((UPropertySource)src, &sa, &errorCode);
break;
case UPROPS_SRC_EMOJI: {
const icu::EmojiProps *ep = icu::EmojiProps::getSingleton(errorCode);
if (U_SUCCESS(errorCode)) {
ep->addPropertyStarts(&sa, errorCode);
}
break;
}
default:
errorCode = U_INTERNAL_PROGRAM_ERROR;
break;
@@ -268,6 +276,26 @@ UnicodeSet *makeSet(UProperty property, UErrorCode &errorCode) {
errorCode = U_MEMORY_ALLOCATION_ERROR;
return nullptr;
}
if (UCHAR_BASIC_EMOJI <= property && property <= UCHAR_RGI_EMOJI) {
// property of strings
const icu::EmojiProps *ep = icu::EmojiProps::getSingleton(errorCode);
if (U_FAILURE(errorCode)) { return nullptr; }
USetAdder sa = {
(USet *)set.getAlias(),
_set_add,
_set_addRange,
_set_addString,
nullptr, // don't need remove()
nullptr // don't need removeRange()
};
ep->addStrings(&sa, property, errorCode);
if (property != UCHAR_BASIC_EMOJI && property != UCHAR_RGI_EMOJI) {
// property of _only_ strings
set->freeze();
return set.orphan();
}
}
const UnicodeSet *inclusions =
icu::CharacterProperties::getInclusionsForProperty(property, errorCode);
if (U_FAILURE(errorCode)) { return nullptr; }
+1 -1
View File
@@ -38,7 +38,7 @@ static UMemFreeFn *pFree;
#if U_DEBUG && defined(UPRV_MALLOC_COUNT)
#include <stdio.h>
static int n=0;
static long b=0;
static long b=0;
#endif
U_CAPI void * U_EXPORT2
+1 -1
View File
@@ -150,7 +150,7 @@ uprv_calloc(size_t num, size_t size) U_MALLOC_ATTR U_ALLOC_SIZE_ATTR2(1,2);
* Clears any user heap functions from u_setMemoryFunctions()
* Does NOT deallocate any remaining allocated memory.
*/
U_CFUNC UBool
U_CFUNC UBool
cmemory_cleanup(void);
/**
+5 -4
View File
@@ -18,7 +18,7 @@
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
//
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#pragma code_page(1252)
@@ -29,17 +29,17 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
// TEXTINCLUDE
//
1 TEXTINCLUDE
1 TEXTINCLUDE
BEGIN
"msvcres.h\0"
END
2 TEXTINCLUDE
2 TEXTINCLUDE
BEGIN
"#include <winresrc.h>\0"
END
3 TEXTINCLUDE
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
@@ -107,3 +107,4 @@ END
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
+1 -1
View File
@@ -30,7 +30,7 @@ CStr::CStr(const UnicodeString &in) {
}
#else
// No conversion available. Convert any invariant characters; substitute '?' for the rest.
// Note: can't just call u_UCharsToChars() or CharString.appendInvariantChars() on the
// Note: can't just call u_UCharsToChars() or CharString.appendInvariantChars() on the
// whole string because they require that the entire input be invariant.
char buf[2];
for (int i=0; i<in.length(); i = in.moveIndex32(i, 1)) {
+2 -2
View File
@@ -24,11 +24,11 @@
* ICU-internal class CStr, a small helper class to facilitate passing UnicodeStrings
* to functions needing (const char *) strings, such as printf().
*
* It is intended primarily for use in debugging or in tests. Uses platform
* It is intended primarily for use in debugging or in tests. Uses platform
* default code page conversion, which will do the best job possible,
* but may be lossy, depending on the platform.
*
* If no other conversion is available, use invariant conversion and substitue
* If no other conversion is available, use invariant conversion and substitute
* '?' for non-invariant characters.
*
* Example Usage:
+10 -10
View File
@@ -17,7 +17,7 @@
* Date Name Description
* 6/18/98 hshih Created
* 09/08/98 stephen Added include for ctype, for Mac Port
* 11/15/99 helena Integrated S/390 IEEE changes.
* 11/15/99 helena Integrated S/390 IEEE changes.
******************************************************************************
*/
@@ -161,15 +161,15 @@ T_CString_integerToString(char* buffer, int32_t v, int32_t radix)
uint8_t digit;
int32_t length = 0;
uint32_t uval;
U_ASSERT(radix>=2 && radix<=16);
uval = (uint32_t) v;
if(v<0 && radix == 10) {
/* Only in base 10 do we conside numbers to be signed. */
uval = (uint32_t)(-v);
uval = (uint32_t)(-v);
buffer[length++] = '-';
}
tbx = sizeof(tbuf)-1;
tbuf[tbx] = 0; /* We are generating the digits backwards. Null term the end. */
do {
@@ -177,7 +177,7 @@ T_CString_integerToString(char* buffer, int32_t v, int32_t radix)
tbuf[--tbx] = (char)(T_CString_itosOffset(digit));
uval = uval / radix;
} while (uval != 0);
/* copy converted number into user buffer */
uprv_strcpy(buffer+length, tbuf+tbx);
length += sizeof(tbuf) - tbx -1;
@@ -199,15 +199,15 @@ T_CString_int64ToString(char* buffer, int64_t v, uint32_t radix)
uint8_t digit;
int32_t length = 0;
uint64_t uval;
U_ASSERT(radix>=2 && radix<=16);
uval = (uint64_t) v;
if(v<0 && radix == 10) {
/* Only in base 10 do we conside numbers to be signed. */
uval = (uint64_t)(-v);
uval = (uint64_t)(-v);
buffer[length++] = '-';
}
tbx = sizeof(tbuf)-1;
tbuf[tbx] = 0; /* We are generating the digits backwards. Null term the end. */
do {
@@ -215,7 +215,7 @@ T_CString_int64ToString(char* buffer, int64_t v, uint32_t radix)
tbuf[--tbx] = (char)(T_CString_itosOffset(digit));
uval = uval / radix;
} while (uval != 0);
/* copy converted number into user buffer */
uprv_strcpy(buffer+length, tbuf+tbx);
length += sizeof(tbuf) - tbx -1;
@@ -331,7 +331,7 @@ uprv_strndup(const char *src, int32_t n) {
dup = uprv_strdup(src);
} else {
dup = (char*)uprv_malloc(n+1);
if (dup) {
if (dup) {
uprv_memcpy(dup, src, n);
dup[n] = 0;
}
+2 -1
View File
@@ -1,6 +1,6 @@
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
/*
******************************************************************************
*
* Copyright (C) 2001, International Business Machines
@@ -52,3 +52,4 @@ U_CAPI size_t uprv_wcslen(const wchar_t *src) {
}
#endif
+4 -4
View File
@@ -1,6 +1,6 @@
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
/*
******************************************************************************
*
* Copyright (C) 2001, International Business Machines
@@ -42,11 +42,11 @@
# define uprv_wcscat wcscat
# define uprv_wcslen wcslen
#else
U_CAPI wchar_t* U_EXPORT2
U_CAPI wchar_t* U_EXPORT2
uprv_wcscpy(wchar_t *dst, const wchar_t *src);
U_CAPI wchar_t* U_EXPORT2
U_CAPI wchar_t* U_EXPORT2
uprv_wcscat(wchar_t *dst, const wchar_t *src);
U_CAPI size_t U_EXPORT2
U_CAPI size_t U_EXPORT2
uprv_wcslen(const wchar_t *src);
#endif
+66 -60
View File
@@ -47,7 +47,9 @@ int32_t
DictionaryBreakEngine::findBreaks( UText *text,
int32_t startPos,
int32_t endPos,
UVector32 &foundBreaks ) const {
UVector32 &foundBreaks,
UErrorCode& status) const {
if (U_FAILURE(status)) return 0;
(void)startPos; // TODO: remove this param?
int32_t result = 0;
@@ -66,9 +68,9 @@ DictionaryBreakEngine::findBreaks( UText *text,
}
rangeStart = start;
rangeEnd = current;
result = divideUpDictionaryRange(text, rangeStart, rangeEnd, foundBreaks);
result = divideUpDictionaryRange(text, rangeStart, rangeEnd, foundBreaks, status);
utext_setNativeIndex(text, current);
return result;
}
@@ -106,24 +108,24 @@ private:
public:
PossibleWord() : count(0), prefix(0), offset(-1), mark(0), current(0) {}
~PossibleWord() {}
// Fill the list of candidates if needed, select the longest, and return the number found
int32_t candidates( UText *text, DictionaryMatcher *dict, int32_t rangeEnd );
// Select the currently marked candidate, point after it in the text, and invalidate self
int32_t acceptMarked( UText *text );
// Back up from the current candidate to the next shorter one; return TRUE if that exists
// and point the text after it
UBool backUp( UText *text );
// Return the longest prefix this candidate location shares with a dictionary word
// Return value is in code points.
int32_t longestPrefix() { return prefix; }
// Mark the current candidate as the one we like
void markCurrent() { mark = current; }
// Get length in code points of the marked word.
int32_t markedCPLength() { return cpLengths[mark]; }
};
@@ -179,7 +181,7 @@ static const int32_t THAI_ROOT_COMBINE_THRESHOLD = 3;
// dictionary word, with a preceding word
static const int32_t THAI_PREFIX_COMBINE_THRESHOLD = 3;
// Ellision character
// Elision character
static const int32_t THAI_PAIYANNOI = 0x0E2F;
// Repeat character
@@ -227,7 +229,9 @@ int32_t
ThaiBreakEngine::divideUpDictionaryRange( UText *text,
int32_t rangeStart,
int32_t rangeEnd,
UVector32 &foundBreaks ) const {
UVector32 &foundBreaks,
UErrorCode& status) const {
if (U_FAILURE(status)) return 0;
utext_setNativeIndex(text, rangeStart);
utext_moveIndex32(text, THAI_MIN_WORD_SPAN);
if (utext_getNativeIndex(text) >= rangeEnd) {
@@ -240,18 +244,17 @@ ThaiBreakEngine::divideUpDictionaryRange( UText *text,
int32_t cpWordLength = 0; // Word Length in Code Points.
int32_t cuWordLength = 0; // Word length in code units (UText native indexing)
int32_t current;
UErrorCode status = U_ZERO_ERROR;
PossibleWord words[THAI_LOOKAHEAD];
utext_setNativeIndex(text, rangeStart);
while (U_SUCCESS(status) && (current = (int32_t)utext_getNativeIndex(text)) < rangeEnd) {
cpWordLength = 0;
cuWordLength = 0;
// Look for candidate words at the current position
int32_t candidates = words[wordsFound%THAI_LOOKAHEAD].candidates(text, fDictionary, rangeEnd);
// If we found exactly one, use that
if (candidates == 1) {
cuWordLength = words[wordsFound % THAI_LOOKAHEAD].acceptMarked(text);
@@ -268,12 +271,12 @@ ThaiBreakEngine::divideUpDictionaryRange( UText *text,
if (words[(wordsFound + 1) % THAI_LOOKAHEAD].candidates(text, fDictionary, rangeEnd) > 0) {
// Followed by another dictionary word; mark first word as a good candidate
words[wordsFound%THAI_LOOKAHEAD].markCurrent();
// If we're already at the end of the range, we're done
if ((int32_t)utext_getNativeIndex(text) >= rangeEnd) {
goto foundBest;
}
// See if any of the possible second words is followed by a third word
do {
// If we find a third word, stop right away
@@ -292,13 +295,13 @@ foundBest:
cpWordLength = words[wordsFound % THAI_LOOKAHEAD].markedCPLength();
wordsFound += 1;
}
// We come here after having either found a word or not. We look ahead to the
// next word. If it's not a dictionary word, we will combine it with the word we
// just found (if there is one), but only if the preceding word does not exceed
// the threshold.
// The text iterator should now be positioned at the end of the word we found.
UChar32 uc = 0;
if ((int32_t)utext_getNativeIndex(text) < rangeEnd && cpWordLength < THAI_ROOT_COMBINE_THRESHOLD) {
// if it is a dictionary word, do nothing. If it isn't, then if there is
@@ -334,12 +337,12 @@ foundBest:
}
}
}
// Bump the word count if there wasn't already one
if (cuWordLength <= 0) {
wordsFound += 1;
}
// Update the length with the passed-over characters
cuWordLength += chars;
}
@@ -348,14 +351,14 @@ foundBest:
utext_setNativeIndex(text, current+cuWordLength);
}
}
// Never stop before a combining mark.
int32_t currPos;
while ((currPos = (int32_t)utext_getNativeIndex(text)) < rangeEnd && fMarkSet.contains(utext_current32(text))) {
utext_next32(text);
cuWordLength += (int32_t)utext_getNativeIndex(text) - currPos;
}
// Look ahead for possible suffixes if a dictionary word does not follow.
// We do this in code rather than using a rule so that the heuristic
// resynch continues to function. For example, one of the suffix characters
@@ -465,7 +468,9 @@ int32_t
LaoBreakEngine::divideUpDictionaryRange( UText *text,
int32_t rangeStart,
int32_t rangeEnd,
UVector32 &foundBreaks ) const {
UVector32 &foundBreaks,
UErrorCode& status) const {
if (U_FAILURE(status)) return 0;
if ((rangeEnd - rangeStart) < LAO_MIN_WORD_SPAN) {
return 0; // Not enough characters for two words
}
@@ -474,7 +479,6 @@ LaoBreakEngine::divideUpDictionaryRange( UText *text,
int32_t cpWordLength = 0;
int32_t cuWordLength = 0;
int32_t current;
UErrorCode status = U_ZERO_ERROR;
PossibleWord words[LAO_LOOKAHEAD];
utext_setNativeIndex(text, rangeStart);
@@ -485,7 +489,7 @@ LaoBreakEngine::divideUpDictionaryRange( UText *text,
// Look for candidate words at the current position
int32_t candidates = words[wordsFound%LAO_LOOKAHEAD].candidates(text, fDictionary, rangeEnd);
// If we found exactly one, use that
if (candidates == 1) {
cuWordLength = words[wordsFound % LAO_LOOKAHEAD].acceptMarked(text);
@@ -502,12 +506,12 @@ LaoBreakEngine::divideUpDictionaryRange( UText *text,
if (words[(wordsFound + 1) % LAO_LOOKAHEAD].candidates(text, fDictionary, rangeEnd) > 0) {
// Followed by another dictionary word; mark first word as a good candidate
words[wordsFound%LAO_LOOKAHEAD].markCurrent();
// If we're already at the end of the range, we're done
if ((int32_t)utext_getNativeIndex(text) >= rangeEnd) {
goto foundBest;
}
// See if any of the possible second words is followed by a third word
do {
// If we find a third word, stop right away
@@ -525,9 +529,9 @@ foundBest:
cpWordLength = words[wordsFound % LAO_LOOKAHEAD].markedCPLength();
wordsFound += 1;
}
// We come here after having either found a word or not. We look ahead to the
// next word. If it's not a dictionary word, we will combine it withe the word we
// next word. If it's not a dictionary word, we will combine it with the word we
// just found (if there is one), but only if the preceding word does not exceed
// the threshold.
// The text iterator should now be positioned at the end of the word we found.
@@ -563,12 +567,12 @@ foundBest:
}
}
}
// Bump the word count if there wasn't already one
if (cuWordLength <= 0) {
wordsFound += 1;
}
// Update the length with the passed-over characters
cuWordLength += chars;
}
@@ -577,14 +581,14 @@ foundBest:
utext_setNativeIndex(text, current + cuWordLength);
}
}
// Never stop before a combining mark.
int32_t currPos;
while ((currPos = (int32_t)utext_getNativeIndex(text)) < rangeEnd && fMarkSet.contains(utext_current32(text))) {
utext_next32(text);
cuWordLength += (int32_t)utext_getNativeIndex(text) - currPos;
}
// Look ahead for possible suffixes if a dictionary word does not follow.
// We do this in code rather than using a rule so that the heuristic
// resynch continues to function. For example, one of the suffix characters
@@ -657,7 +661,9 @@ int32_t
BurmeseBreakEngine::divideUpDictionaryRange( UText *text,
int32_t rangeStart,
int32_t rangeEnd,
UVector32 &foundBreaks ) const {
UVector32 &foundBreaks,
UErrorCode& status ) const {
if (U_FAILURE(status)) return 0;
if ((rangeEnd - rangeStart) < BURMESE_MIN_WORD_SPAN) {
return 0; // Not enough characters for two words
}
@@ -666,7 +672,6 @@ BurmeseBreakEngine::divideUpDictionaryRange( UText *text,
int32_t cpWordLength = 0;
int32_t cuWordLength = 0;
int32_t current;
UErrorCode status = U_ZERO_ERROR;
PossibleWord words[BURMESE_LOOKAHEAD];
utext_setNativeIndex(text, rangeStart);
@@ -677,7 +682,7 @@ BurmeseBreakEngine::divideUpDictionaryRange( UText *text,
// Look for candidate words at the current position
int32_t candidates = words[wordsFound%BURMESE_LOOKAHEAD].candidates(text, fDictionary, rangeEnd);
// If we found exactly one, use that
if (candidates == 1) {
cuWordLength = words[wordsFound % BURMESE_LOOKAHEAD].acceptMarked(text);
@@ -694,12 +699,12 @@ BurmeseBreakEngine::divideUpDictionaryRange( UText *text,
if (words[(wordsFound + 1) % BURMESE_LOOKAHEAD].candidates(text, fDictionary, rangeEnd) > 0) {
// Followed by another dictionary word; mark first word as a good candidate
words[wordsFound%BURMESE_LOOKAHEAD].markCurrent();
// If we're already at the end of the range, we're done
if ((int32_t)utext_getNativeIndex(text) >= rangeEnd) {
goto foundBest;
}
// See if any of the possible second words is followed by a third word
do {
// If we find a third word, stop right away
@@ -717,9 +722,9 @@ foundBest:
cpWordLength = words[wordsFound % BURMESE_LOOKAHEAD].markedCPLength();
wordsFound += 1;
}
// We come here after having either found a word or not. We look ahead to the
// next word. If it's not a dictionary word, we will combine it withe the word we
// next word. If it's not a dictionary word, we will combine it with the word we
// just found (if there is one), but only if the preceding word does not exceed
// the threshold.
// The text iterator should now be positioned at the end of the word we found.
@@ -755,12 +760,12 @@ foundBest:
}
}
}
// Bump the word count if there wasn't already one
if (cuWordLength <= 0) {
wordsFound += 1;
}
// Update the length with the passed-over characters
cuWordLength += chars;
}
@@ -769,14 +774,14 @@ foundBest:
utext_setNativeIndex(text, current + cuWordLength);
}
}
// Never stop before a combining mark.
int32_t currPos;
while ((currPos = (int32_t)utext_getNativeIndex(text)) < rangeEnd && fMarkSet.contains(utext_current32(text))) {
utext_next32(text);
cuWordLength += (int32_t)utext_getNativeIndex(text) - currPos;
}
// Look ahead for possible suffixes if a dictionary word does not follow.
// We do this in code rather than using a rule so that the heuristic
// resynch continues to function. For example, one of the suffix characters
@@ -861,7 +866,9 @@ int32_t
KhmerBreakEngine::divideUpDictionaryRange( UText *text,
int32_t rangeStart,
int32_t rangeEnd,
UVector32 &foundBreaks ) const {
UVector32 &foundBreaks,
UErrorCode& status ) const {
if (U_FAILURE(status)) return 0;
if ((rangeEnd - rangeStart) < KHMER_MIN_WORD_SPAN) {
return 0; // Not enough characters for two words
}
@@ -870,7 +877,6 @@ KhmerBreakEngine::divideUpDictionaryRange( UText *text,
int32_t cpWordLength = 0;
int32_t cuWordLength = 0;
int32_t current;
UErrorCode status = U_ZERO_ERROR;
PossibleWord words[KHMER_LOOKAHEAD];
utext_setNativeIndex(text, rangeStart);
@@ -1024,7 +1030,7 @@ foundBest:
foundBreaks.push((current+cuWordLength), status);
}
}
// Don't return a break for the end of the dictionary range if there is one there.
if (foundBreaks.peeki() >= rangeEnd) {
(void) foundBreaks.popi();
@@ -1098,7 +1104,7 @@ static inline int32_t utext_i32_flag(int32_t bitIndex) {
return (int32_t)1 << bitIndex;
}
/*
* @param text A UText representing the text
* @param rangeStart The start of the range of dictionary characters
@@ -1106,11 +1112,13 @@ static inline int32_t utext_i32_flag(int32_t bitIndex) {
* @param foundBreaks vector<int32> to receive the break positions
* @return The number of breaks found
*/
int32_t
int32_t
CjkBreakEngine::divideUpDictionaryRange( UText *inText,
int32_t rangeStart,
int32_t rangeEnd,
UVector32 &foundBreaks ) const {
UVector32 &foundBreaks,
UErrorCode& status) const {
if (U_FAILURE(status)) return 0;
if (rangeStart >= rangeEnd) {
return 0;
}
@@ -1122,9 +1130,6 @@ CjkBreakEngine::divideUpDictionaryRange( UText *inText,
// If NULL then mapping is 1:1
LocalPointer<UVector32> inputMap;
UErrorCode status = U_ZERO_ERROR;
// if UText has the input string as one contiguous UTF-16 chunk
if ((inText->providerProperties & utext_i32_flag(UTEXT_PROVIDER_STABLE_CHUNKS)) &&
inText->chunkNativeStart <= rangeStart &&
@@ -1169,7 +1174,7 @@ CjkBreakEngine::divideUpDictionaryRange( UText *inText,
if (U_FAILURE(status)) {
return 0;
}
UnicodeString fragment;
UnicodeString normalizedFragment;
for (int32_t srcI = 0; srcI < inString.length();) { // Once per normalization chunk
@@ -1238,7 +1243,7 @@ CjkBreakEngine::divideUpDictionaryRange( UText *inText,
}
}
}
// bestSnlp[i] is the snlp of the best segmentation of the first i
// code points in the range to be matched.
UVector32 bestSnlp(numCodePts + 1, status);
@@ -1248,7 +1253,7 @@ CjkBreakEngine::divideUpDictionaryRange( UText *inText,
}
// prev[i] is the index of the last CJK code point in the previous word in
// prev[i] is the index of the last CJK code point in the previous word in
// the best segmentation of the first i characters.
UVector32 prev(numCodePts + 1, status);
for(int32_t i = 0; i <= numCodePts; i++){
@@ -1283,8 +1288,8 @@ CjkBreakEngine::divideUpDictionaryRange( UText *inText,
// Note: lengths is filled with code point lengths
// The NULL parameter is the ignored code unit lengths.
// if there are no single character matches found in the dictionary
// starting with this character, treat character as a 1-character word
// if there are no single character matches found in the dictionary
// starting with this character, treat character as a 1-character word
// with the highest value possible, i.e. the least likely to occur.
// Exclude Korean characters from this treatment, as they should be left
// together by default.
@@ -1357,7 +1362,7 @@ CjkBreakEngine::divideUpDictionaryRange( UText *inText,
numBreaks++;
}
// Now that we're done, convert positions in t_boundary[] (indices in
// Now that we're done, convert positions in t_boundary[] (indices in
// the normalized input string) back to indices in the original input UText
// while reversing t_boundary and pushing values to foundBreaks.
int32_t prevCPPos = -1;
@@ -1391,3 +1396,4 @@ CjkBreakEngine::divideUpDictionaryRange( UText *inText,
U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_BREAK_ITERATION */
+22 -8
View File
@@ -62,7 +62,7 @@ class DictionaryBreakEngine : public LanguageBreakEngine {
* @return true if this engine handles the particular character and break
* type.
*/
virtual UBool handles(UChar32 c) const;
virtual UBool handles(UChar32 c) const override;
/**
* <p>Find any breaks within a run in the supplied text.</p>
@@ -73,12 +73,14 @@ class DictionaryBreakEngine : public LanguageBreakEngine {
* @param startPos The start of the run within the supplied text.
* @param endPos The end of the run within the supplied text.
* @param foundBreaks vector of int32_t to receive the break positions
* @param status Information on any errors encountered.
* @return The number of breaks found.
*/
virtual int32_t findBreaks( UText *text,
int32_t startPos,
int32_t endPos,
UVector32 &foundBreaks ) const;
UVector32 &foundBreaks,
UErrorCode& status ) const override;
protected:
@@ -96,12 +98,14 @@ class DictionaryBreakEngine : public LanguageBreakEngine {
* @param rangeStart The start of the range of dictionary characters
* @param rangeEnd The end of the range of dictionary characters
* @param foundBreaks Output of C array of int32_t break positions, or 0
* @param status Information on any errors encountered.
* @return The number of breaks found
*/
virtual int32_t divideUpDictionaryRange( UText *text,
int32_t rangeStart,
int32_t rangeEnd,
UVector32 &foundBreaks ) const = 0;
UVector32 &foundBreaks,
UErrorCode& status) const = 0;
};
@@ -153,12 +157,14 @@ class ThaiBreakEngine : public DictionaryBreakEngine {
* @param rangeStart The start of the range of dictionary characters
* @param rangeEnd The end of the range of dictionary characters
* @param foundBreaks Output of C array of int32_t break positions, or 0
* @param status Information on any errors encountered.
* @return The number of breaks found
*/
virtual int32_t divideUpDictionaryRange( UText *text,
int32_t rangeStart,
int32_t rangeEnd,
UVector32 &foundBreaks ) const;
UVector32 &foundBreaks,
UErrorCode& status) const override;
};
@@ -209,12 +215,14 @@ class LaoBreakEngine : public DictionaryBreakEngine {
* @param rangeStart The start of the range of dictionary characters
* @param rangeEnd The end of the range of dictionary characters
* @param foundBreaks Output of C array of int32_t break positions, or 0
* @param status Information on any errors encountered.
* @return The number of breaks found
*/
virtual int32_t divideUpDictionaryRange( UText *text,
int32_t rangeStart,
int32_t rangeEnd,
UVector32 &foundBreaks ) const;
UVector32 &foundBreaks,
UErrorCode& status) const override;
};
@@ -265,12 +273,14 @@ class BurmeseBreakEngine : public DictionaryBreakEngine {
* @param rangeStart The start of the range of dictionary characters
* @param rangeEnd The end of the range of dictionary characters
* @param foundBreaks Output of C array of int32_t break positions, or 0
* @param status Information on any errors encountered.
* @return The number of breaks found
*/
virtual int32_t divideUpDictionaryRange( UText *text,
int32_t rangeStart,
int32_t rangeEnd,
UVector32 &foundBreaks ) const;
UVector32 &foundBreaks,
UErrorCode& status) const override;
};
@@ -321,12 +331,14 @@ class KhmerBreakEngine : public DictionaryBreakEngine {
* @param rangeStart The start of the range of dictionary characters
* @param rangeEnd The end of the range of dictionary characters
* @param foundBreaks Output of C array of int32_t break positions, or 0
* @param status Information on any errors encountered.
* @return The number of breaks found
*/
virtual int32_t divideUpDictionaryRange( UText *text,
int32_t rangeStart,
int32_t rangeEnd,
UVector32 &foundBreaks ) const;
UVector32 &foundBreaks,
UErrorCode& status) const override;
};
@@ -385,12 +397,14 @@ class CjkBreakEngine : public DictionaryBreakEngine {
* @param rangeStart The start of the range of dictionary characters
* @param rangeEnd The end of the range of dictionary characters
* @param foundBreaks Output of C array of int32_t break positions, or 0
* @param status Information on any errors encountered.
* @return The number of breaks found
*/
virtual int32_t divideUpDictionaryRange( UText *text,
int32_t rangeStart,
int32_t rangeEnd,
UVector32 &foundBreaks ) const;
UVector32 &foundBreaks,
UErrorCode& status) const override;
};
+5 -5
View File
@@ -30,7 +30,7 @@ const int32_t DictionaryData::TRANSFORM_NONE = 0;
const int32_t DictionaryData::TRANSFORM_TYPE_OFFSET = 0x1000000;
const int32_t DictionaryData::TRANSFORM_TYPE_MASK = 0x7f000000;
const int32_t DictionaryData::TRANSFORM_OFFSET_MASK = 0x1fffff;
DictionaryMatcher::~DictionaryMatcher() {
}
@@ -172,10 +172,10 @@ udict_swap(const UDataSwapper *ds, const void *inData, int32_t length,
headerSize = udata_swapDataHeader(ds, inData, length, outData, pErrorCode);
if (pErrorCode == NULL || U_FAILURE(*pErrorCode)) return 0;
pInfo = (const UDataInfo *)((const char *)inData + 4);
if (!(pInfo->dataFormat[0] == 0x44 &&
pInfo->dataFormat[1] == 0x69 &&
pInfo->dataFormat[2] == 0x63 &&
pInfo->dataFormat[3] == 0x74 &&
if (!(pInfo->dataFormat[0] == 0x44 &&
pInfo->dataFormat[1] == 0x69 &&
pInfo->dataFormat[2] == 0x63 &&
pInfo->dataFormat[3] == 0x74 &&
pInfo->formatVersion[0] == 1)) {
udata_printError(ds, "udict_swap(): data format %02x.%02x.%02x.%02x (format version %02x) is not recognized as dictionary data\n",
pInfo->dataFormat[0], pInfo->dataFormat[1], pInfo->dataFormat[2], pInfo->dataFormat[3], pInfo->formatVersion[0]);
+6 -6
View File
@@ -62,7 +62,7 @@ public:
/**
* Wrapper class around generic dictionaries, implementing matches().
* getType() should return a TRIE_TYPE_??? constant from DictionaryData.
*
*
* All implementations of this interface must be thread-safe if they are to be used inside of the
* dictionary-based break iteration code.
*/
@@ -107,8 +107,8 @@ public:
virtual ~UCharsDictionaryMatcher();
virtual int32_t matches(UText *text, int32_t maxLength, int32_t limit,
int32_t *lengths, int32_t *cpLengths, int32_t *values,
int32_t *prefix) const;
virtual int32_t getType() const;
int32_t *prefix) const override;
virtual int32_t getType() const override;
private:
const UChar *characters;
UDataMemory *file;
@@ -125,8 +125,8 @@ public:
virtual ~BytesDictionaryMatcher();
virtual int32_t matches(UText *text, int32_t maxLength, int32_t limit,
int32_t *lengths, int32_t *cpLengths, int32_t *values,
int32_t *prefix) const;
virtual int32_t getType() const;
int32_t *prefix) const override;
virtual int32_t getType() const override;
private:
UChar32 transform(UChar32 c) const;
@@ -159,7 +159,7 @@ udict_swap(const UDataSwapper *ds, const void *inData, int32_t length, void *out
* Constants are defined in the DictionaryData class.
*
* For the data structure of BytesTrie & UCharsTrie see
* http://site.icu-project.org/design/struct/tries
* https://icu.unicode.org/design/struct/tries
* and the bytestrie.h and ucharstrie.h header files.
*
* int32_t indexes[indexesLength]; -- indexesLength=indexes[IX_STRING_TRIE_OFFSET]/4;
+6 -5
View File
@@ -5,7 +5,7 @@
* others. All Rights Reserved.
*******************************************************************************
*
* File DTINTRV.CPP
* File DTINTRV.CPP
*
*******************************************************************************
*/
@@ -34,7 +34,7 @@ DateInterval::~DateInterval(){}
DateInterval::DateInterval(const DateInterval& other)
: UObject(other) {
*this = other;
}
}
DateInterval&
@@ -47,16 +47,17 @@ DateInterval::operator=(const DateInterval& other) {
}
DateInterval*
DateInterval*
DateInterval::clone() const {
return new DateInterval(*this);
}
UBool
DateInterval::operator==(const DateInterval& other) const {
bool
DateInterval::operator==(const DateInterval& other) const {
return ( fromDate == other.fromDate && toDate == other.toDate );
}
U_NAMESPACE_END
+220
View File
@@ -0,0 +1,220 @@
// © 2021 and later: Unicode, Inc. and others.
// License & terms of use: https://www.unicode.org/copyright.html
// emojiprops.cpp
// created: 2021sep04 Markus W. Scherer
#include "unicode/utypes.h"
#include "unicode/uchar.h"
#include "unicode/ucharstrie.h"
#include "unicode/ucptrie.h"
#include "unicode/udata.h"
#include "unicode/ustringtrie.h"
#include "unicode/utf16.h"
#include "emojiprops.h"
#include "ucln.h"
#include "ucln_cmn.h"
#include "umutex.h"
#include "uset_imp.h"
U_NAMESPACE_BEGIN
namespace {
EmojiProps *singleton = nullptr;
icu::UInitOnce emojiInitOnce = U_INITONCE_INITIALIZER;
UBool U_CALLCONV emojiprops_cleanup() {
delete singleton;
singleton = nullptr;
emojiInitOnce.reset();
return true;
}
void U_CALLCONV initSingleton(UErrorCode &errorCode) {
if (U_FAILURE(errorCode)) { return; }
singleton = new EmojiProps(errorCode);
if (singleton == nullptr) {
errorCode = U_MEMORY_ALLOCATION_ERROR;
} else if (U_FAILURE(errorCode)) {
delete singleton;
singleton = nullptr;
}
ucln_common_registerCleanup(UCLN_COMMON_EMOJIPROPS, emojiprops_cleanup);
}
// TODO: turn this into a shared helper function
// Requires the major version to match, and then requires at least the minor version.
UBool udata_isAcceptableMajorMinor(
const UDataInfo &info, const UChar *dataFormat, uint8_t major, uint8_t minor) {
return
info.size >= 20 &&
info.isBigEndian == U_IS_BIG_ENDIAN &&
info.charsetFamily == U_CHARSET_FAMILY &&
info.dataFormat[0] == dataFormat[0] &&
info.dataFormat[1] == dataFormat[1] &&
info.dataFormat[2] == dataFormat[2] &&
info.dataFormat[3] == dataFormat[3] &&
info.formatVersion[0] == major &&
info.formatVersion[1] >= minor;
}
} // namespace
EmojiProps::~EmojiProps() {
udata_close(memory);
ucptrie_close(cpTrie);
}
const EmojiProps *
EmojiProps::getSingleton(UErrorCode &errorCode) {
if (U_FAILURE(errorCode)) { return nullptr; }
umtx_initOnce(emojiInitOnce, &initSingleton, errorCode);
return singleton;
}
UBool U_CALLCONV
EmojiProps::isAcceptable(void * /*context*/, const char * /*type*/, const char * /*name*/,
const UDataInfo *pInfo) {
return udata_isAcceptableMajorMinor(*pInfo, u"Emoj", 1, 0);
}
void
EmojiProps::load(UErrorCode &errorCode) {
memory = udata_openChoice(nullptr, "icu", "uemoji", isAcceptable, this, &errorCode);
if (U_FAILURE(errorCode)) { return; }
const uint8_t *inBytes = (const uint8_t *)udata_getMemory(memory);
const int32_t *inIndexes = (const int32_t *)inBytes;
int32_t indexesLength = inIndexes[IX_CPTRIE_OFFSET] / 4;
if (indexesLength <= IX_RGI_EMOJI_ZWJ_SEQUENCE_TRIE_OFFSET) {
errorCode = U_INVALID_FORMAT_ERROR; // Not enough indexes.
return;
}
int32_t i = IX_CPTRIE_OFFSET;
int32_t offset = inIndexes[i++];
int32_t nextOffset = inIndexes[i];
cpTrie = ucptrie_openFromBinary(UCPTRIE_TYPE_FAST, UCPTRIE_VALUE_BITS_8,
inBytes + offset, nextOffset - offset, nullptr, &errorCode);
if (U_FAILURE(errorCode)) {
return;
}
for (i = IX_BASIC_EMOJI_TRIE_OFFSET; i <= IX_RGI_EMOJI_ZWJ_SEQUENCE_TRIE_OFFSET; ++i) {
offset = inIndexes[i];
nextOffset = inIndexes[i + 1];
// Set/leave nullptr if there is no UCharsTrie.
const UChar *p = nextOffset > offset ? (const UChar *)(inBytes + offset) : nullptr;
stringTries[getStringTrieIndex(i)] = p;
}
}
void
EmojiProps::addPropertyStarts(const USetAdder *sa, UErrorCode & /*errorCode*/) const {
// Add the start code point of each same-value range of the trie.
UChar32 start = 0, end;
uint32_t value;
while ((end = ucptrie_getRange(cpTrie, start, UCPMAP_RANGE_NORMAL, 0,
nullptr, nullptr, &value)) >= 0) {
sa->add(sa->set, start);
start = end + 1;
}
}
UBool
EmojiProps::hasBinaryProperty(UChar32 c, UProperty which) {
UErrorCode errorCode = U_ZERO_ERROR;
const EmojiProps *ep = getSingleton(errorCode);
return U_SUCCESS(errorCode) && ep->hasBinaryPropertyImpl(c, which);
}
UBool
EmojiProps::hasBinaryPropertyImpl(UChar32 c, UProperty which) const {
if (which < UCHAR_EMOJI || UCHAR_RGI_EMOJI < which) {
return false;
}
// Note: UCHAR_REGIONAL_INDICATOR is a single, hardcoded range implemented elsewhere.
static constexpr int8_t bitFlags[] = {
BIT_EMOJI, // UCHAR_EMOJI=57
BIT_EMOJI_PRESENTATION, // UCHAR_EMOJI_PRESENTATION=58
BIT_EMOJI_MODIFIER, // UCHAR_EMOJI_MODIFIER=59
BIT_EMOJI_MODIFIER_BASE, // UCHAR_EMOJI_MODIFIER_BASE=60
BIT_EMOJI_COMPONENT, // UCHAR_EMOJI_COMPONENT=61
-1, // UCHAR_REGIONAL_INDICATOR=62
-1, // UCHAR_PREPENDED_CONCATENATION_MARK=63
BIT_EXTENDED_PICTOGRAPHIC, // UCHAR_EXTENDED_PICTOGRAPHIC=64
BIT_BASIC_EMOJI, // UCHAR_BASIC_EMOJI=65
-1, // UCHAR_EMOJI_KEYCAP_SEQUENCE=66
-1, // UCHAR_RGI_EMOJI_MODIFIER_SEQUENCE=67
-1, // UCHAR_RGI_EMOJI_FLAG_SEQUENCE=68
-1, // UCHAR_RGI_EMOJI_TAG_SEQUENCE=69
-1, // UCHAR_RGI_EMOJI_ZWJ_SEQUENCE=70
BIT_BASIC_EMOJI, // UCHAR_RGI_EMOJI=71
};
int32_t bit = bitFlags[which - UCHAR_EMOJI];
if (bit < 0) {
return false; // not a property that we support in this function
}
uint8_t bits = UCPTRIE_FAST_GET(cpTrie, UCPTRIE_8, c);
return (bits >> bit) & 1;
}
UBool
EmojiProps::hasBinaryProperty(const UChar *s, int32_t length, UProperty which) {
UErrorCode errorCode = U_ZERO_ERROR;
const EmojiProps *ep = getSingleton(errorCode);
return U_SUCCESS(errorCode) && ep->hasBinaryPropertyImpl(s, length, which);
}
UBool
EmojiProps::hasBinaryPropertyImpl(const UChar *s, int32_t length, UProperty which) const {
if (s == nullptr && length != 0) { return false; }
if (length <= 0 && (length == 0 || *s == 0)) { return false; } // empty string
// The caller should have delegated single code points to hasBinaryProperty(c, which).
if (which < UCHAR_BASIC_EMOJI || UCHAR_RGI_EMOJI < which) {
return false;
}
UProperty firstProp = which, lastProp = which;
if (which == UCHAR_RGI_EMOJI) {
// RGI_Emoji is the union of the other emoji properties of strings.
firstProp = UCHAR_BASIC_EMOJI;
lastProp = UCHAR_RGI_EMOJI_ZWJ_SEQUENCE;
}
for (int32_t prop = firstProp; prop <= lastProp; ++prop) {
const UChar *trieUChars = stringTries[prop - UCHAR_BASIC_EMOJI];
if (trieUChars != nullptr) {
UCharsTrie trie(trieUChars);
UStringTrieResult result = trie.next(s, length);
if (USTRINGTRIE_HAS_VALUE(result)) {
return true;
}
}
}
return false;
}
void
EmojiProps::addStrings(const USetAdder *sa, UProperty which, UErrorCode &errorCode) const {
if (U_FAILURE(errorCode)) { return; }
if (which < UCHAR_BASIC_EMOJI || UCHAR_RGI_EMOJI < which) {
return;
}
UProperty firstProp = which, lastProp = which;
if (which == UCHAR_RGI_EMOJI) {
// RGI_Emoji is the union of the other emoji properties of strings.
firstProp = UCHAR_BASIC_EMOJI;
lastProp = UCHAR_RGI_EMOJI_ZWJ_SEQUENCE;
}
for (int32_t prop = firstProp; prop <= lastProp; ++prop) {
const UChar *trieUChars = stringTries[prop - UCHAR_BASIC_EMOJI];
if (trieUChars != nullptr) {
UCharsTrie::Iterator iter(trieUChars, 0, errorCode);
while (iter.next(errorCode)) {
const UnicodeString &s = iter.getString();
sa->addString(sa->set, s.getBuffer(), s.length());
}
}
}
}
U_NAMESPACE_END
+90
View File
@@ -0,0 +1,90 @@
// © 2021 and later: Unicode, Inc. and others.
// License & terms of use: https://www.unicode.org/copyright.html
// emojiprops.h
// created: 2021sep03 Markus W. Scherer
#ifndef __EMOJIPROPS_H__
#define __EMOJIPROPS_H__
#include "unicode/utypes.h"
#include "unicode/ucptrie.h"
#include "unicode/udata.h"
#include "unicode/uobject.h"
#include "uset_imp.h"
U_NAMESPACE_BEGIN
class EmojiProps : public UMemory {
public:
// @internal
EmojiProps(UErrorCode &errorCode) { load(errorCode); }
~EmojiProps();
static const EmojiProps *getSingleton(UErrorCode &errorCode);
static UBool hasBinaryProperty(UChar32 c, UProperty which);
static UBool hasBinaryProperty(const UChar *s, int32_t length, UProperty which);
void addPropertyStarts(const USetAdder *sa, UErrorCode &errorCode) const;
void addStrings(const USetAdder *sa, UProperty which, UErrorCode &errorCode) const;
enum {
// Byte offsets from the start of the data, after the generic header,
// in ascending order.
// UCPTrie=CodePointTrie, follows the indexes
IX_CPTRIE_OFFSET,
IX_RESERVED1,
IX_RESERVED2,
IX_RESERVED3,
// UCharsTrie=CharsTrie
IX_BASIC_EMOJI_TRIE_OFFSET,
IX_EMOJI_KEYCAP_SEQUENCE_TRIE_OFFSET,
IX_RGI_EMOJI_MODIFIER_SEQUENCE_TRIE_OFFSET,
IX_RGI_EMOJI_FLAG_SEQUENCE_TRIE_OFFSET,
IX_RGI_EMOJI_TAG_SEQUENCE_TRIE_OFFSET,
IX_RGI_EMOJI_ZWJ_SEQUENCE_TRIE_OFFSET,
IX_RESERVED10,
IX_RESERVED11,
IX_RESERVED12,
IX_TOTAL_SIZE,
// Not initially byte offsets.
IX_RESERVED14,
IX_RESERVED15,
IX_COUNT // 16
};
// Properties in the code point trie.
enum {
// https://www.unicode.org/reports/tr51/#Emoji_Properties
BIT_EMOJI,
BIT_EMOJI_PRESENTATION,
BIT_EMOJI_MODIFIER,
BIT_EMOJI_MODIFIER_BASE,
BIT_EMOJI_COMPONENT,
BIT_EXTENDED_PICTOGRAPHIC,
// https://www.unicode.org/reports/tr51/#Emoji_Sets
BIT_BASIC_EMOJI
};
private:
static UBool U_CALLCONV
isAcceptable(void *context, const char *type, const char *name, const UDataInfo *pInfo);
/** Input i: One of the IX_..._TRIE_OFFSET indexes into the data file indexes[] array. */
static int32_t getStringTrieIndex(int32_t i) {
return i - IX_BASIC_EMOJI_TRIE_OFFSET;
}
void load(UErrorCode &errorCode);
UBool hasBinaryPropertyImpl(UChar32 c, UProperty which) const;
UBool hasBinaryPropertyImpl(const UChar *s, int32_t length, UProperty which) const;
UDataMemory *memory = nullptr;
UCPTrie *cpTrie = nullptr;
const UChar *stringTries[6] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr };
};
U_NAMESPACE_END
#endif // __EMOJIPROPS_H__
+39 -40
View File
@@ -49,7 +49,7 @@ static void _fb_trace(const char *m, const UnicodeString *s, UBool b, int32_t d,
/**
* Used with sortedInsert()
*/
static int8_t U_CALLCONV compareUnicodeString(UElement t1, UElement t2) {
static int32_t U_CALLCONV compareUnicodeString(UElement t1, UElement t2) {
const UnicodeString &a = *(const UnicodeString*)t1.pointer;
const UnicodeString &b = *(const UnicodeString*)t2.pointer;
return a.compare(b);
@@ -90,7 +90,6 @@ class U_COMMON_API UStringSet : public UVector {
} else {
sortedInsert(str, compareUnicodeString, status);
if(U_FAILURE(status)) {
delete str;
return false;
}
return true;
@@ -138,7 +137,7 @@ static const UChar kFULLSTOP = 0x002E; // '.'
*/
class SimpleFilteredSentenceBreakData : public UMemory {
public:
SimpleFilteredSentenceBreakData(UCharsTrie *forwards, UCharsTrie *backwards )
SimpleFilteredSentenceBreakData(UCharsTrie *forwards, UCharsTrie *backwards )
: fForwardsPartialTrie(forwards), fBackwardsTrie(backwards), refcount(1) { }
SimpleFilteredSentenceBreakData *incr() {
umtx_atomic_inc(&refcount);
@@ -186,37 +185,37 @@ public:
/* -- cloning and other subclass stuff -- */
virtual BreakIterator * createBufferClone(void * /*stackBuffer*/,
int32_t &/*BufferSize*/,
UErrorCode &status) {
UErrorCode &status) override {
// for now - always deep clone
status = U_SAFECLONE_ALLOCATED_WARNING;
return clone();
}
virtual SimpleFilteredSentenceBreakIterator* clone() const { return new SimpleFilteredSentenceBreakIterator(*this); }
virtual UClassID getDynamicClassID(void) const { return NULL; }
virtual UBool operator==(const BreakIterator& o) const { if(this==&o) return true; return false; }
virtual SimpleFilteredSentenceBreakIterator* clone() const override { return new SimpleFilteredSentenceBreakIterator(*this); }
virtual UClassID getDynamicClassID(void) const override { return NULL; }
virtual bool operator==(const BreakIterator& o) const override { if(this==&o) return true; return false; }
/* -- text modifying -- */
virtual void setText(UText *text, UErrorCode &status) { fDelegate->setText(text,status); }
virtual BreakIterator &refreshInputText(UText *input, UErrorCode &status) { fDelegate->refreshInputText(input,status); return *this; }
virtual void adoptText(CharacterIterator* it) { fDelegate->adoptText(it); }
virtual void setText(const UnicodeString &text) { fDelegate->setText(text); }
virtual void setText(UText *text, UErrorCode &status) override { fDelegate->setText(text,status); }
virtual BreakIterator &refreshInputText(UText *input, UErrorCode &status) override { fDelegate->refreshInputText(input,status); return *this; }
virtual void adoptText(CharacterIterator* it) override { fDelegate->adoptText(it); }
virtual void setText(const UnicodeString &text) override { fDelegate->setText(text); }
/* -- other functions that are just delegated -- */
virtual UText *getUText(UText *fillIn, UErrorCode &status) const { return fDelegate->getUText(fillIn,status); }
virtual CharacterIterator& getText(void) const { return fDelegate->getText(); }
virtual UText *getUText(UText *fillIn, UErrorCode &status) const override { return fDelegate->getUText(fillIn,status); }
virtual CharacterIterator& getText(void) const override { return fDelegate->getText(); }
/* -- ITERATION -- */
virtual int32_t first(void);
virtual int32_t preceding(int32_t offset);
virtual int32_t previous(void);
virtual UBool isBoundary(int32_t offset);
virtual int32_t current(void) const { return fDelegate->current(); } // we keep the delegate current, so this should be correct.
virtual int32_t first(void) override;
virtual int32_t preceding(int32_t offset) override;
virtual int32_t previous(void) override;
virtual UBool isBoundary(int32_t offset) override;
virtual int32_t current(void) const override { return fDelegate->current(); } // we keep the delegate current, so this should be correct.
virtual int32_t next(void);
virtual int32_t next(void) override;
virtual int32_t next(int32_t n);
virtual int32_t following(int32_t offset);
virtual int32_t last(void);
virtual int32_t next(int32_t n) override;
virtual int32_t following(int32_t offset) override;
virtual int32_t last(void) override;
private:
/**
@@ -235,7 +234,7 @@ private:
int32_t internalPrev(int32_t n);
/**
* set up the UText with the value of the fDelegate.
* Call this before calling breakExceptionAt.
* Call this before calling breakExceptionAt.
* May be able to avoid excess calls
*/
void resetState(UErrorCode &status);
@@ -388,7 +387,7 @@ SimpleFilteredSentenceBreakIterator::internalNext(int32_t n) {
default:
case kNoExceptionHere:
return n;
}
}
}
return n;
}
@@ -417,7 +416,7 @@ SimpleFilteredSentenceBreakIterator::internalPrev(int32_t n) {
default:
case kNoExceptionHere:
return n;
}
}
}
return n;
}
@@ -460,9 +459,9 @@ UBool SimpleFilteredSentenceBreakIterator::isBoundary(int32_t offset) {
default:
case kNoExceptionHere:
return true;
}
}
}
int32_t
SimpleFilteredSentenceBreakIterator::next(int32_t offset) {
return internalNext(fDelegate->next(offset));
@@ -488,9 +487,9 @@ public:
virtual ~SimpleFilteredBreakIteratorBuilder();
SimpleFilteredBreakIteratorBuilder(const Locale &fromLocale, UErrorCode &status);
SimpleFilteredBreakIteratorBuilder(UErrorCode &status);
virtual UBool suppressBreakAfter(const UnicodeString& exception, UErrorCode& status);
virtual UBool unsuppressBreakAfter(const UnicodeString& exception, UErrorCode& status);
virtual BreakIterator *build(BreakIterator* adoptBreakIterator, UErrorCode& status);
virtual UBool suppressBreakAfter(const UnicodeString& exception, UErrorCode& status) override;
virtual UBool unsuppressBreakAfter(const UnicodeString& exception, UErrorCode& status) override;
virtual BreakIterator *build(BreakIterator* adoptBreakIterator, UErrorCode& status) override;
private:
UStringSet fSet;
};
@@ -499,7 +498,7 @@ SimpleFilteredBreakIteratorBuilder::~SimpleFilteredBreakIteratorBuilder()
{
}
SimpleFilteredBreakIteratorBuilder::SimpleFilteredBreakIteratorBuilder(UErrorCode &status)
SimpleFilteredBreakIteratorBuilder::SimpleFilteredBreakIteratorBuilder(UErrorCode &status)
: fSet(status)
{
}
@@ -510,16 +509,16 @@ SimpleFilteredBreakIteratorBuilder::SimpleFilteredBreakIteratorBuilder(const Loc
if(U_SUCCESS(status)) {
UErrorCode subStatus = U_ZERO_ERROR;
LocalUResourceBundlePointer b(ures_open(U_ICUDATA_BRKITR, fromLocale.getBaseName(), &subStatus));
if (U_FAILURE(subStatus) || (subStatus == U_USING_DEFAULT_WARNING) ) {
status = subStatus; // copy the failing status
if (U_FAILURE(subStatus) || (subStatus == U_USING_DEFAULT_WARNING) ) {
status = subStatus; // copy the failing status
#if FB_DEBUG
fprintf(stderr, "open BUNDLE %s : %s, %s\n", fromLocale.getBaseName(), "[exit]", u_errorName(status));
#endif
return; // leaves the builder empty, if you try to use it.
}
LocalUResourceBundlePointer exceptions(ures_getByKeyWithFallback(b.getAlias(), "exceptions", NULL, &subStatus));
if (U_FAILURE(subStatus) || (subStatus == U_USING_DEFAULT_WARNING) ) {
status = subStatus; // copy the failing status
if (U_FAILURE(subStatus) || (subStatus == U_USING_DEFAULT_WARNING) ) {
status = subStatus; // copy the failing status
#if FB_DEBUG
fprintf(stderr, "open EXCEPTIONS %s : %s, %s\n", fromLocale.getBaseName(), "[exit]", u_errorName(status));
#endif
@@ -533,9 +532,9 @@ SimpleFilteredBreakIteratorBuilder::SimpleFilteredBreakIteratorBuilder(const Loc
fprintf(stderr, "open SentenceBreak %s => %s, %s\n", fromLocale.getBaseName(), ures_getLocale(breaks.getAlias(), &subsub), u_errorName(subStatus));
}
#endif
if (U_FAILURE(subStatus) || (subStatus == U_USING_DEFAULT_WARNING) ) {
status = subStatus; // copy the failing status
if (U_FAILURE(subStatus) || (subStatus == U_USING_DEFAULT_WARNING) ) {
status = subStatus; // copy the failing status
#if FB_DEBUG
fprintf(stderr, "open %s : %s, %s\n", fromLocale.getBaseName(), "[exit]", u_errorName(status));
#endif
@@ -543,7 +542,7 @@ SimpleFilteredBreakIteratorBuilder::SimpleFilteredBreakIteratorBuilder(const Loc
}
LocalUResourceBundlePointer strs;
subStatus = status; // Pick up inherited warning status now
subStatus = status; // Pick up inherited warning status now
do {
strs.adoptInstead(ures_getNextResource(breaks.getAlias(), strs.orphan(), &subStatus));
if(strs.isValid() && U_SUCCESS(subStatus)) {
@@ -600,7 +599,7 @@ SimpleFilteredBreakIteratorBuilder::build(BreakIterator* adoptBreakIterator, UEr
int32_t subCount = fSet.size();
UnicodeString *ustrs_ptr = newUnicodeStringArray(subCount);
LocalArray<UnicodeString> ustrs(ustrs_ptr);
LocalMemory<int> partials;
+1
View File
@@ -264,3 +264,4 @@ inline UBool Hashtable::equals(const Hashtable& that)const{
U_NAMESPACE_END
#endif
+2 -2
View File
@@ -16,11 +16,11 @@
U_CAPI void U_EXPORT2 u_getDataVersion(UVersionInfo dataVersionFillin, UErrorCode *status) {
UResourceBundle *icudatares = NULL;
if (U_FAILURE(*status)) {
return;
}
if (dataVersionFillin != NULL) {
icudatares = ures_openDirect(NULL, U_ICU_VERSION_BUNDLE , status);
if (U_SUCCESS(*status)) {
+55 -53
View File
@@ -45,7 +45,7 @@ using namespace icu;
#endif
/**
* Internal structure of an ICU plugin.
* Internal structure of an ICU plugin.
*/
struct UPlugData {
@@ -75,21 +75,21 @@ struct UPlugData {
* @param listSize the number of entries in the list
* @param memberSize the size of one member
* @param itemToRemove the item number of the member
* @return the new listsize
* @return the new listsize
*/
static int32_t uplug_removeEntryAt(void *list, int32_t listSize, int32_t memberSize, int32_t itemToRemove) {
uint8_t *bytePtr = (uint8_t *)list;
/* get rid of some bad cases first */
if(listSize<1) {
return listSize;
}
/* is there anything to move? */
if(listSize > itemToRemove+1) {
memmove(bytePtr+(itemToRemove*memberSize), bytePtr+((itemToRemove+1)*memberSize), memberSize);
}
return listSize-1;
}
@@ -98,13 +98,13 @@ static int32_t uplug_removeEntryAt(void *list, int32_t listSize, int32_t memberS
#if U_ENABLE_DYLOAD
/**
* Library management. Internal.
* Library management. Internal.
* @internal
*/
struct UPlugLibrary;
/**
* Library management. Internal.
* Library management. Internal.
* @internal
*/
typedef struct UPlugLibrary {
@@ -125,7 +125,7 @@ static int32_t libraryMax = UPLUG_LIBRARY_INITIAL_COUNT;
*/
static int32_t searchForLibraryName(const char *libName) {
int32_t i;
for(i=0;i<libraryCount;i++) {
if(!uprv_strcmp(libName, libraryList[i].name)) {
return i;
@@ -136,7 +136,7 @@ static int32_t searchForLibraryName(const char *libName) {
static int32_t searchForLibrary(void *lib) {
int32_t i;
for(i=0;i<libraryCount;i++) {
if(lib==libraryList[i].lib) {
return i;
@@ -153,7 +153,7 @@ uplug_findLibrary(void *lib, UErrorCode *status) {
return NULL;
}
libEnt = searchForLibrary(lib);
if(libEnt!=-1) {
if(libEnt!=-1) {
ret = libraryList[libEnt].name;
} else {
*status = U_MISSING_RESOURCE_ERROR;
@@ -165,7 +165,7 @@ U_CAPI void * U_EXPORT2
uplug_openLibrary(const char *libName, UErrorCode *status) {
int32_t libEntry = -1;
void *lib = NULL;
if(U_FAILURE(*status)) return NULL;
libEntry = searchForLibraryName(libName);
@@ -179,13 +179,13 @@ uplug_openLibrary(const char *libName, UErrorCode *status) {
#endif
return NULL;
}
/* Some operating systems don't want
/* Some operating systems don't want
DL operations from multiple threads. */
libraryList[libEntry].lib = uprv_dl_open(libName, status);
#if UPLUG_TRACE
DBG((stderr, "uplug_openLibrary(%s,%s) libEntry %d, lib %p\n", libName, u_errorName(*status), libEntry, lib));
#endif
if(libraryList[libEntry].lib == NULL || U_FAILURE(*status)) {
/* cleanup. */
libraryList[libEntry].lib = NULL; /* failure with open */
@@ -212,12 +212,12 @@ uplug_openLibrary(const char *libName, UErrorCode *status) {
U_CAPI void U_EXPORT2
uplug_closeLibrary(void *lib, UErrorCode *status) {
int32_t i;
#if UPLUG_TRACE
DBG((stderr, "uplug_closeLibrary(%p,%s) list %p\n", lib, u_errorName(*status), (void*)libraryList));
#endif
if(U_FAILURE(*status)) return;
for(i=0;i<libraryCount;i++) {
if(lib==libraryList[i].lib) {
if(--(libraryList[i].ref) == 0) {
@@ -237,7 +237,7 @@ static int32_t pluginCount = 0;
static int32_t uplug_pluginNumber(UPlugData* d) {
UPlugData *pastPlug = &pluginList[pluginCount];
if(d<=pluginList) {
@@ -257,7 +257,7 @@ uplug_nextPlug(UPlugData *prior) {
} else {
UPlugData *nextPlug = &prior[1];
UPlugData *pastPlug = &pluginList[pluginCount];
if(nextPlug>=pastPlug) {
return NULL;
} else {
@@ -284,9 +284,9 @@ static void uplug_callPlug(UPlugData *plug, UPlugReason reason, UErrorCode *stat
static void uplug_unloadPlug(UPlugData *plug, UErrorCode *status) {
if(plug->awaitingLoad) { /* shouldn't happen. Plugin hasn'tbeen loaded yet.*/
if(plug->awaitingLoad) { /* shouldn't happen. Plugin hasn't been loaded yet.*/
*status = U_INTERNAL_PROGRAM_ERROR;
return;
return;
}
if(U_SUCCESS(plug->pluginStatus)) {
/* Don't unload a plug which has a failing load status - means it didn't actually load. */
@@ -295,13 +295,13 @@ static void uplug_unloadPlug(UPlugData *plug, UErrorCode *status) {
}
static void uplug_queryPlug(UPlugData *plug, UErrorCode *status) {
if(!plug->awaitingLoad || !(plug->level == UPLUG_LEVEL_UNKNOWN) ) { /* shouldn't happen. Plugin hasn'tbeen loaded yet.*/
if(!plug->awaitingLoad || !(plug->level == UPLUG_LEVEL_UNKNOWN) ) { /* shouldn't happen. Plugin hasn't been loaded yet.*/
*status = U_INTERNAL_PROGRAM_ERROR;
return;
return;
}
plug->level = UPLUG_LEVEL_INVALID;
uplug_callPlug(plug, UPLUG_REASON_QUERY, status);
if(U_SUCCESS(*status)) {
if(U_SUCCESS(*status)) {
if(plug->level == UPLUG_LEVEL_INVALID) {
plug->pluginStatus = U_PLUGIN_DIDNT_SET_LEVEL;
plug->awaitingLoad = FALSE;
@@ -317,7 +317,7 @@ static void uplug_loadPlug(UPlugData *plug, UErrorCode *status) {
if(U_FAILURE(*status)) {
return;
}
if(!plug->awaitingLoad || (plug->level < UPLUG_LEVEL_LOW) ) { /* shouldn't happen. Plugin hasn'tbeen loaded yet.*/
if(!plug->awaitingLoad || (plug->level < UPLUG_LEVEL_LOW) ) { /* shouldn't happen. Plugin hasn't been loaded yet.*/
*status = U_INTERNAL_PROGRAM_ERROR;
return;
}
@@ -372,17 +372,17 @@ static UPlugData *uplug_allocatePlug(UPlugEntrypoint *entrypoint, const char *co
} else {
plug->config[0] = 0;
}
if(symName!=NULL) {
uprv_strncpy(plug->sym, symName, UPLUG_NAME_MAX);
} else {
plug->sym[0] = 0;
}
plug->entrypoint = entrypoint;
plug->lib = lib;
uplug_queryPlug(plug, status);
return plug;
}
@@ -421,7 +421,7 @@ uplug_removePlug(UPlugData *plug, UErrorCode *status) {
UPlugData *cursor = NULL;
UPlugData *plugToRemove = NULL;
if(U_FAILURE(*status)) return;
for(cursor=pluginList;cursor!=NULL;) {
if(cursor==plug) {
plugToRemove = plug;
@@ -430,14 +430,14 @@ uplug_removePlug(UPlugData *plug, UErrorCode *status) {
cursor = uplug_nextPlug(cursor);
}
}
uplug_doUnloadPlug(plugToRemove, status);
}
U_CAPI void U_EXPORT2
U_CAPI void U_EXPORT2
uplug_setPlugNoUnload(UPlugData *data, UBool dontUnload)
{
data->dontUnload = dontUnload;
@@ -508,10 +508,10 @@ uplug_getConfiguration(UPlugData *data) {
}
U_CAPI UPlugData* U_EXPORT2
uplug_getPlugInternal(int32_t n) {
uplug_getPlugInternal(int32_t n) {
if(n <0 || n >= pluginCount) {
return NULL;
} else {
} else {
return &(pluginList[n]);
}
}
@@ -526,7 +526,7 @@ uplug_getPlugLoadStatus(UPlugData *plug) {
/**
* Initialize a plugin fron an entrypoint and library - but don't load it.
* Initialize a plugin from an entrypoint and library - but don't load it.
*/
static UPlugData* uplug_initPlugFromEntrypointAndLibrary(UPlugEntrypoint *entrypoint, const char *config, void *lib, const char *sym,
UErrorCode *status) {
@@ -551,7 +551,7 @@ uplug_loadPlugFromEntrypoint(UPlugEntrypoint *entrypoint, const char *config, UE
#if U_ENABLE_DYLOAD
static UPlugData*
static UPlugData*
uplug_initErrorPlug(const char *libName, const char *sym, const char *config, const char *nameOrError, UErrorCode loadStatus, UErrorCode *status)
{
UPlugData *plug = uplug_allocateEmptyPlug(status);
@@ -583,7 +583,7 @@ uplug_initErrorPlug(const char *libName, const char *sym, const char *config, co
/**
* Fetch a plugin from DLL, and then initialize it from a library- but don't load it.
*/
static UPlugData*
static UPlugData*
uplug_initPlugFromLibrary(const char *libName, const char *sym, const char *config, UErrorCode *status) {
void *lib = NULL;
UPlugData *plug = NULL;
@@ -615,7 +615,7 @@ uplug_initPlugFromLibrary(const char *libName, const char *sym, const char *conf
}
U_CAPI UPlugData* U_EXPORT2
uplug_loadPlugFromLibrary(const char *libName, const char *sym, const char *config, UErrorCode *status) {
uplug_loadPlugFromLibrary(const char *libName, const char *sym, const char *config, UErrorCode *status) {
UPlugData *plug = NULL;
if(U_FAILURE(*status)) { return NULL; }
plug = uplug_initPlugFromLibrary(libName, sym, config, status);
@@ -635,7 +635,7 @@ U_CAPI UPlugLevel U_EXPORT2 uplug_getCurrentLevel() {
static UBool U_CALLCONV uplug_cleanup(void)
{
int32_t i;
UPlugData *pluginToRemove;
/* cleanup plugs */
for(i=0;i<pluginCount;i++) {
@@ -654,7 +654,7 @@ static UBool U_CALLCONV uplug_cleanup(void)
static void uplug_loadWaitingPlugs(UErrorCode *status) {
int32_t i;
UPlugLevel currentLevel = uplug_getCurrentLevel();
if(U_FAILURE(*status)) {
return;
}
@@ -679,15 +679,15 @@ static void uplug_loadWaitingPlugs(UErrorCode *status) {
}
}
pluginToLoad->awaitingLoad = FALSE;
}
}
}
}
}
for(i=0;i<pluginCount;i++) {
UErrorCode subStatus = U_ZERO_ERROR;
UPlugData *pluginToLoad = &pluginList[i];
if(pluginToLoad->awaitingLoad) {
if(pluginToLoad->level == UPLUG_LEVEL_INVALID) {
if(pluginToLoad->level == UPLUG_LEVEL_INVALID) {
pluginToLoad->pluginStatus = U_PLUGIN_DIDNT_SET_LEVEL;
} else if(pluginToLoad->level == UPLUG_LEVEL_UNKNOWN) {
pluginToLoad->pluginStatus = U_INTERNAL_PROGRAM_ERROR;
@@ -697,7 +697,7 @@ static void uplug_loadWaitingPlugs(UErrorCode *status) {
pluginToLoad->awaitingLoad = FALSE;
}
}
#if UPLUG_TRACE
DBG((stderr, " Done Loading Plugs. Level: %d\n", (int32_t)uplug_getCurrentLevel()));
#endif
@@ -733,7 +733,7 @@ uplug_init(UErrorCode *status) {
}
if(U_FAILURE(*status)) return;
#if defined(DEFAULT_ICU_PLUGINS)
#if defined(DEFAULT_ICU_PLUGINS)
if(plugin_dir.isEmpty()) {
plugin_dir.append(DEFAULT_ICU_PLUGINS, -1, *status);
}
@@ -745,7 +745,7 @@ uplug_init(UErrorCode *status) {
if(!plugin_dir.isEmpty()) {
FILE *f;
CharString pluginFile;
#ifdef OS390BATCH
/* There are potentially a lot of ways to implement a plugin directory on OS390/zOS */
@@ -778,8 +778,8 @@ uplug_init(UErrorCode *status) {
#endif
return;
}
/* plugin_file is not used for processing - it is only used
/* plugin_file is not used for processing - it is only used
so that uplug_getPluginFile() works (i.e. icuinfo)
*/
pluginFile.extract(plugin_file, sizeof(plugin_file), *status);
@@ -787,7 +787,7 @@ uplug_init(UErrorCode *status) {
#if UPLUG_TRACE
DBG((stderr, "pluginfile= %s len %d/%d\n", plugin_file, (int)strlen(plugin_file), (int)sizeof(plugin_file)));
#endif
#ifdef __MVS__
if (iscics()) /* 12 Nov 2011 JAM */
{
@@ -803,8 +803,8 @@ uplug_init(UErrorCode *status) {
char linebuf[1024];
char *p, *libName=NULL, *symName=NULL, *config=NULL;
int32_t line = 0;
while(fgets(linebuf,1023,f)) {
line++;
@@ -830,7 +830,7 @@ uplug_init(UErrorCode *status) {
while(*p&&!isspace((int)*p)) {
p++;
}
if(*p) { /* has config */
*p=0;
++p;
@@ -841,7 +841,7 @@ uplug_init(UErrorCode *status) {
config = p;
}
}
/* chop whitespace at the end of the config */
if(config!=NULL&&*config!=0) {
p = config+strlen(config);
@@ -849,9 +849,9 @@ uplug_init(UErrorCode *status) {
*p=0;
}
}
/* OK, we're good. */
{
{
UErrorCode subStatus = U_ZERO_ERROR;
UPlugData *plug = uplug_initPlugFromLibrary(libName, symName, config, &subStatus);
if(U_FAILURE(subStatus) && U_SUCCESS(*status)) {
@@ -880,3 +880,5 @@ uplug_init(UErrorCode *status) {
}
#endif
+5 -5
View File
@@ -9,7 +9,7 @@
******************************************************************************
*
* FILE NAME : icuplugimp.h
*
*
* Internal functions for the ICU plugin system
*
* Date Name Description
@@ -26,7 +26,7 @@
#if UCONFIG_ENABLE_PLUGINS
/*========================*/
/** @{ Library Manipulation
/** @{ Library Manipulation
*/
/**
@@ -65,7 +65,7 @@ uplug_findLibrary(void *lib, UErrorCode *status);
*/
/**
* Initialize the plugins
* Initialize the plugins
* @param status error result
* @internal - Internal use only.
*/
@@ -75,12 +75,12 @@ uplug_init(UErrorCode *status);
/**
* Get raw plug N
* @internal - Internal use only
*/
*/
U_CAPI UPlugData* U_EXPORT2
uplug_getPlugInternal(int32_t n);
/**
* Get the name of the plugin file.
* Get the name of the plugin file.
* @internal - Internal use only.
*/
U_CAPI const char* U_EXPORT2
+1 -1
View File
@@ -157,7 +157,7 @@ static void U_CALLCONV initSingletons(const char *what, UErrorCode &errorCode) {
} else if (uprv_strcmp(what, "nfkc_cf") == 0) {
nfkc_cfSingleton = Norm2AllModes::createInstance(NULL, "nfkc_cf", errorCode);
} else {
UPRV_UNREACHABLE; // Unknown singleton
UPRV_UNREACHABLE_EXIT; // Unknown singleton
}
ucln_common_registerCleanup(UCLN_COMMON_LOADED_NORMALIZER2, uprv_loaded_normalizer2_cleanup);
}
+8 -8
View File
@@ -228,7 +228,7 @@ LocaleBuilder& LocaleBuilder::setExtension(char key, StringPiece value)
return *this;
}
if (extensions_ == nullptr) {
extensions_ = new Locale();
extensions_ = Locale::getRoot().clone();
if (extensions_ == nullptr) {
status_ = U_MEMORY_ALLOCATION_ERROR;
return *this;
@@ -259,11 +259,11 @@ LocaleBuilder& LocaleBuilder::setUnicodeLocaleKeyword(
return *this;
}
if (extensions_ == nullptr) {
extensions_ = new Locale();
}
if (extensions_ == nullptr) {
status_ = U_MEMORY_ALLOCATION_ERROR;
return *this;
extensions_ = Locale::getRoot().clone();
if (extensions_ == nullptr) {
status_ = U_MEMORY_ALLOCATION_ERROR;
return *this;
}
}
extensions_->setUnicodeKeywordValue(key, type, status_);
return *this;
@@ -280,7 +280,7 @@ LocaleBuilder& LocaleBuilder::addUnicodeLocaleAttribute(
return *this;
}
if (extensions_ == nullptr) {
extensions_ = new Locale();
extensions_ = Locale::getRoot().clone();
if (extensions_ == nullptr) {
status_ = U_MEMORY_ALLOCATION_ERROR;
return *this;
@@ -415,7 +415,7 @@ void LocaleBuilder::copyExtensionsFrom(const Locale& src, UErrorCode& errorCode)
return;
}
if (extensions_ == nullptr) {
extensions_ = new Locale();
extensions_ = Locale::getRoot().clone();
if (extensions_ == nullptr) {
status_ = U_MEMORY_ALLOCATION_ERROR;
return;
+3 -3
View File
@@ -187,7 +187,7 @@ LocaleMatcher::Builder &LocaleMatcher::Builder::setSupportedLocalesFromListStrin
for (int32_t i = 0; i < length; ++i) {
Locale *locale = list.orphanLocaleAt(i);
if (locale == nullptr) { continue; }
supportedLocales_->addElement(locale, errorCode_);
supportedLocales_->addElementX(locale, errorCode_);
if (U_FAILURE(errorCode_)) {
delete locale;
break;
@@ -207,7 +207,7 @@ LocaleMatcher::Builder &LocaleMatcher::Builder::setSupportedLocales(Locale::Iter
errorCode_ = U_MEMORY_ALLOCATION_ERROR;
break;
}
supportedLocales_->addElement(clone, errorCode_);
supportedLocales_->addElementX(clone, errorCode_);
if (U_FAILURE(errorCode_)) {
delete clone;
break;
@@ -223,7 +223,7 @@ LocaleMatcher::Builder &LocaleMatcher::Builder::addSupportedLocale(const Locale
errorCode_ = U_MEMORY_ALLOCATION_ERROR;
return *this;
}
supportedLocales_->addElement(clone, errorCode_);
supportedLocales_->addElementX(clone, errorCode_);
if (U_FAILURE(errorCode_)) {
delete clone;
}
+1 -1
View File
@@ -16,7 +16,7 @@
/**
* Prototype for user-supplied service hook. This function is expected to return
* a type of factory object specific to the requested service.
*
*
* @param what service-specific string identifying the specific user hook
* @param status error status
* @return a service-specific hook, or NULL on failure.
+1 -1
View File
@@ -64,7 +64,7 @@ U_NAMESPACE_BEGIN
void U_CALLCONV locale_available_init() {
// This function is a friend of class Locale.
// This function is only invoked via umtx_initOnce().
// for now, there is a hardcoded list, so just walk through that list and set it up.
// Note: this function is a friend of class Locale.
availableLocaleListCount = uloc_countAvailable();
+1 -1
View File
@@ -88,7 +88,7 @@ class U_COMMON_API LocaleBased : public UMemory {
private:
char* valid;
char* actual;
};
+22 -10
View File
@@ -298,7 +298,7 @@ static const char _kSeparator[] = "separator";
static int32_t
_getStringOrCopyKey(const char *path, const char *locale,
const char *tableKey,
const char *tableKey,
const char* subTableKey,
const char *itemKey,
const char *substitute,
@@ -316,8 +316,9 @@ _getStringOrCopyKey(const char *path, const char *locale,
/* see comment about closing rb near "return item;" in _res_getTableStringWithFallback() */
}
} else {
bool isLanguageCode = (uprv_strncmp(tableKey, _kLanguages, 9) == 0);
/* Language code should not be a number. If it is, set the error code. */
if (!uprv_strncmp(tableKey, "Languages", 9) && uprv_strtol(itemKey, NULL, 10)) {
if (isLanguageCode && uprv_strtol(itemKey, NULL, 10)) {
*pErrorCode = U_MISSING_RESOURCE_ERROR;
} else {
/* second-level item, use special fallback */
@@ -327,6 +328,17 @@ _getStringOrCopyKey(const char *path, const char *locale,
itemKey,
&length,
pErrorCode);
if (U_FAILURE(*pErrorCode) && isLanguageCode && itemKey != nullptr) {
// convert itemKey locale code to canonical form and try again, ICU-20870
*pErrorCode = U_ZERO_ERROR;
Locale canonKey = Locale::createCanonical(itemKey);
s=uloc_getTableStringWithFallback(path, locale,
tableKey,
subTableKey,
canonKey.getName(),
&length,
pErrorCode);
}
}
}
@@ -496,7 +508,7 @@ uloc_getDisplayName(const char *locale,
const UChar *pattern;
int32_t patLen = 0;
int32_t sub0Pos, sub1Pos;
UChar formatOpenParen = 0x0028; // (
UChar formatReplaceOpenParen = 0x005B; // [
UChar formatCloseParen = 0x0029; // )
@@ -793,9 +805,9 @@ uloc_getDisplayKeyword(const char* keyword,
/* pass itemKey=NULL to look for a top-level item */
return _getStringOrCopyKey(U_ICUDATA_LANG, displayLocale,
_kKeys, NULL,
keyword,
keyword,
_kKeys, NULL,
keyword,
keyword,
dest, destCapacity,
status);
@@ -830,8 +842,8 @@ uloc_getDisplayKeywordValue( const char* locale,
ulocimp_getKeywordValue(locale, keyword, sink, status);
}
/*
* if the keyword is equal to currency .. then to get the display name
/*
* if the keyword is equal to currency .. then to get the display name
* we need to do the fallback ourselves
*/
if(uprv_stricmp(keyword, _kCurrency)==0){
@@ -877,11 +889,11 @@ uloc_getDisplayKeywordValue( const char* locale,
}
}
}else{
return _getStringOrCopyKey(U_ICUDATA_LANG, displayLocale,
_kTypes, keyword,
_kTypes, keyword,
keywordValue.data(),
keywordValue.data(),
dest, destCapacity,
+47 -21
View File
@@ -313,29 +313,29 @@ public:
LocaleDisplayNamesImpl(const Locale& locale, UDisplayContext *contexts, int32_t length);
virtual ~LocaleDisplayNamesImpl();
virtual const Locale& getLocale() const;
virtual UDialectHandling getDialectHandling() const;
virtual UDisplayContext getContext(UDisplayContextType type) const;
virtual const Locale& getLocale() const override;
virtual UDialectHandling getDialectHandling() const override;
virtual UDisplayContext getContext(UDisplayContextType type) const override;
virtual UnicodeString& localeDisplayName(const Locale& locale,
UnicodeString& result) const;
UnicodeString& result) const override;
virtual UnicodeString& localeDisplayName(const char* localeId,
UnicodeString& result) const;
UnicodeString& result) const override;
virtual UnicodeString& languageDisplayName(const char* lang,
UnicodeString& result) const;
UnicodeString& result) const override;
virtual UnicodeString& scriptDisplayName(const char* script,
UnicodeString& result) const;
UnicodeString& result) const override;
virtual UnicodeString& scriptDisplayName(UScriptCode scriptCode,
UnicodeString& result) const;
UnicodeString& result) const override;
virtual UnicodeString& regionDisplayName(const char* region,
UnicodeString& result) const;
UnicodeString& result) const override;
virtual UnicodeString& variantDisplayName(const char* variant,
UnicodeString& result) const;
UnicodeString& result) const override;
virtual UnicodeString& keyDisplayName(const char* key,
UnicodeString& result) const;
UnicodeString& result) const override;
virtual UnicodeString& keyValueDisplayName(const char* key,
const char* value,
UnicodeString& result) const;
UnicodeString& result) const override;
private:
UnicodeString& localeIdName(const char* localeId,
UnicodeString& result, bool substitute) const;
@@ -407,7 +407,7 @@ struct LocaleDisplayNamesImpl::CapitalizationContextSink : public ResourceSink {
virtual ~CapitalizationContextSink();
virtual void put(const char *key, ResourceValue &value, UBool /*noFallback*/,
UErrorCode &errorCode) {
UErrorCode &errorCode) override {
ResourceTable contexts = value.getTable(errorCode);
if (U_FAILURE(errorCode)) { return; }
for (int i = 0; contexts.getKeyAndValue(i, key, value); ++i) {
@@ -723,11 +723,25 @@ LocaleDisplayNamesImpl::localeIdName(const char* localeId,
return result;
}
}
if (substitute) {
return langData.get("Languages", localeId, result);
} else {
return langData.getNoFallback("Languages", localeId, result);
langData.getNoFallback("Languages", localeId, result);
if (result.isBogus() && uprv_strchr(localeId, '_') == NULL) {
// Canonicalize lang and try again, ICU-20870
// (only for language codes without script or region)
Locale canonLocale = Locale::createCanonical(localeId);
const char* canonLocId = canonLocale.getName();
if (nameLength == UDISPCTX_LENGTH_SHORT) {
langData.getNoFallback("Languages%short", canonLocId, result);
if (!result.isBogus()) {
return result;
}
}
langData.getNoFallback("Languages", canonLocId, result);
}
if (result.isBogus() && substitute) {
// use key, this is what langData.get (with fallback) falls back to.
result.setTo(UnicodeString(localeId, -1, US_INV)); // use key (
}
return result;
}
UnicodeString&
@@ -742,10 +756,22 @@ LocaleDisplayNamesImpl::languageDisplayName(const char* lang,
return adjustForUsageAndContext(kCapContextUsageLanguage, result);
}
}
if (substitute == UDISPCTX_SUBSTITUTE) {
langData.get("Languages", lang, result);
} else {
langData.getNoFallback("Languages", lang, result);
langData.getNoFallback("Languages", lang, result);
if (result.isBogus()) {
// Canonicalize lang and try again, ICU-20870
Locale canonLocale = Locale::createCanonical(lang);
const char* canonLocId = canonLocale.getName();
if (nameLength == UDISPCTX_LENGTH_SHORT) {
langData.getNoFallback("Languages%short", canonLocId, result);
if (!result.isBogus()) {
return adjustForUsageAndContext(kCapContextUsageLanguage, result);
}
}
langData.getNoFallback("Languages", canonLocId, result);
}
if (result.isBogus() && substitute == UDISPCTX_SUBSTITUTE) {
// use key, this is what langData.get (with fallback) falls back to.
result.setTo(UnicodeString(lang, -1, US_INV)); // use key (
}
return adjustForUsageAndContext(kCapContextUsageLanguage, result);
}
+41 -65
View File
@@ -297,13 +297,12 @@ Locale::Locale( const char * newLanguage,
else
{
UErrorCode status = U_ZERO_ERROR;
int32_t size = 0;
int32_t lsize = 0;
int32_t csize = 0;
int32_t vsize = 0;
int32_t ksize = 0;
// Calculate the size of the resulting string.
// Check the sizes of the input strings.
// Language
if ( newLanguage != NULL )
@@ -313,7 +312,6 @@ Locale::Locale( const char * newLanguage,
setToBogus();
return;
}
size = lsize;
}
CharString togo(newLanguage, lsize, status); // start with newLanguage
@@ -326,7 +324,6 @@ Locale::Locale( const char * newLanguage,
setToBogus();
return;
}
size += csize;
}
// _Variant
@@ -350,21 +347,6 @@ Locale::Locale( const char * newLanguage,
}
}
if( vsize > 0 )
{
size += vsize;
}
// Separator rules:
if ( vsize > 0 )
{
size += 2; // at least: __v
}
else if ( csize > 0 )
{
size += 1; // at least: _v
}
if ( newKeywords != NULL)
{
ksize = (int32_t)uprv_strlen(newKeywords);
@@ -372,11 +354,9 @@ Locale::Locale( const char * newLanguage,
setToBogus();
return;
}
size += ksize + 1;
}
// NOW we have the full locale string..
// Now, copy it back.
// We've checked the input sizes, now build up the full locale string..
// newLanguage is already copied
@@ -469,14 +449,18 @@ Locale& Locale::operator=(Locale&& other) U_NOEXCEPT {
if ((baseName != fullName) && (baseName != fullNameBuffer)) uprv_free(baseName);
if (fullName != fullNameBuffer) uprv_free(fullName);
if (other.fullName == other.fullNameBuffer) {
if (other.fullName == other.fullNameBuffer || other.baseName == other.fullNameBuffer) {
uprv_strcpy(fullNameBuffer, other.fullNameBuffer);
}
if (other.fullName == other.fullNameBuffer) {
fullName = fullNameBuffer;
} else {
fullName = other.fullName;
}
if (other.baseName == other.fullName) {
if (other.baseName == other.fullNameBuffer) {
baseName = fullNameBuffer;
} else if (other.baseName == other.fullName) {
baseName = fullName;
} else {
baseName = other.baseName;
@@ -499,7 +483,7 @@ Locale::clone() const {
return new Locale(*this);
}
UBool
bool
Locale::operator==( const Locale& other) const
{
return (uprv_strcmp(other.fullName, fullName) == 0);
@@ -768,7 +752,7 @@ AliasDataBuilder::readLanguageAlias(
alias, strings, types, replacementIndexes, length,
#if U_DEBUG
[](const char* type) {
// Assert the aliasFrom only contains the following possibilties
// Assert the aliasFrom only contains the following possibilities
// language_REGION_variant
// language_REGION
// language_variant
@@ -1227,7 +1211,7 @@ AliasReplacer::parseLanguageReplacement(
status = U_MEMORY_ALLOCATION_ERROR;
return;
}
toBeFreed.addElement(str, status);
toBeFreed.addElementX(str, status);
char* data = str->data();
replacedLanguage = (const char*) data;
char* endOfField = uprv_strchr(data, '_');
@@ -1367,7 +1351,7 @@ AliasReplacer::replaceLanguage(
}
if (replacedExtensions != nullptr) {
// DO NOTHING
// UTS35 does not specifiy what should we do if we have extensions in the
// UTS35 does not specify what should we do if we have extensions in the
// replacement. Currently we know only the following 4 "BCP47 LegacyRules" have
// extensions in them languageAlias:
// i_default => en_x_i_default
@@ -1441,7 +1425,7 @@ AliasReplacer::replaceTerritory(UVector& toBeFreed, UErrorCode& status)
return false;
}
replacedRegion = item->data();
toBeFreed.addElement(item.orphan(), status);
toBeFreed.addElementX(item.orphan(), status);
}
U_ASSERT(!same(region, replacedRegion));
region = replacedRegion;
@@ -1567,6 +1551,7 @@ AliasReplacer::replaceTransformedExtensions(
const char* tvalue = uprv_strchr(tkey, '-');
if (tvalue == nullptr) {
status = U_ILLEGAL_ARGUMENT_ERROR;
return false;
}
const char* nextTKey = ultag_getTKeyStart(tvalue);
if (nextTKey != nullptr) {
@@ -1578,13 +1563,8 @@ AliasReplacer::replaceTransformedExtensions(
}
tkey = nextTKey;
} while (tkey != nullptr);
tfields.sort([](UElement e1, UElement e2) -> int8_t {
// uprv_strcmp return int and in some platform, such as arm64-v8a,
// it may return positive values > 127 which cause the casted value
// of int8_t negative.
int res = uprv_strcmp(
(const char*)e1.pointer, (const char*)e2.pointer);
return (res == 0) ? 0 : ((res > 0) ? 1 : -1);
tfields.sort([](UElement e1, UElement e2) -> int32_t {
return uprv_strcmp((const char*)e1.pointer, (const char*)e2.pointer);
}, status);
for (int32_t i = 0; i < tfields.size(); i++) {
if (output.length() > 0) {
@@ -1592,8 +1572,11 @@ AliasReplacer::replaceTransformedExtensions(
}
const char* tfield = (const char*) tfields.elementAt(i);
const char* tvalue = uprv_strchr(tfield, '-');
if (tvalue == nullptr) {
status = U_ILLEGAL_ARGUMENT_ERROR;
return false;
}
// Split the "tkey-tvalue" pair string so that we can canonicalize the tvalue.
U_ASSERT(tvalue != nullptr);
*((char*)tvalue++) = '\0'; // NULL terminate tkey
output.append(tfield, status).append('-', status);
const char* bcpTValue = ulocimp_toBcpType(tfield, tvalue, nullptr, nullptr);
@@ -1623,13 +1606,8 @@ AliasReplacer::outputToString(
if (!notEmpty(script) && !notEmpty(region)) {
out.append(SEP_CHAR, status);
}
variants.sort([](UElement e1, UElement e2) -> int8_t {
// uprv_strcmp return int and in some platform, such as arm64-v8a,
// it may return positive values > 127 which cause the casted value
// of int8_t negative.
int res = uprv_strcmp(
(const char*)e1.pointer, (const char*)e2.pointer);
return (res == 0) ? 0 : ((res > 0) ? 1 : -1);
variants.sort([](UElement e1, UElement e2) -> int32_t {
return uprv_strcmp((const char*)e1.pointer, (const char*)e2.pointer);
}, status);
int32_t variantsStart = out.length();
for (int32_t i = 0; i < variants.size(); i++) {
@@ -1681,21 +1659,16 @@ AliasReplacer::replace(const Locale& locale, CharString& out, UErrorCode& status
while ((end = uprv_strchr(start, SEP_CHAR)) != nullptr &&
U_SUCCESS(status)) {
*end = NULL_CHAR; // null terminate inside variantsBuff
variants.addElement(start, status);
variants.addElementX(start, status);
start = end + 1;
}
variants.addElement(start, status);
variants.addElementX(start, status);
}
if (U_FAILURE(status)) { return false; }
// Sort the variants
variants.sort([](UElement e1, UElement e2) -> int8_t {
// uprv_strcmp return int and in some platform, such as arm64-v8a,
// it may return positive values > 127 which cause the casted value
// of int8_t negative.
int res = uprv_strcmp(
(const char*)e1.pointer, (const char*)e2.pointer);
return (res == 0) ? 0 : ((res > 0) ? 1 : -1);
variants.sort([](UElement e1, UElement e2) -> int32_t {
return uprv_strcmp((const char*)e1.pointer, (const char*)e2.pointer);
}, status);
// A changed count to assert when loop too many times.
@@ -1737,7 +1710,7 @@ AliasReplacer::replace(const Locale& locale, CharString& out, UErrorCode& status
} // while(1)
if (U_FAILURE(status)) { return false; }
// Nothing changed and we know the order of the vaiants are not change
// Nothing changed and we know the order of the variants are not change
// because we have no variant or only one.
const char* extensionsStr = locale_getKeywordsStart(locale.getName());
if (changed == 0 && variants.size() <= 1 && extensionsStr == nullptr) {
@@ -2445,7 +2418,7 @@ private:
public:
static UClassID U_EXPORT2 getStaticClassID(void) { return (UClassID)&fgClassID; }
virtual UClassID getDynamicClassID(void) const { return getStaticClassID(); }
virtual UClassID getDynamicClassID(void) const override { return getStaticClassID(); }
public:
KeywordEnumeration(const char *keys, int32_t keywordLen, int32_t currentIndex, UErrorCode &status)
: keywords((char *)&fgClassID), current((char *)&fgClassID), length(0) {
@@ -2469,13 +2442,13 @@ public:
virtual ~KeywordEnumeration();
virtual StringEnumeration * clone() const
virtual StringEnumeration * clone() const override
{
UErrorCode status = U_ZERO_ERROR;
return new KeywordEnumeration(keywords, length, (int32_t)(current - keywords), status);
}
virtual int32_t count(UErrorCode &/*status*/) const {
virtual int32_t count(UErrorCode &/*status*/) const override {
char *kw = keywords;
int32_t result = 0;
while(*kw) {
@@ -2485,7 +2458,7 @@ public:
return result;
}
virtual const char* next(int32_t* resultLength, UErrorCode& status) {
virtual const char* next(int32_t* resultLength, UErrorCode& status) override {
const char* result;
int32_t len;
if(U_SUCCESS(status) && *current != 0) {
@@ -2504,13 +2477,13 @@ public:
return result;
}
virtual const UnicodeString* snext(UErrorCode& status) {
virtual const UnicodeString* snext(UErrorCode& status) override {
int32_t resultLength = 0;
const char *s = next(&resultLength, status);
return setChars(s, resultLength, status);
}
virtual void reset(UErrorCode& /*status*/) {
virtual void reset(UErrorCode& /*status*/) override {
current = keywords;
}
};
@@ -2528,18 +2501,18 @@ public:
using KeywordEnumeration::KeywordEnumeration;
virtual ~UnicodeKeywordEnumeration();
virtual const char* next(int32_t* resultLength, UErrorCode& status) {
virtual const char* next(int32_t* resultLength, UErrorCode& status) override {
const char* legacy_key = KeywordEnumeration::next(nullptr, status);
if (U_SUCCESS(status) && legacy_key != nullptr) {
while (U_SUCCESS(status) && legacy_key != nullptr) {
const char* key = uloc_toUnicodeLocaleKey(legacy_key);
if (key == nullptr) {
status = U_ILLEGAL_ARGUMENT_ERROR;
} else {
if (key != nullptr) {
if (resultLength != nullptr) {
*resultLength = static_cast<int32_t>(uprv_strlen(key));
}
return key;
}
// Not a Unicode keyword, could be a t, x or other, continue to look at the next one.
legacy_key = KeywordEnumeration::next(nullptr, status);
}
if (resultLength != nullptr) *resultLength = 0;
return nullptr;
@@ -2696,6 +2669,9 @@ Locale::setKeywordValue(const char* keywordName, const char* keywordValue, UErro
if (fullName != fullNameBuffer) {
// if full Name is already on the heap, need to free it.
uprv_free(fullName);
if (baseName == fullName) {
baseName = newFullName; // baseName should not point to freed memory.
}
}
fullName = newFullName;
status = U_ZERO_ERROR;
+27 -21
View File
@@ -115,7 +115,7 @@ findLikelySubtags(const char* localeID,
* @param tag The tag to add.
* @param tagLength The length of the tag.
* @param buffer The output buffer.
* @param bufferLength The length of the output buffer. This is an input/ouput parameter.
* @param bufferLength The length of the output buffer. This is an input/output parameter.
**/
static void U_CALLCONV
appendTag(
@@ -148,7 +148,7 @@ appendTag(
* to be used when constructing the new tag. If the alternateTags parameter is NULL, or
* it contains no language tag, the default tag for the unknown language is used.
*
* If the length of the new string exceeds the capacity of the output buffer,
* If the length of the new string exceeds the capacity of the output buffer,
* the function copies as many bytes to the output buffer as it can, and returns
* the error U_BUFFER_OVERFLOW_ERROR.
*
@@ -366,7 +366,7 @@ error:
* must be less than or equal to 0. If the lang parameter is an empty string, the
* default value for an unknown language is written to the output buffer.
*
* If the length of the new string exceeds the capacity of the output buffer,
* If the length of the new string exceeds the capacity of the output buffer,
* the function copies as many bytes to the output buffer as it can, and returns
* the error U_BUFFER_OVERFLOW_ERROR.
*
@@ -506,7 +506,7 @@ parseTagString(
*/
if (_isIDSeparator(*position)) {
++position;
}
}
}
subtagLength = ulocimp_getCountry(position, &position, *err).extract(region, *regionLength, *err);
@@ -1181,13 +1181,13 @@ error:
}
}
static UBool
static int32_t
do_canonicalize(const char* localeID,
char* buffer,
int32_t bufferCapacity,
UErrorCode* err)
{
uloc_canonicalize(
int32_t canonicalizedSize = uloc_canonicalize(
localeID,
buffer,
bufferCapacity,
@@ -1195,16 +1195,14 @@ do_canonicalize(const char* localeID,
if (*err == U_STRING_NOT_TERMINATED_WARNING ||
*err == U_BUFFER_OVERFLOW_ERROR) {
*err = U_ILLEGAL_ARGUMENT_ERROR;
return FALSE;
return canonicalizedSize;
}
else if (U_FAILURE(*err)) {
return FALSE;
return -1;
}
else {
return TRUE;
return canonicalizedSize;
}
}
@@ -1241,12 +1239,17 @@ static UBool
_ulocimp_addLikelySubtags(const char* localeID,
icu::ByteSink& sink,
UErrorCode* status) {
char localeBuffer[ULOC_FULLNAME_CAPACITY];
if (do_canonicalize(localeID, localeBuffer, sizeof localeBuffer, status)) {
return _uloc_addLikelySubtags(localeBuffer, sink, status);
PreflightingLocaleIDBuffer localeBuffer;
do {
localeBuffer.requestedCapacity = do_canonicalize(localeID, localeBuffer.getBuffer(),
localeBuffer.getCapacity(), status);
} while (localeBuffer.needToTryAgain(status));
if (U_SUCCESS(*status)) {
return _uloc_addLikelySubtags(localeBuffer.getBuffer(), sink, status);
} else {
return FALSE;
}
return FALSE;
}
U_CAPI void U_EXPORT2
@@ -1289,11 +1292,13 @@ U_CAPI void U_EXPORT2
ulocimp_minimizeSubtags(const char* localeID,
icu::ByteSink& sink,
UErrorCode* status) {
char localeBuffer[ULOC_FULLNAME_CAPACITY];
if (do_canonicalize(localeID, localeBuffer, sizeof localeBuffer, status)) {
_uloc_minimizeSubtags(localeBuffer, sink, status);
}
PreflightingLocaleIDBuffer localeBuffer;
do {
localeBuffer.requestedCapacity = do_canonicalize(localeID, localeBuffer.getBuffer(),
localeBuffer.getCapacity(), status);
} while (localeBuffer.needToTryAgain(status));
_uloc_minimizeSubtags(localeBuffer.getBuffer(), sink, status);
}
// Pairs of (language subtag, + or -) for finding out fast if common languages
@@ -1407,3 +1412,4 @@ ulocimp_getRegionForSupplementalData(const char *localeID, UBool inferRegion,
uprv_strncpy(region, rgBuf, regionCapacity);
return u_terminateChars(region, regionCapacity, rgLen, status);
}
+5 -5
View File
@@ -20,7 +20,7 @@
*
* Date Name Description
* 3/11/97 aliu Fixed off-by-one bug in assignment operator. Added
* setId() method and safety check against
* setId() method and safety check against
* MAX_ID_LENGTH.
* 04/23/99 stephen Added C wrapper for convertToPosix.
* 09/18/00 george Removed the memory leaks.
@@ -118,7 +118,7 @@ static const ILcidPosixElement locmap_ ## id [] =
// Keep static locale variables inside the function so that
// it can be created properly during static init.
//
// Note: This table should be updated periodically. Check the [MS-LCID] Windows Language Code Identifier
// Note: This table should be updated periodically. Check the [MS-LCID] Windows Language Code Identifier
// (LCID) Reference defined at https://msdn.microsoft.com/en-us/library/cc233965.aspx
//
// Microsoft is moving away from LCID in favor of locale name as of Vista. This table needs to be
@@ -132,7 +132,7 @@ static const ILcidPosixElement locmap_ ## id [] =
////////////////////////////////////////////
*/
// TODO: For Windows ideally this table would be a list of exceptions rather than a complete list as
// TODO: For Windows ideally this table would be a list of exceptions rather than a complete list as
// LocaleNameToLCID and LCIDToLocaleName provide 90% of these.
ILCID_POSIX_ELEMENT_ARRAY(0x0436, af, af_ZA)
@@ -524,7 +524,7 @@ ILCID_POSIX_SUBTABLE(nl) {
/* The "no" locale split into nb and nn. By default in ICU, "no" is nb.*/
// TODO: Not all of these are needed on Windows, but I don't know how ICU treats preferred ones here.
ILCID_POSIX_SUBTABLE(no) {
{0x14, "no"}, /* really nb_NO - actually Windows differentiates between neutral (no region) and specific (with region) */
{0x14, "no"}, /* really nb_NO - actually Windows differentiates between neutral (no region) and specific (with region) */
{0x7c14, "nb"}, /* really nb */
{0x0414, "nb_NO"}, /* really nb_NO. Keep first in the 414 list. */
{0x0414, "no_NO"}, /* really nb_NO */
@@ -1273,7 +1273,7 @@ uprv_convertToLCID(const char *langID, const char* posixID, UErrorCode* status)
mid = (high+low) >> 1; /*Finds median*/
if (mid == oldmid)
if (mid == oldmid)
break;
compVal = uprv_strcmp(langID, gPosixIDmap[mid].regionMaps->posixID);
+2 -1
View File
@@ -9,7 +9,7 @@
******************************************************************************
*
* File locmap.h : Locale Mapping Classes
*
*
*
* Created by: Helena Shih
*
@@ -37,3 +37,4 @@ U_CAPI uint32_t uprv_convertToLCIDPlatform(const char* localeID, UErrorCode* sta
U_CAPI uint32_t uprv_convertToLCID(const char* langID, const char* posixID, UErrorCode* status);
#endif /* LOCMAP_H */
+7 -7
View File
@@ -83,9 +83,9 @@ uloc_getTableStringWithFallback(const char *path, const char *locale,
if(U_FAILURE(errorCode)){
*pErrorCode = errorCode;
}
break;*/
ures_getByKeyWithFallback(table.getAlias(), subTableKey, table.getAlias(), &errorCode);
}
if(U_SUCCESS(errorCode)){
@@ -112,8 +112,8 @@ uloc_getTableStringWithFallback(const char *path, const char *locale,
break;
}
}
if(U_FAILURE(errorCode)){
if(U_FAILURE(errorCode)){
/* still can't figure out ?.. try the fallback mechanism */
int32_t len = 0;
@@ -126,9 +126,9 @@ uloc_getTableStringWithFallback(const char *path, const char *locale,
*pErrorCode = errorCode;
break;
}
u_UCharsToChars(fallbackLocale, explicitFallbackName, len);
/* guard against recursive fallback */
if(uprv_strcmp(explicitFallbackName, locale)==0){
*pErrorCode = U_INTERNAL_PROGRAM_ERROR;
@@ -207,7 +207,7 @@ uloc_getCharacterOrientation(const char* localeId,
/**
* Get the layout line orientation for the specified locale.
*
*
* @param localeID locale name
* @param status Error status
* @return an enum indicating the layout orientation for lines.
+3 -1
View File
@@ -33,7 +33,7 @@ static icu::Hashtable * LocaleUtility_cache = NULL;
*/
/**
* Release all static memory held by Locale Utility.
* Release all static memory held by Locale Utility.
*/
U_CDECL_BEGIN
static UBool U_CALLCONV service_cleanup(void) {
@@ -271,3 +271,5 @@ U_NAMESPACE_END
/* !UCONFIG_NO_SERVICE */
#endif
+1 -1
View File
@@ -72,7 +72,7 @@ UBool LSR::isEquivalentTo(const LSR &other) const {
(regionIndex > 0 || uprv_strcmp(region, other.region) == 0);
}
UBool LSR::operator==(const LSR &other) const {
bool LSR::operator==(const LSR &other) const {
return
uprv_strcmp(language, other.language) == 0 &&
uprv_strcmp(script, other.script) == 0 &&
+2 -2
View File
@@ -65,9 +65,9 @@ struct LSR final : public UMemory {
static int32_t indexForRegion(const char *region);
UBool isEquivalentTo(const LSR &other) const;
UBool operator==(const LSR &other) const;
bool operator==(const LSR &other) const;
inline UBool operator!=(const LSR &other) const {
inline bool operator!=(const LSR &other) const {
return !operator==(other);
}
+855
View File
@@ -0,0 +1,855 @@
// © 2021 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
#include <utility>
#include <ctgmath>
#include "unicode/utypes.h"
#if !UCONFIG_NO_BREAK_ITERATION
#include "brkeng.h"
#include "charstr.h"
#include "cmemory.h"
#include "lstmbe.h"
#include "putilimp.h"
#include "uassert.h"
#include "ubrkimpl.h"
#include "uresimp.h"
#include "uvectr32.h"
#include "uvector.h"
#include "unicode/brkiter.h"
#include "unicode/resbund.h"
#include "unicode/ubrk.h"
#include "unicode/uniset.h"
#include "unicode/ustring.h"
#include "unicode/utf.h"
U_NAMESPACE_BEGIN
// Uncomment the following #define to debug.
// #define LSTM_DEBUG 1
// #define LSTM_VECTORIZER_DEBUG 1
/**
* Interface for reading 1D array.
*/
class ReadArray1D {
public:
virtual ~ReadArray1D();
virtual int32_t d1() const = 0;
virtual float get(int32_t i) const = 0;
#ifdef LSTM_DEBUG
void print() const {
printf("\n[");
for (int32_t i = 0; i < d1(); i++) {
printf("%0.8e ", get(i));
if (i % 4 == 3) printf("\n");
}
printf("]\n");
}
#endif
};
ReadArray1D::~ReadArray1D()
{
}
/**
* Interface for reading 2D array.
*/
class ReadArray2D {
public:
virtual ~ReadArray2D();
virtual int32_t d1() const = 0;
virtual int32_t d2() const = 0;
virtual float get(int32_t i, int32_t j) const = 0;
};
ReadArray2D::~ReadArray2D()
{
}
/**
* A class to index a float array as a 1D Array without owning the pointer or
* copy the data.
*/
class ConstArray1D : public ReadArray1D {
public:
ConstArray1D() : data_(nullptr), d1_(0) {}
ConstArray1D(const float* data, int32_t d1) : data_(data), d1_(d1) {}
virtual ~ConstArray1D();
// Init the object, the object does not own the data nor copy.
// It is designed to directly use data from memory mapped resources.
void init(const int32_t* data, int32_t d1) {
U_ASSERT(IEEE_754 == 1);
data_ = reinterpret_cast<const float*>(data);
d1_ = d1;
}
// ReadArray1D methods.
virtual int32_t d1() const override { return d1_; }
virtual float get(int32_t i) const override {
U_ASSERT(i < d1_);
return data_[i];
}
private:
const float* data_;
int32_t d1_;
};
ConstArray1D::~ConstArray1D()
{
}
/**
* A class to index a float array as a 2D Array without owning the pointer or
* copy the data.
*/
class ConstArray2D : public ReadArray2D {
public:
ConstArray2D() : data_(nullptr), d1_(0), d2_(0) {}
ConstArray2D(const float* data, int32_t d1, int32_t d2)
: data_(data), d1_(d1), d2_(d2) {}
virtual ~ConstArray2D();
// Init the object, the object does not own the data nor copy.
// It is designed to directly use data from memory mapped resources.
void init(const int32_t* data, int32_t d1, int32_t d2) {
U_ASSERT(IEEE_754 == 1);
data_ = reinterpret_cast<const float*>(data);
d1_ = d1;
d2_ = d2;
}
// ReadArray2D methods.
inline int32_t d1() const override { return d1_; }
inline int32_t d2() const override { return d2_; }
float get(int32_t i, int32_t j) const override {
U_ASSERT(i < d1_);
U_ASSERT(j < d2_);
return data_[i * d2_ + j];
}
// Expose the ith row as a ConstArray1D
inline ConstArray1D row(int32_t i) const {
U_ASSERT(i < d1_);
return ConstArray1D(data_ + i * d2_, d2_);
}
private:
const float* data_;
int32_t d1_;
int32_t d2_;
};
ConstArray2D::~ConstArray2D()
{
}
/**
* A class to allocate data as a writable 1D array.
* This is the main class implement matrix operation.
*/
class Array1D : public ReadArray1D {
public:
Array1D() : memory_(nullptr), data_(nullptr), d1_(0) {}
Array1D(int32_t d1, UErrorCode &status)
: memory_(uprv_malloc(d1 * sizeof(float))),
data_((float*)memory_), d1_(d1) {
if (U_SUCCESS(status)) {
if (memory_ == nullptr) {
status = U_MEMORY_ALLOCATION_ERROR;
return;
}
clear();
}
}
virtual ~Array1D();
// A special constructor which does not own the memory but writeable
// as a slice of an array.
Array1D(float* data, int32_t d1)
: memory_(nullptr), data_(data), d1_(d1) {}
// ReadArray1D methods.
virtual int32_t d1() const override { return d1_; }
virtual float get(int32_t i) const override {
U_ASSERT(i < d1_);
return data_[i];
}
// Return the index which point to the max data in the array.
inline int32_t maxIndex() const {
int32_t index = 0;
float max = data_[0];
for (int32_t i = 1; i < d1_; i++) {
if (data_[i] > max) {
max = data_[i];
index = i;
}
}
return index;
}
// Slice part of the array to a new one.
inline Array1D slice(int32_t from, int32_t size) const {
U_ASSERT(from >= 0);
U_ASSERT(from < d1_);
U_ASSERT(from + size <= d1_);
return Array1D(data_ + from, size);
}
// Add dot product of a 1D array and a 2D array into this one.
inline Array1D& addDotProduct(const ReadArray1D& a, const ReadArray2D& b) {
U_ASSERT(a.d1() == b.d1());
U_ASSERT(b.d2() == d1());
for (int32_t i = 0; i < d1(); i++) {
for (int32_t j = 0; j < a.d1(); j++) {
data_[i] += a.get(j) * b.get(j, i);
}
}
return *this;
}
// Hadamard Product the values of another array of the same size into this one.
inline Array1D& hadamardProduct(const ReadArray1D& a) {
U_ASSERT(a.d1() == d1());
for (int32_t i = 0; i < d1(); i++) {
data_[i] *= a.get(i);
}
return *this;
}
// Add the Hadamard Product of two arrays of the same size into this one.
inline Array1D& addHadamardProduct(const ReadArray1D& a, const ReadArray1D& b) {
U_ASSERT(a.d1() == d1());
U_ASSERT(b.d1() == d1());
for (int32_t i = 0; i < d1(); i++) {
data_[i] += a.get(i) * b.get(i);
}
return *this;
}
// Add the values of another array of the same size into this one.
inline Array1D& add(const ReadArray1D& a) {
U_ASSERT(a.d1() == d1());
for (int32_t i = 0; i < d1(); i++) {
data_[i] += a.get(i);
}
return *this;
}
// Assign the values of another array of the same size into this one.
inline Array1D& assign(const ReadArray1D& a) {
U_ASSERT(a.d1() == d1());
for (int32_t i = 0; i < d1(); i++) {
data_[i] = a.get(i);
}
return *this;
}
// Apply tanh to all the elements in the array.
inline Array1D& tanh() {
return tanh(*this);
}
// Apply tanh of a and store into this array.
inline Array1D& tanh(const Array1D& a) {
U_ASSERT(a.d1() == d1());
for (int32_t i = 0; i < d1_; i++) {
data_[i] = std::tanh(a.get(i));
}
return *this;
}
// Apply sigmoid to all the elements in the array.
inline Array1D& sigmoid() {
for (int32_t i = 0; i < d1_; i++) {
data_[i] = 1.0f/(1.0f + expf(-data_[i]));
}
return *this;
}
inline Array1D& clear() {
uprv_memset(data_, 0, d1_ * sizeof(float));
return *this;
}
private:
void* memory_;
float* data_;
int32_t d1_;
};
Array1D::~Array1D()
{
uprv_free(memory_);
}
class Array2D : public ReadArray2D {
public:
Array2D() : memory_(nullptr), data_(nullptr), d1_(0), d2_(0) {}
Array2D(int32_t d1, int32_t d2, UErrorCode &status)
: memory_(uprv_malloc(d1 * d2 * sizeof(float))),
data_((float*)memory_), d1_(d1), d2_(d2) {
if (U_SUCCESS(status)) {
if (memory_ == nullptr) {
status = U_MEMORY_ALLOCATION_ERROR;
return;
}
clear();
}
}
virtual ~Array2D();
// ReadArray2D methods.
virtual int32_t d1() const override { return d1_; }
virtual int32_t d2() const override { return d2_; }
virtual float get(int32_t i, int32_t j) const override {
U_ASSERT(i < d1_);
U_ASSERT(j < d2_);
return data_[i * d2_ + j];
}
inline Array1D row(int32_t i) const {
U_ASSERT(i < d1_);
return Array1D(data_ + i * d2_, d2_);
}
inline Array2D& clear() {
uprv_memset(data_, 0, d1_ * d2_ * sizeof(float));
return *this;
}
private:
void* memory_;
float* data_;
int32_t d1_;
int32_t d2_;
};
Array2D::~Array2D()
{
uprv_free(memory_);
}
typedef enum {
BEGIN,
INSIDE,
END,
SINGLE
} LSTMClass;
typedef enum {
UNKNOWN,
CODE_POINTS,
GRAPHEME_CLUSTER,
} EmbeddingType;
struct LSTMData : public UMemory {
LSTMData(UResourceBundle* rb, UErrorCode &status);
~LSTMData();
UHashtable* fDict;
EmbeddingType fType;
const UChar* fName;
ConstArray2D fEmbedding;
ConstArray2D fForwardW;
ConstArray2D fForwardU;
ConstArray1D fForwardB;
ConstArray2D fBackwardW;
ConstArray2D fBackwardU;
ConstArray1D fBackwardB;
ConstArray2D fOutputW;
ConstArray1D fOutputB;
private:
UResourceBundle* fBundle;
};
LSTMData::LSTMData(UResourceBundle* rb, UErrorCode &status)
: fDict(nullptr), fType(UNKNOWN), fName(nullptr),
fBundle(rb)
{
if (U_FAILURE(status)) {
return;
}
if (IEEE_754 != 1) {
status = U_UNSUPPORTED_ERROR;
return;
}
LocalUResourceBundlePointer embeddings_res(
ures_getByKey(rb, "embeddings", nullptr, &status));
int32_t embedding_size = ures_getInt(embeddings_res.getAlias(), &status);
LocalUResourceBundlePointer hunits_res(
ures_getByKey(rb, "hunits", nullptr, &status));
if (U_FAILURE(status)) return;
int32_t hunits = ures_getInt(hunits_res.getAlias(), &status);
const UChar* type = ures_getStringByKey(rb, "type", nullptr, &status);
if (U_FAILURE(status)) return;
if (u_strCompare(type, -1, u"codepoints", -1, false) == 0) {
fType = CODE_POINTS;
} else if (u_strCompare(type, -1, u"graphclust", -1, false) == 0) {
fType = GRAPHEME_CLUSTER;
}
fName = ures_getStringByKey(rb, "model", nullptr, &status);
LocalUResourceBundlePointer dataRes(ures_getByKey(rb, "data", nullptr, &status));
if (U_FAILURE(status)) return;
int32_t data_len = 0;
const int32_t* data = ures_getIntVector(dataRes.getAlias(), &data_len, &status);
fDict = uhash_open(uhash_hashUChars, uhash_compareUChars, nullptr, &status);
StackUResourceBundle stackTempBundle;
ResourceDataValue value;
ures_getValueWithFallback(rb, "dict", stackTempBundle.getAlias(), value, status);
ResourceArray stringArray = value.getArray(status);
int32_t num_index = stringArray.getSize();
if (U_FAILURE(status)) { return; }
// put dict into hash
int32_t stringLength;
for (int32_t idx = 0; idx < num_index; idx++) {
stringArray.getValue(idx, value);
const UChar* str = value.getString(stringLength, status);
uhash_putiAllowZero(fDict, (void*)str, idx, &status);
if (U_FAILURE(status)) return;
#ifdef LSTM_VECTORIZER_DEBUG
printf("Assign [");
while (*str != 0x0000) {
printf("U+%04x ", *str);
str++;
}
printf("] map to %d\n", idx-1);
#endif
}
int32_t mat1_size = (num_index + 1) * embedding_size;
int32_t mat2_size = embedding_size * 4 * hunits;
int32_t mat3_size = hunits * 4 * hunits;
int32_t mat4_size = 4 * hunits;
int32_t mat5_size = mat2_size;
int32_t mat6_size = mat3_size;
int32_t mat7_size = mat4_size;
int32_t mat8_size = 2 * hunits * 4;
#if U_DEBUG
int32_t mat9_size = 4;
U_ASSERT(data_len == mat1_size + mat2_size + mat3_size + mat4_size + mat5_size +
mat6_size + mat7_size + mat8_size + mat9_size);
#endif
fEmbedding.init(data, (num_index + 1), embedding_size);
data += mat1_size;
fForwardW.init(data, embedding_size, 4 * hunits);
data += mat2_size;
fForwardU.init(data, hunits, 4 * hunits);
data += mat3_size;
fForwardB.init(data, 4 * hunits);
data += mat4_size;
fBackwardW.init(data, embedding_size, 4 * hunits);
data += mat5_size;
fBackwardU.init(data, hunits, 4 * hunits);
data += mat6_size;
fBackwardB.init(data, 4 * hunits);
data += mat7_size;
fOutputW.init(data, 2 * hunits, 4);
data += mat8_size;
fOutputB.init(data, 4);
}
LSTMData::~LSTMData() {
uhash_close(fDict);
ures_close(fBundle);
}
class Vectorizer : public UMemory {
public:
Vectorizer(UHashtable* dict) : fDict(dict) {}
virtual ~Vectorizer();
virtual void vectorize(UText *text, int32_t startPos, int32_t endPos,
UVector32 &offsets, UVector32 &indices,
UErrorCode &status) const = 0;
protected:
int32_t stringToIndex(const UChar* str) const {
UBool found = false;
int32_t ret = uhash_getiAndFound(fDict, (const void*)str, &found);
if (!found) {
ret = fDict->count;
}
#ifdef LSTM_VECTORIZER_DEBUG
printf("[");
while (*str != 0x0000) {
printf("U+%04x ", *str);
str++;
}
printf("] map to %d\n", ret);
#endif
return ret;
}
private:
UHashtable* fDict;
};
Vectorizer::~Vectorizer()
{
}
class CodePointsVectorizer : public Vectorizer {
public:
CodePointsVectorizer(UHashtable* dict) : Vectorizer(dict) {}
virtual ~CodePointsVectorizer();
virtual void vectorize(UText *text, int32_t startPos, int32_t endPos,
UVector32 &offsets, UVector32 &indices,
UErrorCode &status) const override;
};
CodePointsVectorizer::~CodePointsVectorizer()
{
}
void CodePointsVectorizer::vectorize(
UText *text, int32_t startPos, int32_t endPos,
UVector32 &offsets, UVector32 &indices, UErrorCode &status) const
{
if (offsets.ensureCapacity(endPos - startPos, status) &&
indices.ensureCapacity(endPos - startPos, status)) {
if (U_FAILURE(status)) return;
utext_setNativeIndex(text, startPos);
int32_t current;
UChar str[2] = {0, 0};
while (U_SUCCESS(status) &&
(current = (int32_t)utext_getNativeIndex(text)) < endPos) {
// Since the LSTMBreakEngine is currently only accept chars in BMP,
// we can ignore the possibility of hitting supplementary code
// point.
str[0] = (UChar) utext_next32(text);
U_ASSERT(!U_IS_SURROGATE(str[0]));
offsets.addElement(current, status);
indices.addElement(stringToIndex(str), status);
}
}
}
class GraphemeClusterVectorizer : public Vectorizer {
public:
GraphemeClusterVectorizer(UHashtable* dict)
: Vectorizer(dict)
{
}
virtual ~GraphemeClusterVectorizer();
virtual void vectorize(UText *text, int32_t startPos, int32_t endPos,
UVector32 &offsets, UVector32 &indices,
UErrorCode &status) const override;
};
GraphemeClusterVectorizer::~GraphemeClusterVectorizer()
{
}
constexpr int32_t MAX_GRAPHEME_CLSTER_LENGTH = 10;
void GraphemeClusterVectorizer::vectorize(
UText *text, int32_t startPos, int32_t endPos,
UVector32 &offsets, UVector32 &indices, UErrorCode &status) const
{
if (U_FAILURE(status)) return;
if (!offsets.ensureCapacity(endPos - startPos, status) ||
!indices.ensureCapacity(endPos - startPos, status)) {
return;
}
if (U_FAILURE(status)) return;
LocalPointer<BreakIterator> graphemeIter(BreakIterator::createCharacterInstance(Locale(), status));
if (U_FAILURE(status)) return;
graphemeIter->setText(text, status);
if (U_FAILURE(status)) return;
if (startPos != 0) {
graphemeIter->preceding(startPos);
}
int32_t last = startPos;
int32_t current = startPos;
UChar str[MAX_GRAPHEME_CLSTER_LENGTH];
while ((current = graphemeIter->next()) != BreakIterator::DONE) {
if (current >= endPos) {
break;
}
if (current > startPos) {
utext_extract(text, last, current, str, MAX_GRAPHEME_CLSTER_LENGTH, &status);
if (U_FAILURE(status)) return;
offsets.addElement(last, status);
indices.addElement(stringToIndex(str), status);
if (U_FAILURE(status)) return;
}
last = current;
}
if (U_FAILURE(status) || last >= endPos) {
return;
}
utext_extract(text, last, endPos, str, MAX_GRAPHEME_CLSTER_LENGTH, &status);
if (U_SUCCESS(status)) {
offsets.addElement(last, status);
indices.addElement(stringToIndex(str), status);
}
}
// Computing LSTM as stated in
// https://en.wikipedia.org/wiki/Long_short-term_memory#LSTM_with_a_forget_gate
// ifco is temp array allocate outside which does not need to be
// input/output value but could avoid unnecessary memory alloc/free if passing
// in.
void compute(
int32_t hunits,
const ReadArray2D& W, const ReadArray2D& U, const ReadArray1D& b,
const ReadArray1D& x, Array1D& h, Array1D& c,
Array1D& ifco)
{
// ifco = x * W + h * U + b
ifco.assign(b)
.addDotProduct(x, W)
.addDotProduct(h, U);
ifco.slice(0*hunits, hunits).sigmoid(); // i: sigmod
ifco.slice(1*hunits, hunits).sigmoid(); // f: sigmoid
ifco.slice(2*hunits, hunits).tanh(); // c_: tanh
ifco.slice(3*hunits, hunits).sigmoid(); // o: sigmod
c.hadamardProduct(ifco.slice(hunits, hunits))
.addHadamardProduct(ifco.slice(0, hunits), ifco.slice(2*hunits, hunits));
h.tanh(c)
.hadamardProduct(ifco.slice(3*hunits, hunits));
}
// Minimum word size
static const int32_t MIN_WORD = 2;
// Minimum number of characters for two words
static const int32_t MIN_WORD_SPAN = MIN_WORD * 2;
int32_t
LSTMBreakEngine::divideUpDictionaryRange( UText *text,
int32_t startPos,
int32_t endPos,
UVector32 &foundBreaks,
UErrorCode& status) const {
if (U_FAILURE(status)) return 0;
int32_t beginFoundBreakSize = foundBreaks.size();
utext_setNativeIndex(text, startPos);
utext_moveIndex32(text, MIN_WORD_SPAN);
if (utext_getNativeIndex(text) >= endPos) {
return 0; // Not enough characters for two words
}
utext_setNativeIndex(text, startPos);
UVector32 offsets(status);
UVector32 indices(status);
if (U_FAILURE(status)) return 0;
fVectorizer->vectorize(text, startPos, endPos, offsets, indices, status);
if (U_FAILURE(status)) return 0;
int32_t* offsetsBuf = offsets.getBuffer();
int32_t* indicesBuf = indices.getBuffer();
int32_t input_seq_len = indices.size();
int32_t hunits = fData->fForwardU.d1();
// ----- Begin of all the Array memory allocation needed for this function
// Allocate temp array used inside compute()
Array1D ifco(4 * hunits, status);
Array1D c(hunits, status);
Array1D logp(4, status);
// TODO: limit size of hBackward. If input_seq_len is too big, we could
// run out of memory.
// Backward LSTM
Array2D hBackward(input_seq_len, hunits, status);
// Allocate fbRow and slice the internal array in two.
Array1D fbRow(2 * hunits, status);
// ----- End of all the Array memory allocation needed for this function
if (U_FAILURE(status)) return 0;
// To save the needed memory usage, the following is different from the
// Python or ICU4X implementation. We first perform the Backward LSTM
// and then merge the iteration of the forward LSTM and the output layer
// together because we only neetdto remember the h[t-1] for Forward LSTM.
for (int32_t i = input_seq_len - 1; i >= 0; i--) {
Array1D hRow = hBackward.row(i);
if (i != input_seq_len - 1) {
hRow.assign(hBackward.row(i+1));
}
#ifdef LSTM_DEBUG
printf("hRow %d\n", i);
hRow.print();
printf("indicesBuf[%d] = %d\n", i, indicesBuf[i]);
printf("fData->fEmbedding.row(indicesBuf[%d]):\n", i);
fData->fEmbedding.row(indicesBuf[i]).print();
#endif // LSTM_DEBUG
compute(hunits,
fData->fBackwardW, fData->fBackwardU, fData->fBackwardB,
fData->fEmbedding.row(indicesBuf[i]),
hRow, c, ifco);
}
Array1D forwardRow = fbRow.slice(0, hunits); // point to first half of data in fbRow.
Array1D backwardRow = fbRow.slice(hunits, hunits); // point to second half of data n fbRow.
// The following iteration merge the forward LSTM and the output layer
// together.
c.clear(); // reuse c since it is the same size.
for (int32_t i = 0; i < input_seq_len; i++) {
#ifdef LSTM_DEBUG
printf("forwardRow %d\n", i);
forwardRow.print();
#endif // LSTM_DEBUG
// Forward LSTM
// Calculate the result into forwardRow, which point to the data in the first half
// of fbRow.
compute(hunits,
fData->fForwardW, fData->fForwardU, fData->fForwardB,
fData->fEmbedding.row(indicesBuf[i]),
forwardRow, c, ifco);
// assign the data from hBackward.row(i) to second half of fbRowa.
backwardRow.assign(hBackward.row(i));
logp.assign(fData->fOutputB).addDotProduct(fbRow, fData->fOutputW);
#ifdef LSTM_DEBUG
printf("backwardRow %d\n", i);
backwardRow.print();
printf("logp %d\n", i);
logp.print();
#endif // LSTM_DEBUG
// current = argmax(logp)
LSTMClass current = (LSTMClass)logp.maxIndex();
// BIES logic.
if (current == BEGIN || current == SINGLE) {
if (i != 0) {
foundBreaks.addElement(offsetsBuf[i], status);
if (U_FAILURE(status)) return 0;
}
}
}
return foundBreaks.size() - beginFoundBreakSize;
}
Vectorizer* createVectorizer(const LSTMData* data, UErrorCode &status) {
if (U_FAILURE(status)) {
return nullptr;
}
switch (data->fType) {
case CODE_POINTS:
return new CodePointsVectorizer(data->fDict);
break;
case GRAPHEME_CLUSTER:
return new GraphemeClusterVectorizer(data->fDict);
break;
default:
break;
}
UPRV_UNREACHABLE_EXIT;
}
LSTMBreakEngine::LSTMBreakEngine(const LSTMData* data, const UnicodeSet& set, UErrorCode &status)
: DictionaryBreakEngine(), fData(data), fVectorizer(createVectorizer(fData, status))
{
if (U_FAILURE(status)) {
fData = nullptr; // If failure, we should not delete fData in destructor because the caller will do so.
return;
}
setCharacters(set);
}
LSTMBreakEngine::~LSTMBreakEngine() {
delete fData;
delete fVectorizer;
}
const UChar* LSTMBreakEngine::name() const {
return fData->fName;
}
UnicodeString defaultLSTM(UScriptCode script, UErrorCode& status) {
// open root from brkitr tree.
UResourceBundle *b = ures_open(U_ICUDATA_BRKITR, "", &status);
b = ures_getByKeyWithFallback(b, "lstm", b, &status);
UnicodeString result = ures_getUnicodeStringByKey(b, uscript_getShortName(script), &status);
ures_close(b);
return result;
}
U_CAPI const LSTMData* U_EXPORT2 CreateLSTMDataForScript(UScriptCode script, UErrorCode& status)
{
if (script != USCRIPT_KHMER && script != USCRIPT_LAO && script != USCRIPT_MYANMAR && script != USCRIPT_THAI) {
return nullptr;
}
UnicodeString name = defaultLSTM(script, status);
if (U_FAILURE(status)) return nullptr;
CharString namebuf;
namebuf.appendInvariantChars(name, status).truncate(namebuf.lastIndexOf('.'));
LocalUResourceBundlePointer rb(
ures_openDirect(U_ICUDATA_BRKITR, namebuf.data(), &status));
if (U_FAILURE(status)) return nullptr;
return CreateLSTMData(rb.orphan(), status);
}
U_CAPI const LSTMData* U_EXPORT2 CreateLSTMData(UResourceBundle* rb, UErrorCode& status)
{
return new LSTMData(rb, status);
}
U_CAPI const LanguageBreakEngine* U_EXPORT2
CreateLSTMBreakEngine(UScriptCode script, const LSTMData* data, UErrorCode& status)
{
UnicodeString unicodeSetString;
switch(script) {
case USCRIPT_THAI:
unicodeSetString = UnicodeString(u"[[:Thai:]&[:LineBreak=SA:]]");
break;
case USCRIPT_MYANMAR:
unicodeSetString = UnicodeString(u"[[:Mymr:]&[:LineBreak=SA:]]");
break;
default:
delete data;
return nullptr;
}
UnicodeSet unicodeSet;
unicodeSet.applyPattern(unicodeSetString, status);
const LanguageBreakEngine* engine = new LSTMBreakEngine(data, unicodeSet, status);
if (U_FAILURE(status) || engine == nullptr) {
if (engine != nullptr) {
delete engine;
} else {
status = U_MEMORY_ALLOCATION_ERROR;
}
return nullptr;
}
return engine;
}
U_CAPI void U_EXPORT2 DeleteLSTMData(const LSTMData* data)
{
delete data;
}
U_CAPI const UChar* U_EXPORT2 LSTMDataName(const LSTMData* data)
{
return data->fName;
}
U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_BREAK_ITERATION */
+87
View File
@@ -0,0 +1,87 @@
// © 2021 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
#ifndef LSTMBE_H
#define LSTMBE_H
#include "unicode/utypes.h"
#if !UCONFIG_NO_BREAK_ITERATION
#include "unicode/uniset.h"
#include "unicode/ures.h"
#include "unicode/utext.h"
#include "unicode/utypes.h"
#include "brkeng.h"
#include "dictbe.h"
#include "uvectr32.h"
U_NAMESPACE_BEGIN
class Vectorizer;
struct LSTMData;
/*******************************************************************
* LSTMBreakEngine
*/
/**
* <p>LSTMBreakEngine is a kind of DictionaryBreakEngine that uses a
* LSTM to determine language-specific breaks.</p>
*
* <p>After it is constructed a LSTMBreakEngine may be shared between
* threads without synchronization.</p>
*/
class LSTMBreakEngine : public DictionaryBreakEngine {
public:
/**
* <p>Constructor.</p>
*/
LSTMBreakEngine(const LSTMData* data, const UnicodeSet& set, UErrorCode &status);
/**
* <p>Virtual destructor.</p>
*/
virtual ~LSTMBreakEngine();
virtual const UChar* name() const;
protected:
/**
* <p>Divide up a range of known dictionary characters handled by this break engine.</p>
*
* @param text A UText representing the text
* @param rangeStart The start of the range of dictionary characters
* @param rangeEnd The end of the range of dictionary characters
* @param foundBreaks Output of C array of int32_t break positions, or 0
* @param status Information on any errors encountered.
* @return The number of breaks found
*/
virtual int32_t divideUpDictionaryRange(UText *text,
int32_t rangeStart,
int32_t rangeEnd,
UVector32 &foundBreaks,
UErrorCode& status) const override;
private:
const LSTMData* fData;
const Vectorizer* fVectorizer;
};
U_CAPI const LanguageBreakEngine* U_EXPORT2 CreateLSTMBreakEngine(
UScriptCode script, const LSTMData* data, UErrorCode& status);
U_CAPI const LSTMData* U_EXPORT2 CreateLSTMData(
UResourceBundle* rb, UErrorCode& status);
U_CAPI const LSTMData* U_EXPORT2 CreateLSTMDataForScript(
UScriptCode script, UErrorCode& status);
U_CAPI void U_EXPORT2 DeleteLSTMData(const LSTMData* data);
U_CAPI const UChar* U_EXPORT2 LSTMDataName(const LSTMData* data);
U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_BREAK_ITERATION */
#endif /* LSTMBE_H */
+5 -5
View File
@@ -309,10 +309,10 @@ MessagePattern::clear() {
numericValuesLength=0;
}
UBool
bool
MessagePattern::operator==(const MessagePattern &other) const {
if(this==&other) {
return TRUE;
return true;
}
return
aposMode==other.aposMode &&
@@ -387,10 +387,10 @@ MessagePattern::getPluralOffset(int32_t pluralStart) const {
// MessagePattern::Part ---------------------------------------------------- ***
UBool
bool
MessagePattern::Part::operator==(const Part &other) const {
if(this==&other) {
return TRUE;
return true;
}
return
type==other.type &&
@@ -454,7 +454,7 @@ MessagePattern::parseMessage(int32_t index, int32_t msgStartLength,
UChar c=msg.charAt(index++);
if(c==u_apos) {
if(index==msg.length()) {
// The apostrophe is the last character in the pattern.
// The apostrophe is the last character in the pattern.
// Add a Part for auto-quoting.
addPart(UMSGPAT_PART_TYPE_INSERT_CHAR, index, 0,
u_apos, errorCode); // value=char to be inserted
+3 -3
View File
@@ -11,15 +11,15 @@
//
/*
These are defined before unicode/uversion.h in order to prevent
STLPort's broken stddef.h from being used when rc.exe parses this file.
These are defined before unicode/uversion.h in order to prevent
STLPort's broken stddef.h from being used when rc.exe parses this file.
*/
#define _STLP_OUTERMOST_HEADER_ID 0
#define _STLP_WINCE 1
#include "unicode/uversion.h"
#define ICU_WEBSITE "http://icu-project.org"
#define ICU_WEBSITE "https://icu.unicode.org/"
#define ICU_COMPANY "The ICU Project"
#define ICU_PRODUCT_PREFIX "ICU"
#define ICU_PRODUCT "International Components for Unicode"
+429 -426
View File
@@ -1,6 +1,5 @@
// © 2016 and later: Unicode, Inc. and others.
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
//
// Copyright (C) 1999-2016, International Business Machines
// Corporation and others. All Rights Reserved.
//
@@ -8,31 +7,30 @@
//
// machine-generated by: icu/source/tools/gennorm2/n2builder.cpp
#ifdef INCLUDED_FROM_NORMALIZER2_CPP
static const UVersionInfo norm2_nfc_data_formatVersion={4,0,0,0};
static const UVersionInfo norm2_nfc_data_dataVersion={0xd,0,0,0};
static const UVersionInfo norm2_nfc_data_dataVersion={0xe,0,0,0};
static const int32_t norm2_nfc_data_indexes[Normalizer2Impl::IX_COUNT]={
0x50,0x4bac,0x8814,0x8914,0x8914,0x8914,0x8914,0x8914,0xc0,0x300,0xae2,0x29e0,0x3c66,0xfc00,0x1288,0x3b9c,
0x50,0x4c54,0x88bc,0x89bc,0x89bc,0x89bc,0x89bc,0x89bc,0xc0,0x300,0xae2,0x29e0,0x3c66,0xfc00,0x1288,0x3b9c,
0x3c34,0x3c66,0x300,0
};
static const uint16_t norm2_nfc_data_trieIndex[1746]={
static const uint16_t norm2_nfc_data_trieIndex[1748]={
0,0x40,0x7b,0xbb,0xfb,0x13a,0x17a,0x1b2,0x1f2,0x226,0x254,0x226,0x294,0x2d4,0x313,0x353,
0x393,0x3d2,0x40f,0x44e,0x226,0x226,0x488,0x4c8,0x4f8,0x530,0x226,0x570,0x59f,0x5de,0x226,0x5f3,
0x631,0x65f,0x226,0x68c,0x6cc,0x709,0x729,0x768,0x7a7,0x7e4,0x803,0x840,0x729,0x879,0x8a7,0x8e6,
0x226,0x920,0x937,0x977,0x98e,0x9cd,0x226,0xa03,0xa23,0xa5e,0xa6a,0xaa5,0xacd,0xb0a,0xb4a,0xb84,
0xb9f,0x226,0xbda,0x226,0xc1a,0xc39,0xc6f,0xcac,0x226,0x226,0x226,0x226,0x226,0xccf,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0xcfb,0x226,0x226,0xd30,
0x226,0x226,0xd4e,0x226,0xd78,0x226,0x226,0x226,0xdb4,0xdd4,0xe14,0xe53,0xe8e,0xece,0xf02,0xf2e,
0x808,0x226,0x226,0xf62,0x226,0x226,0x226,0xfa2,0xfe2,0x1022,0x1062,0x10a2,0x10e2,0x1122,0x1162,0x11a2,
0x11e2,0x226,0x226,0x1212,0x1243,0x226,0x1273,0x12a6,0x12e3,0x1322,0x1362,0x1398,0x13c6,0x226,0x226,0x226,
0x631,0x65f,0x687,0x6bd,0x6fd,0x73a,0x75a,0x799,0x7d8,0x815,0x834,0x871,0x75a,0x8aa,0x8d8,0x917,
0x834,0x951,0x968,0x9a8,0x9bf,0x9fe,0x226,0xa34,0xa54,0xa8f,0xa9b,0xad6,0xafe,0xb3b,0xb7b,0xbb5,
0xbd0,0x226,0xc0b,0x226,0xc4b,0xc6a,0xca0,0xcdd,0x226,0x226,0x226,0x226,0x226,0xd00,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0xd2c,0x226,0x226,0xd61,
0x226,0x226,0xd7f,0x226,0xda9,0x226,0x226,0x226,0xde5,0xe05,0xe45,0xe84,0xebf,0xeff,0xf33,0xf5f,
0x839,0x226,0x226,0xf93,0x226,0x226,0x226,0xfd3,0x1013,0x1053,0x1093,0x10d3,0x1113,0x1153,0x1193,0x11d3,
0x1213,0x226,0x226,0x1243,0x1274,0x226,0x12a4,0x12d7,0x1314,0x1353,0x1393,0x13c9,0x13f7,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x13f1,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0xcbd,0x226,0x140e,0x226,0x144e,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x148e,0x14c8,0x1506,0x1546,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1422,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0xcee,0x226,0x143f,0x226,0x147f,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x14bf,0x14f9,0x1537,0x1577,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
@@ -61,20 +59,20 @@ static const uint16_t norm2_nfc_data_trieIndex[1746]={
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1585,0x15c3,0x15e3,0x226,0x226,0x226,0x226,
0x161d,0x226,0x226,0x1645,0x1677,0x16a5,0x80c,0x16b8,0x226,0x226,0x16c8,0x1708,0x226,0x226,0x226,0x1420,
0x1748,0x1750,0x1758,0x1760,0x174c,0x1754,0x175c,0x1748,0x1750,0x1758,0x1760,0x174c,0x1754,0x175c,0x1748,0x1750,
0x1758,0x1760,0x174c,0x1754,0x175c,0x1748,0x1750,0x1758,0x1760,0x174c,0x1754,0x175c,0x1748,0x1750,0x1758,0x1760,
0x174c,0x1754,0x175c,0x1748,0x1750,0x1758,0x1760,0x174c,0x1754,0x175c,0x1748,0x1750,0x1758,0x1760,0x174c,0x1754,
0x175c,0x1748,0x1750,0x1758,0x1760,0x174c,0x1754,0x175c,0x1748,0x1750,0x1758,0x1760,0x174c,0x1754,0x175c,0x1748,
0x1750,0x1758,0x1760,0x174c,0x1754,0x175c,0x1748,0x1750,0x1758,0x1760,0x174c,0x1754,0x175c,0x1748,0x1750,0x1758,
0x1760,0x174c,0x1754,0x175c,0x1748,0x1750,0x1758,0x1760,0x174c,0x1754,0x175c,0x1748,0x1750,0x1758,0x1760,0x174c,
0x1754,0x175c,0x1748,0x1750,0x1758,0x1760,0x174c,0x1754,0x175c,0x1748,0x1750,0x1758,0x1760,0x174c,0x1754,0x175c,
0x1748,0x1750,0x1758,0x1760,0x174c,0x1754,0x175c,0x1748,0x1750,0x1758,0x1760,0x174c,0x1754,0x175c,0x1748,0x1750,
0x1758,0x1760,0x174c,0x1754,0x175c,0x1748,0x1750,0x1758,0x1760,0x174c,0x1754,0x175c,0x1748,0x1750,0x1758,0x1760,
0x174c,0x1754,0x175c,0x1748,0x1750,0x1758,0x1760,0x174c,0x1754,0x175c,0x1748,0x1750,0x1758,0x1760,0x174c,0x1754,
0x175c,0x1748,0x1750,0x1758,0x1760,0x174c,0x1754,0x175c,0x1748,0x1750,0x1758,0x1760,0x174c,0x1754,0x1794,0x226,
0x17d4,0x180f,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x15b6,0x15f4,0x1614,0x226,0x226,0x226,0x226,
0x164e,0x226,0x226,0x1676,0x16a8,0x16d6,0x83d,0x16e9,0x226,0x226,0x16f9,0x1739,0x226,0x226,0x226,0x1451,
0x1779,0x1781,0x1789,0x1791,0x177d,0x1785,0x178d,0x1779,0x1781,0x1789,0x1791,0x177d,0x1785,0x178d,0x1779,0x1781,
0x1789,0x1791,0x177d,0x1785,0x178d,0x1779,0x1781,0x1789,0x1791,0x177d,0x1785,0x178d,0x1779,0x1781,0x1789,0x1791,
0x177d,0x1785,0x178d,0x1779,0x1781,0x1789,0x1791,0x177d,0x1785,0x178d,0x1779,0x1781,0x1789,0x1791,0x177d,0x1785,
0x178d,0x1779,0x1781,0x1789,0x1791,0x177d,0x1785,0x178d,0x1779,0x1781,0x1789,0x1791,0x177d,0x1785,0x178d,0x1779,
0x1781,0x1789,0x1791,0x177d,0x1785,0x178d,0x1779,0x1781,0x1789,0x1791,0x177d,0x1785,0x178d,0x1779,0x1781,0x1789,
0x1791,0x177d,0x1785,0x178d,0x1779,0x1781,0x1789,0x1791,0x177d,0x1785,0x178d,0x1779,0x1781,0x1789,0x1791,0x177d,
0x1785,0x178d,0x1779,0x1781,0x1789,0x1791,0x177d,0x1785,0x178d,0x1779,0x1781,0x1789,0x1791,0x177d,0x1785,0x178d,
0x1779,0x1781,0x1789,0x1791,0x177d,0x1785,0x178d,0x1779,0x1781,0x1789,0x1791,0x177d,0x1785,0x178d,0x1779,0x1781,
0x1789,0x1791,0x177d,0x1785,0x178d,0x1779,0x1781,0x1789,0x1791,0x177d,0x1785,0x178d,0x1779,0x1781,0x1789,0x1791,
0x177d,0x1785,0x178d,0x1779,0x1781,0x1789,0x1791,0x177d,0x1785,0x178d,0x1779,0x1781,0x1789,0x1791,0x177d,0x1785,
0x178d,0x1779,0x1781,0x1789,0x1791,0x177d,0x1785,0x178d,0x1779,0x1781,0x1789,0x1791,0x177d,0x1785,0x17c5,0x226,
0x1805,0x1840,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
@@ -82,57 +80,57 @@ static const uint16_t norm2_nfc_data_trieIndex[1746]={
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x184f,0x188f,0x18cf,0x190f,0x194f,0x198f,0x19cf,0x1a0f,0x1a32,0x1a72,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1a92,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x655,0x664,0x67c,0x69b,0x6b0,0x6b0,0x6b0,0x6b4,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x1880,0x18c0,0x1900,0x1940,0x1980,0x19c0,0x1a00,0x1a40,0x1a63,0x1aa3,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1ac3,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x657,0x666,0x67e,0x69d,0x6b2,0x6b2,0x6b2,0x6b6,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0xbda,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0xc0b,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x54f,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x40c,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1ac5,0x226,0x226,0x1ad5,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0xdc6,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1ae5,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x15d6,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x1aef,0x54f,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x7eb,0x226,0x226,
0x9ba,0x226,0x1aff,0x1b0c,0x1b18,0x226,0x226,0x226,0x226,0x414,0x226,0x1b23,0x1b33,0x226,0x226,0x226,
0x7e0,0x226,0x226,0x226,0x226,0x1b43,0x226,0x226,0x226,0x1b4e,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x1b55,0x226,0x226,0x226,0x226,0x1b60,0x1b6f,0x8f6,0x1b7d,0x412,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x1b8b,0x798,0x226,0x226,0x226,0x226,0x226,0x1b9b,0x1baa,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x8d6,0x1bb2,0x1bc2,0x226,
0x226,0x226,0x9ba,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1bcc,0x226,0x226,0x226,0x226,0x226,
0x226,0x7e6,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1bc9,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1bdc,
0x7e0,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x84d,0x226,0x226,0x226,0x7ed,0x7ea,
0x226,0x226,0x226,0x226,0x7e8,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x9ba,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0xbd4,0x226,0x226,0x226,
0x226,0x7ea,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x1bec,0x226,0x226,0x226,0xefb,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1af6,0x226,0x226,0x1b06,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0xdf7,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1b16,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1607,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x1b20,0x54f,0x226,0x226,0x1b30,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x81c,0x226,0x226,
0x1b40,0x226,0x1b50,0x1b5d,0x1b69,0x226,0x226,0x226,0x226,0x414,0x226,0x1b74,0x1b84,0x226,0x226,0x226,
0x811,0x226,0x226,0x226,0x226,0x1b94,0x226,0x226,0x226,0x1b9f,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x1ba6,0x226,0x226,0x226,0x226,0x1bb1,0x1bc0,0x927,0x1bce,0x412,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x1bdc,0x7c9,0x226,0x226,0x226,0x226,0x226,0x1bec,0x1bfb,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x907,0x1c03,0x1c13,0x226,
0x226,0x226,0x9eb,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1c1d,0x226,0x226,0x226,0x226,0x226,
0x226,0x817,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1c1a,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1c2d,
0x811,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x87e,0x226,0x226,0x226,0x81e,0x81b,
0x226,0x226,0x226,0x226,0x819,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x9eb,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0xc05,0x226,0x226,0x226,
0x226,0x81b,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x1c3d,0x226,0x226,0x226,0xf2c,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x1bfc,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1bfe,
0x226,0x226,0x226,0x226,0x226,0x1c4d,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1c4f,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x1c0d,0x1c1d,0x1c2b,0x1c38,0x226,0x1c44,0x1c52,0x1c62,0x226,0x226,
0x226,0x226,0xcea,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1c72,0x1c7a,
0x1c88,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0xefb,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x4fc,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x1c98,0x226,0x226,0x226,0x226,0x226,0x226,0x1ca4,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x1cb4,0x1cc4,0x1cd4,0x1ce4,0x1cf4,0x1d04,0x1d14,0x1d24,0x1d34,0x1d44,0x1d54,
0x1d64,0x1d74,0x1d84,0x1d94,0x1da4,0x1db4,0x1dc4,0x1dd4,0x1de4,0x1df4,0x1e04,0x1e14,0x1e24,0x1e34,0x1e44,0x1e54,
0x1e64,0x1e74,0x1e84,0x1e94,0x1ea4,0x1eb4,0x1ec4,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x1c5e,0x1c6e,0x1c7c,0x1c89,0x226,0x1c95,0x1ca3,0x1cb3,0x226,0x226,
0x226,0x226,0xd1b,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1cc3,0x1ccb,
0x1cd9,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0xf2c,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x7c9,0x226,
0x226,0x226,0x4fc,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x1ce9,0x226,0x226,0x226,0x226,0x226,0x226,0x1cf5,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x1d05,0x1d15,0x1d25,0x1d35,0x1d45,0x1d55,0x1d65,0x1d75,0x1d85,
0x1d95,0x1da5,0x1db5,0x1dc5,0x1dd5,0x1de5,0x1df5,0x1e05,0x1e15,0x1e25,0x1e35,0x1e45,0x1e55,0x1e65,0x1e75,0x1e85,
0x1e95,0x1ea5,0x1eb5,0x1ec5,0x1ed5,0x1ee5,0x1ef5,0x1f05,0x1f15,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x226,
0x226,0x226,0x226,0x226,0x226,0x408,0x428,0xc4,0xc4,0xc4,0x448,0x457,0x46d,0x489,0x4a6,0x4c2,
0x4df,0x4fc,0x51b,0x538,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,
0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0x552,0xc4,0x566,0xc4,0xc4,0xc4,0xc4,
0x226,0x226,0x226,0x226,0x226,0x226,0x226,0x408,0x428,0xc4,0xc4,0xc4,0x448,0x457,0x46d,0x489,
0x4a6,0x4c2,0x4df,0x4fc,0x51b,0x538,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,
0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0x552,0xc4,0x566,0xc4,0xc4,
0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,
0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0x586,0xc4,0xc4,0xc4,0xc4,0xc4,
0xc4,0xc4,0xc4,0x591,0x5ae,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0x5ce,0x5e2,0xc4,0xc4,0x5f5,
0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0x586,0xc4,0xc4,0xc4,
0xc4,0xc4,0xc4,0xc4,0xc4,0x591,0x5ae,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0x5ce,0x5e4,0xc4,
0xc4,0x5f7,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,
0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,
0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,0xc4,
0x615,0x635
0xc4,0xc4,0x617,0x637
};
static const uint16_t norm2_nfc_data_trieData[7892]={
static const uint16_t norm2_nfc_data_trieData[7974]={
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
@@ -238,401 +236,406 @@ static const uint16_t norm2_nfc_data_trieData[7892]={
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,0xffb8,0xffb8,0xffb8,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0xffb8,
0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,0xffb8,
0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffcc,0xffb8,0xffb8,0xffb8,0xfe36,0xfe38,0xfe3a,0xffcc,
0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffb8,0xffb8,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0xffcc,
0xffb8,0xffb8,0xffb8,0xffcc,0xffcc,0xffcc,0xffcc,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffb8,0xffb8,0xffb8,0xffb8,
0xffb8,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,
0xffb8,0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffcc,0xffb8,0xffb8,0xffb8,0xfe36,0xfe38,0xfe3a,
0xffcc,0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffb8,0xffb8,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,0x864,0x1993,1,1,1,1,1,1,0x868,0x1999,1,0x86c,
0x199f,1,1,1,1,1,1,1,0xfc0e,1,1,1,1,1,1,1,
1,1,1,1,1,1,0xfe12,1,1,1,0xffcc,0xffb8,0xffcc,0xffcc,1,1,
1,0x29ec,0x29f2,0x29f8,0x29fe,0x2a04,0x2a0a,0x2a10,0x2a16,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,0x864,0x1993,1,1,1,1,1,1,0x868,0x1999,1,
0x86c,0x199f,1,1,1,1,1,1,1,0xfc0e,1,1,1,1,1,1,
1,1,1,1,1,1,1,0xfe12,1,1,1,0xffcc,0xffb8,0xffcc,0xffcc,1,
1,1,0x29ec,0x29f2,0x29f8,0x29fe,0x2a04,0x2a0a,0x2a10,0x2a16,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1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1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,
0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,
0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,0xfe00,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,0xffcc,0xffcc,0xffcc,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
0xfe12,0xfe12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,0xffcc,0xffcc,0xffcc,1,0xfe02,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffcc,0xffcc,0xffb8,0xffb8,
0xffb8,0xffb8,0xffcc,1,0xfe02,0xfe02,0xfe02,0xfe02,0xfe02,0xfe02,0xfe02,1,1,1,1,0xffb8,
1,1,1,1,1,1,0xffcc,1,1,1,0xffcc,0xffcc,1,1,1,1,
1,1,0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,0xffd4,
0xffac,0xffb8,0xff94,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xff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d8a,0x1d94,0x1d9e,0x1da8,0x1db0,0x1db6,
0x1dbd,0x1dc3,0x1dc8,0x1dce,0x1dd4,0x1dda,0x1de0,0x1de6,0x1dec,0x1df2,0x1df9,0x1dff,0x1e05,0x1e0b,0x1e11,0x1e17,
0x1e1c,0x1e22,0x1e28,0x1e2e,0x1e35,0x1e3b,0x1e41,0x1e47,0x1e4c,0x1e52,0x1e58,0x1e5e,1,0x1e65,1,1,
1,1,0xe1a,0xe28,0x1e6a,0x1e70,0x1e78,0x1e82,0x1e8c,0x1e96,0x1ea0,0x1eaa,0x1eb4,0x1ebe,0x1ec8,0x1ed2,
0x1edc,0x1ee6,0x1ef0,0x1efa,0x1f04,0x1f0e,0x1f18,0x1f22,0x1f2c,0x1f36,0xe36,0xe40,0x1f3e,0x1f44,0x1f4a,0x1f50,
0x1f58,0x1f62,0x1f6c,0x1f76,0x1f80,0x1f8a,0x1f94,0x1f9e,0x1fa8,0x1fb2,0x1fba,0x1fc0,0x1fc6,0x1fcc,0xe4a,0xe54,
0x1fd2,0x1fd8,0x1fe0,0x1fea,0x1ff4,0x1ffe,0x2008,0x2012,0x201c,0x2026,0x2030,0x203a,0x2044,0x204e,0x2058,0x2062,
0x206c,0x2076,0x2080,0x208a,0x2094,0x209e,0x20a6,0x20ac,0x20b2,0x20b8,0x20c0,0x20ca,0x20d4,0x20de,0x20e8,0x20f2,
0x20fc,0x2106,0x2110,0x211a,0x2122,0x2128,0x212f,0x2135,0x213a,0x2140,0x2146,0x214c,1,1,1,1,
1,1,0xe5e,0xe74,0xe8c,0xe9a,0xea8,0xeb6,0xec4,0xed2,0xede,0xef4,0xf0c,0xf1a,0xf28,0xf36,
0xf44,0xf52,0xf5e,0xf6c,0x2155,0x215f,0x2169,0x2173,1,1,0xf7a,0xf88,0x217d,0x2187,0x2191,0x219b,
1,1,0xf96,0xfac,0xfc4,0xfd2,0xfe0,0xfee,0xffc,0x100a,0x1016,0x102c,0x1044,0x1052,0x1060,0x106e,
0x107c,0x108a,0x1096,0x10a8,0x21a5,0x21af,0x21b9,0x21c3,0x21cd,0x21d7,0x10ba,0x10cc,0x21e1,0x21eb,0x21f5,0x21ff,
0x2209,0x2213,0x10de,0x10ec,0x221d,0x2227,0x2231,0x223b,1,1,0x10fa,0x1108,0x2245,0x224f,0x2259,0x2263,
1,1,0x1116,0x1128,0x226d,0x2277,0x2281,0x228b,0x2295,0x229f,1,0x113a,1,0x22a9,1,0x22b3,
1,0x22bd,0x114c,0x1162,0x117a,0x1188,0x1196,0x11a4,0x11b2,0x11c0,0x11cc,0x11e2,0x11fa,0x1208,0x1216,0x1224,
0x1232,0x1240,0x124c,0x3b9e,0x22c5,0x3ba6,0x1256,0x3bae,0x22cb,0x3bb6,0x22d1,0x3bbe,0x22d7,0x3bc6,0x1260,0x3bce,
1,1,0x22de,0x22e8,0x22f7,0x2307,0x2317,0x2327,0x2337,0x2347,0x2352,0x235c,0x236b,0x237b,0x238b,0x239b,
0x23ab,0x23bb,0x23c6,0x23d0,0x23df,0x23ef,0x23ff,0x240f,0x241f,0x242f,0x243a,0x2444,0x2453,0x2463,0x2473,0x2483,
0x2493,0x24a3,0x24ae,0x24b8,0x24c7,0x24d7,0x24e7,0x24f7,0x2507,0x2517,0x2522,0x252c,0x253b,0x254b,0x255b,0x256b,
0x257b,0x258b,0x2595,0x259b,0x25a3,0x25aa,0x25b3,1,0x126a,0x25bd,0x25c5,0x25cb,0x25d1,0x3bd6,0x25d6,1,
0x2ab2,0x8f0,1,0x25dd,0x25e5,0x25ec,0x25f5,1,0x1274,0x25ff,0x2607,0x3bde,0x260d,0x3be6,0x2612,0x2619,
0x261f,0x2625,0x262b,0x2631,0x2639,0x3bf0,1,1,0x2641,0x2649,0x2651,0x2657,0x265d,0x3bfa,1,0x2663,
0x2669,0x266f,0x2675,0x267b,0x2683,0x3c04,0x268b,0x2691,0x2697,0x269f,0x26a7,0x26ad,0x26b3,0x3c0e,0x26b9,0x26bf,
0x3c16,0x2ab7,1,1,0x26c7,0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1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,0x920,0x271f,1,1,1,0x924,0x2725,1,0x928,0x272b,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,0x92c,0x2731,0x930,0x2737,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0x934,
1,1,1,0x273d,1,0x938,0x2743,0x93c,1,0x2749,0x940,0x274f,1,1,1,0x944,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,0x2755,0x948,0x275b,1,0x94c,0x950,1,1,1,1,1,1,1,0x2761,
0x2767,0x276d,0x2773,0x2779,0x954,0x958,0x277f,0x2785,0x95c,0x960,0x278b,0x2791,0x964,0x968,0x96c,0x970,
1,1,0x2797,0x279d,0x974,0x978,0x27a3,0x27a9,0x97c,0x980,0x27af,0x27b5,1,1,1,1,
1,1,1,0x984,0x988,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,0x98c,1,1,1,1,1,0x990,0x994,1,0x998,0x27bb,0x27c1,
0x27c7,0x27cd,1,1,0x99c,0x9a0,0x9a4,0x9a8,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,0x27d3,0x27d9,0x27df,0x27e5,1,1,1,1,
1,1,0x27eb,0x27f1,0x27f7,0x27fd,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0x2ac7,
0x2acb,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,0x2acf,1,1,
1,1,1,1,1,0xfe12,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,
0xffcc,0xffcc,1,1,0xffb8,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,0xfe12,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,0xffcc,0xffcc,
0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,
0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,0xffb4,0xffc8,0xffd0,0xffbc,0xffc0,0xffc0,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,0x9ac,1,
1,1,1,0x9b0,0x2803,0x9b4,0x2809,0x9b8,0x280f,0x9bc,0x2815,0x9c0,0x281b,0x9c4,0x2821,0x9c8,
0x2827,0x9cc,0x282d,0x9d0,0x2833,0x9d4,0x2839,0x9d8,0x283f,0x9dc,0x2845,1,0x9e0,0x284b,0x9e4,0x2851,
0x9e8,0x2857,1,1,1,1,1,0x9ec,0x285d,0x2863,0x9f4,0x2869,0x286f,0x9fc,0x2875,0x287b,
0xa04,0x2881,0x2887,0xa0c,0x288d,0x2893,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,0x2899,1,1,1,1,0xfc10,
0xfc10,1,1,0xa14,0x289f,1,1,1,1,1,1,1,0xa18,1,1,1,
1,0xa1c,0x28a5,0xa20,0x28ab,0xa24,0x28b1,0xa28,0x28b7,0xa2c,0x28bd,0xa30,0x28c3,0xa34,0x28c9,0xa38,
0x28cf,0xa3c,0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,0xffcc,0xffb8,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffb8,0xffcc,0xffcc,
0xffd4,0xffac,0xffb8,0xff94,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,
0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,
0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffd0,0xffc8,0xffc8,0xffb8,0xffb4,0xffcc,0xffd2,
0xffb8,0xffcc,0xffb8,0x1a6c,0x1a72,0x1a78,0x1a7e,0x1a85,0x1a8b,0x1a91,0x1a97,0x1a9f,0x1aa9,0x1ab0,0x1ab6,0x1abc,
0x1ac2,0x1ac8,0x1ace,0x1ad5,0x1adb,0x1ae0,0x1ae6,0x1aee,0x1af8,0x1b02,0x1b0c,0x1b14,0x1b1a,0x1b20,0x1b26,0x1b2f,
0x1b39,0x1b41,0x1b47,0x1b4c,0x1b52,0x1b58,0x1b5e,0x1b64,0x1b6a,0x1b70,0x1b76,0x1b7d,0x1b83,0x1b88,0x1b8e,0x1b94,
0x1b9a,0x1ba2,0x1bac,0x1bb4,0x1bba,0x1bc0,0x1bc6,0x1bcc,0x1bd2,0xdde,0xde8,0x1bda,0x1be4,0x1bec,0x1bf2,0x1bf8,
0x1bfe,0x1c04,0x1c0a,0x1c10,0x1c16,0x1c1d,0x1c23,0x1c28,0x1c2e,0x1c34,0x1c3a,0x1c40,0x1c46,0x1c4c,0x1c52,0x1c5a,
0x1c64,0x1c6e,0x1c78,0x1c82,0x1c8c,0x1c96,0x1ca0,0x1ca9,0x1caf,0x1cb5,0x1cbb,0x1cc0,0x1cc6,0xdf2,0xdfc,0x1cce,
0x1cd8,0x1ce0,0x1ce6,0x1cec,0x1cf2,0xe06,0xe10,0x1cfa,0x1d04,0x1d0e,0x1d18,0x1d22,0x1d2c,0x1d34,0x1d3a,0x1d40,
0x1d46,0x1d4c,0x1d52,0x1d58,0x1d5e,0x1d64,0x1d6a,0x1d70,0x1d76,0x1d7c,0x1d82,0x1d8a,0x1d94,0x1d9e,0x1da8,0x1db0,
0x1db6,0x1dbd,0x1dc3,0x1dc8,0x1dce,0x1dd4,0x1dda,0x1de0,0x1de6,0x1dec,0x1df2,0x1df9,0x1dff,0x1e05,0x1e0b,0x1e11,
0x1e17,0x1e1c,0x1e22,0x1e28,0x1e2e,0x1e35,0x1e3b,0x1e41,0x1e47,0x1e4c,0x1e52,0x1e58,0x1e5e,1,0x1e65,1,
1,1,1,0xe1a,0xe28,0x1e6a,0x1e70,0x1e78,0x1e82,0x1e8c,0x1e96,0x1ea0,0x1eaa,0x1eb4,0x1ebe,0x1ec8,
0x1ed2,0x1edc,0x1ee6,0x1ef0,0x1efa,0x1f04,0x1f0e,0x1f18,0x1f22,0x1f2c,0x1f36,0xe36,0xe40,0x1f3e,0x1f44,0x1f4a,
0x1f50,0x1f58,0x1f62,0x1f6c,0x1f76,0x1f80,0x1f8a,0x1f94,0x1f9e,0x1fa8,0x1fb2,0x1fba,0x1fc0,0x1fc6,0x1fcc,0xe4a,
0xe54,0x1fd2,0x1fd8,0x1fe0,0x1fea,0x1ff4,0x1ffe,0x2008,0x2012,0x201c,0x2026,0x2030,0x203a,0x2044,0x204e,0x2058,
0x2062,0x206c,0x2076,0x2080,0x208a,0x2094,0x209e,0x20a6,0x20ac,0x20b2,0x20b8,0x20c0,0x20ca,0x20d4,0x20de,0x20e8,
0x20f2,0x20fc,0x2106,0x2110,0x211a,0x2122,0x2128,0x212f,0x2135,0x213a,0x2140,0x2146,0x214c,1,1,1,
1,1,1,0xe5e,0xe74,0xe8c,0xe9a,0xea8,0xeb6,0xec4,0xed2,0xede,0xef4,0xf0c,0xf1a,0xf28,
0xf36,0xf44,0xf52,0xf5e,0xf6c,0x2155,0x215f,0x2169,0x2173,1,1,0xf7a,0xf88,0x217d,0x2187,0x2191,
0x219b,1,1,0xf96,0xfac,0xfc4,0xfd2,0xfe0,0xfee,0xffc,0x100a,0x1016,0x102c,0x1044,0x1052,0x1060,
0x106e,0x107c,0x108a,0x1096,0x10a8,0x21a5,0x21af,0x21b9,0x21c3,0x21cd,0x21d7,0x10ba,0x10cc,0x21e1,0x21eb,0x21f5,
0x21ff,0x2209,0x2213,0x10de,0x10ec,0x221d,0x2227,0x2231,0x223b,1,1,0x10fa,0x1108,0x2245,0x224f,0x2259,
0x2263,1,1,0x1116,0x1128,0x226d,0x2277,0x2281,0x228b,0x2295,0x229f,1,0x113a,1,0x22a9,1,
0x22b3,1,0x22bd,0x114c,0x1162,0x117a,0x1188,0x1196,0x11a4,0x11b2,0x11c0,0x11cc,0x11e2,0x11fa,0x1208,0x1216,
0x1224,0x1232,0x1240,0x124c,0x3b9e,0x22c5,0x3ba6,0x1256,0x3bae,0x22cb,0x3bb6,0x22d1,0x3bbe,0x22d7,0x3bc6,0x1260,
0x3bce,1,1,0x22de,0x22e8,0x22f7,0x2307,0x2317,0x2327,0x2337,0x2347,0x2352,0x235c,0x236b,0x237b,0x238b,
0x239b,0x23ab,0x23bb,0x23c6,0x23d0,0x23df,0x23ef,0x23ff,0x240f,0x241f,0x242f,0x243a,0x2444,0x2453,0x2463,0x2473,
0x2483,0x2493,0x24a3,0x24ae,0x24b8,0x24c7,0x24d7,0x24e7,0x24f7,0x2507,0x2517,0x2522,0x252c,0x253b,0x254b,0x255b,
0x256b,0x257b,0x258b,0x2595,0x259b,0x25a3,0x25aa,0x25b3,1,0x126a,0x25bd,0x25c5,0x25cb,0x25d1,0x3bd6,0x25d6,
1,0x2ab2,0x8f0,1,0x25dd,0x25e5,0x25ec,0x25f5,1,0x1274,0x25ff,0x2607,0x3bde,0x260d,0x3be6,0x2612,
0x2619,0x261f,0x2625,0x262b,0x2631,0x2639,0x3bf0,1,1,0x2641,0x2649,0x2651,0x2657,0x265d,0x3bfa,1,
0x2663,0x2669,0x266f,0x2675,0x267b,0x2683,0x3c04,0x268b,0x2691,0x2697,0x269f,0x26a7,0x26ad,0x26b3,0x3c0e,0x26b9,
0x26bf,0x3c16,0x2ab7,1,1,0x26c7,0x26ce,0x26d7,1,0x127e,0x26e1,0x26e9,0x3c1e,0x26ef,0x3c26,0x26f4,
0x2abb,0x8fc,1,0xfa09,0xfa09,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,0xffcc,1,0xffcc,0xffcc,0xffb8,1,1,0xffcc,
0xffcc,1,1,1,1,1,0xffcc,0xffcc,1,0xffcc,1,1,1,1,1,1,
1,1,1,0xffcc,0xffcc,0xfe02,0xfe02,0xffcc,0xffcc,0xffcc,0xffcc,0xfe02,0xfe02,0xfe02,0xffcc,0xffcc,
1,1,1,1,0xffcc,1,1,1,0xfe02,0xfe02,0xffcc,0xffb8,0xffcc,0xfe02,0xfe02,0xffb8,
0xffb8,0xffb8,0xffb8,0xffcc,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,0x2abe,1,1,1,0x2ac2,0x3c2e,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,0x908,1,0x90c,1,0x910,1,1,1,1,1,0x26fb,0x2701,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,0x2707,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,0x270d,0x2713,0x2719,0x914,1,0x918,1,0x91c,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,0x920,0x271f,1,1,1,0x924,0x2725,1,0x928,
0x272b,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,0x92c,0x2731,0x930,0x2737,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
0x934,1,1,1,0x273d,1,0x938,0x2743,0x93c,1,0x2749,0x940,0x274f,1,1,1,
0x944,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,0x2755,0x948,0x275b,1,0x94c,0x950,1,1,1,1,1,1,1,
0x2761,0x2767,0x276d,0x2773,0x2779,0x954,0x958,0x277f,0x2785,0x95c,0x960,0x278b,0x2791,0x964,0x968,0x96c,
0x970,1,1,0x2797,0x279d,0x974,0x978,0x27a3,0x27a9,0x97c,0x980,0x27af,0x27b5,1,1,1,
1,1,1,1,0x984,0x988,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,0x98c,1,1,1,1,1,0x990,0x994,1,0x998,0x27bb,
0x27c1,0x27c7,0x27cd,1,1,0x99c,0x9a0,0x9a4,0x9a8,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,0x27d3,0x27d9,0x27df,0x27e5,1,1,1,
1,1,1,0x27eb,0x27f1,0x27f7,0x27fd,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
0x2ac7,0x2acb,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,0x2acf,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,0xfe12,1,
1,1,1,1,1,1,1,1,0xae2,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0xffcc,
0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,
0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,0xffb4,0xffc8,0xffd0,0xffbc,0xffc0,0xffc0,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0x9ac,
1,1,1,1,0x9b0,0x2803,0x9b4,0x2809,0x9b8,0x280f,0x9bc,0x2815,0x9c0,0x281b,0x9c4,0x2821,
0x9c8,0x2827,0x9cc,0x282d,0x9d0,0x2833,0x9d4,0x2839,0x9d8,0x283f,0x9dc,0x2845,1,0x9e0,0x284b,0x9e4,
0x2851,0x9e8,0x2857,1,1,1,1,1,0x9ec,0x285d,0x2863,0x9f4,0x2869,0x286f,0x9fc,0x2875,
0x287b,0xa04,0x2881,0x2887,0xa0c,0x288d,0x2893,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,0x2899,1,1,1,1,
0xfc10,0xfc10,1,1,0xa14,0x289f,1,1,1,1,1,1,1,0xa18,1,1,
1,1,0xa1c,0x28a5,0xa20,0x28ab,0xa24,0x28b1,0xa28,0x28b7,0xa2c,0x28bd,0xa30,0x28c3,0xa34,0x28c9,
0xa38,0x28cf,0xa3c,0x28d5,0xa40,0x28db,0xa44,0x28e1,0xa48,0x28e7,1,0xa4c,0x28ed,0xa50,0x28f3,0xa54,
0x28f9,1,1,1,1,1,0xa58,0x28ff,0x2905,0xa60,0x290b,0x2911,0xa68,0x2917,0x291d,0xa70,
0x2923,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
1,1,1,1,1,1,1,1,1,0xffcc,1,0xffcc,0xffcc,0xffb8,1,1,
0xffcc,0xffcc,1,1,1,1,1,0xffcc,0xffcc,1,0xffcc,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0xfe12,
1,1,1,1,1,1,1,1,1,0xae2,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,
0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,
0x1289,0x1289,0x1289,0x1289,0xae2,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,
0x1289,0x1289,0x1289,0x1289,0x1289,0xae2,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,
0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,
0xae2,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,
0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0xae2,0x1289,0x1289,0x1289,
0x1289,0xae2,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,
0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0xae2,0x1289,0x1289,
0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,
0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,0x1289,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31,0x2e35,0x2e39,0x2e3d,
0x2e41,0x2e45,0x2e49,0x2e4d,0x2e51,0x2e55,0x2e59,0x2e5d,0x2e61,0x2e65,0x2e69,0x2e6d,0x2e71,0x2e75,0x2e79,0x2e7d,
0x2e81,0x2e85,0x2e89,0x2e8d,0x2e91,0x2e95,0x2e99,0x2e9d,0x2ea1,0x2ea5,0x2ea9,0x2ead,0x2eb1,0x2eb5,0x2eb9,0x2ebd,
0x2ec1,0x2ec5,0x2ec9,0x2ecd,0x2ed1,0x2ed5,0x2ed9,0x2edd,0x2ee1,0x2ee5,0x2ee9,0x2eed,0x2ef1,1,1,0x2ef5,
1,0x2ef9,1,1,0x2efd,0x2f01,0x2f05,0x2f09,0x2f0d,0x2f11,0x2f15,0x2f19,0x2f1d,0x2f21,1,0x2f25,
1,0x2f29,1,1,0x2f2d,0x2f31,1,1,1,0x2f35,0x2f39,0x2f3d,0x2f41,0x2f45,0x2f49,0x2f4d,
0x2f51,0x2f55,0x2f59,0x2f5d,0x2f61,0x2f65,0x2f69,0x2f6d,0x2f71,0x2f75,0x2f79,0x2f7d,0x2f81,0x2f85,0x2f89,0x2f8d,
0x2f91,0x2f95,0x2f99,0x2f9d,0x2fa1,0x2fa5,0x2fa9,0x2fad,0x2fb1,0x2fb5,0x2fb9,0x2fbd,0x2fc1,0x2fc5,0x2fc9,0x2fcd,
0x2fd1,0x2fd5,0x2fd9,0x2fdd,0x2fe1,0x2fe5,0x2d25,0x2fe9,0x2fed,0x2ff1,0x2ff5,0x2ff9,0x2ffd,0x2ffd,0x3001,0x3005,
0x3009,0x300d,0x3011,0x3015,0x3019,0x301d,0x2f2d,0x3021,0x3025,0x3029,0x302d,0x3031,0x3037,1,1,0x303b,
0x303f,0x3043,0x3047,0x304b,0x304f,0x3053,0x3057,0x2f65,0x305b,0x305f,0x3063,0x2ef5,0x3067,0x306b,0x306f,0x3073,
0x3077,0x307b,0x307f,0x3083,0x3087,0x308b,0x308f,0x3093,0x2f89,0x3097,0x2f8d,0x309b,0x309f,0x30a3,0x30a7,0x30ab,
0x2ef9,0x2b75,0x30af,0x30b3,0x30b7,0x2c8d,0x2de9,0x30bb,0x30bf,0x2fa9,0x30c3,0x2fad,0x30c7,0x30cb,0x30cf,0x2f01,
0x30d3,0x30d7,0x30db,0x30df,0x30e3,0x2f05,0x30e7,0x30eb,0x30ef,0x30f3,0x30f7,0x30fb,0x2fe5,0x30ff,0x3103,0x2d25,
0x3107,0x2ff5,0x310b,0x310f,0x3113,0x3117,0x311b,0x3009,0x311f,0x2f29,0x3123,0x300d,0x2c41,0x3127,0x3011,0x312b,
0x3019,0x312f,0x3133,0x3137,0x313b,0x313f,0x3021,0x2f19,0x3143,0x3025,0x3147,0x3029,0x314b,0x2af1,0x314f,0x3155,
0x315b,0x3161,0x3165,0x3169,0x316d,0x3173,0x3179,0x317f,0x3183,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0x3186,
0xfe34,0x318c,1,1,1,1,1,1,1,1,1,1,0x3192,0x3198,0x31a0,0x31aa,
0x31b2,0x31b8,0x31be,0x31c4,0x31ca,0x31d0,0x31d6,0x31dc,0x31e2,1,0x31e8,0x31ee,0x31f4,0x31fa,0x3200,1,
0x3206,1,0x320c,0x3212,1,0x3218,0x321e,1,0x3224,0x322a,0x3230,0x3236,0x323c,0x3242,0x3248,0x324e,
0x3254,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,0x3b97,1,
0x2ad5,0x2ad9,0x2add,0x2ae1,0x2ae5,0x2ae9,0x2aed,0x2af1,0x2af1,0x2af5,0x2af9,0x2afd,0x2b01,0x2b05,0x2b09,0x2b0d,
0x2b11,0x2b15,0x2b19,0x2b1d,0x2b21,0x2b25,0x2b29,0x2b2d,0x2b31,0x2b35,0x2b39,0x2b3d,0x2b41,0x2b45,0x2b49,0x2b4d,
0x2b51,0x2b55,0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x301d,0x2f2d,0x3021,0x3025,0x3029,0x302d,0x3031,0x3037,1,1,
0x303b,0x303f,0x3043,0x3047,0x304b,0x304f,0x3053,0x3057,0x2f65,0x305b,0x305f,0x3063,0x2ef5,0x3067,0x306b,0x306f,
0x3073,0x3077,0x307b,0x307f,0x3083,0x3087,0x308b,0x308f,0x3093,0x2f89,0x3097,0x2f8d,0x309b,0x309f,0x30a3,0x30a7,
0x30ab,0x2ef9,0x2b75,0x30af,0x30b3,0x30b7,0x2c8d,0x2de9,0x30bb,0x30bf,0x2fa9,0x30c3,0x2fad,0x30c7,0x30cb,0x30cf,
0x2f01,0x30d3,0x30d7,0x30db,0x30df,0x30e3,0x2f05,0x30e7,0x30eb,0x30ef,0x30f3,0x30f7,0x30fb,0x2fe5,0x30ff,0x3103,
0x2d25,0x3107,0x2ff5,0x310b,0x310f,0x3113,0x3117,0x311b,0x3009,0x311f,0x2f29,0x3123,0x300d,0x2c41,0x3127,0x3011,
0x312b,0x3019,0x312f,0x3133,0x3137,0x313b,0x313f,0x3021,0x2f19,0x3143,0x3025,0x3147,0x3029,0x314b,0x2af1,0x314f,
0x3155,0x315b,0x3161,0x3165,0x3169,0x316d,0x3173,0x3179,0x317f,0x3183,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,
0xffcc,0xffcc,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,0xffb8,1,0xffcc,1,1,1,1,1,1,1,1,0xffcc,0xfe02,0xffb8,
1,1,1,1,0xfe12,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,1,1,1,
1,1,1,1,1,0xffb8,0xffb8,0xffcc,0xffcc,0xffcc,0xffb8,0xffcc,0xffb8,0xffb8,0xffb8,1,
1,1,1,1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ffb8,0xffb8,1,1,1,1,1,1,1,1,1,1,0xffcc,0xffcc,
0xffcc,0xffcc,1,1,1,1,1,1,1,1,1,1,1,0x32e6,0x32f0,0x3304,
0x331c,0x3334,0x334c,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,
0xffcc,0xffcc,0xffcc,1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,0xffcc,0xffcc,1,0xffcc,0xffcc,
0xffcc,0xffcc,0xffcc,1,1,1,1,1,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,1,
1,1,1,1,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xfe0e,1,
1,1,1,1,0x335b,0x335f,0x3363,0x3367,0x336d,0x2f4d,0x3371,0x3375,0x3379,0x337d,0x2f51,0x3381,
0x3385,0x3389,0x2f55,0x338f,0x3393,0x3397,0x339b,0x33a1,0x33a5,0x33a9,0x33ad,0x33b3,0x33b7,0x33bb,0x33bf,0x303f,
0x33c3,0x33c9,0x33cd,0x33d1,0x33d5,0x33d9,0x33dd,0x33e1,0x33e5,0x3053,0x2f59,0x2f5d,0x3057,0x33e9,0x33ed,0x2c59,
0x33f1,0x2f61,0x33f5,0x33f9,0x33fd,0x3401,0x3401,0x3401,0x3405,0x340b,0x340f,0x3413,0x3417,0x341d,0x3421,0x3425,
0x3429,0x342d,0x3431,0x3435,0x3439,0x343d,0x3441,0x3445,0x3449,0x344d,0x344d,0x305f,0x3451,0x3455,0x3459,0x345d,
0x2f69,0x3461,0x3465,0x3469,0x2ebd,0x346d,0x3471,0x3475,0x3479,0x347d,0x3481,0x3485,0x3489,0x348d,0x3493,0x3497,
0x349b,0x349f,0x34a3,0x34a7,0x34ab,0x34b1,0x34b7,0x34bb,0x34bf,0x34c3,0x34c7,0x34cb,0x34cf,0x34d3,0x34d7,0x34d7,
0x34db,0x34e1,0x34e5,0x2c49,0x34e9,0x34ed,0x34f3,0x34f7,0x34fb,0x34ff,0x3503,0x3507,0x2f7d,0x350b,0x350f,0x3513,
0x3519,0x351d,0x3523,0x3527,0x352b,0x352f,0x3533,0x3537,0x353b,0x353f,0x3543,0x3547,0x354b,0x354f,0x3555,0x3559,
0x355d,0x3561,0x2b71,0x3565,0x356b,0x356f,0x356f,0x3575,0x3579,0x3579,0x357d,0x3581,0x3587,0x358d,0x3591,0x3595,
0x3599,0x359d,0x35a1,0x35a5,0x35a9,0x35ad,0x35b1,0x2f81,0x35b5,0x35bb,0x35bf,0x35c3,0x308f,0x35c3,0x35c7,0x2f89,
0x35cb,0x35cf,0x35d3,0x35d7,0x2f8d,0x2b05,0x35db,0x35df,0x35e3,0x35e7,0x35eb,0x35ef,0x35f3,0x35f9,0x35fd,0x3601,
0x3605,0x3609,0x360d,0x3613,0x3617,0x361b,0x361f,0x3623,0x3627,0x362b,0x362f,0x3633,0x2f91,0x3637,0x363b,0x3641,
0x3645,0x3649,0x364d,0x2f99,0x3651,0x3655,0x3659,0x365d,0x3661,0x3665,0x3669,0x366d,0x2b75,0x30af,0x3671,0x3675,
0x3679,0x367d,0x3683,0x3687,0x368b,0x368f,0x2f9d,0x3693,0x3699,0x369d,0x36a1,0x3161,0x36a5,0x36a9,0x36ad,0x36b1,
0x36b5,0x36bb,0x36bf,0x36c3,0x36c7,0x36cd,0x36d1,0x36d5,0x36d9,0x2c8d,0x36dd,0x36e1,0x36e7,0x36ed,0x36f3,0x36f7,
0x36fd,0x3701,0x3705,0x3709,0x370d,0x2fa1,0x2de9,0x3711,0x3715,0x3719,0x371d,0x3723,0x3727,0x372b,0x372f,0x30bf,
0x3733,0x3737,0x373d,0x3741,0x3745,0x374b,0x3751,0x3755,0x30c3,0x3759,0x375d,0x3761,0x3765,0x3769,0x376d,0x3771,
0x3777,0x377b,0x3781,0x3785,0x378b,0x30cb,0x378f,0x3793,0x3799,0x379d,0x37a1,0x37a7,0x37ad,0x37b1,0x37b5,0x37b9,
0x37bd,0x37bd,0x37c1,0x37c5,0x30d3,0x37c9,0x37cd,0x37d1,0x37d5,0x37d9,0x37df,0x37e3,0x2c55,0x37e9,0x37ef,0x37f3,
0x37f9,0x37ff,0x3805,0x3809,0x30eb,0x380d,0x3813,0x3819,0x381f,0x3825,0x3829,0x3829,0x30ef,0x3169,0x382d,0x3831,
0x3835,0x3839,0x383f,0x2bbd,0x30f7,0x3843,0x3847,0x2fcd,0x384d,0x3853,0x2f15,0x3859,0x385d,0x2fdd,0x3861,0x3865,
0x3869,0x386f,0x386f,0x3875,0x3879,0x387d,0x3883,0x3887,0x388b,0x388f,0x3895,0x3899,0x389d,0x38a1,0x38a5,0x38a9,
0x38af,0x38b3,0x38b7,0x38bb,0x38bf,0x38c3,0x38c7,0x38cd,0x38d3,0x38d7,0x38dd,0x38e1,0x38e7,0x38eb,0x2ff5,0x38ef,
0x38f5,0x38fb,0x38ff,0x3905,0x3909,0x390f,0x3913,0x3917,0x391b,0x391f,0x3923,0x3927,0x392d,0x3933,0x3939,0x3575,
0x393f,0x3943,0x3947,0x394b,0x394f,0x3953,0x3957,0x395b,0x395f,0x3963,0x3967,0x396b,0x2c9d,0x3971,0x3975,0x3979,
0x397d,0x3981,0x3985,0x3001,0x3989,0x398d,0x3991,0x3995,0x3999,0x399f,0x39a5,0x39ab,0x39af,0x39b3,0x39b7,0x39bb,
0x39c1,0x39c5,0x39cb,0x39cf,0x39d3,0x39d9,0x39df,0x39e3,0x2ba9,0x39e7,0x39eb,0x39ef,0x39f3,0x39f7,0x39fb,0x3113,
0x39ff,0x3a03,0x3a07,0x3a0b,0x3a0f,0x3a13,0x3a17,0x3a1b,0x3a1f,0x3a23,0x3a29,0x3a2d,0x3a31,0x3a35,0x3a39,0x3a3d,
0x3a43,0x3a49,0x3a4d,0x3a51,0x3127,0x312b,0x3a55,0x3a59,0x3a5f,0x3a63,0x3a67,0x3a6b,0x3a6f,0x3a75,0x3a7b,0x3a7f,
0x3a83,0x3a87,0x3a8d,0x312f,0x3a91,0x3a97,0x3a9d,0x3aa1,0x3aa5,0x3aa9,0x3aaf,0x3ab3,0x3ab7,0x3abb,0x3abf,0x3ac3,
0x3ac7,0x3acb,0x3ad1,0x3ad5,0x3ad9,0x3add,0x3ae3,0x3ae7,0x3aeb,0x3aef,0x3af3,0x3af9,0x3aff,0x3b03,0x3b07,0x3b0b,
0x3b11,0x3b15,0x3147,0x3147,0x3b1b,0x3b1f,0x3b25,0x3b29,0x3b2d,0x3b31,0x3b35,0x3b39,0x3b3d,0x3b41,0x314b,0x3b47,
0x3b4b,0x3b4f,0x3b53,0x3b57,0x3b5b,0x3b61,0x3b65,0x3b6b,0x3b71,0x3b77,0x3b7b,0x3b7f,0x3b83,0x3b87,0x3b8b,0x3b8f,
0x3b93,0x3b97,1,1
0x3186,0xfe34,0x318c,1,1,1,1,1,1,1,1,1,1,0x3192,0x3198,0x31a0,
0x31aa,0x31b2,0x31b8,0x31be,0x31c4,0x31ca,0x31d0,0x31d6,0x31dc,0x31e2,1,0x31e8,0x31ee,0x31f4,0x31fa,0x3200,
1,0x3206,1,0x320c,0x3212,1,0x3218,0x321e,1,0x3224,0x322a,0x3230,0x3236,0x323c,0x3242,0x3248,
0x324e,0x3254,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,
0xffb8,0xffcc,0xffcc,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,0xffb8,1,0xffcc,1,1,1,1,1,1,1,1,0xffcc,0xfe02,
0xffb8,1,1,1,1,0xfe12,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,1,1,
1,1,1,1,1,1,0xffb8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x32c0,0x32d8,0xffb0,0xffb0,0xfe02,0xfe02,0xfe02,1,1,1,0xffc4,0xffb0,0xffb0,0xffb0,1,
1,1,1,1,1,1,1,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,1,1,0xffcc,0xffcc,
0xffcc,0xffcc,0xffcc,0xffb8,0xffb8,1,1,1,1,1,1,1,1,1,1,0xffcc,
0xffcc,0xffcc,0xffcc,1,1,1,1,1,1,1,1,1,1,1,0x32e6,0x32f0,
0x3304,0x331c,0x3334,0x334c,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,
0xffcc,0xffcc,0xffcc,0xffcc,1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,1,0xffcc,0xffcc,1,0xffcc,
0xffcc,0xffcc,0xffcc,0xffcc,1,1,1,1,1,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,0xffb8,
1,1,1,1,1,1,1,1,1,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xffcc,0xfe0e,
1,1,1,1,1,0x335b,0x335f,0x3363,0x3367,0x336d,0x2f4d,0x3371,0x3375,0x3379,0x337d,0x2f51,
0x3381,0x3385,0x3389,0x2f55,0x338f,0x3393,0x3397,0x339b,0x33a1,0x33a5,0x33a9,0x33ad,0x33b3,0x33b7,0x33bb,0x33bf,
0x303f,0x33c3,0x33c9,0x33cd,0x33d1,0x33d5,0x33d9,0x33dd,0x33e1,0x33e5,0x3053,0x2f59,0x2f5d,0x3057,0x33e9,0x33ed,
0x2c59,0x33f1,0x2f61,0x33f5,0x33f9,0x33fd,0x3401,0x3401,0x3401,0x3405,0x340b,0x340f,0x3413,0x3417,0x341d,0x3421,
0x3425,0x3429,0x342d,0x3431,0x3435,0x3439,0x343d,0x3441,0x3445,0x3449,0x344d,0x344d,0x305f,0x3451,0x3455,0x3459,
0x345d,0x2f69,0x3461,0x3465,0x3469,0x2ebd,0x346d,0x3471,0x3475,0x3479,0x347d,0x3481,0x3485,0x3489,0x348d,0x3493,
0x3497,0x349b,0x349f,0x34a3,0x34a7,0x34ab,0x34b1,0x34b7,0x34bb,0x34bf,0x34c3,0x34c7,0x34cb,0x34cf,0x34d3,0x34d7,
0x34d7,0x34db,0x34e1,0x34e5,0x2c49,0x34e9,0x34ed,0x34f3,0x34f7,0x34fb,0x34ff,0x3503,0x3507,0x2f7d,0x350b,0x350f,
0x3513,0x3519,0x351d,0x3523,0x3527,0x352b,0x352f,0x3533,0x3537,0x353b,0x353f,0x3543,0x3547,0x354b,0x354f,0x3555,
0x3559,0x355d,0x3561,0x2b71,0x3565,0x356b,0x356f,0x356f,0x3575,0x3579,0x3579,0x357d,0x3581,0x3587,0x358d,0x3591,
0x3595,0x3599,0x359d,0x35a1,0x35a5,0x35a9,0x35ad,0x35b1,0x2f81,0x35b5,0x35bb,0x35bf,0x35c3,0x308f,0x35c3,0x35c7,
0x2f89,0x35cb,0x35cf,0x35d3,0x35d7,0x2f8d,0x2b05,0x35db,0x35df,0x35e3,0x35e7,0x35eb,0x35ef,0x35f3,0x35f9,0x35fd,
0x3601,0x3605,0x3609,0x360d,0x3613,0x3617,0x361b,0x361f,0x3623,0x3627,0x362b,0x362f,0x3633,0x2f91,0x3637,0x363b,
0x3641,0x3645,0x3649,0x364d,0x2f99,0x3651,0x3655,0x3659,0x365d,0x3661,0x3665,0x3669,0x366d,0x2b75,0x30af,0x3671,
0x3675,0x3679,0x367d,0x3683,0x3687,0x368b,0x368f,0x2f9d,0x3693,0x3699,0x369d,0x36a1,0x3161,0x36a5,0x36a9,0x36ad,
0x36b1,0x36b5,0x36bb,0x36bf,0x36c3,0x36c7,0x36cd,0x36d1,0x36d5,0x36d9,0x2c8d,0x36dd,0x36e1,0x36e7,0x36ed,0x36f3,
0x36f7,0x36fd,0x3701,0x3705,0x3709,0x370d,0x2fa1,0x2de9,0x3711,0x3715,0x3719,0x371d,0x3723,0x3727,0x372b,0x372f,
0x30bf,0x3733,0x3737,0x373d,0x3741,0x3745,0x374b,0x3751,0x3755,0x30c3,0x3759,0x375d,0x3761,0x3765,0x3769,0x376d,
0x3771,0x3777,0x377b,0x3781,0x3785,0x378b,0x30cb,0x378f,0x3793,0x3799,0x379d,0x37a1,0x37a7,0x37ad,0x37b1,0x37b5,
0x37b9,0x37bd,0x37bd,0x37c1,0x37c5,0x30d3,0x37c9,0x37cd,0x37d1,0x37d5,0x37d9,0x37df,0x37e3,0x2c55,0x37e9,0x37ef,
0x37f3,0x37f9,0x37ff,0x3805,0x3809,0x30eb,0x380d,0x3813,0x3819,0x381f,0x3825,0x3829,0x3829,0x30ef,0x3169,0x382d,
0x3831,0x3835,0x3839,0x383f,0x2bbd,0x30f7,0x3843,0x3847,0x2fcd,0x384d,0x3853,0x2f15,0x3859,0x385d,0x2fdd,0x3861,
0x3865,0x3869,0x386f,0x386f,0x3875,0x3879,0x387d,0x3883,0x3887,0x388b,0x388f,0x3895,0x3899,0x389d,0x38a1,0x38a5,
0x38a9,0x38af,0x38b3,0x38b7,0x38bb,0x38bf,0x38c3,0x38c7,0x38cd,0x38d3,0x38d7,0x38dd,0x38e1,0x38e7,0x38eb,0x2ff5,
0x38ef,0x38f5,0x38fb,0x38ff,0x3905,0x3909,0x390f,0x3913,0x3917,0x391b,0x391f,0x3923,0x3927,0x392d,0x3933,0x3939,
0x3575,0x393f,0x3943,0x3947,0x394b,0x394f,0x3953,0x3957,0x395b,0x395f,0x3963,0x3967,0x396b,0x2c9d,0x3971,0x3975,
0x3979,0x397d,0x3981,0x3985,0x3001,0x3989,0x398d,0x3991,0x3995,0x3999,0x399f,0x39a5,0x39ab,0x39af,0x39b3,0x39b7,
0x39bb,0x39c1,0x39c5,0x39cb,0x39cf,0x39d3,0x39d9,0x39df,0x39e3,0x2ba9,0x39e7,0x39eb,0x39ef,0x39f3,0x39f7,0x39fb,
0x3113,0x39ff,0x3a03,0x3a07,0x3a0b,0x3a0f,0x3a13,0x3a17,0x3a1b,0x3a1f,0x3a23,0x3a29,0x3a2d,0x3a31,0x3a35,0x3a39,
0x3a3d,0x3a43,0x3a49,0x3a4d,0x3a51,0x3127,0x312b,0x3a55,0x3a59,0x3a5f,0x3a63,0x3a67,0x3a6b,0x3a6f,0x3a75,0x3a7b,
0x3a7f,0x3a83,0x3a87,0x3a8d,0x312f,0x3a91,0x3a97,0x3a9d,0x3aa1,0x3aa5,0x3aa9,0x3aaf,0x3ab3,0x3ab7,0x3abb,0x3abf,
0x3ac3,0x3ac7,0x3acb,0x3ad1,0x3ad5,0x3ad9,0x3add,0x3ae3,0x3ae7,0x3aeb,0x3aef,0x3af3,0x3af9,0x3aff,0x3b03,0x3b07,
0x3b0b,0x3b11,0x3b15,0x3147,0x3147,0x3b1b,0x3b1f,0x3b25,0x3b29,0x3b2d,0x3b31,0x3b35,0x3b39,0x3b3d,0x3b41,0x314b,
0x3b47,0x3b4b,0x3b4f,0x3b53,0x3b57,0x3b5b,0x3b61,0x3b65,0x3b6b,0x3b71,0x3b77,0x3b7b,0x3b7f,0x3b83,0x3b87,0x3b8b,
0x3b8f,0x3b93,0x3b97,1,1,1
};
static const UCPTrie norm2_nfc_data_trie={
norm2_nfc_data_trieIndex,
{ norm2_nfc_data_trieData },
1746, 7892,
1748, 7974,
0x2fc00, 0x30,
0, 0,
0, 0,
@@ -1128,7 +1131,7 @@ static const uint16_t norm2_nfc_data_extraData[7732]={
};
static const uint8_t norm2_nfc_data_smallFCD[256]={
0xc0,0xef,3,0x7f,0xdf,0x70,0xcf,0x87,0xc7,0xe6,0x66,0x46,0x64,0x46,0x66,0x5b,
0xc0,0xef,3,0x7f,0xdf,0x70,0xcf,0x87,0xd7,0xe6,0x66,0x46,0x66,0x46,0x66,0x5b,
0x12,0,0,4,0,0,0,0x43,0x20,2,0x69,0xae,0xc2,0xc0,0xff,0xff,
0xc0,0x72,0xbf,0,0,0,0,0,0,0,0x40,0,0x80,0x88,0,0,
0xfe,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2 -2
View File
@@ -293,11 +293,11 @@ U_CDECL_BEGIN
static UBool U_CALLCONV uprv_normalizer2_cleanup() {
delete noopSingleton;
noopSingleton = NULL;
noopInitOnce.reset();
noopInitOnce.reset();
#if NORM2_HARDCODE_NFC_DATA
delete nfcSingleton;
nfcSingleton = NULL;
nfcInitOnce.reset();
nfcInitOnce.reset();
#endif
return TRUE;
}
+2 -2
View File
@@ -86,7 +86,7 @@ UChar32 codePointFromValidUTF8(const uint8_t *cpStart, const uint8_t *cpLimit) {
case 4:
return ((c&7)<<18) | ((cpStart[1]&0x3f)<<12) | ((cpStart[2]&0x3f)<<6) | (cpStart[3]&0x3f);
default:
UPRV_UNREACHABLE; // Should not occur.
UPRV_UNREACHABLE_EXIT; // Should not occur.
}
}
@@ -2504,7 +2504,7 @@ void CanonIterData::addToStartSet(UChar32 origin, UChar32 decompLead, UErrorCode
UChar32 firstOrigin=(UChar32)(canonValue&CANON_VALUE_MASK);
canonValue=(canonValue&~CANON_VALUE_MASK)|CANON_HAS_SET|(uint32_t)canonStartSets.size();
umutablecptrie_set(mutableTrie, decompLead, canonValue, &errorCode);
canonStartSets.addElement(set, errorCode);
canonStartSets.addElementX(set, errorCode);
if(firstOrigin!=0) {
set->add(firstOrigin);
}
+2 -2
View File
@@ -241,7 +241,7 @@ private:
* Low-level implementation of the Unicode Normalization Algorithm.
* For the data structure and details see the documentation at the end of
* this normalizer2impl.h and in the design doc at
* http://site.icu-project.org/design/normalization/custom
* https://icu.unicode.org/design/normalization/custom
*/
class U_COMMON_API Normalizer2Impl : public UObject {
public:
@@ -806,7 +806,7 @@ unorm_getFCD16(UChar32 c);
* Constants are defined as enum values of the Normalizer2Impl class.
*
* Many details of the data structures are described in the design doc
* which is at http://site.icu-project.org/design/normalization/custom
* which is at https://icu.unicode.org/design/normalization/custom
*
* int32_t indexes[indexesLength]; -- indexesLength=indexes[IX_NORM_TRIE_OFFSET]/4;
*
+17 -17
View File
@@ -2,7 +2,7 @@
// License & terms of use: http://www.unicode.org/copyright.html
/*
*************************************************************************
* COPYRIGHT:
* COPYRIGHT:
* Copyright (c) 1996-2012, International Business Machines Corporation and
* others. All Rights Reserved.
*************************************************************************
@@ -94,7 +94,7 @@ Normalizer::~Normalizer()
delete text;
}
Normalizer*
Normalizer*
Normalizer::clone() const
{
return new Normalizer(*this);
@@ -107,8 +107,8 @@ int32_t Normalizer::hashCode() const
{
return text->hashCode() + fUMode + fOptions + buffer.hashCode() + bufferPos + currentIndex + nextIndex;
}
UBool Normalizer::operator==(const Normalizer& that) const
bool Normalizer::operator==(const Normalizer& that) const
{
return
this==&that ||
@@ -125,9 +125,9 @@ UBool Normalizer::operator==(const Normalizer& that) const
//-------------------------------------------------------------------------
void U_EXPORT2
Normalizer::normalize(const UnicodeString& source,
Normalizer::normalize(const UnicodeString& source,
UNormalizationMode mode, int32_t options,
UnicodeString& result,
UnicodeString& result,
UErrorCode &status) {
if(source.isBogus() || U_FAILURE(status)) {
result.setToBogus();
@@ -160,17 +160,17 @@ Normalizer::normalize(const UnicodeString& source,
}
void U_EXPORT2
Normalizer::compose(const UnicodeString& source,
Normalizer::compose(const UnicodeString& source,
UBool compat, int32_t options,
UnicodeString& result,
UnicodeString& result,
UErrorCode &status) {
normalize(source, compat ? UNORM_NFKC : UNORM_NFC, options, result, status);
}
void U_EXPORT2
Normalizer::decompose(const UnicodeString& source,
Normalizer::decompose(const UnicodeString& source,
UBool compat, int32_t options,
UnicodeString& result,
UnicodeString& result,
UErrorCode &status) {
normalize(source, compat ? UNORM_NFKD : UNORM_NFD, options, result, status);
}
@@ -368,7 +368,7 @@ int32_t Normalizer::endIndex() const {
//-------------------------------------------------------------------------
void
Normalizer::setMode(UNormalizationMode newMode)
Normalizer::setMode(UNormalizationMode newMode)
{
fUMode = newMode;
init();
@@ -381,8 +381,8 @@ Normalizer::getUMode() const
}
void
Normalizer::setOption(int32_t option,
UBool value)
Normalizer::setOption(int32_t option,
UBool value)
{
if (value) {
fOptions |= option;
@@ -403,7 +403,7 @@ Normalizer::getOption(int32_t option) const
* The iteration position is set to the beginning of the input text.
*/
void
Normalizer::setText(const UnicodeString& newText,
Normalizer::setText(const UnicodeString& newText,
UErrorCode &status)
{
if (U_FAILURE(status)) {
@@ -424,8 +424,8 @@ Normalizer::setText(const UnicodeString& newText,
* The iteration position is set to the beginning of the string.
*/
void
Normalizer::setText(const CharacterIterator& newText,
UErrorCode &status)
Normalizer::setText(const CharacterIterator& newText,
UErrorCode &status)
{
if (U_FAILURE(status)) {
return;
@@ -463,7 +463,7 @@ Normalizer::setText(ConstChar16Ptr newText,
* @param result Receives a copy of the text under iteration.
*/
void
Normalizer::getText(UnicodeString& result)
Normalizer::getText(UnicodeString& result)
{
text->getText(result);
}
+2 -1
View File
@@ -29,7 +29,7 @@ PluralMapBase::Category
PluralMapBase::toCategory(const UnicodeString &pluralForm) {
CharString cCategory;
UErrorCode status = U_ZERO_ERROR;
cCategory.appendInvariantChars(pluralForm, status);
cCategory.appendInvariantChars(pluralForm, status);
return U_FAILURE(status) ? NONE : toCategory(cCategory.data());
}
@@ -41,3 +41,4 @@ const char *PluralMapBase::getCategoryName(Category c) {
U_NAMESPACE_END
+2 -2
View File
@@ -46,7 +46,7 @@ public:
/**
* Converts a category name such as "zero", "one", "two", "few", "many"
* or "other" to a category enum. Returns NONE for urecongized
* or "other" to a category enum. Returns NONE for unrecognized
* category name.
*/
static Category toCategory(const UnicodeString &categoryName);
@@ -62,7 +62,7 @@ public:
* A Map of plural categories to values. It maintains ownership of the
* values.
*
* Type T is the value type. T must provide the followng:
* Type T is the value type. T must provide the following:
* 1) Default constructor
* 2) Copy constructor
* 3) Assignment operator
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -468,7 +468,7 @@ u_strFromPunycode(const UChar *src, int32_t srcLength,
}
i+=digit*w;
/** RAM: comment out the old code for conformance with draft-ietf-idn-punycode-03.txt
/** RAM: comment out the old code for conformance with draft-ietf-idn-punycode-03.txt
t=k-bias;
if(t<TMIN) {
t=TMIN;
+10 -1
View File
@@ -727,8 +727,10 @@ static char *gTimeZoneBufferPtr = NULL;
#if !U_PLATFORM_USES_ONLY_WIN32_API
#define isNonDigit(ch) (ch < '0' || '9' < ch)
#define isDigit(ch) ('0' <= ch && ch <= '9')
static UBool isValidOlsonID(const char *id) {
int32_t idx = 0;
int32_t idxMax = 0;
/* Determine if this is something like Iceland (Olson ID)
or AST4ADT (non-Olson ID) */
@@ -736,6 +738,13 @@ static UBool isValidOlsonID(const char *id) {
idx++;
}
/* Allow at maximum 2 numbers at the end of the id to support zone id's
like GMT+11. */
idxMax = idx + 2;
while (id[idx] && isDigit(id[idx]) && idx < idxMax) {
idx++;
}
/* If we went through the whole string, then it might be okay.
The timezone is sometimes set to "CST-7CDT", "CST6CDT5,J129,J131/19:30",
"GRNLNDST3GRNLNDDT" or similar, so we cannot use it.
@@ -918,7 +927,7 @@ static UBool compareBinaryFiles(const char* defaultTZFileName, const char* TZFil
if (sizeFile != tzInfo->defaultTZFileSize) {
result = FALSE;
} else {
/* Store the data from the files in seperate buffers and
/* Store the data from the files in separate buffers and
* compare each byte to determine equality.
*/
if (tzInfo->defaultTZBuffer == NULL) {
+12 -11
View File
@@ -262,7 +262,7 @@ RuleBasedBreakIterator::operator=(const RuleBasedBreakIterator& that) {
fCharIter = &fSCharIter;
if (that.fCharIter != NULL && that.fCharIter != &that.fSCharIter) {
// This is a little bit tricky - it will intially appear that
// This is a little bit tricky - it will initially appear that
// this->fCharIter is adopted, even if that->fCharIter was
// not adopted. That's ok.
fCharIter = that.fCharIter->clone();
@@ -366,16 +366,16 @@ RuleBasedBreakIterator::clone() const {
}
/**
* Equality operator. Returns TRUE if both BreakIterators are of the
* Equality operator. Returns true if both BreakIterators are of the
* same class, have the same behavior, and iterate over the same text.
*/
UBool
bool
RuleBasedBreakIterator::operator==(const BreakIterator& that) const {
if (typeid(*this) != typeid(that)) {
return FALSE;
return false;
}
if (this == &that) {
return TRUE;
return true;
}
// The base class BreakIterator carries no state that participates in equality,
@@ -388,21 +388,21 @@ RuleBasedBreakIterator::operator==(const BreakIterator& that) const {
// The two break iterators are operating on different text,
// or have a different iteration position.
// Note that fText's position is always the same as the break iterator's position.
return FALSE;
return false;
}
if (!(fPosition == that2.fPosition &&
fRuleStatusIndex == that2.fRuleStatusIndex &&
fDone == that2.fDone)) {
return FALSE;
return false;
}
if (that2.fData == fData ||
(fData != NULL && that2.fData != NULL && *that2.fData == *fData)) {
// The two break iterators are using the same rules.
return TRUE;
return true;
}
return FALSE;
return false;
}
/**
@@ -671,7 +671,7 @@ int32_t RuleBasedBreakIterator::preceding(int32_t offset) {
}
/**
* Returns true if the specfied position is a boundary position. As a side
* Returns true if the specified position is a boundary position. As a side
* effect, leaves the iterator pointing to the first boundary position at
* or after "offset".
*
@@ -1037,7 +1037,7 @@ int32_t RuleBasedBreakIterator::handleSafePrevious(int32_t fromPosition) {
if (state == STOP_STATE) {
// This is the normal exit from the lookup state machine.
// Transistion to state zero means we have found a safe point.
// Transition to state zero means we have found a safe point.
break;
}
}
@@ -1260,6 +1260,7 @@ RuleBasedBreakIterator::getLanguageBreakEngine(UChar32 c) {
// first.
fLanguageBreakEngines->insertElementAt(fUnhandledBreakEngine, 0, status);
// If we can't insert it, or creation failed, get rid of it
U_ASSERT(!fLanguageBreakEngines->hasDeleter());
if (U_FAILURE(status)) {
delete fUnhandledBreakEngine;
fUnhandledBreakEngine = 0;
+5 -5
View File
@@ -74,7 +74,7 @@ UBool RuleBasedBreakIterator::DictionaryCache::following(int32_t fromPos, int32_
return TRUE;
}
}
UPRV_UNREACHABLE;
UPRV_UNREACHABLE_EXIT;
}
@@ -114,7 +114,7 @@ UBool RuleBasedBreakIterator::DictionaryCache::preceding(int32_t fromPos, int32_
return TRUE;
}
}
UPRV_UNREACHABLE;
UPRV_UNREACHABLE_EXIT;
}
void RuleBasedBreakIterator::DictionaryCache::populateDictionary(int32_t startPos, int32_t endPos,
@@ -163,7 +163,7 @@ void RuleBasedBreakIterator::DictionaryCache::populateDictionary(int32_t startPo
// Ask the language object if there are any breaks. It will add them to the cache and
// leave the text pointer on the other side of its range, ready to search for the next one.
if (lbe != NULL) {
foundBreakCount += lbe->findBreaks(text, rangeStart, rangeEnd, fBreaks);
foundBreakCount += lbe->findBreaks(text, rangeStart, rangeEnd, fBreaks, status);
}
// Reload the loop variables for the next go-round
@@ -201,7 +201,7 @@ void RuleBasedBreakIterator::DictionaryCache::populateDictionary(int32_t startPo
/*
* BreakCache implemetation
* BreakCache implementation
*/
RuleBasedBreakIterator::BreakCache::BreakCache(RuleBasedBreakIterator *bi, UErrorCode &status) :
@@ -386,7 +386,7 @@ UBool RuleBasedBreakIterator::BreakCache::populateNear(int32_t position, UErrorC
// Add following position(s) to the cache.
while (fBoundaries[fEndBufIdx] < position) {
if (!populateFollowing()) {
UPRV_UNREACHABLE;
UPRV_UNREACHABLE_EXIT;
}
}
fBufIdx = fEndBufIdx; // Set iterator position to the end of the buffer.
+2 -2
View File
@@ -30,7 +30,7 @@ U_NAMESPACE_BEGIN
*
* The boundaries are stored in a simple ArrayList (vector), with the
* assumption that they will be accessed sequentially.
*/
*/
class RuleBasedBreakIterator::DictionaryCache: public UMemory {
public:
DictionaryCache(RuleBasedBreakIterator *bi, UErrorCode &status);
@@ -55,7 +55,7 @@ class RuleBasedBreakIterator::DictionaryCache: public UMemory {
RuleBasedBreakIterator *fBI;
UVector32 fBreaks; // A vector containing the boundaries.
int32_t fPositionInCache; // Index in fBreaks of last boundary returned by following()
// or preceding(). Optimizes sequential access.
+17 -14
View File
@@ -7,7 +7,7 @@
# and others. All rights reserved.
#**************************************************************************
#
# rbbicst Compile the RBBI rule paser state table data into initialized C data.
# rbbicst Compile the RBBI rule parser state table data into initialized C data.
# Usage:
# cd icu/source/common
# perl rbbicst.pl < rbbirpt.txt > rbbirpt.h
@@ -264,7 +264,7 @@ if ($javaOutput) {
$n++;
}
print " \n";
#
# Emit constants for char class names
#
@@ -272,8 +272,8 @@ if ($javaOutput) {
print " static final short kRuleSet_$setName = $charClasses{$setName};\n";
}
print "\n\n";
print " static class RBBIRuleTableElement { \n";
print " short fAction; \n";
print " short fCharClass; \n";
@@ -291,20 +291,20 @@ if ($javaOutput) {
print " } \n";
print " }; \n";
print " \n";
print " static RBBIRuleTableElement[] gRuleParseStateTable = { \n ";
print " new RBBIRuleTableElement(doNOP, 0, 0,0, true, null ) // 0 \n"; #output the unused state 0.
print " new RBBIRuleTableElement(doNOP, 0, 0,0, true, null ) // 0 \n"; #output the unused state 0.
for ($state=1; $state < $num_states; $state++) {
print " , new RBBIRuleTableElement($state_func_name[$state],";
if ($state_literal_chars[$state] ne "") {
$c = $state_literal_chars[$state];
print("'$c', ");
print("'$c', ");
}else {
print " $charClasses{$state_char_class[$state]},";
}
print " $states{$state_dest_state[$state]},";
# The push-state field is optional. If omitted, fill field with a zero, which flags
# the state machine that there is no push state.
if ($state_push_state[$state] eq "") {
@@ -313,14 +313,14 @@ if ($javaOutput) {
print " $states{$state_push_state[$state]},";
}
print " $state_flag[$state], ";
# if this is the first row of the table for this state, put out the state name.
if ($stateNames[$state] ne "") {
print " \"$stateNames[$state]\") ";
} else {
print " null ) ";
}
# Put out a comment showing the number (index) of this state row,
print " // $state ";
print "\n";
@@ -328,7 +328,7 @@ if ($javaOutput) {
print " };\n";
print "}; \n";
}
else
{
@@ -357,7 +357,7 @@ else
print "U_NAMESPACE_BEGIN\n";
#
# Emit the constants for indicies of Unicode Sets
# Emit the constants for indices of Unicode Sets
# Define one constant for each of the character classes encountered.
# At the same time, store the index corresponding to the set name back into hash.
#
@@ -382,7 +382,7 @@ else
print " rbbiLastAction};\n\n";
#
# Emit the struct definition for transtion table elements.
# Emit the struct definition for transition table elements.
#
print "//-------------------------------------------------------------------------------\n";
print "//\n";
@@ -454,3 +454,6 @@ else
print "U_NAMESPACE_END\n";
print "#endif\n";
}
+7 -7
View File
@@ -170,17 +170,17 @@ RBBIDataWrapper::~RBBIDataWrapper() {
// should still be ==.
//
//-----------------------------------------------------------------------------
UBool RBBIDataWrapper::operator ==(const RBBIDataWrapper &other) const {
bool RBBIDataWrapper::operator ==(const RBBIDataWrapper &other) const {
if (fHeader == other.fHeader) {
return TRUE;
return true;
}
if (fHeader->fLength != other.fHeader->fLength) {
return FALSE;
return false;
}
if (uprv_memcmp(fHeader, other.fHeader, fHeader->fLength) == 0) {
return TRUE;
return true;
}
return FALSE;
return false;
}
int32_t RBBIDataWrapper::hashCode() {
@@ -283,7 +283,7 @@ void RBBIDataWrapper::printData() {
printTable("Forward State Transition Table", fForwardTable);
printTable("Reverse State Transition Table", fReverseTable);
RBBIDebugPrintf("\nOrignal Rules source:\n");
RBBIDebugPrintf("\nOriginal Rules source:\n");
for (int32_t c=0; fRuleSource[c] != 0; c++) {
RBBIDebugPrintf("%c", fRuleSource[c]);
}
@@ -345,7 +345,7 @@ ubrk_swap(const UDataSwapper *ds, const void *inData, int32_t length, void *outD
//
const uint8_t *inBytes =(const uint8_t *)inData+headerSize;
RBBIDataHeader *rbbiDH = (RBBIDataHeader *)inBytes;
if (ds->readUInt32(rbbiDH->fMagic) != 0xb1a0 ||
if (ds->readUInt32(rbbiDH->fMagic) != 0xb1a0 ||
!RBBIDataWrapper::isDataVersionAcceptable(rbbiDH->fFormatVersion) ||
ds->readUInt32(rbbiDH->fLength) < sizeof(RBBIDataHeader)) {
udata_printError(ds, "ubrk_swap(): RBBI Data header is invalid.\n");
+4 -4
View File
@@ -61,8 +61,8 @@ U_NAMESPACE_BEGIN
// The current RBBI data format version.
static const uint8_t RBBI_DATA_FORMAT_VERSION[] = {6, 0, 0, 0};
/*
* The following structs map exactly onto the raw data from ICU common data file.
/*
* The following structs map exactly onto the raw data from ICU common data file.
*/
struct RBBIDataHeader {
uint32_t fMagic; /* == 0xbla0 */
@@ -171,7 +171,7 @@ public:
void init(const RBBIDataHeader *data, UErrorCode &status);
RBBIDataWrapper *addReference();
void removeReference();
UBool operator ==(const RBBIDataWrapper &other) const;
bool operator ==(const RBBIDataWrapper &other) const;
int32_t hashCode();
const UnicodeString &getRuleSourceString() const;
void printData();
@@ -184,7 +184,7 @@ public:
const RBBIStateTable *fForwardTable;
const RBBIStateTable *fReverseTable;
const char *fRuleSource;
const int32_t *fRuleStatusTable;
const int32_t *fRuleStatusTable;
/* number of int32_t values in the rule status table. Used to sanity check indexing */
int32_t fStatusMaxIdx;
+4 -3
View File
@@ -266,6 +266,7 @@ void RBBINode::findNodes(UVector *dest, RBBINode::NodeType kind, UErrorCode &s
if (U_FAILURE(status)) {
return;
}
U_ASSERT(!dest->hasDeleter());
if (fType == kind) {
dest->addElement(this, status);
}
@@ -343,7 +344,7 @@ U_CFUNC void RBBI_DEBUG_printUnicodeString(const UnicodeString &s, int minWidth)
void RBBINode::printNodeHeader() {
RBBIDebugPrintf(" Address serial type LeftChild RightChild Parent position value\n");
}
void RBBINode::printTree(const RBBINode *node, UBool printHeading) {
if (printHeading) {
printNodeHeader();
@@ -351,12 +352,12 @@ void RBBINode::printTree(const RBBINode *node, UBool printHeading) {
printNode(node);
if (node != NULL) {
// Only dump the definition under a variable reference if asked to.
// Unconditinally dump children of all other node types.
// Unconditionally dump children of all other node types.
if (node->fType != varRef) {
if (node->fLeftChild != NULL) {
printTree(node->fLeftChild, FALSE);
}
if (node->fRightChild != NULL) {
printTree(node->fRightChild, FALSE);
}
+8 -7
View File
@@ -46,21 +46,21 @@ class RBBINode : public UMemory {
opLParen
};
enum OpPrecedence {
enum OpPrecedence {
precZero,
precStart,
precLParen,
precOpOr,
precOpCat
};
NodeType fType;
RBBINode *fParent;
RBBINode *fLeftChild;
RBBINode *fRightChild;
UnicodeSet *fInputSet; // For uset nodes only.
OpPrecedence fPrecedence; // For binary ops only.
UnicodeString fText; // Text corresponding to this node.
// May be lazily evaluated when (if) needed
// for some node types.
@@ -71,7 +71,7 @@ class RBBINode : public UMemory {
int fLastPos; // Last position in the rule source string
// of any text associated with this node.
// If there's a right child, this will be the same
// as that child's last postion.
// as that child's last position.
UBool fNullable; // See Aho.
int32_t fVal; // For leafChar nodes, the value.
@@ -94,7 +94,7 @@ class RBBINode : public UMemory {
RBBINode(NodeType t);
RBBINode(const RBBINode &other);
~RBBINode();
RBBINode *cloneTree();
RBBINode *flattenVariables();
void flattenSets();
@@ -108,7 +108,7 @@ class RBBINode : public UMemory {
private:
RBBINode &operator = (const RBBINode &other); // No defs.
UBool operator == (const RBBINode &other); // Private, so these functions won't accidently be used.
bool operator == (const RBBINode &other); // Private, so these functions won't accidentally be used.
#ifdef RBBI_DEBUG
public:
@@ -117,10 +117,11 @@ class RBBINode : public UMemory {
};
#ifdef RBBI_DEBUG
U_CFUNC void
U_CFUNC void
RBBI_DEBUG_printUnicodeString(const UnicodeString &s, int minWidth=0);
#endif
U_NAMESPACE_END
#endif
+1 -1
View File
@@ -268,7 +268,7 @@ RBBIRuleBuilder::createRuleBasedBreakIterator( const UnicodeString &rules,
if (U_FAILURE(status)) {
delete This;
This = NULL;
}
}
else if(This == NULL) { // test for NULL
status = U_MEMORY_ALLOCATION_ERROR;
}
+8 -5
View File
@@ -73,10 +73,10 @@ private:
public:
// API inherited from class SymbolTable
virtual const UnicodeString* lookup(const UnicodeString& s) const;
virtual const UnicodeFunctor* lookupMatcher(UChar32 ch) const;
virtual const UnicodeString* lookup(const UnicodeString& s) const override;
virtual const UnicodeFunctor* lookupMatcher(UChar32 ch) const override;
virtual UnicodeString parseReference(const UnicodeString& text,
ParsePosition& pos, int32_t limit) const;
ParsePosition& pos, int32_t limit) const override;
// Additional Functions
RBBISymbolTable(RBBIRuleScanner *, const UnicodeString &fRules, UErrorCode &status);
@@ -91,7 +91,7 @@ public:
// A do-nothing inline function for non-debug builds. Member funcs can't be empty
// or the call sites won't compile.
int32_t fFakeField;
#define rbbiSymtablePrint() fFakeField=0;
#define rbbiSymtablePrint() fFakeField=0;
#endif
private:
@@ -223,7 +223,7 @@ typedef std::pair<int32_t, int32_t> IntPair;
#define RBBIDebugPrintf printf
#define RBBIDebugPuts puts
#else
#undef RBBIDebugPrintf
#undef RBBIDebugPrintf
#define RBBIDebugPuts(arg)
#endif
@@ -232,3 +232,6 @@ U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_BREAK_ITERATION */
#endif
+80 -80
View File
@@ -8,8 +8,8 @@
// It is generated by the Perl script "rbbicst.pl" from
// the rule parser state definitions file "rbbirpt.txt".
//
// Copyright (C) 2002-2016 International Business Machines Corporation
// and others. All rights reserved.
// Copyright (C) 2002-2016 International Business Machines Corporation
// and others. All rights reserved.
//
//---------------------------------------------------------------------------------
#ifndef RBBIRPT_H
@@ -81,107 +81,107 @@ struct RBBIRuleTableEl {
static const struct RBBIRuleTableEl gRuleParseStateTable[] = {
{doNOP, 0, 0, 0, TRUE}
, {doExprStart, 254, 29, 9, FALSE} // 1 start
, {doNOP, 132, 1,0, TRUE} // 2
, {doNoChain, 94 /* ^ */, 12, 9, TRUE} // 3
, {doExprStart, 36 /* $ */, 88, 98, FALSE} // 4
, {doNOP, 33 /* ! */, 19,0, TRUE} // 5
, {doNOP, 59 /* ; */, 1,0, TRUE} // 6
, {doNOP, 252, 0,0, FALSE} // 7
, {doExprStart, 255, 29, 9, FALSE} // 8
, {doNOP, 132, 1,0, TRUE} // 2
, {doNoChain, 94 /* ^ */, 12, 9, TRUE} // 3
, {doExprStart, 36 /* $ */, 88, 98, FALSE} // 4
, {doNOP, 33 /* ! */, 19,0, TRUE} // 5
, {doNOP, 59 /* ; */, 1,0, TRUE} // 6
, {doNOP, 252, 0,0, FALSE} // 7
, {doExprStart, 255, 29, 9, FALSE} // 8
, {doEndOfRule, 59 /* ; */, 1,0, TRUE} // 9 break-rule-end
, {doNOP, 132, 9,0, TRUE} // 10
, {doRuleError, 255, 103,0, FALSE} // 11
, {doNOP, 132, 9,0, TRUE} // 10
, {doRuleError, 255, 103,0, FALSE} // 11
, {doExprStart, 254, 29,0, FALSE} // 12 start-after-caret
, {doNOP, 132, 12,0, TRUE} // 13
, {doRuleError, 94 /* ^ */, 103,0, FALSE} // 14
, {doExprStart, 36 /* $ */, 88, 37, FALSE} // 15
, {doRuleError, 59 /* ; */, 103,0, FALSE} // 16
, {doRuleError, 252, 103,0, FALSE} // 17
, {doExprStart, 255, 29,0, FALSE} // 18
, {doNOP, 132, 12,0, TRUE} // 13
, {doRuleError, 94 /* ^ */, 103,0, FALSE} // 14
, {doExprStart, 36 /* $ */, 88, 37, FALSE} // 15
, {doRuleError, 59 /* ; */, 103,0, FALSE} // 16
, {doRuleError, 252, 103,0, FALSE} // 17
, {doExprStart, 255, 29,0, FALSE} // 18
, {doNOP, 33 /* ! */, 21,0, TRUE} // 19 rev-option
, {doReverseDir, 255, 28, 9, FALSE} // 20
, {doReverseDir, 255, 28, 9, FALSE} // 20
, {doOptionStart, 130, 23,0, TRUE} // 21 option-scan1
, {doRuleError, 255, 103,0, FALSE} // 22
, {doRuleError, 255, 103,0, FALSE} // 22
, {doNOP, 129, 23,0, TRUE} // 23 option-scan2
, {doOptionEnd, 255, 25,0, FALSE} // 24
, {doOptionEnd, 255, 25,0, FALSE} // 24
, {doNOP, 59 /* ; */, 1,0, TRUE} // 25 option-scan3
, {doNOP, 132, 25,0, TRUE} // 26
, {doRuleError, 255, 103,0, FALSE} // 27
, {doNOP, 132, 25,0, TRUE} // 26
, {doRuleError, 255, 103,0, FALSE} // 27
, {doExprStart, 255, 29, 9, FALSE} // 28 reverse-rule
, {doRuleChar, 254, 38,0, TRUE} // 29 term
, {doNOP, 132, 29,0, TRUE} // 30
, {doRuleChar, 131, 38,0, TRUE} // 31
, {doNOP, 91 /* [ */, 94, 38, FALSE} // 32
, {doLParen, 40 /* ( */, 29, 38, TRUE} // 33
, {doNOP, 36 /* $ */, 88, 37, FALSE} // 34
, {doDotAny, 46 /* . */, 38,0, TRUE} // 35
, {doRuleError, 255, 103,0, FALSE} // 36
, {doNOP, 132, 29,0, TRUE} // 30
, {doRuleChar, 131, 38,0, TRUE} // 31
, {doNOP, 91 /* [ */, 94, 38, FALSE} // 32
, {doLParen, 40 /* ( */, 29, 38, TRUE} // 33
, {doNOP, 36 /* $ */, 88, 37, FALSE} // 34
, {doDotAny, 46 /* . */, 38,0, TRUE} // 35
, {doRuleError, 255, 103,0, FALSE} // 36
, {doCheckVarDef, 255, 38,0, FALSE} // 37 term-var-ref
, {doNOP, 132, 38,0, TRUE} // 38 expr-mod
, {doUnaryOpStar, 42 /* * */, 43,0, TRUE} // 39
, {doUnaryOpPlus, 43 /* + */, 43,0, TRUE} // 40
, {doUnaryOpQuestion, 63 /* ? */, 43,0, TRUE} // 41
, {doNOP, 255, 43,0, FALSE} // 42
, {doUnaryOpStar, 42 /* * */, 43,0, TRUE} // 39
, {doUnaryOpPlus, 43 /* + */, 43,0, TRUE} // 40
, {doUnaryOpQuestion, 63 /* ? */, 43,0, TRUE} // 41
, {doNOP, 255, 43,0, FALSE} // 42
, {doExprCatOperator, 254, 29,0, FALSE} // 43 expr-cont
, {doNOP, 132, 43,0, TRUE} // 44
, {doExprCatOperator, 131, 29,0, FALSE} // 45
, {doExprCatOperator, 91 /* [ */, 29,0, FALSE} // 46
, {doExprCatOperator, 40 /* ( */, 29,0, FALSE} // 47
, {doExprCatOperator, 36 /* $ */, 29,0, FALSE} // 48
, {doExprCatOperator, 46 /* . */, 29,0, FALSE} // 49
, {doExprCatOperator, 47 /* / */, 55,0, FALSE} // 50
, {doExprCatOperator, 123 /* { */, 67,0, TRUE} // 51
, {doExprOrOperator, 124 /* | */, 29,0, TRUE} // 52
, {doExprRParen, 41 /* ) */, 255,0, TRUE} // 53
, {doExprFinished, 255, 255,0, FALSE} // 54
, {doNOP, 132, 43,0, TRUE} // 44
, {doExprCatOperator, 131, 29,0, FALSE} // 45
, {doExprCatOperator, 91 /* [ */, 29,0, FALSE} // 46
, {doExprCatOperator, 40 /* ( */, 29,0, FALSE} // 47
, {doExprCatOperator, 36 /* $ */, 29,0, FALSE} // 48
, {doExprCatOperator, 46 /* . */, 29,0, FALSE} // 49
, {doExprCatOperator, 47 /* / */, 55,0, FALSE} // 50
, {doExprCatOperator, 123 /* { */, 67,0, TRUE} // 51
, {doExprOrOperator, 124 /* | */, 29,0, TRUE} // 52
, {doExprRParen, 41 /* ) */, 255,0, TRUE} // 53
, {doExprFinished, 255, 255,0, FALSE} // 54
, {doSlash, 47 /* / */, 57,0, TRUE} // 55 look-ahead
, {doNOP, 255, 103,0, FALSE} // 56
, {doNOP, 255, 103,0, FALSE} // 56
, {doExprCatOperator, 254, 29,0, FALSE} // 57 expr-cont-no-slash
, {doNOP, 132, 43,0, TRUE} // 58
, {doExprCatOperator, 131, 29,0, FALSE} // 59
, {doExprCatOperator, 91 /* [ */, 29,0, FALSE} // 60
, {doExprCatOperator, 40 /* ( */, 29,0, FALSE} // 61
, {doExprCatOperator, 36 /* $ */, 29,0, FALSE} // 62
, {doExprCatOperator, 46 /* . */, 29,0, FALSE} // 63
, {doExprOrOperator, 124 /* | */, 29,0, TRUE} // 64
, {doExprRParen, 41 /* ) */, 255,0, TRUE} // 65
, {doExprFinished, 255, 255,0, FALSE} // 66
, {doNOP, 132, 43,0, TRUE} // 58
, {doExprCatOperator, 131, 29,0, FALSE} // 59
, {doExprCatOperator, 91 /* [ */, 29,0, FALSE} // 60
, {doExprCatOperator, 40 /* ( */, 29,0, FALSE} // 61
, {doExprCatOperator, 36 /* $ */, 29,0, FALSE} // 62
, {doExprCatOperator, 46 /* . */, 29,0, FALSE} // 63
, {doExprOrOperator, 124 /* | */, 29,0, TRUE} // 64
, {doExprRParen, 41 /* ) */, 255,0, TRUE} // 65
, {doExprFinished, 255, 255,0, FALSE} // 66
, {doNOP, 132, 67,0, TRUE} // 67 tag-open
, {doStartTagValue, 128, 70,0, FALSE} // 68
, {doTagExpectedError, 255, 103,0, FALSE} // 69
, {doStartTagValue, 128, 70,0, FALSE} // 68
, {doTagExpectedError, 255, 103,0, FALSE} // 69
, {doNOP, 132, 74,0, TRUE} // 70 tag-value
, {doNOP, 125 /* } */, 74,0, FALSE} // 71
, {doTagDigit, 128, 70,0, TRUE} // 72
, {doTagExpectedError, 255, 103,0, FALSE} // 73
, {doNOP, 125 /* } */, 74,0, FALSE} // 71
, {doTagDigit, 128, 70,0, TRUE} // 72
, {doTagExpectedError, 255, 103,0, FALSE} // 73
, {doNOP, 132, 74,0, TRUE} // 74 tag-close
, {doTagValue, 125 /* } */, 77,0, TRUE} // 75
, {doTagExpectedError, 255, 103,0, FALSE} // 76
, {doTagValue, 125 /* } */, 77,0, TRUE} // 75
, {doTagExpectedError, 255, 103,0, FALSE} // 76
, {doExprCatOperator, 254, 29,0, FALSE} // 77 expr-cont-no-tag
, {doNOP, 132, 77,0, TRUE} // 78
, {doExprCatOperator, 131, 29,0, FALSE} // 79
, {doExprCatOperator, 91 /* [ */, 29,0, FALSE} // 80
, {doExprCatOperator, 40 /* ( */, 29,0, FALSE} // 81
, {doExprCatOperator, 36 /* $ */, 29,0, FALSE} // 82
, {doExprCatOperator, 46 /* . */, 29,0, FALSE} // 83
, {doExprCatOperator, 47 /* / */, 55,0, FALSE} // 84
, {doExprOrOperator, 124 /* | */, 29,0, TRUE} // 85
, {doExprRParen, 41 /* ) */, 255,0, TRUE} // 86
, {doExprFinished, 255, 255,0, FALSE} // 87
, {doNOP, 132, 77,0, TRUE} // 78
, {doExprCatOperator, 131, 29,0, FALSE} // 79
, {doExprCatOperator, 91 /* [ */, 29,0, FALSE} // 80
, {doExprCatOperator, 40 /* ( */, 29,0, FALSE} // 81
, {doExprCatOperator, 36 /* $ */, 29,0, FALSE} // 82
, {doExprCatOperator, 46 /* . */, 29,0, FALSE} // 83
, {doExprCatOperator, 47 /* / */, 55,0, FALSE} // 84
, {doExprOrOperator, 124 /* | */, 29,0, TRUE} // 85
, {doExprRParen, 41 /* ) */, 255,0, TRUE} // 86
, {doExprFinished, 255, 255,0, FALSE} // 87
, {doStartVariableName, 36 /* $ */, 90,0, TRUE} // 88 scan-var-name
, {doNOP, 255, 103,0, FALSE} // 89
, {doNOP, 255, 103,0, FALSE} // 89
, {doNOP, 130, 92,0, TRUE} // 90 scan-var-start
, {doVariableNameExpectedErr, 255, 103,0, FALSE} // 91
, {doVariableNameExpectedErr, 255, 103,0, FALSE} // 91
, {doNOP, 129, 92,0, TRUE} // 92 scan-var-body
, {doEndVariableName, 255, 255,0, FALSE} // 93
, {doEndVariableName, 255, 255,0, FALSE} // 93
, {doScanUnicodeSet, 91 /* [ */, 255,0, TRUE} // 94 scan-unicode-set
, {doScanUnicodeSet, 112 /* p */, 255,0, TRUE} // 95
, {doScanUnicodeSet, 80 /* P */, 255,0, TRUE} // 96
, {doNOP, 255, 103,0, FALSE} // 97
, {doScanUnicodeSet, 112 /* p */, 255,0, TRUE} // 95
, {doScanUnicodeSet, 80 /* P */, 255,0, TRUE} // 96
, {doNOP, 255, 103,0, FALSE} // 97
, {doNOP, 132, 98,0, TRUE} // 98 assign-or-rule
, {doStartAssign, 61 /* = */, 29, 101, TRUE} // 99
, {doNOP, 255, 37, 9, FALSE} // 100
, {doStartAssign, 61 /* = */, 29, 101, TRUE} // 99
, {doNOP, 255, 37, 9, FALSE} // 100
, {doEndAssign, 59 /* ; */, 1,0, TRUE} // 101 assign-end
, {doRuleErrorAssignExpr, 255, 103,0, FALSE} // 102
, {doRuleErrorAssignExpr, 255, 103,0, FALSE} // 102
, {doExit, 255, 103,0, TRUE} // 103 errorDeath
};
#ifdef RBBI_DEBUG
+8 -8
View File
@@ -96,7 +96,7 @@ RBBIRuleScanner::RBBIRuleScanner(RBBIRuleBuilder *rb)
fLineNum = 1;
fCharNum = 0;
fLastChar = 0;
fStateTable = NULL;
fStack[0] = 0;
fStackPtr = 0;
@@ -175,7 +175,7 @@ RBBIRuleScanner::~RBBIRuleScanner() {
// Node Stack.
// Normally has one entry, which is the entire parse tree for the rules.
// If errors occured, there may be additional subtrees left on the stack.
// If errors occurred, there may be additional subtrees left on the stack.
while (fNodeStackPtr > 0) {
delete fNodeStack[fNodeStackPtr];
fNodeStackPtr--;
@@ -357,7 +357,7 @@ UBool RBBIRuleScanner::doParseActions(int32_t action)
thisRule->fRuleRoot = TRUE;
// Flag if chaining into this rule is wanted.
//
//
if (fRB->fChainRules && // If rule chaining is enabled globally via !!chain
!fNoChainInRule) { // and no '^' chain-in inhibit was on this rule
thisRule->fChainIn = TRUE;
@@ -375,7 +375,7 @@ UBool RBBIRuleScanner::doParseActions(int32_t action)
RBBINode **destRules = (fReverseRule? &fRB->fSafeRevTree : fRB->fDefaultTree);
if (*destRules != NULL) {
// This is not the first rule encounted.
// This is not the first rule encountered.
// OR previous stuff (from *destRules)
// with the current rule expression (on the Node Stack)
// with the resulting OR expression going to *destRules
@@ -1116,7 +1116,7 @@ void RBBIRuleScanner::parse() {
if (U_FAILURE(*fRB->fStatus)) {
return;
}
// If there are no forward rules set an error.
//
if (fRB->fForwardTree == NULL) {
@@ -1223,7 +1223,7 @@ void RBBIRuleScanner::scanSet() {
// TODO: Get more accurate position of the error from UnicodeSet's return info.
// UnicodeSet appears to not be reporting correctly at this time.
#ifdef RBBI_DEBUG
RBBIDebugPrintf("UnicodeSet parse postion.ErrorIndex = %d\n", pos.getIndex());
RBBIDebugPrintf("UnicodeSet parse position.ErrorIndex = %d\n", pos.getIndex());
#endif
error(localStatus);
delete uset;
@@ -1244,7 +1244,7 @@ void RBBIRuleScanner::scanSet() {
}
// Advance the RBBI parse postion over the UnicodeSet pattern.
// Advance the RBBI parse position over the UnicodeSet pattern.
// Don't just set fScanIndex because the line/char positions maintained
// for error reporting would be thrown off.
i = pos.getIndex();
@@ -1267,7 +1267,7 @@ void RBBIRuleScanner::scanSet() {
fRB->fRules.extractBetween(n->fFirstPos, n->fLastPos, n->fText);
// findSetFor() serves several purposes here:
// - Adopts storage for the UnicodeSet, will be responsible for deleting.
// - Mantains collection of all sets in use, needed later for establishing
// - Maintains collection of all sets in use, needed later for establishing
// character categories for run time engine.
// - Eliminates mulitiple instances of the same set.
// - Creates a new uset node if necessary (if this isn't a duplicate.)
+2 -2
View File
@@ -34,7 +34,7 @@ class RBBISymbolTable;
//--------------------------------------------------------------------------------
//
// class RBBIRuleScanner does the lowest level, character-at-a-time
// scanning of break iterator rules.
// scanning of break iterator rules.
//
// The output of the scanner is parse trees for
// the rule expressions and a list of all Unicode Sets
@@ -144,7 +144,7 @@ private:
UnicodeSet fRuleSets[10]; // Unicode Sets that are needed during
// the scanning of RBBI rules. The
// indicies for these are assigned by the
// indices for these are assigned by the
// perl script that builds the state tables.
// See rbbirpt.h.
+1 -1
View File
@@ -436,7 +436,7 @@ UBool RBBISetBuilder::sawBOF() const {
//------------------------------------------------------------------------
//
// getFirstChar Given a runtime RBBI character category, find
// the first UChar32 that is in the set of chars
// the first UChar32 that is in the set of chars
// in the category.
//------------------------------------------------------------------------
UChar32 RBBISetBuilder::getFirstChar(int32_t category) const {
+2 -2
View File
@@ -45,7 +45,7 @@ RBBISymbolTable::RBBISymbolTable(RBBIRuleScanner *rs, const UnicodeString &rules
{
fHashTable = NULL;
fCachedSetLookup = NULL;
fHashTable = uhash_open(uhash_hashUnicodeString, uhash_compareUnicodeString, NULL, &status);
// uhash_open checks status
if (U_FAILURE(status)) {
@@ -63,7 +63,7 @@ RBBISymbolTable::~RBBISymbolTable()
//
// RBBISymbolTable::lookup This function from the abstract symbol table inteface
// RBBISymbolTable::lookup This function from the abstract symbol table interface
// looks up a variable name and returns a UnicodeString
// containing the substitution text.
//
+33 -18
View File
@@ -79,7 +79,7 @@ void RBBITableBuilder::buildForwardTable() {
//
// Walk through the tree, replacing any references to $variables with a copy of the
// parse tree for the substition expression.
// parse tree for the substitution expression.
//
fTree = fTree->flattenVariables();
#ifdef RBBI_DEBUG
@@ -90,11 +90,11 @@ void RBBITableBuilder::buildForwardTable() {
#endif
//
// If the rules contained any references to {bof}
// If the rules contained any references to {bof}
// add a {bof} <cat> <former root of tree> to the
// tree. Means that all matches must start out with the
// tree. Means that all matches must start out with the
// {bof} fake character.
//
//
if (fRB->fSetBuilder->sawBOF()) {
RBBINode *bofTop = new RBBINode(RBBINode::opCat);
RBBINode *bofLeaf = new RBBINode(RBBINode::leafChar);
@@ -390,6 +390,7 @@ void RBBITableBuilder::addRuleRootNodes(UVector *dest, RBBINode *node) {
if (node == NULL || U_FAILURE(*fStatus)) {
return;
}
U_ASSERT(!dest->hasDeleter());
if (node->fRuleRoot) {
dest->addElement(node, *fStatus);
// Note: rules cannot nest. If we found a rule start node,
@@ -420,9 +421,9 @@ void RBBITableBuilder::calcChainedFollowPos(RBBINode *tree, RBBINode *endMarkNod
}
// Collect all leaf nodes that can start matches for rules
// with inbound chaining enabled, which is the union of the
// with inbound chaining enabled, which is the union of the
// firstPosition sets from each of the rule root nodes.
UVector ruleRootNodes(*fStatus);
addRuleRootNodes(&ruleRootNodes, tree);
@@ -530,7 +531,7 @@ void RBBITableBuilder::bofFixup() {
// (excluding the fake bofNode)
// We want the nodes that can start a match in the
// part labeled "rest of tree"
//
//
UVector *matchStartNodes = fTree->fLeftChild->fRightChild->fFirstPosSet;
RBBINode *startNode;
@@ -546,7 +547,7 @@ void RBBITableBuilder::bofFixup() {
// explicitly written into a rule.
// Add everything from the followPos set of this node to the
// followPos set of the fake bofNode at the start of the tree.
//
//
setAdd(bofNode->fFollowPos, startNode->fFollowPos);
}
}
@@ -567,7 +568,7 @@ void RBBITableBuilder::buildStateTable() {
}
RBBIStateDescriptor *failState;
// Set it to NULL to avoid uninitialized warning
RBBIStateDescriptor *initialState = NULL;
RBBIStateDescriptor *initialState = NULL;
//
// Add a dummy state 0 - the stop state. Not from Aho.
int lastInputSymbol = fRB->fSetBuilder->getNumCharCategories() - 1;
@@ -644,8 +645,8 @@ void RBBITableBuilder::buildStateTable() {
if (U == NULL) {
U = new UVector(*fStatus);
if (U == NULL) {
*fStatus = U_MEMORY_ALLOCATION_ERROR;
goto ExitBuildSTdeleteall;
*fStatus = U_MEMORY_ALLOCATION_ERROR;
goto ExitBuildSTdeleteall;
}
}
setAdd(U, p->fFollowPos);
@@ -675,7 +676,7 @@ void RBBITableBuilder::buildStateTable() {
{
RBBIStateDescriptor *newState = new RBBIStateDescriptor(lastInputSymbol, fStatus);
if (newState == NULL) {
*fStatus = U_MEMORY_ALLOCATION_ERROR;
*fStatus = U_MEMORY_ALLOCATION_ERROR;
}
if (U_FAILURE(*fStatus)) {
goto ExitBuildSTdeleteall;
@@ -694,7 +695,7 @@ void RBBITableBuilder::buildStateTable() {
}
}
return;
// delete local pointers only if error occured.
// delete local pointers only if error occurred.
ExitBuildSTdeleteall:
delete initialState;
delete failState;
@@ -1042,6 +1043,8 @@ void RBBITableBuilder::sortedAdd(UVector **vector, int32_t val) {
//
//-----------------------------------------------------------------------------
void RBBITableBuilder::setAdd(UVector *dest, UVector *source) {
U_ASSERT(!dest->hasDeleter());
U_ASSERT(!source->hasDeleter());
int32_t destOriginalSize = dest->size();
int32_t sourceSize = source->size();
int32_t di = 0;
@@ -1070,6 +1073,9 @@ void RBBITableBuilder::setAdd(UVector *dest, UVector *source) {
(void) source->toArray(sourcePtr);
dest->setSize(sourceSize+destOriginalSize, *fStatus);
if (U_FAILURE(*fStatus)) {
return;
}
while (sourcePtr < sourceLim && destPtr < destLim) {
if (*destPtr == *sourcePtr) {
@@ -1431,7 +1437,7 @@ void RBBITableBuilder::exportTable(void *where) {
void RBBITableBuilder::buildSafeReverseTable(UErrorCode &status) {
// The safe table creation has three steps:
// 1. Identifiy pairs of character classes that are "safe." Safe means that boundaries
// 1. Identify pairs of character classes that are "safe." Safe means that boundaries
// following the pair do not depend on context or state before the pair. To test
// whether a pair is safe, run it through the main forward state table, starting
// from each state. If the the final state is the same, no matter what the starting state,
@@ -1445,7 +1451,7 @@ void RBBITableBuilder::buildSafeReverseTable(UErrorCode &status) {
// the first of a pair. In each of these rows, the entry for the second character
// of a safe pair is set to the stop state (0), indicating that a match was found.
// All other table entries are set to the state corresponding the current input
// character, allowing that charcter to be the of a start following pair.
// character, allowing that character to be the of a start following pair.
//
// Because the safe rules are to be run in reverse, moving backwards in the text,
// the first and second pair categories are swapped when building the table.
@@ -1490,16 +1496,25 @@ void RBBITableBuilder::buildSafeReverseTable(UErrorCode &status) {
// The table as a whole is UVector<UnicodeString>
// Each row is represented by a UnicodeString, being used as a Vector<int16>.
// Row 0 is the stop state.
// Row 1 is the start sate.
// Row 1 is the start state.
// Row 2 and beyond are other states, initially one per char class, but
// after initial construction, many of the states will be combined, compacting the table.
// The String holds the nextState data only. The four leading fields of a row, fAccepting,
// fLookAhead, etc. are not needed for the safe table, and are omitted at this stage of building.
U_ASSERT(fSafeTable == nullptr);
fSafeTable = new UVector(uprv_deleteUObject, uhash_compareUnicodeString, numCharClasses + 2, status);
LocalPointer<UVector> lpSafeTable(
new UVector(uprv_deleteUObject, uhash_compareUnicodeString, numCharClasses + 2, status), status);
if (U_FAILURE(status)) {
return;
}
fSafeTable = lpSafeTable.orphan();
for (int32_t row=0; row<numCharClasses + 2; ++row) {
fSafeTable->addElement(new UnicodeString(numCharClasses, 0, numCharClasses+4), status);
LocalPointer<UnicodeString> lpString(new UnicodeString(numCharClasses, 0, numCharClasses+4), status);
fSafeTable->adoptElement(lpString.orphan(), status);
}
if (U_FAILURE(status)) {
return;
}
// From the start state, each input char class transitions to the state for that input.
+2 -2
View File
@@ -69,12 +69,12 @@ public:
bool findDuplCharClassFrom(IntPair *categories);
/** Remove a column from the state table. Used when two character categories
* have been found equivalent, and merged together, to eliminate the uneeded table column.
* have been found equivalent, and merged together, to eliminate the unneeded table column.
*/
void removeColumn(int32_t column);
/**
* Check for, and remove dupicate states (table rows).
* Check for, and remove duplicate states (table rows).
* @return the number of states removed.
*/
int32_t removeDuplicateStates();
+2 -2
View File
@@ -135,7 +135,7 @@ U_NAMESPACE_BEGIN
* so forth, until the chain is exhausted or the tag is found.
*
* Thread-safety is implemented around caches, both the cache that
* stores all the resouce data, and the cache that stores flags
* stores all the resource data, and the cache that stores flags
* indicating whether or not a file has been visited. These caches
* delete their storage at static cleanup time, when the process
* quits.
@@ -206,7 +206,7 @@ ResourceBundle::ResourceBundle(UResourceBundle *res, UErrorCode& err)
}
}
ResourceBundle::ResourceBundle(const char* path, const Locale& locale, UErrorCode& err)
ResourceBundle::ResourceBundle(const char* path, const Locale& locale, UErrorCode& err)
:UObject(), fLocale(NULL)
{
fResource = ures_open(path, locale.getName(), &err);
+1 -1
View File
@@ -39,7 +39,7 @@ ResourceBundle::ResourceBundle( const UnicodeString& path,
constructForLocale(path, Locale::getDefault(), error);
}
void
void
ResourceBundle::constructForLocale(const UnicodeString& path,
const Locale& locale,
UErrorCode& error)
+6 -6
View File
@@ -39,7 +39,7 @@ class RuleCharacterIterator : public UMemory {
private:
/**
* Text being iterated.
*/
*/
const UnicodeString& text;
/**
@@ -51,7 +51,7 @@ private:
* Symbol table used to parse and dereference variables. May be 0.
*/
const SymbolTable* sym;
/**
* Current variable expansion, or 0 if none.
*/
@@ -94,7 +94,7 @@ public:
* position.
* @param text the text to be iterated
* @param sym the symbol table, or null if there is none. If sym is null,
* then variables will not be deferenced, even if the PARSE_VARIABLES
* then variables will not be dereferenced, even if the PARSE_VARIABLES
* option is set.
* @param pos upon input, the index of the next character to return. If a
* variable has been dereferenced, then pos will <em>not</em> increment as
@@ -102,7 +102,7 @@ public:
*/
RuleCharacterIterator(const UnicodeString& text, const SymbolTable* sym,
ParsePosition& pos);
/**
* Returns true if this iterator has no more characters to return.
*/
@@ -207,7 +207,7 @@ public:
* representation of this object
*/
// UnicodeString& toString(UnicodeString& result) const;
private:
/**
* Returns the current 32-bit code point without parsing escapes, parsing
@@ -215,7 +215,7 @@ private:
* @return the current 32-bit code point
*/
UChar32 _current() const;
/**
* Advances the position by the given amount.
* @param count the number of 16-bit code units to advance past
+3 -3
View File
@@ -79,10 +79,10 @@ StringCharacterIterator::operator=(const StringCharacterIterator& that) {
return *this;
}
UBool
bool
StringCharacterIterator::operator==(const ForwardCharacterIterator& that) const {
if (this == &that) {
return TRUE;
return true;
}
// do not call UCharCharacterIterator::operator==()
@@ -90,7 +90,7 @@ StringCharacterIterator::operator==(const ForwardCharacterIterator& that) const
// while we compare UnicodeString objects
if (typeid(*this) != typeid(that)) {
return FALSE;
return false;
}
StringCharacterIterator& realThat = (StringCharacterIterator&)that;
+153 -164
View File
@@ -8,6 +8,7 @@
*/
#include "unicode/utypes.h"
#include "unicode/localpointer.h"
#if !UCONFIG_NO_SERVICE
@@ -26,60 +27,60 @@ U_NAMESPACE_BEGIN
const UChar ICUServiceKey::PREFIX_DELIMITER = 0x002F; /* '/' */
ICUServiceKey::ICUServiceKey(const UnicodeString& id)
ICUServiceKey::ICUServiceKey(const UnicodeString& id)
: _id(id) {
}
ICUServiceKey::~ICUServiceKey()
ICUServiceKey::~ICUServiceKey()
{
}
const UnicodeString&
ICUServiceKey::getID() const
const UnicodeString&
ICUServiceKey::getID() const
{
return _id;
}
UnicodeString&
ICUServiceKey::canonicalID(UnicodeString& result) const
UnicodeString&
ICUServiceKey::canonicalID(UnicodeString& result) const
{
return result.append(_id);
}
UnicodeString&
ICUServiceKey::currentID(UnicodeString& result) const
UnicodeString&
ICUServiceKey::currentID(UnicodeString& result) const
{
return canonicalID(result);
}
UnicodeString&
ICUServiceKey::currentDescriptor(UnicodeString& result) const
UnicodeString&
ICUServiceKey::currentDescriptor(UnicodeString& result) const
{
prefix(result);
result.append(PREFIX_DELIMITER);
return currentID(result);
}
UBool
ICUServiceKey::fallback()
UBool
ICUServiceKey::fallback()
{
return FALSE;
}
UBool
ICUServiceKey::isFallbackOf(const UnicodeString& id) const
UBool
ICUServiceKey::isFallbackOf(const UnicodeString& id) const
{
return id == _id;
}
UnicodeString&
ICUServiceKey::prefix(UnicodeString& result) const
UnicodeString&
ICUServiceKey::prefix(UnicodeString& result) const
{
return result;
}
UnicodeString&
ICUServiceKey::parsePrefix(UnicodeString& result)
UnicodeString&
ICUServiceKey::parsePrefix(UnicodeString& result)
{
int32_t n = result.indexOf(PREFIX_DELIMITER);
if (n < 0) {
@@ -89,8 +90,8 @@ ICUServiceKey::parsePrefix(UnicodeString& result)
return result;
}
UnicodeString&
ICUServiceKey::parseSuffix(UnicodeString& result)
UnicodeString&
ICUServiceKey::parseSuffix(UnicodeString& result)
{
int32_t n = result.indexOf(PREFIX_DELIMITER);
if (n >= 0) {
@@ -100,8 +101,8 @@ ICUServiceKey::parseSuffix(UnicodeString& result)
}
#ifdef SERVICE_DEBUG
UnicodeString&
ICUServiceKey::debug(UnicodeString& result) const
UnicodeString&
ICUServiceKey::debug(UnicodeString& result) const
{
debugClass(result);
result.append((UnicodeString)" id: ");
@@ -109,8 +110,8 @@ ICUServiceKey::debug(UnicodeString& result) const
return result;
}
UnicodeString&
ICUServiceKey::debugClass(UnicodeString& result) const
UnicodeString&
ICUServiceKey::debugClass(UnicodeString& result) const
{
return result.append((UnicodeString)"ICUServiceKey");
}
@@ -124,30 +125,30 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(ICUServiceKey)
ICUServiceFactory::~ICUServiceFactory() {}
SimpleFactory::SimpleFactory(UObject* instanceToAdopt, const UnicodeString& id, UBool visible)
SimpleFactory::SimpleFactory(UObject* instanceToAdopt, const UnicodeString& id, UBool visible)
: _instance(instanceToAdopt), _id(id), _visible(visible)
{
}
SimpleFactory::~SimpleFactory()
SimpleFactory::~SimpleFactory()
{
delete _instance;
}
UObject*
SimpleFactory::create(const ICUServiceKey& key, const ICUService* service, UErrorCode& status) const
UObject*
SimpleFactory::create(const ICUServiceKey& key, const ICUService* service, UErrorCode& status) const
{
if (U_SUCCESS(status)) {
UnicodeString temp;
if (_id == key.currentID(temp)) {
return service->cloneInstance(_instance);
return service->cloneInstance(_instance);
}
}
return NULL;
}
void
SimpleFactory::updateVisibleIDs(Hashtable& result, UErrorCode& status) const
void
SimpleFactory::updateVisibleIDs(Hashtable& result, UErrorCode& status) const
{
if (_visible) {
result.put(_id, (void*)this, status); // cast away const
@@ -156,8 +157,8 @@ SimpleFactory::updateVisibleIDs(Hashtable& result, UErrorCode& status) const
}
}
UnicodeString&
SimpleFactory::getDisplayName(const UnicodeString& id, const Locale& /* locale */, UnicodeString& result) const
UnicodeString&
SimpleFactory::getDisplayName(const UnicodeString& id, const Locale& /* locale */, UnicodeString& result) const
{
if (_visible && _id == id) {
result = _id;
@@ -168,8 +169,8 @@ SimpleFactory::getDisplayName(const UnicodeString& id, const Locale& /* locale *
}
#ifdef SERVICE_DEBUG
UnicodeString&
SimpleFactory::debug(UnicodeString& toAppendTo) const
UnicodeString&
SimpleFactory::debug(UnicodeString& toAppendTo) const
{
debugClass(toAppendTo);
toAppendTo.append((UnicodeString)" id: ");
@@ -179,8 +180,8 @@ SimpleFactory::debug(UnicodeString& toAppendTo) const
return toAppendTo;
}
UnicodeString&
SimpleFactory::debugClass(UnicodeString& toAppendTo) const
UnicodeString&
SimpleFactory::debugClass(UnicodeString& toAppendTo) const
{
return toAppendTo.append((UnicodeString)"SimpleFactory");
}
@@ -217,14 +218,14 @@ public:
delete service;
}
CacheEntry(const UnicodeString& _actualDescriptor, UObject* _service)
CacheEntry(const UnicodeString& _actualDescriptor, UObject* _service)
: refcount(1), actualDescriptor(_actualDescriptor), service(_service) {
}
/**
* Instantiation creates an initial reference, so don't call this
* unless you're creating a new pointer to this. Management of
* that pointer will have to know how to deal with refcounts.
* that pointer will have to know how to deal with refcounts.
* Return true if the resource has not already been released.
*/
CacheEntry* ref() {
@@ -237,7 +238,7 @@ public:
* you're removing pointer to this somewhere. Management of that
* pointer will have to know how to deal with refcounts. Once
* the refcount drops to zero, the resource is released. Return
* false if the resouce has been released.
* false if the resource has been released.
*/
CacheEntry* unref() {
if ((--refcount) == 0) {
@@ -256,20 +257,13 @@ public:
}
};
// UObjectDeleter for serviceCache
// Deleter for serviceCache
U_CDECL_BEGIN
static void U_CALLCONV
cacheDeleter(void* obj) {
U_NAMESPACE_USE ((CacheEntry*)obj)->unref();
}
/**
* Deleter for UObjects
*/
static void U_CALLCONV
deleteUObject(void *obj) {
U_NAMESPACE_USE delete (UObject*) obj;
}
U_CDECL_END
/*
@@ -281,8 +275,8 @@ public:
Hashtable cache;
const Locale locale;
DNCache(const Locale& _locale)
: cache(), locale(_locale)
DNCache(const Locale& _locale)
: cache(), locale(_locale)
{
// cache.setKeyDeleter(uprv_deleteUObject);
}
@@ -293,8 +287,8 @@ public:
******************************************************************
*/
StringPair*
StringPair::create(const UnicodeString& displayName,
StringPair*
StringPair::create(const UnicodeString& displayName,
const UnicodeString& id,
UErrorCode& status)
{
@@ -310,12 +304,12 @@ StringPair::create(const UnicodeString& displayName,
return NULL;
}
UBool
UBool
StringPair::isBogus() const {
return displayName.isBogus() || id.isBogus();
}
StringPair::StringPair(const UnicodeString& _displayName,
StringPair::StringPair(const UnicodeString& _displayName,
const UnicodeString& _id)
: displayName(_displayName)
, id(_id)
@@ -345,7 +339,7 @@ ICUService::ICUService()
{
}
ICUService::ICUService(const UnicodeString& newName)
ICUService::ICUService(const UnicodeString& newName)
: name(newName)
, timestamp(0)
, factories(NULL)
@@ -365,14 +359,14 @@ ICUService::~ICUService()
}
}
UObject*
ICUService::get(const UnicodeString& descriptor, UErrorCode& status) const
UObject*
ICUService::get(const UnicodeString& descriptor, UErrorCode& status) const
{
return get(descriptor, NULL, status);
}
UObject*
ICUService::get(const UnicodeString& descriptor, UnicodeString* actualReturn, UErrorCode& status) const
UObject*
ICUService::get(const UnicodeString& descriptor, UnicodeString* actualReturn, UErrorCode& status) const
{
UObject* result = NULL;
ICUServiceKey* key = createKey(&descriptor, status);
@@ -383,8 +377,8 @@ ICUService::get(const UnicodeString& descriptor, UnicodeString* actualReturn, UE
return result;
}
UObject*
ICUService::getKey(ICUServiceKey& key, UErrorCode& status) const
UObject*
ICUService::getKey(ICUServiceKey& key, UErrorCode& status) const
{
return getKey(key, NULL, status);
}
@@ -392,8 +386,8 @@ ICUService::getKey(ICUServiceKey& key, UErrorCode& status) const
// this is a vector that subclasses of ICUService can override to further customize the result object
// before returning it. All other public get functions should call this one.
UObject*
ICUService::getKey(ICUServiceKey& key, UnicodeString* actualReturn, UErrorCode& status) const
UObject*
ICUService::getKey(ICUServiceKey& key, UnicodeString* actualReturn, UErrorCode& status) const
{
return getKey(key, actualReturn, NULL, status);
}
@@ -403,9 +397,9 @@ ICUService::getKey(ICUServiceKey& key, UnicodeString* actualReturn, UErrorCode&
// reentrantly even without knowing the thread.
class XMutex : public UMemory {
public:
inline XMutex(UMutex *mutex, UBool reentering)
inline XMutex(UMutex *mutex, UBool reentering)
: fMutex(mutex)
, fActive(!reentering)
, fActive(!reentering)
{
if (fActive) umtx_lock(fMutex);
}
@@ -418,15 +412,9 @@ private:
UBool fActive;
};
struct UVectorDeleter {
UVector* _obj;
UVectorDeleter() : _obj(NULL) {}
~UVectorDeleter() { delete _obj; }
};
// called only by factories, treat as private
UObject*
ICUService::getKey(ICUServiceKey& key, UnicodeString* actualReturn, const ICUServiceFactory* factory, UErrorCode& status) const
UObject*
ICUService::getKey(ICUServiceKey& key, UnicodeString* actualReturn, const ICUServiceFactory* factory, UErrorCode& status) const
{
if (U_FAILURE(status)) {
return NULL;
@@ -440,10 +428,10 @@ ICUService::getKey(ICUServiceKey& key, UnicodeString* actualReturn, const ICUSer
CacheEntry* result = NULL;
{
// The factory list can't be modified until we're done,
// The factory list can't be modified until we're done,
// otherwise we might update the cache with an invalid result.
// The cache has to stay in synch with the factory list.
// ICU doesn't have monitors so we can't use rw locks, so
// ICU doesn't have monitors so we can't use rw locks, so
// we single-thread everything using this service, for now.
// if factory is not null, we're calling from within the mutex,
@@ -454,6 +442,7 @@ ICUService::getKey(ICUServiceKey& key, UnicodeString* actualReturn, const ICUSer
if (serviceCache == NULL) {
ncthis->serviceCache = new Hashtable(status);
if (ncthis->serviceCache == NULL) {
status = U_MEMORY_ALLOCATION_ERROR;
return NULL;
}
if (U_FAILURE(status)) {
@@ -464,7 +453,7 @@ ICUService::getKey(ICUServiceKey& key, UnicodeString* actualReturn, const ICUSer
}
UnicodeString currentDescriptor;
UVectorDeleter cacheDescriptorList;
LocalPointer<UVector> cacheDescriptorList;
UBool putInCache = FALSE;
int32_t startIndex = 0;
@@ -495,48 +484,50 @@ ICUService::getKey(ICUServiceKey& key, UnicodeString* actualReturn, const ICUSer
}
// first test of cache failed, so we'll have to update
// the cache if we eventually succeed-- that is, if we're
// the cache if we eventually succeed-- that is, if we're
// going to update the cache at all.
putInCache = TRUE;
int32_t index = startIndex;
while (index < limit) {
ICUServiceFactory* f = (ICUServiceFactory*)factories->elementAt(index++);
UObject* service = f->create(key, this, status);
LocalPointer<UObject> service(f->create(key, this, status));
if (U_FAILURE(status)) {
delete service;
return NULL;
}
if (service != NULL) {
result = new CacheEntry(currentDescriptor, service);
if (service.isValid()) {
result = new CacheEntry(currentDescriptor, service.getAlias());
if (result == NULL) {
delete service;
status = U_MEMORY_ALLOCATION_ERROR;
return NULL;
}
service.orphan(); // result now owns service.
goto outerEnd;
}
}
// prepare to load the cache with all additional ids that
// prepare to load the cache with all additional ids that
// will resolve to result, assuming we'll succeed. We
// don't want to keep querying on an id that's going to
// fallback to the one that succeeded, we want to hit the
// cache the first time next goaround.
if (cacheDescriptorList._obj == NULL) {
cacheDescriptorList._obj = new UVector(uprv_deleteUObject, NULL, 5, status);
if (cacheDescriptorList.isNull()) {
cacheDescriptorList.adoptInsteadAndCheckErrorCode(new UVector(uprv_deleteUObject, NULL, 5, status), status);
if (U_FAILURE(status)) {
return NULL;
}
}
UnicodeString* idToCache = new UnicodeString(currentDescriptor);
if (idToCache == NULL || idToCache->isBogus()) {
LocalPointer<UnicodeString> idToCache(new UnicodeString(currentDescriptor), status);
if (U_FAILURE(status)) {
return NULL;
}
if (idToCache->isBogus()) {
status = U_MEMORY_ALLOCATION_ERROR;
return NULL;
}
cacheDescriptorList._obj->addElement(idToCache, status);
cacheDescriptorList->adoptElement(idToCache.orphan(), status);
if (U_FAILURE(status)) {
return NULL;
}
@@ -550,9 +541,9 @@ outerEnd:
return NULL;
}
if (cacheDescriptorList._obj != NULL) {
for (int32_t i = cacheDescriptorList._obj->size(); --i >= 0;) {
UnicodeString* desc = (UnicodeString*)cacheDescriptorList._obj->elementAt(i);
if (cacheDescriptorList.isValid()) {
for (int32_t i = cacheDescriptorList->size(); --i >= 0;) {
UnicodeString* desc = (UnicodeString*)cacheDescriptorList->elementAt(i);
serviceCache->put(*desc, result, status);
if (U_FAILURE(status)) {
@@ -560,7 +551,7 @@ outerEnd:
}
result->ref();
cacheDescriptorList._obj->removeElementAt(i);
cacheDescriptorList->removeElementAt(i);
}
}
}
@@ -569,8 +560,8 @@ outerEnd:
// strip null prefix
if (result->actualDescriptor.indexOf((UChar)0x2f) == 0) { // U+002f=slash (/)
actualReturn->remove();
actualReturn->append(result->actualDescriptor,
1,
actualReturn->append(result->actualDescriptor,
1,
result->actualDescriptor.length() - 1);
} else {
*actualReturn = result->actualDescriptor;
@@ -594,25 +585,26 @@ outerEnd:
return handleDefault(key, actualReturn, status);
}
UObject*
ICUService::handleDefault(const ICUServiceKey& /* key */, UnicodeString* /* actualIDReturn */, UErrorCode& /* status */) const
UObject*
ICUService::handleDefault(const ICUServiceKey& /* key */, UnicodeString* /* actualIDReturn */, UErrorCode& /* status */) const
{
return NULL;
}
UVector&
UVector&
ICUService::getVisibleIDs(UVector& result, UErrorCode& status) const {
return getVisibleIDs(result, NULL, status);
}
UVector&
ICUService::getVisibleIDs(UVector& result, const UnicodeString* matchID, UErrorCode& status) const
UVector&
ICUService::getVisibleIDs(UVector& result, const UnicodeString* matchID, UErrorCode& status) const
{
result.removeAllElements();
if (U_FAILURE(status)) {
return result;
}
UObjectDeleter *savedDeleter = result.setDeleter(uprv_deleteUObject);
{
Mutex mutex(&lock);
@@ -620,7 +612,7 @@ ICUService::getVisibleIDs(UVector& result, const UnicodeString* matchID, UErrorC
if (map != NULL) {
ICUServiceKey* fallbackKey = createKey(matchID, status);
for (int32_t pos = UHASH_FIRST;;) {
for (int32_t pos = UHASH_FIRST; U_SUCCESS(status); ) {
const UHashElement* e = map->nextElement(pos);
if (e == NULL) {
break;
@@ -633,17 +625,11 @@ ICUService::getVisibleIDs(UVector& result, const UnicodeString* matchID, UErrorC
}
}
UnicodeString* idClone = new UnicodeString(*id);
if (idClone == NULL || idClone->isBogus()) {
delete idClone;
LocalPointer<UnicodeString> idClone(new UnicodeString(*id), status);
if (U_SUCCESS(status) && idClone->isBogus()) {
status = U_MEMORY_ALLOCATION_ERROR;
break;
}
result.addElement(idClone, status);
if (U_FAILURE(status)) {
delete idClone;
break;
}
result.adoptElement(idClone.orphan(), status);
}
delete fallbackKey;
}
@@ -651,10 +637,11 @@ ICUService::getVisibleIDs(UVector& result, const UnicodeString* matchID, UErrorC
if (U_FAILURE(status)) {
result.removeAllElements();
}
result.setDeleter(savedDeleter);
return result;
}
const Hashtable*
const Hashtable*
ICUService::getVisibleIDMap(UErrorCode& status) const {
if (U_FAILURE(status)) return NULL;
@@ -681,14 +668,14 @@ ICUService::getVisibleIDMap(UErrorCode& status) const {
}
UnicodeString&
ICUService::getDisplayName(const UnicodeString& id, UnicodeString& result) const
UnicodeString&
ICUService::getDisplayName(const UnicodeString& id, UnicodeString& result) const
{
return getDisplayName(id, result, Locale::getDefault());
}
UnicodeString&
ICUService::getDisplayName(const UnicodeString& id, UnicodeString& result, const Locale& locale) const
UnicodeString&
ICUService::getDisplayName(const UnicodeString& id, UnicodeString& result, const Locale& locale) const
{
{
UErrorCode status = U_ZERO_ERROR;
@@ -721,24 +708,24 @@ ICUService::getDisplayName(const UnicodeString& id, UnicodeString& result, const
return result;
}
UVector&
ICUService::getDisplayNames(UVector& result, UErrorCode& status) const
UVector&
ICUService::getDisplayNames(UVector& result, UErrorCode& status) const
{
return getDisplayNames(result, Locale::getDefault(), NULL, status);
}
UVector&
ICUService::getDisplayNames(UVector& result, const Locale& locale, UErrorCode& status) const
UVector&
ICUService::getDisplayNames(UVector& result, const Locale& locale, UErrorCode& status) const
{
return getDisplayNames(result, locale, NULL, status);
}
UVector&
ICUService::getDisplayNames(UVector& result,
const Locale& locale,
const UnicodeString* matchID,
UErrorCode& status) const
UVector&
ICUService::getDisplayNames(UVector& result,
const Locale& locale,
const UnicodeString* matchID,
UErrorCode& status) const
{
result.removeAllElements();
result.setDeleter(userv_deleteStringPair);
@@ -756,7 +743,7 @@ ICUService::getDisplayNames(UVector& result,
if (U_FAILURE(status)) {
return result;
}
ncthis->dnCache = new DNCache(locale);
ncthis->dnCache = new DNCache(locale);
if (dnCache == NULL) {
status = U_MEMORY_ALLOCATION_ERROR;
return result;
@@ -789,7 +776,7 @@ ICUService::getDisplayNames(UVector& result,
* nextElement(pos) will skip the position at pos and begin the iteration
* at the next position, which in this case will be 0.
*/
int32_t pos = UHASH_FIRST;
int32_t pos = UHASH_FIRST;
const UHashElement *entry = NULL;
while ((entry = dnCache->cache.nextElement(pos)) != NULL) {
const UnicodeString* id = (const UnicodeString*)entry->value.pointer;
@@ -798,7 +785,7 @@ ICUService::getDisplayNames(UVector& result,
}
const UnicodeString* dn = (const UnicodeString*)entry->key.pointer;
StringPair* sp = StringPair::create(*id, *dn, status);
result.addElement(sp, status);
result.adoptElement(sp, status);
if (U_FAILURE(status)) {
result.removeAllElements();
break;
@@ -810,13 +797,13 @@ ICUService::getDisplayNames(UVector& result,
}
URegistryKey
ICUService::registerInstance(UObject* objToAdopt, const UnicodeString& id, UErrorCode& status)
ICUService::registerInstance(UObject* objToAdopt, const UnicodeString& id, UErrorCode& status)
{
return registerInstance(objToAdopt, id, TRUE, status);
}
URegistryKey
ICUService::registerInstance(UObject* objToAdopt, const UnicodeString& id, UBool visible, UErrorCode& status)
ICUService::registerInstance(UObject* objToAdopt, const UnicodeString& id, UBool visible, UErrorCode& status)
{
ICUServiceKey* key = createKey(&id, status);
if (key != NULL) {
@@ -833,7 +820,7 @@ ICUService::registerInstance(UObject* objToAdopt, const UnicodeString& id, UBool
return NULL;
}
ICUServiceFactory*
ICUServiceFactory*
ICUService::createSimpleFactory(UObject* objToAdopt, const UnicodeString& id, UBool visible, UErrorCode& status)
{
if (U_SUCCESS(status)) {
@@ -848,34 +835,36 @@ ICUService::createSimpleFactory(UObject* objToAdopt, const UnicodeString& id, UB
URegistryKey
ICUService::registerFactory(ICUServiceFactory* factoryToAdopt, UErrorCode& status)
{
if (U_SUCCESS(status) && factoryToAdopt != NULL) {
LocalPointer<ICUServiceFactory>lpFactoryToAdopt(factoryToAdopt);
if (U_FAILURE(status) || factoryToAdopt == nullptr) {
return nullptr;
}
{
Mutex mutex(&lock);
if (factories == NULL) {
factories = new UVector(deleteUObject, NULL, status);
if (factories == nullptr) {
LocalPointer<UVector> lpFactories(new UVector(uprv_deleteUObject, nullptr, status), status);
if (U_FAILURE(status)) {
delete factories;
return NULL;
return nullptr;
}
factories = lpFactories.orphan();
}
factories->insertElementAt(factoryToAdopt, 0, status);
factories->insertElementAt(lpFactoryToAdopt.orphan(), 0, status);
if (U_SUCCESS(status)) {
clearCaches();
} else {
delete factoryToAdopt;
factoryToAdopt = NULL;
}
}
} // Close of mutex lock block.
if (factoryToAdopt != NULL) {
if (U_SUCCESS(status)) {
notifyChanged();
return (URegistryKey)factoryToAdopt;
} else {
return nullptr;
}
return (URegistryKey)factoryToAdopt;
}
UBool
ICUService::unregister(URegistryKey rkey, UErrorCode& status)
UBool
ICUService::unregister(URegistryKey rkey, UErrorCode& status)
{
ICUServiceFactory *factory = (ICUServiceFactory*)rkey;
UBool result = FALSE;
@@ -896,8 +885,8 @@ ICUService::unregister(URegistryKey rkey, UErrorCode& status)
return result;
}
void
ICUService::reset()
void
ICUService::reset()
{
{
Mutex mutex(&lock);
@@ -907,28 +896,28 @@ ICUService::reset()
notifyChanged();
}
void
ICUService::reInitializeFactories()
void
ICUService::reInitializeFactories()
{
if (factories != NULL) {
factories->removeAllElements();
}
}
UBool
ICUService::isDefault() const
UBool
ICUService::isDefault() const
{
return countFactories() == 0;
}
ICUServiceKey*
ICUService::createKey(const UnicodeString* id, UErrorCode& status) const
ICUServiceKey*
ICUService::createKey(const UnicodeString* id, UErrorCode& status) const
{
return (U_FAILURE(status) || id == NULL) ? NULL : new ICUServiceKey(*id);
}
void
ICUService::clearCaches()
void
ICUService::clearCaches()
{
// callers synchronize before use
++timestamp;
@@ -939,33 +928,33 @@ ICUService::clearCaches()
delete serviceCache; serviceCache = NULL;
}
void
ICUService::clearServiceCache()
void
ICUService::clearServiceCache()
{
// callers synchronize before use
delete serviceCache; serviceCache = NULL;
}
UBool
ICUService::acceptsListener(const EventListener& l) const
UBool
ICUService::acceptsListener(const EventListener& l) const
{
return dynamic_cast<const ServiceListener*>(&l) != NULL;
}
void
ICUService::notifyListener(EventListener& l) const
void
ICUService::notifyListener(EventListener& l) const
{
((ServiceListener&)l).serviceChanged(*this);
}
UnicodeString&
ICUService::getName(UnicodeString& result) const
ICUService::getName(UnicodeString& result) const
{
return result.append(name);
}
int32_t
ICUService::countFactories() const
int32_t
ICUService::countFactories() const
{
return factories == NULL ? 0 : factories->size();
}
+39 -38
View File
@@ -61,16 +61,16 @@ class DNCache;
* The descriptor contains an optional prefix, followed by '/'
* and the currentID. Factories that handle complex keys,
* for example number format factories that generate multiple
* kinds of formatters for the same locale, use the descriptor
* to provide a fully unique identifier for the service object,
* kinds of formatters for the same locale, use the descriptor
* to provide a fully unique identifier for the service object,
* while using the currentID (in this case, the locale string),
* as the visible IDs that can be localized.</p>
*
* <p>The default implementation of ICUServiceKey has no fallbacks and
* has no custom descriptors.</p>
* has no custom descriptors.</p>
*/
class U_COMMON_API ICUServiceKey : public UObject {
private:
private:
const UnicodeString _id;
protected:
@@ -111,7 +111,7 @@ class U_COMMON_API ICUServiceKey : public UObject {
* the canonical ID to result. Result is returned as a convenience.</p>
*
* @param result the output parameter to which the current id will be appended.
* @return the modified result.
* @return the modified result.
*/
virtual UnicodeString& currentID(UnicodeString& result) const;
@@ -127,7 +127,7 @@ class U_COMMON_API ICUServiceKey : public UObject {
* instantiate the service.</p>
*
* @param result the output parameter to which the current id will be appended.
* @return the modified result.
* @return the modified result.
*/
virtual UnicodeString& currentDescriptor(UnicodeString& result) const;
@@ -162,10 +162,10 @@ class U_COMMON_API ICUServiceKey : public UObject {
/**
* <p>A utility to parse the prefix out of a descriptor string. Only
* the (undelimited) prefix, if any, remains in result. Result is returned as a
* the (undelimited) prefix, if any, remains in result. Result is returned as a
* convenience.</p>
*
* @param result an input/output parameter that on entry is a descriptor, and
* @param result an input/output parameter that on entry is a descriptor, and
* on exit is the prefix of that descriptor.
* @return the modified result.
*/
@@ -173,10 +173,10 @@ class U_COMMON_API ICUServiceKey : public UObject {
/**
* <p>A utility to parse the suffix out of a descriptor string. Only
* the (undelimited) suffix, if any, remains in result. Result is returned as a
* the (undelimited) suffix, if any, remains in result. Result is returned as a
* convenience.</p>
*
* @param result an input/output parameter that on entry is a descriptor, and
* @param result an input/output parameter that on entry is a descriptor, and
* on exit is the suffix of that descriptor.
* @return the modified result.
*/
@@ -191,7 +191,7 @@ public:
/**
* UObject RTTI boilerplate.
*/
virtual UClassID getDynamicClassID() const;
virtual UClassID getDynamicClassID() const override;
#ifdef SERVICE_DEBUG
public:
@@ -254,7 +254,7 @@ class U_COMMON_API ICUServiceFactory : public UObject {
/**
* <p>Return, in result, the display name of the id in the provided locale.
* This is an id, not a descriptor. If the id is
* This is an id, not a descriptor. If the id is
* not visible, sets result to bogus. If the
* incoming result is bogus, it remains bogus. Result is returned as a
* convenience. Results are not defined if id is not one supported by this
@@ -290,7 +290,7 @@ class U_COMMON_API SimpleFactory : public ICUServiceFactory {
public:
/**
* <p>Construct a SimpleFactory that maps a single ID to a single
* <p>Construct a SimpleFactory that maps a single ID to a single
* service instance. If visible is true, the ID will be visible.
* The instance must not be NULL. The SimpleFactory will adopt
* the instance, which must not be changed subsequent to this call.</p>
@@ -315,16 +315,16 @@ class U_COMMON_API SimpleFactory : public ICUServiceFactory {
* @param status the error code status.
* @return the service object, or NULL if the factory does not support the key.
*/
virtual UObject* create(const ICUServiceKey& key, const ICUService* service, UErrorCode& status) const;
virtual UObject* create(const ICUServiceKey& key, const ICUService* service, UErrorCode& status) const override;
/**
* <p>This implementation adds a mapping from ID -> this to result if visible is true,
* <p>This implementation adds a mapping from ID -> this to result if visible is true,
* otherwise it removes ID from result.</p>
*
* @param result the mapping table to update.
* @param status the error code status.
*/
virtual void updateVisibleIDs(Hashtable& result, UErrorCode& status) const;
virtual void updateVisibleIDs(Hashtable& result, UErrorCode& status) const override;
/**
* <p>This implementation returns the factory ID if it equals id and visible is true,
@@ -336,7 +336,7 @@ class U_COMMON_API SimpleFactory : public ICUServiceFactory {
* @param result output parameter to hold the display name.
* @return result.
*/
virtual UnicodeString& getDisplayName(const UnicodeString& id, const Locale& locale, UnicodeString& result) const;
virtual UnicodeString& getDisplayName(const UnicodeString& id, const Locale& locale, UnicodeString& result) const override;
public:
/**
@@ -347,7 +347,7 @@ public:
/**
* UObject RTTI boilerplate.
*/
virtual UClassID getDynamicClassID() const;
virtual UClassID getDynamicClassID() const override;
#ifdef SERVICE_DEBUG
public:
@@ -363,7 +363,7 @@ public:
/**
* <p>ServiceListener is the listener that ICUService provides by default.
* ICUService will notifiy this listener when factories are added to
* ICUService will notify this listener when factories are added to
* or removed from the service. Subclasses can provide
* different listener interfaces that extend EventListener, and modify
* acceptsListener and notifyListener as appropriate.</p>
@@ -376,22 +376,22 @@ public:
* <p>This method is called when the service changes. At the time of the
* call this listener is registered with the service. It must
* not modify the notifier in the context of this call.</p>
*
*
* @param service the service that changed.
*/
virtual void serviceChanged(const ICUService& service) const = 0;
public:
/**
* UObject RTTI boilerplate.
*/
static UClassID U_EXPORT2 getStaticClassID();
/**
* UObject RTTI boilerplate.
*/
virtual UClassID getDynamicClassID() const;
virtual UClassID getDynamicClassID() const override;
};
/*
@@ -422,7 +422,7 @@ public:
* @param status the error code status.
* @return a StringPair if the creation was successful, otherwise NULL.
*/
static StringPair* create(const UnicodeString& displayName,
static StringPair* create(const UnicodeString& displayName,
const UnicodeString& id,
UErrorCode& status);
@@ -521,10 +521,10 @@ private:
* subclass of ICUService that uses Locale names as IDs and uses
* ICUServiceKeys that implement the standard resource bundle fallback
* strategy. Most clients will wish to subclass it instead of
* ICUService.</p>
* ICUService.</p>
*/
class U_COMMON_API ICUService : public ICUNotifier {
protected:
protected:
/**
* Name useful for debugging.
*/
@@ -631,7 +631,7 @@ class U_COMMON_API ICUService : public ICUNotifier {
* has no fallback. If no object is found, the result of handleDefault
* is returned.</p>
*
* <p>Subclasses can override this method to further customize the
* <p>Subclasses can override this method to further customize the
* result before returning it.
*
* @param key the key.
@@ -646,7 +646,7 @@ class U_COMMON_API ICUService : public ICUNotifier {
* of a previous getKey call, to determine what previously-registered factories would
* have returned. For details, see getKey(ICUServiceKey&, UErrorCode&). Subclasses
* should not call it directly, but call through one of the other get functions.</p>
*
*
* @param key the key.
* @param actualReturn a pointer to a UnicodeString to hold the matched descriptor, or NULL.
* @param factory the factory making the recursive call.
@@ -710,7 +710,7 @@ class U_COMMON_API ICUService : public ICUNotifier {
UnicodeString& getDisplayName(const UnicodeString& id, UnicodeString& result, const Locale& locale) const;
/**
* <p>Convenience override of getDisplayNames(const Locale&, const UnicodeString*) that
* <p>Convenience override of getDisplayNames(const Locale&, const UnicodeString*) that
* uses the current default Locale as the locale and NULL for
* the matchID.</p>
*
@@ -721,7 +721,7 @@ class U_COMMON_API ICUService : public ICUNotifier {
UVector& getDisplayNames(UVector& result, UErrorCode& status) const;
/**
* <p>Convenience override of getDisplayNames(const Locale&, const UnicodeString*) that
* <p>Convenience override of getDisplayNames(const Locale&, const UnicodeString*) that
* uses NULL for the matchID.</p>
*
* @param result a vector to hold the returned displayName/id StringPairs.
@@ -755,8 +755,8 @@ class U_COMMON_API ICUService : public ICUNotifier {
* @param status the error code status.
* @return the result vector. */
UVector& getDisplayNames(UVector& result,
const Locale& locale,
const UnicodeString* matchID,
const Locale& locale,
const UnicodeString* matchID,
UErrorCode& status) const;
/**
@@ -772,7 +772,7 @@ class U_COMMON_API ICUService : public ICUNotifier {
URegistryKey registerInstance(UObject* objToAdopt, const UnicodeString& id, UErrorCode& status);
/**
* <p>Register a service instance with the provided ID. The ID will be
* <p>Register a service instance with the provided ID. The ID will be
* canonicalized. The canonicalized ID will be returned by
* getVisibleIDs if visible is true. The service instance will be adopted and
* must not be modified subsequent to this call.</p>
@@ -819,7 +819,7 @@ class U_COMMON_API ICUService : public ICUNotifier {
* listeners.</p>
*
* @param rkey the registry key.
* @param status the error code status.
* @param status the error code status.
* @return true if the call successfully unregistered the factory.
*/
virtual UBool unregister(URegistryKey rkey, UErrorCode& status);
@@ -835,7 +835,7 @@ class U_COMMON_API ICUService : public ICUNotifier {
/**
* <p>Return true if the service is in its default state.</p>
*
* <p>The default implementation returns true if there are no
* <p>The default implementation returns true if there are no
* factories registered.</p>
*/
virtual UBool isDefault(void) const;
@@ -930,7 +930,7 @@ class U_COMMON_API ICUService : public ICUNotifier {
* @param l the listener to test.
* @return true if the service accepts the listener.
*/
virtual UBool acceptsListener(const EventListener& l) const;
virtual UBool acceptsListener(const EventListener& l) const override;
/**
* <p>Notify the listener of a service change.</p>
@@ -941,7 +941,7 @@ class U_COMMON_API ICUService : public ICUNotifier {
*
* @param l the listener to notify.
*/
virtual void notifyListener(EventListener& l) const;
virtual void notifyListener(EventListener& l) const override;
/************************************************************************
* Utilities for subclasses.
@@ -993,3 +993,4 @@ U_NAMESPACE_END
/* ICUSERV_H */
#endif
+2
View File
@@ -184,3 +184,5 @@ U_NAMESPACE_END
/* !UCONFIG_NO_SERVICE */
#endif
+5 -3
View File
@@ -105,9 +105,9 @@ LocaleKeyFactory::getDisplayName(const UnicodeString& id, const Locale& locale,
}
UObject*
LocaleKeyFactory::handleCreate(const Locale& /* loc */,
int32_t /* kind */,
const ICUService* /* service */,
LocaleKeyFactory::handleCreate(const Locale& /* loc */,
int32_t /* kind */,
const ICUService* /* service */,
UErrorCode& /* status */) const {
return NULL;
}
@@ -148,3 +148,5 @@ U_NAMESPACE_END
/* !UCONFIG_NO_SERVICE */
#endif
+46 -45
View File
@@ -60,11 +60,11 @@ class ServiceListener;
*
* <p>Canonicalization adjusts the locale string so that the
* section before the first understore is in lower case, and the rest
* is in upper case, with no trailing underscores.</p>
* is in upper case, with no trailing underscores.</p>
*/
class U_COMMON_API LocaleKey : public ICUServiceKey {
private:
private:
int32_t _kind;
UnicodeString _primaryID;
UnicodeString _fallbackID;
@@ -78,15 +78,15 @@ class U_COMMON_API LocaleKey : public ICUServiceKey {
/**
* Create a LocaleKey with canonical primary and fallback IDs.
*/
static LocaleKey* createWithCanonicalFallback(const UnicodeString* primaryID,
static LocaleKey* createWithCanonicalFallback(const UnicodeString* primaryID,
const UnicodeString* canonicalFallbackID,
UErrorCode& status);
/**
* Create a LocaleKey with canonical primary and fallback IDs.
*/
static LocaleKey* createWithCanonicalFallback(const UnicodeString* primaryID,
const UnicodeString* canonicalFallbackID,
static LocaleKey* createWithCanonicalFallback(const UnicodeString* primaryID,
const UnicodeString* canonicalFallbackID,
int32_t kind,
UErrorCode& status);
@@ -97,16 +97,16 @@ class U_COMMON_API LocaleKey : public ICUServiceKey {
* fallbackID is the current default locale's string in
* canonical form.
*/
LocaleKey(const UnicodeString& primaryID,
const UnicodeString& canonicalPrimaryID,
const UnicodeString* canonicalFallbackID,
LocaleKey(const UnicodeString& primaryID,
const UnicodeString& canonicalPrimaryID,
const UnicodeString* canonicalFallbackID,
int32_t kind);
public:
/**
* Append the prefix associated with the kind, or nothing if the kind is KIND_ANY.
*/
virtual UnicodeString& prefix(UnicodeString& result) const;
virtual UnicodeString& prefix(UnicodeString& result) const override;
/**
* Return the kind code associated with this key.
@@ -116,17 +116,17 @@ class U_COMMON_API LocaleKey : public ICUServiceKey {
/**
* Return the canonicalID.
*/
virtual UnicodeString& canonicalID(UnicodeString& result) const;
virtual UnicodeString& canonicalID(UnicodeString& result) const override;
/**
* Return the currentID.
*/
virtual UnicodeString& currentID(UnicodeString& result) const;
virtual UnicodeString& currentID(UnicodeString& result) const override;
/**
* Return the (canonical) current descriptor, or null if no current id.
*/
virtual UnicodeString& currentDescriptor(UnicodeString& result) const;
virtual UnicodeString& currentDescriptor(UnicodeString& result) const override;
/**
* Convenience method to return the locale corresponding to the (canonical) original ID.
@@ -145,23 +145,23 @@ class U_COMMON_API LocaleKey : public ICUServiceKey {
* <p>First falls back through the primary ID, then through
* the fallbackID. The final fallback is the empty string,
* unless the primary id was the empty string, in which case
* there is no fallback.
* there is no fallback.
*/
virtual UBool fallback();
virtual UBool fallback() override;
/**
* Return true if a key created from id matches, or would eventually
* fallback to match, the canonical ID of this key.
* fallback to match, the canonical ID of this key.
*/
virtual UBool isFallbackOf(const UnicodeString& id) const;
virtual UBool isFallbackOf(const UnicodeString& id) const override;
public:
/**
* UObject boilerplate.
*/
static UClassID U_EXPORT2 getStaticClassID();
virtual UClassID getDynamicClassID() const;
virtual UClassID getDynamicClassID() const override;
/**
* Destructor.
@@ -183,7 +183,7 @@ class U_COMMON_API LocaleKey : public ICUServiceKey {
/**
* A subclass of ICUServiceFactory that uses LocaleKeys, and is able to
* 'cover' more specific locales with more general locales that it
* supports.
* supports.
*
* <p>Coverage may be either of the values VISIBLE or INVISIBLE.
*
@@ -203,7 +203,7 @@ public:
enum {
/**
* Coverage value indicating that the factory makes
* its locales visible, and does not cover more specific
* its locales visible, and does not cover more specific
* locales.
*/
VISIBLE = 0,
@@ -238,7 +238,7 @@ protected:
* kind off to handleCreate (which subclasses must implement).
*/
public:
virtual UObject* create(const ICUServiceKey& key, const ICUService* service, UErrorCode& status) const;
virtual UObject* create(const ICUServiceKey& key, const ICUService* service, UErrorCode& status) const override;
protected:
virtual UBool handlesKey(const ICUServiceKey& key, UErrorCode& status) const;
@@ -248,12 +248,12 @@ public:
* Override of superclass method. This adjusts the result based
* on the coverage rule for this factory.
*/
virtual void updateVisibleIDs(Hashtable& result, UErrorCode& status) const;
virtual void updateVisibleIDs(Hashtable& result, UErrorCode& status) const override;
/**
* Return a localized name for the locale represented by id.
*/
virtual UnicodeString& getDisplayName(const UnicodeString& id, const Locale& locale, UnicodeString& result) const;
virtual UnicodeString& getDisplayName(const UnicodeString& id, const Locale& locale, UnicodeString& result) const override;
protected:
/**
@@ -263,13 +263,13 @@ protected:
virtual UObject* handleCreate(const Locale& loc, int32_t kind, const ICUService* service, UErrorCode& status) const;
/**
* Return true if this id is one the factory supports (visible or
* Return true if this id is one the factory supports (visible or
* otherwise).
*/
// virtual UBool isSupportedID(const UnicodeString& id, UErrorCode& status) const;
/**
* Return the set of ids that this factory supports (visible or
* Return the set of ids that this factory supports (visible or
* otherwise). This can be called often and might need to be
* cached if it is expensive to create.
*/
@@ -281,7 +281,7 @@ public:
*/
static UClassID U_EXPORT2 getStaticClassID();
virtual UClassID getDynamicClassID() const;
virtual UClassID getDynamicClassID() const override;
#ifdef SERVICE_DEBUG
public:
@@ -306,14 +306,14 @@ class U_COMMON_API SimpleLocaleKeyFactory : public LocaleKeyFactory {
const int32_t _kind;
public:
SimpleLocaleKeyFactory(UObject* objToAdopt,
const UnicodeString& locale,
int32_t kind,
SimpleLocaleKeyFactory(UObject* objToAdopt,
const UnicodeString& locale,
int32_t kind,
int32_t coverage);
SimpleLocaleKeyFactory(UObject* objToAdopt,
const Locale& locale,
int32_t kind,
SimpleLocaleKeyFactory(UObject* objToAdopt,
const Locale& locale,
int32_t kind,
int32_t coverage);
/**
@@ -324,13 +324,13 @@ class U_COMMON_API SimpleLocaleKeyFactory : public LocaleKeyFactory {
/**
* Override of superclass method. Returns the service object if kind/locale match. Service is not used.
*/
virtual UObject* create(const ICUServiceKey& key, const ICUService* service, UErrorCode& status) const;
virtual UObject* create(const ICUServiceKey& key, const ICUService* service, UErrorCode& status) const override;
/**
* Override of superclass method. This adjusts the result based
* on the coverage rule for this factory.
*/
virtual void updateVisibleIDs(Hashtable& result, UErrorCode& status) const;
virtual void updateVisibleIDs(Hashtable& result, UErrorCode& status) const override;
protected:
/**
@@ -345,7 +345,7 @@ public:
*/
static UClassID U_EXPORT2 getStaticClassID();
virtual UClassID getDynamicClassID() const;
virtual UClassID getDynamicClassID() const override;
#ifdef SERVICE_DEBUG
public:
@@ -366,7 +366,7 @@ public:
* IDs. Subclasses then override handleCreate to create the actual service
* object. The default implementation returns a resource bundle.
*/
class U_COMMON_API ICUResourceBundleFactory : public LocaleKeyFactory
class U_COMMON_API ICUResourceBundleFactory : public LocaleKeyFactory
{
protected:
UnicodeString _bundleName;
@@ -394,20 +394,20 @@ protected:
/**
* Return the supported IDs. This is the set of all locale names in ICULocaleData.
*/
virtual const Hashtable* getSupportedIDs(UErrorCode& status) const;
virtual const Hashtable* getSupportedIDs(UErrorCode& status) const override;
/**
* Create the service. The default implementation returns the resource bundle
* for the locale, ignoring kind, and service.
*/
virtual UObject* handleCreate(const Locale& loc, int32_t kind, const ICUService* service, UErrorCode& status) const;
virtual UObject* handleCreate(const Locale& loc, int32_t kind, const ICUService* service, UErrorCode& status) const override;
public:
/**
* UObject boilerplate.
*/
static UClassID U_EXPORT2 getStaticClassID();
virtual UClassID getDynamicClassID() const;
virtual UClassID getDynamicClassID() const override;
#ifdef SERVICE_DEBUG
@@ -422,7 +422,7 @@ public:
******************************************************************
*/
class U_COMMON_API ICULocaleService : public ICUService
class U_COMMON_API ICULocaleService : public ICUService
{
private:
Locale fallbackLocale;
@@ -447,7 +447,7 @@ class U_COMMON_API ICULocaleService : public ICUService
#if 0
// redeclare because of overload resolution rules?
// no, causes ambiguities since both UnicodeString and Locale have constructors that take a const char*
// need some compiler flag to remove warnings
// need some compiler flag to remove warnings
UObject* get(const UnicodeString& descriptor, UErrorCode& status) const {
return ICUService::get(descriptor, status);
}
@@ -475,12 +475,12 @@ class U_COMMON_API ICULocaleService : public ICUService
* get(Locale, String, Locale[]) with a null kind.
*/
UObject* get(const Locale& locale, Locale* actualReturn, UErrorCode& status) const;
/**
* Convenience override for callers using locales. This uses
* createKey(Locale.toString(), kind) to create a key, calls getKey, and then
* if actualReturn is not null, returns the actualResult from
* getKey (stripping any prefix) into a Locale.
* getKey (stripping any prefix) into a Locale.
*/
UObject* get(const Locale& locale, int32_t kind, Locale* actualReturn, UErrorCode& status) const;
@@ -512,7 +512,7 @@ class U_COMMON_API ICULocaleService : public ICUService
* We really need a flag that is understood by all compilers that will suppress the warning about
* hidden overrides.
*/
virtual URegistryKey registerInstance(UObject* objToAdopt, const UnicodeString& locale, UBool visible, UErrorCode& status);
virtual URegistryKey registerInstance(UObject* objToAdopt, const UnicodeString& locale, UBool visible, UErrorCode& status) override;
/**
* Convenience method for callers using locales. This returns the standard
@@ -531,7 +531,7 @@ class U_COMMON_API ICULocaleService : public ICUService
/**
* Override superclass createKey method.
*/
virtual ICUServiceKey* createKey(const UnicodeString* id, UErrorCode& status) const;
virtual ICUServiceKey* createKey(const UnicodeString* id, UErrorCode& status) const override;
/**
* Additional createKey that takes a kind.
@@ -548,3 +548,4 @@ U_NAMESPACE_END
/* ICULSERV_H */
#endif
+10 -8
View File
@@ -92,12 +92,12 @@ ICULocaleService::get(const Locale& locale, int32_t kind, Locale* actualReturn,
URegistryKey
ICULocaleService::registerInstance(UObject* objToAdopt, const UnicodeString& locale,
ICULocaleService::registerInstance(UObject* objToAdopt, const UnicodeString& locale,
UBool visible, UErrorCode& status)
{
Locale loc;
LocaleUtility::initLocaleFromName(locale, loc);
return registerInstance(objToAdopt, loc, LocaleKey::KIND_ANY,
return registerInstance(objToAdopt, loc, LocaleKey::KIND_ANY,
visible ? LocaleKeyFactory::VISIBLE : LocaleKeyFactory::INVISIBLE, status);
}
@@ -179,7 +179,7 @@ private:
length = other._ids.size();
for(i = 0; i < length; ++i) {
_ids.addElement(((UnicodeString *)other._ids.elementAt(i))->clone(), status);
_ids.addElementX(((UnicodeString *)other._ids.elementAt(i))->clone(), status);
}
if(U_SUCCESS(status)) {
@@ -201,7 +201,7 @@ public:
virtual ~ServiceEnumeration();
virtual StringEnumeration *clone() const {
virtual StringEnumeration *clone() const override {
UErrorCode status = U_ZERO_ERROR;
ServiceEnumeration *cl = new ServiceEnumeration(*this, status);
if(U_FAILURE(status)) {
@@ -221,18 +221,18 @@ public:
return FALSE;
}
virtual int32_t count(UErrorCode& status) const {
virtual int32_t count(UErrorCode& status) const override {
return upToDate(status) ? _ids.size() : 0;
}
virtual const UnicodeString* snext(UErrorCode& status) {
virtual const UnicodeString* snext(UErrorCode& status) override {
if (upToDate(status) && (_pos < _ids.size())) {
return (const UnicodeString*)_ids[_pos++];
}
return NULL;
}
virtual void reset(UErrorCode& status) {
virtual void reset(UErrorCode& status) override {
if (status == U_ENUM_OUT_OF_SYNC_ERROR) {
status = U_ZERO_ERROR;
}
@@ -245,7 +245,7 @@ public:
public:
static UClassID U_EXPORT2 getStaticClassID(void);
virtual UClassID getDynamicClassID(void) const;
virtual UClassID getDynamicClassID(void) const override;
};
ServiceEnumeration::~ServiceEnumeration() {}
@@ -291,3 +291,5 @@ U_NAMESPACE_END
/* !UCONFIG_NO_SERVICE */
#endif
+10 -9
View File
@@ -23,8 +23,8 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(EventListener)
static UMutex notifyLock;
ICUNotifier::ICUNotifier(void)
: listeners(NULL)
ICUNotifier::ICUNotifier(void)
: listeners(NULL)
{
}
@@ -37,8 +37,8 @@ ICUNotifier::~ICUNotifier(void) {
}
void
ICUNotifier::addListener(const EventListener* l, UErrorCode& status)
void
ICUNotifier::addListener(const EventListener* l, UErrorCode& status)
{
if (U_SUCCESS(status)) {
if (l == NULL) {
@@ -59,7 +59,7 @@ ICUNotifier::addListener(const EventListener* l, UErrorCode& status)
}
}
listeners->addElement((void*)l, status); // cast away const
listeners->addElementX((void*)l, status); // cast away const
}
#ifdef NOTIFIER_DEBUG
else {
@@ -70,8 +70,8 @@ ICUNotifier::addListener(const EventListener* l, UErrorCode& status)
}
}
void
ICUNotifier::removeListener(const EventListener *l, UErrorCode& status)
void
ICUNotifier::removeListener(const EventListener *l, UErrorCode& status)
{
if (U_SUCCESS(status)) {
if (l == NULL) {
@@ -99,8 +99,8 @@ ICUNotifier::removeListener(const EventListener *l, UErrorCode& status)
}
}
void
ICUNotifier::notifyChanged(void)
void
ICUNotifier::notifyChanged(void)
{
if (listeners != NULL) {
Mutex lmx(&notifyLock);
@@ -117,3 +117,4 @@ U_NAMESPACE_END
/* UCONFIG_NO_SERVICE */
#endif
+15 -15
View File
@@ -34,13 +34,13 @@ U_NAMESPACE_END
U_NAMESPACE_BEGIN
class U_COMMON_API EventListener : public UObject {
public:
public:
virtual ~EventListener();
public:
static UClassID U_EXPORT2 getStaticClassID();
virtual UClassID getDynamicClassID() const;
virtual UClassID getDynamicClassID() const override;
public:
#ifdef SERVICE_DEBUG
@@ -62,54 +62,54 @@ public:
* eventually dequeues the list and calls notifyListener on each
* listener in the list.</p>
*
* <p>Subclasses override acceptsListener and notifyListener
* <p>Subclasses override acceptsListener and notifyListener
* to add type-safe notification. AcceptsListener should return
* true if the listener is of the appropriate type; ICUNotifier
* itself will ensure the listener is non-null and that the
* identical listener is not already registered with the Notifier.
* NotifyListener should cast the listener to the appropriate
* NotifyListener should cast the listener to the appropriate
* type and call the appropriate method on the listener.
*/
class U_COMMON_API ICUNotifier : public UMemory {
private: UVector* listeners;
public:
public:
ICUNotifier(void);
virtual ~ICUNotifier(void);
/**
* Add a listener to be notified when notifyChanged is called.
* The listener must not be null. AcceptsListener must return
* true for the listener. Attempts to concurrently
* register the identical listener more than once will be
* silently ignored.
* silently ignored.
*/
virtual void addListener(const EventListener* l, UErrorCode& status);
/**
* Stop notifying this listener. The listener must
* not be null. Attempts to remove a listener that is
* not registered will be silently ignored.
*/
virtual void removeListener(const EventListener* l, UErrorCode& status);
/**
* ICU doesn't spawn its own threads. All listeners are notified in
* the thread of the caller. Misbehaved listeners can therefore
* indefinitely block the calling thread. Callers should beware of
* deadlock situations.
* deadlock situations.
*/
virtual void notifyChanged(void);
protected:
protected:
/**
* Subclasses implement this to return true if the listener is
* of the appropriate type.
*/
virtual UBool acceptsListener(const EventListener& l) const = 0;
/**
* Subclasses implement this to notify the listener.
*/
+2
View File
@@ -92,3 +92,5 @@ U_NAMESPACE_END
/* !UCONFIG_NO_SERVICE */
#endif
+2
View File
@@ -119,3 +119,5 @@ U_NAMESPACE_END
/* !UCONFIG_NO_SERVICE */
#endif
+5 -5
View File
@@ -78,7 +78,7 @@ public:
* Decrements the number of hard references to this object, and
* arrange for possible cache-eviction and/or deletion if ref
* count goes to zero. Thread-safe.
*
*
* Not for use from within the UnifiedCache implementation.
*/
void removeRef() const;
@@ -108,12 +108,12 @@ public:
*/
void deleteIfZeroRefCount() const;
/**
* Returns a writable version of ptr.
* If there is exactly one owner, then ptr itself is returned as a
* non-const pointer.
* If there are multiple owners, then ptr is replaced with a
* If there are multiple owners, then ptr is replaced with a
* copy-constructed clone,
* and that is returned.
* Returns NULL if cloning failed.
@@ -136,7 +136,7 @@ public:
* Makes dest an owner of the object pointed to by src while adjusting
* reference counts and deleting the previous object dest pointed to
* if necessary. Before this call is made, dest must either be NULL or
* be included in the reference count of the object it points to.
* be included in the reference count of the object it points to.
*
* T must be a subclass of SharedObject.
*/
@@ -174,7 +174,7 @@ private:
* Reference count, excluding references from within the UnifiedCache implementation.
*/
mutable u_atomic_int32_t hardRefCount;
mutable const UnifiedCacheBase *cachePtr;
};
+9 -9
View File
@@ -36,20 +36,20 @@
enum UStringPrepType{
USPREP_UNASSIGNED = 0x0000 ,
USPREP_MAP = 0x0001 ,
USPREP_PROHIBITED = 0x0002 ,
USPREP_PROHIBITED = 0x0002 ,
USPREP_DELETE = 0x0003 ,
USPREP_TYPE_LIMIT = 0x0004
USPREP_TYPE_LIMIT = 0x0004
};
typedef enum UStringPrepType UStringPrepType;
#ifdef USPREP_TYPE_NAMES_ARRAY
static const char* usprepTypeNames[] ={
"UNASSIGNED" ,
"MAP" ,
"PROHIBITED" ,
"UNASSIGNED" ,
"MAP" ,
"PROHIBITED" ,
"DELETE",
"TYPE_LIMIT"
"TYPE_LIMIT"
};
#endif
@@ -60,7 +60,7 @@ enum{
enum{
_SPREP_TYPE_THRESHOLD = 0xFFF0,
_SPREP_MAX_INDEX_VALUE = 0x3FBF, /*16139*/
_SPREP_MAX_INDEX_VALUE = 0x3FBF, /*16139*/
_SPREP_MAX_INDEX_TOP_LENGTH = 0x0003
};
@@ -68,7 +68,7 @@ enum{
enum {
_SPREP_INDEX_TRIE_SIZE = 0, /* number of bytes in StringPrep trie */
_SPREP_INDEX_MAPPING_DATA_SIZE = 1, /* The array that contains the mapping */
_SPREP_NORM_CORRECTNS_LAST_UNI_VERSION = 2, /* The index of Unicode version of last entry in NormalizationCorrections.txt */
_SPREP_NORM_CORRECTNS_LAST_UNI_VERSION = 2, /* The index of Unicode version of last entry in NormalizationCorrections.txt */
_SPREP_ONE_UCHAR_MAPPING_INDEX_START = 3, /* The starting index of 1 UChar mapping index in the mapping data array */
_SPREP_TWO_UCHARS_MAPPING_INDEX_START = 4, /* The starting index of 2 UChars mapping index in the mapping data array */
_SPREP_THREE_UCHARS_MAPPING_INDEX_START = 5, /* The starting index of 3 UChars mapping index in the mapping data array */
@@ -101,7 +101,7 @@ struct UStringPrepProfile{
* @internal
*/
U_CAPI void U_EXPORT2
uprv_syntaxError(const UChar* rules,
uprv_syntaxError(const UChar* rules,
int32_t pos,
int32_t rulesLen,
UParseError* parseError);
+2 -2
View File
@@ -83,9 +83,9 @@ enum Key {
*
* This method is always safe and OK to chain: in the case of a memory or other
* error, it returns an empty set from static memory.
*
*
* Example:
*
*
* UBool hasIgnorables = unisets::get(unisets::DEFAULT_IGNORABLES)->contains(...);
*
* @param key The desired UnicodeSet according to the enum in this file.
+24 -24
View File
@@ -383,7 +383,7 @@ StringTrieBuilder::equalNodes(const void *left, const void *right) {
return *(const Node *)left==*(const Node *)right;
}
UBool
bool
StringTrieBuilder::Node::operator==(const Node &other) const {
return this==&other || (typeid(*this)==typeid(other) && hash==other.hash);
}
@@ -396,13 +396,13 @@ StringTrieBuilder::Node::markRightEdgesFirst(int32_t edgeNumber) {
return edgeNumber;
}
UBool
bool
StringTrieBuilder::FinalValueNode::operator==(const Node &other) const {
if(this==&other) {
return TRUE;
return true;
}
if(!Node::operator==(other)) {
return FALSE;
return false;
}
const FinalValueNode &o=(const FinalValueNode &)other;
return value==o.value;
@@ -413,25 +413,25 @@ StringTrieBuilder::FinalValueNode::write(StringTrieBuilder &builder) {
offset=builder.writeValueAndFinal(value, TRUE);
}
UBool
bool
StringTrieBuilder::ValueNode::operator==(const Node &other) const {
if(this==&other) {
return TRUE;
return true;
}
if(!Node::operator==(other)) {
return FALSE;
return false;
}
const ValueNode &o=(const ValueNode &)other;
return hasValue==o.hasValue && (!hasValue || value==o.value);
}
UBool
bool
StringTrieBuilder::IntermediateValueNode::operator==(const Node &other) const {
if(this==&other) {
return TRUE;
return true;
}
if(!ValueNode::operator==(other)) {
return FALSE;
return false;
}
const IntermediateValueNode &o=(const IntermediateValueNode &)other;
return next==o.next;
@@ -451,13 +451,13 @@ StringTrieBuilder::IntermediateValueNode::write(StringTrieBuilder &builder) {
offset=builder.writeValueAndFinal(value, FALSE);
}
UBool
bool
StringTrieBuilder::LinearMatchNode::operator==(const Node &other) const {
if(this==&other) {
return TRUE;
return true;
}
if(!ValueNode::operator==(other)) {
return FALSE;
return false;
}
const LinearMatchNode &o=(const LinearMatchNode &)other;
return length==o.length && next==o.next;
@@ -471,21 +471,21 @@ StringTrieBuilder::LinearMatchNode::markRightEdgesFirst(int32_t edgeNumber) {
return edgeNumber;
}
UBool
bool
StringTrieBuilder::ListBranchNode::operator==(const Node &other) const {
if(this==&other) {
return TRUE;
return true;
}
if(!Node::operator==(other)) {
return FALSE;
return false;
}
const ListBranchNode &o=(const ListBranchNode &)other;
for(int32_t i=0; i<length; ++i) {
if(units[i]!=o.units[i] || values[i]!=o.values[i] || equal[i]!=o.equal[i]) {
return FALSE;
return false;
}
}
return TRUE;
return true;
}
int32_t
@@ -550,13 +550,13 @@ StringTrieBuilder::ListBranchNode::write(StringTrieBuilder &builder) {
}
}
UBool
bool
StringTrieBuilder::SplitBranchNode::operator==(const Node &other) const {
if(this==&other) {
return TRUE;
return true;
}
if(!Node::operator==(other)) {
return FALSE;
return false;
}
const SplitBranchNode &o=(const SplitBranchNode &)other;
return unit==o.unit && lessThan==o.lessThan && greaterOrEqual==o.greaterOrEqual;
@@ -584,13 +584,13 @@ StringTrieBuilder::SplitBranchNode::write(StringTrieBuilder &builder) {
offset=builder.write(unit);
}
UBool
bool
StringTrieBuilder::BranchHeadNode::operator==(const Node &other) const {
if(this==&other) {
return TRUE;
return true;
}
if(!ValueNode::operator==(other)) {
return FALSE;
return false;
}
const BranchHeadNode &o=(const BranchHeadNode &)other;
return length==o.length && next==o.next;
+24 -4
View File
@@ -10,7 +10,7 @@
*
* File uassert.h
*
* Contains the U_ASSERT and UPRV_UNREACHABLE macros
* Contains the U_ASSERT and UPRV_UNREACHABLE_* macros
*
******************************************************************************
*/
@@ -38,14 +38,34 @@
#endif
/**
* \def UPRV_UNREACHABLE
* \def UPRV_UNREACHABLE_ASSERT
* This macro is used in places that we had believed were unreachable, but
* experience has shown otherwise (possibly due to memory corruption, etc).
* In this case we call assert() in debug versions as with U_ASSERT, instead
* of unconditionally calling abort(). However we also allow redefinition as
* with UPRV_UNREACHABLE_EXIT.
* @internal
*/
#if defined(UPRV_UNREACHABLE_ASSERT)
// Use the predefined value.
#elif U_DEBUG
# include <assert.h>
# define UPRV_UNREACHABLE_ASSERT assert(false)
#elif U_CPLUSPLUS_VERSION
# define UPRV_UNREACHABLE_ASSERT (void)0
#else
# define UPRV_UNREACHABLE_ASSERT
#endif
/**
* \def UPRV_UNREACHABLE_EXIT
* This macro is used to unconditionally abort if unreachable code is ever executed.
* @internal
*/
#if defined(UPRV_UNREACHABLE)
#if defined(UPRV_UNREACHABLE_EXIT)
// Use the predefined value.
#else
# define UPRV_UNREACHABLE abort()
# define UPRV_UNREACHABLE_EXIT abort()
#endif
#endif
+3 -3
View File
@@ -2047,7 +2047,7 @@ processPropertySeq(UBiDi *pBiDi, LevState *pLevState, uint8_t _prop,
break;
default: /* we should never get here */
UPRV_UNREACHABLE;
UPRV_UNREACHABLE_EXIT;
}
}
if((addLevel) || (start < start0)) {
@@ -2250,7 +2250,7 @@ resolveImplicitLevels(UBiDi *pBiDi,
start2=i;
break;
default: /* we should never get here */
UPRV_UNREACHABLE;
UPRV_UNREACHABLE_EXIT;
}
}
}
@@ -2724,7 +2724,7 @@ ubidi_setPara(UBiDi *pBiDi, const UChar *text, int32_t length,
break;
default:
/* we should never get here */
UPRV_UNREACHABLE;
UPRV_UNREACHABLE_EXIT;
}
/*
* If there are no external levels specified and there
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -31,7 +31,7 @@
* text in a single paragraph or in a line of a single paragraph
* which has already been processed according to
* the Unicode 6.3 BiDi algorithm as defined in
* http://www.unicode.org/unicode/reports/tr9/ , version 28,
* https://www.unicode.org/reports/tr9/ , version 28,
* also described in The Unicode Standard, Version 6.3.0 .
*
* This means that there is a UBiDi object with a levels
@@ -530,7 +530,7 @@ static int32_t getRunFromLogicalIndex(UBiDi *pBiDi, int32_t logicalIndex) {
visualStart+=length;
}
/* we should never get here */
UPRV_UNREACHABLE;
UPRV_UNREACHABLE_EXIT;
}
/*
Loaded 100 of 715 files, more files were not shown because too many files have changed in this diff. Show more