def brk
bend-kit-unicode@0.1.0.0 · unicode.bend:177
import bend-kit-unicode@0.1.0.0/unicode.bend as Unicode
import Base
177
178
179
180def brk(+p: U32, +q: U32, +ri: Bool, +ep: U32, +incb: U32) -> Bool:
181 +gp = gcb(p)
182 +gq = gcb(q)
183 +ctl = (U32.is_le(1, gp) && U32.is_le(gp, 3)) || (U32.is_le(1, gq) && U32.is_le(gq, 3))
184 +glue = hangul.join(gp, gq) || eq(gq, 4) || eq(gq, 5) || eq(gq, 8) || eq(gp, 7)
185 +conj = eq(incb, 2) && eq((q >> 5n : U32), 1)
186 +emoji = eq(ep, 2) && U32.is_ne((q .&. 16 : U32), 0)
187 +flag = eq(gp, 6) && eq(gq, 6) && ri
188 Bool.not((eq(gp, 1) && eq(gq, 2)) || (Bool.not(ctl) && (glue || conj || emoji || flag)))