[indic-generator] Add a couple comments

This commit is contained in:
Behdad Esfahbod 2022-06-09 11:49:02 -06:00
parent 91d6f45bc9
commit 2963154c15
2 changed files with 8 additions and 3 deletions

View File

@ -243,15 +243,18 @@ for k,new_cat in category_overrides.items():
data[k] = (new_cat, pos, block)
# We only expect position for certain types
positioned_categories = ('CM', 'SM', 'RS', 'H', 'M')
for k, (cat, pos, block) in data.items():
if cat not in ('CM', 'SM', 'RS', 'H', 'M'):
if cat not in positioned_categories:
pos = 'END'
data[k] = (cat, pos, block)
# Position overrides are more complicated
# Keep in sync with CONSONANT_FLAGS in the shaper
consonant_categories = ('C', 'CS', 'Ra','CM', 'V', 'PLACEHOLDER', 'DOTTEDCIRCLE')
for k, (cat, pos, block) in data.items():
if cat in ('C', 'CS', 'Ra','CM', 'V', 'PLACEHOLDER', 'DOTTEDCIRCLE'):
if cat in consonant_categories:
pos = 'BASE_C'
data[k] = (cat, pos, block)

View File

@ -78,7 +78,9 @@ enum indic_category_t {
*
* We treat Vowels and placeholders as if they were consonants. This is safe because Vowels
* cannot happen in a consonant syllable. The plus side however is, we can call the
* consonant syllable logic from the vowel syllable function and get it all right! */
* consonant syllable logic from the vowel syllable function and get it all right!
*
* Keep in sync with consonant_categories in the generator. */
#define CONSONANT_FLAGS (FLAG (OT_C) | FLAG (OT_CS) | FLAG (OT_Ra) | MEDIAL_FLAGS | FLAG (OT_V) | FLAG (OT_PLACEHOLDER) | FLAG (OT_DOTTEDCIRCLE))
#define JOINER_FLAGS (FLAG (OT_ZWJ) | FLAG (OT_ZWNJ))