
IntlRuleBasedBreakIterator::getRules 메서드는 언어별 분리 규칙을 가져올 때 사용됩니다.
IntlRuleBasedBreakIterator::getRules 메서드는 언어별 분리 규칙을 위한 RuleBasedBreakIterator 객체의 규칙을 반환합니다. 반환값은 RuleBasedBreakIterator 객체의 규칙을 나타내는 RuleBasedBreakIterator::Rule 객체의 배열입니다.
IntlRuleBasedBreakIterator::getRules 메서드를 사용하는 샘플 코드는 다음과 같습니다.
#hostingforum.kr
cpp
#include
#include
int main() {
// 언어별 분리 규칙을 가져올 언어 코드를 설정합니다.
UErrorCode status = U_ZERO_ERROR;
UChar *languageCode = (UChar*)"ko"; // 한국어
// 언어별 분리 규칙을 가져올 RuleBasedBreakIterator 객체를 생성합니다.
UErrorCode status = U_ZERO_ERROR;
UBreakIterator *breakIterator = ubrk_open(languageCode, U_FOLD_CASE_DEFAULT, &status);
// 언어별 분리 규칙을 가져옵니다.
URule *rules = ubrk_getRules(breakIterator, &status);
// 언어별 분리 규칙을 출력합니다.
for (int i = 0; rules[i] != NULL; i++) {
URule *rule = rules[i];
UChar32 category = ubrk_getRuleCategory(rule);
UChar32 type = ubrk_getRuleType(rule);
UChar32 value = ubrk_getRuleValue(rule);
// 언어별 분리 규칙을 출력합니다.
printf("category: %d, type: %d, value: %dn", category, type, value);
}
// 언어별 분리 규칙을 반환합니다.
ubrk_close(breakIterator);
return 0;
}
IntlRuleBasedBreakIterator::getRules 메서드는 언어별 분리 규칙을 가져올 때 사용됩니다. 언어별 분리 규칙을 가져올 때는 언어 코드를 설정하고 RuleBasedBreakIterator 객체를 생성한 후, 언어별 분리 규칙을 가져오고 출력합니다.
IntlRuleBasedBreakIterator::getRules 메서드는 언어별 분리 규칙을 가져올 때 사용하는 것이 좋습니다. 언어별 분리 규칙을 가져올 때는 언어 코드를 설정하고 RuleBasedBreakIterator 객체를 생성한 후, 언어별 분리 규칙을 가져오고 출력합니다.
2025-03-11 03:18