"1000000000000000: \u0628\u0644\u064A\u0627\u0631[ >%spellout-numbering>];",
"2000000000000000: <%%spellout-numbering-m< \u0628\u0644\u064A\u0627\u0631[ >%spellout-numbering>];",
"1000000000000000000: =#,##0=;",
- "%spellout-cardinal-feminine-prefixpart:",
+ "%spellout-cardinal-feminine-prefixpart@noparse:",
"-x: \u0646\u0627\u0642\u0635 >>;",
"x.x: <%spellout-numbering< \u0641\u0627\u0635\u0644\u0629 >%%zz-fraction-feminine> ;",
"0: \u0635\u0641\u0631 ;",
"1: ;",
"3: =%%spellout-cardinal-feminine-prefx= ;",
- "%spellout-cardinal-feminine-postfixpart:",
+ "%spellout-cardinal-feminine-postfixpart@noparse:",
"-x: >>;",
"x.x: ;",
"0: ;",
"1000000000000000: \u0628\u0644\u064A\u0627\u0631[ >%%spellout-numbering-m>];",
"2000000000000000: <%%spellout-numbering-m< \u0628\u0644\u064A\u0627\u0631[ >%%spellout-numbering-m>];",
"1000000000000000000: =#,##0=;",
- "%spellout-cardinal-masculine-prefixpart:",
+ "%spellout-cardinal-masculine-prefixpart@noparse:",
"-x: \u0646\u0627\u0642\u0635 >>;",
"x.x: <%%spellout-numbering-m< \u0641\u0627\u0635\u0644\u0629 >%%zz-fraction-masculine> ;",
"0: \u0635\u0641\u0631 ;",
"1: ;",
"3: =%%spellout-cardinal-masculine-prefx= ;",
- "%spellout-cardinal-masculine-postfixpart:",
+ "%spellout-cardinal-masculine-postfixpart@noparse:",
"-x: >>;",
"x.x: ;",
"0: ;",
"10: =%%spellout-numbering-no-a=;",
"%%lenient-parse:",
"& ' ' , ',' ;",
- "%spellout-numbering-year:",
+ "%spellout-numbering-year@noparse:",
"-x: m\u00EDneas >>;",
"x.x: =#,##0.#=;",
"0: =%spellout-numbering=;",
"12: >>=%spellout-cardinal-postfixparth=;",
"13: >>=%spellout-cardinal-postfixpart=;",
"20: =%spellout-numbering=;",
- "%spellout-numbering:",
+ "%spellout-numbering@noparse:",
"-x: m\u00EDneas >>;",
"x.x: << pointe >>;",
"0: a n\u00E1id;",
"0: =%spellout-cardinal-prefixpart=;",
"12: d\u00F3=%spellout-cardinal-postfixparth=;",
"13: =%spellout-cardinal-prefixpart==%spellout-cardinal-postfixpart=;",
- "%spellout-cardinal-prefixpart:",
+ "%spellout-cardinal-prefixpart@noparse:",
"-x: m\u00EDneas >>;",
"x.x: <%%numberp< pointe >>;",
"0: n\u00E1id;",
"1000000000000: <%%trillions<[, >%%numberp>];",
"1000000000000000: <%%quadrillions<[, >%%numberp>];",
"1000000000000000000: =#,##0=;",
- "%spellout-cardinal-postfixpart:",
+ "%spellout-cardinal-postfixpart@noparse:",
"-x: >>;",
"x.x: ;",
"0: ;",
"2: ;",
"11: ' d\u00E9ag;",
"20: ;",
- "%spellout-cardinal-postfixparth:",
+ "%spellout-cardinal-postfixparth@noparse:",
"-x: >>;",
"x.x: ;",
"0: ;",
"2000000000000000: \u05E9\u05E0\u05D9 \u05D8\u05E8\u05D9\u05DC\u05D9\u05E8\u05D3[ >%%and-feminine>];",
"3000000000000000: <%%spellout-numbering-m< \u05D8\u05E8\u05D9\u05DC\u05D9\u05E8\u05D3[ >%%and-feminine>];",
"1000000000000000000: =#,##0=;",
- "%spellout-cardinal-feminine-prefixpart:",
+ "%spellout-cardinal-feminine-prefixpart@noparse:",
"-x: \u05DE\u05D9\u05E0\u05D5\u05E1 >>;",
"x.x: <%spellout-numbering< \u05E0\u05E7\u05D5\u05D3\u05D4 >%%zz-fraction-feminine> ;",
"0: \u05D0\u05E4\u05E1 ;",
"1: ;",
"2: =%%spellout-cardinal-feminine-prefx= ;",
- "%spellout-cardinal-feminine-postfixpart:",
+ "%spellout-cardinal-feminine-postfixpart@noparse:",
"-x: >>;",
"x.x: ;",
"0: ;",
"2000000000000000: \u05E9\u05E0\u05D9 \u05D8\u05E8\u05D9\u05DC\u05D9\u05E8\u05D3[ >%%and-masculine>];",
"3000000000000000: <%%spellout-numbering-m< \u05D8\u05E8\u05D9\u05DC\u05D9\u05E8\u05D3[ >%%and-masculine>];",
"1000000000000000000: =#,##0=;",
- "%spellout-cardinal-masculine-prefixpart:",
+ "%spellout-cardinal-masculine-prefixpart@noparse:",
"-x: \u05DE\u05D9\u05E0\u05D5\u05E1 >>;",
"x.x: <%%spellout-numbering-m< \u05E0\u05E7\u05D5\u05D3\u05D4 >%%zz-fraction-masculine> ;",
"0: \u05D0\u05E4\u05E1 ;",
"1: ;",
"2: =%%spellout-cardinal-masculine-prefx= ;",
- "%spellout-cardinal-masculine-postfixpart:",
+ "%spellout-cardinal-masculine-postfixpart@noparse:",
"-x: >>;",
"x.x: ;",
"0: ;",
"2000000000000000: <%%spellout-cardinal-masculine< kvadriljuni[>%%and-typeA-masculine>];",
"11000000000000000/1,000: <%%spellout-cardinal-masculine< kvadriljun[>%%and-typeA-masculine>];",
"1000000000000000000: =#,##0=;",
- "%spellout-cardinal-masculine-prefixpart:",
+ "%spellout-cardinal-masculine-prefixpart@noparse:",
"-x: minus >>;",
"x.x: <%%spellout-cardinal-masculine< punt >%%zz-fraction-masculine> ;",
"0: \u017Cero ;",
"2: =%%spellout-cardinal-masculine-prefx= ;",
"%%lenient-parse:",
"&[last primary ignorable ] << ' ' << ',' << '-' << '\u00AD';",
- "%spellout-cardinal-masculine-postfixpart:",
+ "%spellout-cardinal-masculine-postfixpart@noparse:",
"-x: >>;",
"x.x: ;",
"0: ;",
"2000000000000000: <%%spellout-cardinal-masculine< kvadriljuni[>%%and-typeA-feminine>];",
"11000000000000000/1,000: <%%spellout-cardinal-masculine< kvadriljun[>%%and-typeA-feminine>];",
"1000000000000000000: =#,##0=;",
- "%spellout-cardinal-feminine-prefixpart:",
+ "%spellout-cardinal-feminine-prefixpart@noparse:",
"-x: minus >>;",
"x.x: <%%spellout-cardinal-feminine< punt >%%zz-fraction-feminine> ;",
"0: \u017Cero ;",
"1: ;",
"2: =%%spellout-cardinal-feminine-prefx= ;",
- "%spellout-cardinal-feminine-postfixpart:",
+ "%spellout-cardinal-feminine-postfixpart@noparse:",
"-x: >>;",
"x.x: ;",
"0: ;",
/*
******************************************************************************
-* Copyright (C) 1997-2011, International Business Machines
+* Copyright (C) 1997-2012, International Business Machines
* Corporation and others. All Rights Reserved.
******************************************************************************
* file name: nfrs.cpp
0x25, 0x25, 0
}; /* "%%" */
+static const UChar gNoparse[] =
+{
+ 0x40, 0x6E, 0x6F, 0x70, 0x61, 0x72, 0x73, 0x65, 0
+}; /* "@noparse" */
+
NFRuleSet::NFRuleSet(UnicodeString* descriptions, int32_t index, UErrorCode& status)
: name()
, rules(0)
, negativeNumberRule(NULL)
, fIsFractionRuleSet(FALSE)
, fIsPublic(FALSE)
+ , fIsParseable(TRUE)
, fRecursionCount(0)
{
for (int i = 0; i < 3; ++i) {
fIsPublic = name.indexOf(gPercentPercent, 2, 0) != 0;
+ if ( name.endsWith(gNoparse,8) ) {
+ fIsParseable = FALSE;
+ name.truncate(name.length()-8); // remove the @noparse from the name
+ }
+
// all of the other members of NFRuleSet are initialized
// by parseRules()
}
/*
******************************************************************************
-* Copyright (C) 1997-2009, International Business Machines
+* Copyright (C) 1997-2012, International Business Machines
* Corporation and others. All Rights Reserved.
******************************************************************************
* file name: nfrs.h
UBool isPublic() const { return fIsPublic; }
- UBool isParseable() const {
- UnicodeString prefixpart = UNICODE_STRING_SIMPLE("-prefixpart");
- UnicodeString postfix = UNICODE_STRING_SIMPLE("-postfix");
- UnicodeString postfx = UNICODE_STRING_SIMPLE("-postfx");
-
- return ( name.indexOf(prefixpart) == -1 && name.indexOf(postfix) == -1 && name.indexOf(postfx) == -1 );
- }
+ UBool isParseable() const { return fIsParseable; }
UBool isFractionRuleSet() const { return fIsFractionRuleSet; }
NFRule *fractionRules[3];
UBool fIsFractionRuleSet;
UBool fIsPublic;
+ UBool fIsParseable;
int32_t fRecursionCount;
NFRuleSet(const NFRuleSet &other); // forbid copying of this class
#define kHalfMaxDouble (double)(1 << kSomeNumberOfBitsDiv2)
#define kMaxDouble (kHalfMaxDouble * kHalfMaxDouble)
-// Temporary workaround - when noParse is true, do noting in parse.
-// TODO: We need a real fix - see #6895/#6896
-static const char *NO_SPELLOUT_PARSE_LANGUAGES[] = { "ga", NULL };
-
U_NAMESPACE_BEGIN
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(RuleBasedNumberFormat)
, lenient(FALSE)
, lenientParseRules(NULL)
, localizations(NULL)
- , noParse(FALSE) //TODO: to be removed after #6895
{
LocalizationInfo* locinfo = StringLocalizationInfo::create(locs, perror, status);
init(description, locinfo, perror, status);
, lenient(FALSE)
, lenientParseRules(NULL)
, localizations(NULL)
- , noParse(FALSE) //TODO: to be removed after #6895
{
LocalizationInfo* locinfo = StringLocalizationInfo::create(locs, perror, status);
init(description, locinfo, perror, status);
, lenient(FALSE)
, lenientParseRules(NULL)
, localizations(NULL)
- , noParse(FALSE) //TODO: to be removed after #6895
{
init(description, info, perror, status);
}
, lenient(FALSE)
, lenientParseRules(NULL)
, localizations(NULL)
- , noParse(FALSE) //TODO: to be removed after #6895
{
init(description, NULL, perror, status);
}
, lenient(FALSE)
, lenientParseRules(NULL)
, localizations(NULL)
- , noParse(FALSE) //TODO: to be removed after #6895
{
init(description, NULL, perror, status);
}
init (desc, locinfo, perror, status);
- //TODO: we need a real fix - see #6895 / #6896
- noParse = FALSE;
- if (tag == URBNF_SPELLOUT) {
- const char *lang = alocale.getLanguage();
- for (int32_t i = 0; NO_SPELLOUT_PARSE_LANGUAGES[i] != NULL; i++) {
- if (uprv_strcmp(lang, NO_SPELLOUT_PARSE_LANGUAGES[i]) == 0) {
- noParse = TRUE;
- break;
- }
- }
- }
- //TODO: end
-
ures_close(ruleSets);
ures_close(rbnfRules);
}
UParseError perror;
init(rules, rhs.localizations ? rhs.localizations->ref() : NULL, perror, status);
- //TODO: remove below when we fix the parse bug - See #6895 / #6896
- noParse = rhs.noParse;
-
return *this;
}
result = 0;
} else {
result->lenient = lenient;
-
- //TODO: remove below when we fix the parse bug - See #6895 / #6896
- result->noParse = noParse;
}
return result;
}
Formattable& result,
ParsePosition& parsePosition) const
{
- //TODO: We need a real fix. See #6895 / #6896
- if (noParse) {
- // skip parsing
- parsePosition.setErrorIndex(0);
- return;
- }
-
if (!ruleSets) {
parsePosition.setErrorIndex(0);
return;
UBool lenient;
UnicodeString* lenientParseRules;
LocalizationInfo* localizations;
-
- // Temporary workaround - when noParse is true, do noting in parse.
- // TODO: We need a real fix - see #6895/#6896
- UBool noParse;
};
// ---------------