21 return ConsumeConsonantHeadIfValid() && ConsumeConsonantTailIfValid();
24 return ConsumeVowelIfValid();
38 tprintf(
"Invalid start of grapheme sequence:%c=0x%x\n",
85 if (off <= 0x14 || off == 0x50) {
88 if (off <= 0x3b || (0x58 <= off && off <= 0x5f)) {
98 if (off <= 0x4c || (0x51 <= off && off <= 0x54)) {
101 if (0x55 <= off && off <= 0x57) {
108 if (off == 0x60 || off == 0x61) {
111 if (off == 0x62 || off == 0x63) {
136 if (0x70 <= off && off <= 0x73) {
150bool ValidateIndic::ConsumeViramaIfValid(IndicPair joiner,
bool post_matra) {
151 const unsigned num_codes =
codes_.size();
158 tprintf(
"ZWJ after a post-matra virama!!\n");
178 tprintf(
"Virama ZWJ ZWNJ in non-Sinhala: base=0x%x!\n",
static_cast<int>(
script_));
203 tprintf(
"Invalid pre-virama joiner with no 2nd consonant!!\n");
222bool ValidateIndic::ConsumeConsonantHeadIfValid() {
223 const unsigned num_codes =
codes_.size();
228 int index =
output_.size() - 3;
234 bool have_nukta =
false;
240 index =
output_.size() - 2 - have_nukta;
253 tprintf(
"Skipping ending joiner: 0x%x 0x%x\n",
output_.back(), joiner.second);
258 output_.push_back(joiner.second);
261 tprintf(
"Skipping unnecessary joiner: 0x%x 0x%x 0x%x\n",
output_.back(), joiner.second,
268 if (!ConsumeViramaIfValid(joiner,
false)) {
283bool ValidateIndic::ConsumeConsonantTailIfValid() {
327bool ValidateIndic::ConsumeVowelIfValid() {
void tprintf(const char *format,...)
bool ConsumeGraphemeIfValid() override
Validator::CharClass UnicodeToCharClass(char32 ch) const override
static const char32 kZeroWidthNonJoiner
std::vector< char32 > output_
static bool IsVedicAccent(char32 unicode)
bool UseMultiCode(unsigned length)
void MultiCodePart(unsigned length)
static bool IsVirama(char32 unicode)
static const int kIndicCodePageSize
std::pair< CharClass, char32 > IndicPair
bool IsSubscriptScript() const
std::vector< IndicPair > codes_
static const char32 kZeroWidthJoiner