seshat/unicode/
seg.rs

1use crate::unicode::Ucd;
2use crate::unicode::props::Gcb;
3
4pub(super) fn is_gb3(curr: char, next: char) -> bool {
5    if curr.gcb() == Gcb::CR && next.gcb() == Gcb::LF {
6        return true;
7    }
8    false
9}
10
11pub(super) fn is_gb4(curr: char) -> bool {
12    if curr.gcb() == Gcb::CN
13        || curr.gcb() == Gcb::CR
14        || curr.gcb() == Gcb::LF
15    {
16        return true;
17    }
18    false
19}
20
21pub(super) fn is_gb5(next: char) -> bool {
22    if next.gcb() == Gcb::CN
23        || next.gcb() == Gcb::CR
24        || next.gcb() == Gcb::LF
25    {
26        return true;
27    }
28    false
29}
30
31pub(super) fn is_gb6(curr: char, next: char) -> bool {
32    if curr.gcb() == Gcb::L
33        && (next.gcb() == Gcb::L
34            || next.gcb() == Gcb::V
35            || next.gcb() == Gcb::LV
36            || next.gcb() == Gcb::LVT)
37    {
38        return true;
39    }
40    false
41}
42
43pub(super) fn is_gb7(curr: char, next: char) -> bool {
44    if (curr.gcb() == Gcb:: LV
45        || curr.gcb() == Gcb::V)
46        && (next.gcb() == Gcb::V
47            || next.gcb() == Gcb::T)
48    {
49        return true;
50    }
51    false
52}
53
54pub(super) fn is_gb8(curr: char, next: char) -> bool {
55    if (curr.gcb() == Gcb::LVT || curr.gcb() == Gcb::T)
56        && next.gcb() == Gcb::T
57    {
58        return true;
59    }
60    false
61}
62
63pub(super) fn is_gb9(next: char) -> bool {
64    if next.gcb() == Gcb::EX || next.gcb() == Gcb::ZWJ {
65        return true;
66    }
67    false
68}
69
70pub(super) fn is_gb9a(next: char) -> bool {
71    if next.gcb() == Gcb::SM {
72        return true;
73    }
74    false
75}
76
77pub(super) fn is_gb9b(curr: char) -> bool {
78    if curr.gcb() == Gcb::PP {
79        return true;
80    }
81    false
82}