[use] Merge IND and Rsv classes into O

This commit is contained in:
David Corbett 2020-10-17 11:57:08 -04:00 committed by Khaled Hosny
parent c2cdcd4901
commit 79fd5ce22e
5 changed files with 32 additions and 46 deletions

View File

@ -246,9 +246,6 @@ def is_BASE(U, UISC, UGC, AJT):
AJT in [jt_C, jt_D, jt_L, jt_R] and UISC != Joiner or
(UGC == Lo and UISC in [Avagraha, Bindu, Consonant_Final, Consonant_Medial,
Consonant_Subjoined, Vowel, Vowel_Dependent]))
def is_BASE_IND(U, UISC, UGC, AJT):
return (UISC in [Consonant_Dead, Modifying_Letter] or
(UGC == Po and not U in [0x0F04, 0x0F05, 0x0F06, 0x104B, 0x104E, 0x1800, 0x1807, 0x180A, 0x1B5B, 0x1B5C, 0x1B5F, 0x2022, 0x111C8, 0x11A3F, 0x11A45, 0x11C44, 0x11C45]))
def is_BASE_NUM(U, UISC, UGC, AJT):
return UISC == Brahmi_Joining_Number
def is_BASE_OTHER(U, UISC, UGC, AJT):
@ -291,13 +288,12 @@ def is_HIEROGLYPH_SEGMENT_END(U, UISC, UGC, AJT):
def is_ZWNJ(U, UISC, UGC, AJT):
return UISC == Non_Joiner
def is_OTHER(U, UISC, UGC, AJT):
return (UISC in [Joiner, Other]
return ((UGC in [Cn, Po] or UISC in [Consonant_Dead, Joiner, Modifying_Letter, Other])
and not is_BASE(U, UISC, UGC, AJT)
and not is_BASE_OTHER(U, UISC, UGC, AJT)
and not is_SYM(U, UISC, UGC, AJT)
and not is_SYM_MOD(U, UISC, UGC, AJT)
)
def is_Reserved(U, UISC, UGC, AJT):
return UGC == 'Cn'
def is_REPHA(U, UISC, UGC, AJT):
return UISC in [Consonant_Preceding_Repha, Consonant_Prefixed]
def is_SAKOT(U, UISC, UGC, AJT):
@ -319,7 +315,6 @@ def is_VOWEL_MOD(U, UISC, UGC, AJT):
# CGJ, VS, WJ, and ZWJ are handled in find_syllables
use_mapping = {
'B': is_BASE,
'IND': is_BASE_IND,
'N': is_BASE_NUM,
'GB': is_BASE_OTHER,
'F': is_CONS_FINAL,
@ -337,7 +332,6 @@ use_mapping = {
'SE': is_HIEROGLYPH_SEGMENT_END,
'ZWNJ': is_ZWNJ,
'O': is_OTHER,
'Rsv': is_Reserved,
'R': is_REPHA,
'S': is_SYM,
'Sk': is_SAKOT,

View File

@ -70,9 +70,9 @@ static const short _use_syllable_machine_index_offsets[] = {
};
static const char _use_syllable_machine_indicies[] = {
1, 0, 2, 0, 3, 4, 5, 3,
1, 0, 2, 0, 3, 4, 5, 5,
6, 7, 5, 5, 5, 5, 5, 1,
8, 9, 5, 5, 5, 3, 10, 11,
8, 9, 5, 5, 5, 5, 10, 11,
5, 5, 12, 13, 14, 15, 16, 17,
18, 12, 19, 20, 21, 22, 23, 24,
5, 25, 26, 27, 5, 28, 29, 30,
@ -308,7 +308,7 @@ static const int use_syllable_machine_en_main = 2;
#line 156 "hb-ot-shape-complex-use-machine.rl"
#line 154 "hb-ot-shape-complex-use-machine.rl"
#define found_syllable(syllable_type) \
@ -322,7 +322,7 @@ static const int use_syllable_machine_en_main = 2;
static bool
not_standard_default_ignorable (const hb_glyph_info_t &i)
{ return !((i.use_category() == USE_O || i.use_category() == USE_Rsv) && _hb_glyph_info_is_default_ignorable (&i)); }
{ return !(i.use_category() == USE_O && _hb_glyph_info_is_default_ignorable (&i)); }
static void
find_syllables_use (hb_buffer_t *buffer)
@ -359,7 +359,7 @@ find_syllables_use (hb_buffer_t *buffer)
act = 0;
}
#line 200 "hb-ot-shape-complex-use-machine.rl"
#line 198 "hb-ot-shape-complex-use-machine.rl"
unsigned int syllable_serial = 1;
@ -401,59 +401,59 @@ _eof_trans:
{te = p+1;}
break;
case 5:
#line 143 "hb-ot-shape-complex-use-machine.rl"
#line 141 "hb-ot-shape-complex-use-machine.rl"
{te = p+1;{ found_syllable (independent_cluster); }}
break;
case 9:
#line 146 "hb-ot-shape-complex-use-machine.rl"
#line 144 "hb-ot-shape-complex-use-machine.rl"
{te = p+1;{ found_syllable (standard_cluster); }}
break;
case 7:
#line 151 "hb-ot-shape-complex-use-machine.rl"
#line 149 "hb-ot-shape-complex-use-machine.rl"
{te = p+1;{ found_syllable (broken_cluster); }}
break;
case 6:
#line 152 "hb-ot-shape-complex-use-machine.rl"
#line 150 "hb-ot-shape-complex-use-machine.rl"
{te = p+1;{ found_syllable (non_cluster); }}
break;
case 10:
#line 144 "hb-ot-shape-complex-use-machine.rl"
#line 142 "hb-ot-shape-complex-use-machine.rl"
{te = p;p--;{ found_syllable (virama_terminated_cluster); }}
break;
case 11:
#line 145 "hb-ot-shape-complex-use-machine.rl"
#line 143 "hb-ot-shape-complex-use-machine.rl"
{te = p;p--;{ found_syllable (sakot_terminated_cluster); }}
break;
case 8:
#line 146 "hb-ot-shape-complex-use-machine.rl"
#line 144 "hb-ot-shape-complex-use-machine.rl"
{te = p;p--;{ found_syllable (standard_cluster); }}
break;
case 13:
#line 147 "hb-ot-shape-complex-use-machine.rl"
#line 145 "hb-ot-shape-complex-use-machine.rl"
{te = p;p--;{ found_syllable (number_joiner_terminated_cluster); }}
break;
case 12:
#line 148 "hb-ot-shape-complex-use-machine.rl"
#line 146 "hb-ot-shape-complex-use-machine.rl"
{te = p;p--;{ found_syllable (numeral_cluster); }}
break;
case 14:
#line 149 "hb-ot-shape-complex-use-machine.rl"
#line 147 "hb-ot-shape-complex-use-machine.rl"
{te = p;p--;{ found_syllable (symbol_cluster); }}
break;
case 17:
#line 150 "hb-ot-shape-complex-use-machine.rl"
#line 148 "hb-ot-shape-complex-use-machine.rl"
{te = p;p--;{ found_syllable (hieroglyph_cluster); }}
break;
case 15:
#line 151 "hb-ot-shape-complex-use-machine.rl"
#line 149 "hb-ot-shape-complex-use-machine.rl"
{te = p;p--;{ found_syllable (broken_cluster); }}
break;
case 16:
#line 152 "hb-ot-shape-complex-use-machine.rl"
#line 150 "hb-ot-shape-complex-use-machine.rl"
{te = p;p--;{ found_syllable (non_cluster); }}
break;
case 1:
#line 151 "hb-ot-shape-complex-use-machine.rl"
#line 149 "hb-ot-shape-complex-use-machine.rl"
{{p = ((te))-1;}{ found_syllable (broken_cluster); }}
break;
#line 460 "hb-ot-shape-complex-use-machine.hh"
@ -481,7 +481,7 @@ _again:
}
#line 205 "hb-ot-shape-complex-use-machine.rl"
#line 203 "hb-ot-shape-complex-use-machine.rl"
}

View File

@ -45,7 +45,6 @@
O = 0; # OTHER
B = 1; # BASE
IND = 3; # BASE_IND
N = 4; # BASE_NUM
GB = 5; # BASE_OTHER
SUB = 11; # CONS_SUB
@ -53,7 +52,6 @@ H = 12; # HALANT
HN = 13; # HALANT_NUM
ZWNJ = 14; # Zero width non-joiner
Rsv = 17; # Reserved characters
R = 18; # REPHA
S = 19; # SYM
CS = 43; # CONS_WITH_STACKER
@ -136,7 +134,7 @@ number_joiner_terminated_cluster = N number_joiner_terminated_cluster_tail;
numeral_cluster = N numeral_cluster_tail?;
symbol_cluster = (S | GB) symbol_cluster_tail?;
hieroglyph_cluster = SB+ | SB* G SE* (J SE* (G SE*)?)*;
independent_cluster = (IND | O | Rsv);
independent_cluster = O;
other = any;
main := |*
@ -166,7 +164,7 @@ main := |*
static bool
not_standard_default_ignorable (const hb_glyph_info_t &i)
{ return !((i.use_category() == USE_O || i.use_category() == USE_Rsv) && _hb_glyph_info_is_default_ignorable (&i)); }
{ return !(i.use_category() == USE_O && _hb_glyph_info_is_default_ignorable (&i)); }
static void
find_syllables_use (hb_buffer_t *buffer)

View File

@ -46,12 +46,10 @@
#define H USE_H /* HALANT */
#define HN USE_HN /* HALANT_NUM */
#define HVM USE_HVM /* HALANT_OR_VOWEL_MODIFIER */
#define IND USE_IND /* BASE_IND */
#define J USE_J /* HIEROGLYPH_JOINER */
#define N USE_N /* BASE_NUM */
#define O USE_O /* OTHER */
#define R USE_R /* REPHA */
#define Rsv USE_Rsv /* Reserved */
#define S USE_S /* SYM */
#define SB USE_SB /* HIEROGLYPH_SEGMENT_BEGIN */
#define SE USE_SE /* HIEROGLYPH_SEGMENT_END */
@ -146,7 +144,7 @@ static const USE_TABLE_ELEMENT_TYPE use_table[] = {
/* 0990 */ B, O, O, B, B, B, B, B, B, B, B, B, B, B, B, B,
/* 09A0 */ B, B, B, B, B, B, B, B, B, O, B, B, B, B, B, B,
/* 09B0 */ B, O, B, O, O, O, B, B, B, B, O, O, CMBlw, B, VPst, VPre,
/* 09C0 */ VPst, VBlw, VBlw, VBlw, VBlw, O, O, VPre, VPre, O, O, VPre, VPre, H, IND, O,
/* 09C0 */ VPst, VBlw, VBlw, VBlw, VBlw, O, O, VPre, VPre, O, O, VPre, VPre, H, O, O,
/* 09D0 */ O, O, O, O, O, O, O, VPst, O, O, O, O, B, B, O, B,
/* 09E0 */ B, B, VBlw, VBlw, O, O, B, B, B, B, B, B, B, B, B, B,
/* 09F0 */ B, B, O, O, O, O, O, O, O, O, O, O, B, O, FMAbv, O,
@ -186,7 +184,7 @@ static const USE_TABLE_ELEMENT_TYPE use_table[] = {
/* Tamil */
/* 0B80 */ O, O, VMAbv, IND, O, B, B, B, B, B, B, O, O, O, B, B,
/* 0B80 */ O, O, VMAbv, O, O, B, B, B, B, B, B, O, O, O, B, B,
/* 0B90 */ B, O, B, B, B, B, O, O, O, B, B, O, B, O, B, B,
/* 0BA0 */ O, O, O, B, B, O, O, O, B, B, B, O, O, O, B, B,
/* 0BB0 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, VPst, VPst,
@ -224,9 +222,9 @@ static const USE_TABLE_ELEMENT_TYPE use_table[] = {
/* 0D20 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
/* 0D30 */ B, B, B, B, B, B, B, B, B, B, B, VAbv, VAbv, B, VPst, VPst,
/* 0D40 */ VPst, VPst, VPst, VBlw, VBlw, O, VPre, VPre, VPre, O, VPre, VPre, VPre, H, R, O,
/* 0D50 */ O, O, O, O, IND, IND, IND, VPst, O, O, O, O, O, O, O, B,
/* 0D50 */ O, O, O, O, O, O, O, VPst, O, O, O, O, O, O, O, B,
/* 0D60 */ B, B, VBlw, VBlw, O, O, B, B, B, B, B, B, B, B, B, B,
/* 0D70 */ O, O, O, O, O, O, O, O, O, O, IND, IND, IND, IND, IND, IND,
/* 0D70 */ O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O,
/* Sinhala */
@ -251,8 +249,8 @@ static const USE_TABLE_ELEMENT_TYPE use_table[] = {
/* 0F40 */ B, B, B, B, B, B, B, B, O, B, B, B, B, B, B, B,
/* 0F50 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
/* 0F60 */ B, B, B, B, B, B, B, B, B, B, B, B, B, O, O, O,
/* 0F70 */ O, CMBlw, VBlw, VAbv, VAbv, VBlw, VAbv, VAbv, VAbv, VAbv, VBlw, VBlw, VBlw, VBlw, VMAbv, IND,
/* 0F80 */ VBlw, VAbv, VMAbv, VMAbv, VBlw, IND, VMAbv, VMAbv, B, B, B, B, B, SUB, SUB, SUB,
/* 0F70 */ O, CMBlw, VBlw, VAbv, VAbv, VBlw, VAbv, VAbv, VAbv, VAbv, VBlw, VBlw, VBlw, VBlw, VMAbv, O,
/* 0F80 */ VBlw, VAbv, VMAbv, VMAbv, VBlw, O, VMAbv, VMAbv, B, B, B, B, B, SUB, SUB, SUB,
/* 0F90 */ SUB, SUB, SUB, SUB, SUB, SUB, SUB, SUB, O, SUB, SUB, SUB, SUB, SUB, SUB, SUB,
/* 0FA0 */ SUB, SUB, SUB, SUB, SUB, SUB, SUB, SUB, SUB, SUB, SUB, SUB, SUB, SUB, SUB, SUB,
/* 0FB0 */ SUB, SUB, SUB, SUB, SUB, SUB, SUB, SUB, SUB, SUB, SUB, SUB, SUB, O, O, O,
@ -409,7 +407,7 @@ static const USE_TABLE_ELEMENT_TYPE use_table[] = {
/* 1CD0 */ VMAbv, VMAbv, VMAbv, O, VMBlw, VMBlw, VMBlw, VMBlw, VMBlw, VMBlw, VMAbv, VMAbv, VMBlw, VMBlw, VMBlw, VMBlw,
/* 1CE0 */ VMAbv, VMPst, VMBlw, VMBlw, VMBlw, VMBlw, VMBlw, VMBlw, VMBlw, O, O, O, O, VMBlw, O, O,
/* 1CF0 */ O, O, IND, IND, VMAbv, CS, CS, VMPst, VMAbv, VMAbv, GB, O, O, O, O, O,
/* 1CF0 */ O, O, O, O, VMAbv, CS, CS, VMPst, VMAbv, VMAbv, GB, O, O, O, O, O,
#define use_offset_0x1df8u 3040
@ -969,7 +967,7 @@ static const USE_TABLE_ELEMENT_TYPE use_table[] = {
/* 16F20 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
/* 16F30 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
/* 16F40 */ B, B, B, B, B, B, B, B, B, B, B, O, O, O, O, CMBlw,
/* 16F50 */ IND, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw,
/* 16F50 */ O, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw,
/* 16F60 */ VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw,
/* 16F70 */ VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw,
/* 16F80 */ VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, O, O, O, O, O, O, O, VMBlw,
@ -1167,12 +1165,10 @@ hb_use_get_category (hb_codepoint_t u)
#undef H
#undef HN
#undef HVM
#undef IND
#undef J
#undef N
#undef O
#undef R
#undef Rsv
#undef S
#undef SB
#undef SE

View File

@ -46,7 +46,6 @@ enum use_category_t {
USE_O = 0, /* OTHER */
USE_B = 1, /* BASE */
USE_IND = 3, /* BASE_IND */
USE_N = 4, /* BASE_NUM */
USE_GB = 5, /* BASE_OTHER */
USE_SUB = 11, /* CONS_SUB */
@ -54,7 +53,6 @@ enum use_category_t {
USE_HN = 13, /* HALANT_NUM */
USE_ZWNJ = 14, /* Zero width non-joiner */
USE_Rsv = 17, /* Reserved characters */
USE_R = 18, /* REPHA */
USE_S = 19, /* SYM */
USE_CS = 43, /* CONS_WITH_STACKER */