ICU-9353 fix dependencies, mostly dictionary code and listformatter

X-SVN-Rev: 32331
This commit is contained in:
Markus Scherer 2012-09-04 20:38:14 +00:00
parent 6da17ae2f5
commit 22cc0cd7cc
4 changed files with 27 additions and 11 deletions

View File

@ -771,6 +771,7 @@ CjkBreakEngine::divideUpDictionaryRange( UText *text,
}
UnicodeString inputString(charString.elems(), inputLength);
// TODO: Use Normalizer2.
UNormalizationMode norm_mode = UNORM_NFKC;
UBool isNormalized =
Normalizer::quickCheck(inputString, norm_mode, status) == UNORM_YES ||

View File

@ -22,6 +22,9 @@ const int32_t DictionaryData::TRIE_TYPE_BYTES;
const int32_t DictionaryData::TRIE_TYPE_UCHARS;
#endif
DictionaryMatcher::~DictionaryMatcher() {
}
UCharsDictionaryMatcher::~UCharsDictionaryMatcher() {
udata_close(file);
}

View File

@ -61,13 +61,15 @@ public:
* Wrapper class around generic dictionaries, implementing matches().
* getType() should return a TRIE_TYPE_??? constant from DictionaryData.
*
* All implementations of this interface must be threadsafe if they are to be used inside of the
* All implementations of this interface must be thread-safe if they are to be used inside of the
* dictionary-based break iteration code.
*/
class U_COMMON_API DictionaryMatcher {
class U_COMMON_API DictionaryMatcher : public UMemory {
public:
virtual ~DictionaryMatcher();
// this should emulate CompactTrieDictionary::matches()
virtual int32_t matches(UText *text, int32_t maxLength, int32_t *lengths, int &count, int limit, int32_t *values = NULL) const = 0;
virtual int32_t matches(UText *text, int32_t maxLength, int32_t *lengths, int &count,
int limit, int32_t *values = NULL) const = 0;
/** @return DictionaryData::TRIE_TYPE_XYZ */
virtual int32_t getType() const = 0;
};
@ -78,8 +80,9 @@ public:
// constructs a new UCharsDictionaryMatcher.
// The UDataMemory * will be closed on this object's destruction.
UCharsDictionaryMatcher(const UChar *c, UDataMemory *f) : characters(c), file(f) { }
~UCharsDictionaryMatcher();
virtual int32_t matches(UText *text, int32_t maxLength, int32_t *lengths, int &count, int limit, int32_t *values = NULL) const;
virtual ~UCharsDictionaryMatcher();
virtual int32_t matches(UText *text, int32_t maxLength, int32_t *lengths, int &count,
int limit, int32_t *values = NULL) const;
virtual int32_t getType() const;
private:
const UChar *characters;
@ -92,9 +95,11 @@ public:
// constructs a new BytesTrieDictionaryMatcher
// the transform constant should be the constant read from the file, not a masked version!
// the UDataMemory * fed in here will be closed on this object's destruction
BytesDictionaryMatcher(const char *c, int32_t t, UDataMemory *f) : characters(c), transformConstant(t), file(f) { }
~BytesDictionaryMatcher();
virtual int32_t matches(UText *text, int32_t maxLength, int32_t *lengths, int &count, int limit, int32_t *values = NULL) const;
BytesDictionaryMatcher(const char *c, int32_t t, UDataMemory *f)
: characters(c), transformConstant(t), file(f) { }
virtual ~BytesDictionaryMatcher();
virtual int32_t matches(UText *text, int32_t maxLength, int32_t *lengths, int &count,
int limit, int32_t *values = NULL) const;
virtual int32_t getType() const;
private:
UChar32 transform(UChar32 c) const;

View File

@ -37,7 +37,7 @@ group: c_strings
memcmp memcpy memmove memset
# Additional symbols in an optimized build.
__strcpy_chk __strncpy_chk __strcat_chk __strncat_chk
__rawmemchr __memcpy_chk __memmove_chk
__rawmemchr __memcpy_chk __memmove_chk __memset_chk
group: c_string_formatting
atoi atol strtod strtol strtoul
@ -136,6 +136,7 @@ library: common
ucasemap ucasemap_titlecase_brkiter script_runs
uprops ubidi_props ucase uscript
ubidi ushape
listformatter
resourcebundle service_registration resbund_cnv ures_cnv icudataver ucat
loclikely
conversion converter_selector ucnv_set ucnvdisp
@ -164,12 +165,13 @@ group: breakiterator
brkiter.o brkeng.o ubrk.o
rbbi.o rbbinode.o rbbiscan.o rbbisetb.o rbbistbl.o rbbitblb.o
rbbidata.o rbbirb.o
triedict.o dictbe.o
dictionarydata.o dictbe.o
deps
resourcebundle service_registration
schriter utext uniset_core uniset_props
uhash ustack utrie
uvector32 # for triedict.o
ucharstrie bytestrie
normlzr # for dictbe.o, should switch to Normalizer2
group: unormcmp # unorm_compare()
unormcmp.o
@ -491,6 +493,11 @@ group: service_registration
locale_display_names resourcebundle
hashtable uvector
group: listformatter
listformatter.o
deps
resourcebundle
group: ucat # message-catalog-like API
ucat.o
deps