1 /* Word break auxiliary table. -*- coding: utf-8 -*-
2 Copyright (C) 2009-2024 Free Software Foundation, Inc.
3 Written by Bruno Haible <bruno@clisp.org>, 2009.
5 This file is free software.
6 It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+".
7 You can redistribute it and/or modify it under either
8 - the terms of the GNU Lesser General Public License as published
9 by the Free Software Foundation, either version 3, or (at your
10 option) any later version, or
11 - the terms of the GNU General Public License as published by the
12 Free Software Foundation; either version 2, or (at your option)
14 - the same dual license "the GNU LGPLv3+ or the GNU GPLv2+".
16 This file is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 Lesser General Public License and the GNU General Public License
22 You should have received a copy of the GNU Lesser General Public
23 License and of the GNU General Public License along with this
24 program. If not, see <https://www.gnu.org/licenses/>. */
29 #include "wbrktable.h"
31 const int uniwbrk_prop_index
[23] =
36 /* WBP_MIDNUMLET */ 3,
37 /* WBP_MIDLETTER */ 4,
40 /* WBP_EXTENDNUMLET */ 7,
58 /* This table contains the following rules (see UAX #29):
62 (ALetter | HL) × (ALetter | HL) (WB5)
63 (ALetter | HL) × Numeric (WB9)
65 Numeric × (ALetter | HL) (WB10)
66 Numeric × Numeric (WB8)
67 Katakana × Katakana (WB13)
68 (ALetter | HL | Numeric | Katakana) × ExtendNumLet (WB13a)
69 ExtendNumLet × ExtendNumLet (WB13a)
70 ExtendNumLet × (ALetter | HL | Numeric | Katakana) (WB13b)
72 Note that the following rules are not handled here but in the loop in u-wordbreaks.h:
73 - The rules need to look back or look ahead the second character (WB6, WB7, WB7b, WB7c, WB11, WB12)
74 - The rules with a higher precedence over the "ignore" rule (WB4), such as WB3c
77 const unsigned char uniwbrk_table
[12][12] =
78 { /* current: OTHER MIDNUMLET NUMERIC SQ */
79 /* KATAKANA MIDLETTER EXNUMLET HL */
80 /* ALETTER MIDNUM DQ WSS */
82 /* WBP_OTHER */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
83 /* WBP_KATAKANA */ { 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1 },
84 /* WBP_ALETTER */ { 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1 },
85 /* WBP_MIDNUMLET */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
86 /* WBP_MIDLETTER */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
87 /* WBP_MIDNUM */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
88 /* WBP_NUMERIC */ { 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1 },
89 /* WBP_EXTENDNUMLET */ { 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1 },
90 /* WBP_DQ */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
91 /* WBP_SQ */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
92 /* WBP_HL */ { 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1 },
93 /* WBP_WSS */ { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }