00001
00002
00003
00004
00005
00006
#ifndef UBRK_H
00007
#define UBRK_H
00008
00009
#include "unicode/utypes.h"
00010
#include "unicode/uloc.h"
00011
00016
#ifndef UBRK_TYPEDEF_UBREAK_ITERATOR
00017
# define UBRK_TYPEDEF_UBREAK_ITERATOR
00018
00022
typedef void UBreakIterator;
00023 #endif
00024
00025
#if !UCONFIG_NO_BREAK_ITERATION
00026
00027
#include "unicode/parseerr.h"
00028
00187
typedef enum UBreakIteratorType {
00189 UBRK_CHARACTER,
00191
UBRK_WORD,
00193
UBRK_LINE,
00195
UBRK_SENTENCE,
00196
00197
#ifndef U_HIDE_DEPRECATED_API
00198
00206
UBRK_TITLE
00207
#endif
00208
00209 }
UBreakIteratorType;
00210
00214
#define UBRK_DONE ((int32_t) -1)
00215
00216
00225
typedef enum UWordBreak {
00228
UBRK_WORD_NONE = 0,
00230
UBRK_WORD_NONE_LIMIT = 100,
00232
UBRK_WORD_NUMBER = 100,
00234 UBRK_WORD_NUMBER_LIMIT = 200,
00237
UBRK_WORD_LETTER = 200,
00239
UBRK_WORD_LETTER_LIMIT = 300,
00241
UBRK_WORD_KANA = 300,
00243
UBRK_WORD_KANA_LIMIT = 400,
00245
UBRK_WORD_IDEO = 400,
00247
UBRK_WORD_IDEO_LIMIT = 500
00248 }
UWordBreak;
00249
00258
typedef enum ULineBreakTag {
00261
UBRK_LINE_SOFT = 0,
00263
UBRK_LINE_SOFT_LIMIT = 100,
00265
UBRK_LINE_HARD = 100,
00267
UBRK_LINE_HARD_LIMIT = 200
00268 }
ULineBreakTag;
00269
00270
00271
00280
typedef enum USentenceBreakTag {
00285
UBRK_SENTENCE_TERM = 0,
00287
UBRK_SENTENCE_TERM_LIMIT = 100,
00292
UBRK_SENTENCE_SEP = 100,
00294
UBRK_SENTENCE_SEP_LIMIT = 200
00296 }
USentenceBreakTag;
00297
00298
00313
U_STABLE UBreakIterator*
U_EXPORT2
00314
ubrk_open(UBreakIteratorType type,
00315
const char *locale,
00316
const UChar *text,
00317 int32_t textLength,
00318 UErrorCode *status);
00319
00335
U_STABLE UBreakIterator*
U_EXPORT2
00336
ubrk_openRules(
const UChar *rules,
00337 int32_t rulesLength,
00338
const UChar *text,
00339 int32_t textLength,
00340
UParseError *parseErr,
00341 UErrorCode *status);
00342
00359
U_STABLE UBreakIterator *
U_EXPORT2
00360
ubrk_safeClone(
00361
const UBreakIterator *bi,
00362
void *stackBuffer,
00363 int32_t *pBufferSize,
00364 UErrorCode *status);
00365
00370
#define U_BRK_SAFECLONE_BUFFERSIZE 512
00371
00378
U_STABLE void U_EXPORT2
00379
ubrk_close(UBreakIterator *bi);
00380
00389
U_STABLE void U_EXPORT2
00390
ubrk_setText(UBreakIterator* bi,
00391
const UChar* text,
00392 int32_t textLength,
00393 UErrorCode* status);
00394
00403
U_STABLE int32_t U_EXPORT2
00404
ubrk_current(
const UBreakIterator *bi);
00405
00415
U_STABLE int32_t U_EXPORT2
00416
ubrk_next(UBreakIterator *bi);
00417
00427
U_STABLE int32_t U_EXPORT2
00428
ubrk_previous(UBreakIterator *bi);
00429
00438
U_STABLE int32_t U_EXPORT2
00439
ubrk_first(UBreakIterator *bi);
00440
00451
U_STABLE int32_t U_EXPORT2
00452
ubrk_last(UBreakIterator *bi);
00453
00463
U_STABLE int32_t U_EXPORT2
00464
ubrk_preceding(UBreakIterator *bi,
00465 int32_t offset);
00466
00476
U_STABLE int32_t U_EXPORT2
00477
ubrk_following(UBreakIterator *bi,
00478 int32_t offset);
00479
00489
U_STABLE const char*
U_EXPORT2
00490
ubrk_getAvailable(int32_t index);
00491
00500
U_STABLE int32_t U_EXPORT2
00501
ubrk_countAvailable(
void);
00502
00503
00513
U_STABLE UBool U_EXPORT2
00514
ubrk_isBoundary(UBreakIterator *bi, int32_t offset);
00515
00525
U_STABLE int32_t U_EXPORT2
00526
ubrk_getRuleStatus(UBreakIterator *bi);
00527
00545
U_DRAFT int32_t U_EXPORT2
00546
ubrk_getRuleStatusVec(UBreakIterator *bi, int32_t *fillInVec, int32_t capacity, UErrorCode *status);
00547
00557
U_DRAFT const char*
U_EXPORT2
00558
ubrk_getLocaleByType(
const UBreakIterator *bi, ULocDataLocaleType type, UErrorCode* status);
00559
00560
00561
#endif
00562
00563
#endif