Skip to content

Commit

Permalink
Support remap rules in the segmenter (#949)
Browse files Browse the repository at this point in the history
  • Loading branch information
eggrobin authored Oct 17, 2024
1 parent 69a376c commit 109fcb4
Show file tree
Hide file tree
Showing 10 changed files with 395 additions and 287 deletions.
4 changes: 2 additions & 2 deletions unicodetools/data/ucd/dev/auxiliary/GraphemeBreakTest.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<body bgcolor='#FFFFFF'>
<h2>Grapheme_Cluster_Break Chart</h2>
<p><b>Unicode Version:</b> 17.0.0</p>
<p><b>Date:</b> 2024-09-12, 14:11:44 GMT</p>
<p><b>Date:</b> 2024-10-14, 12:06:04 GMT</p>
<p>This page illustrates the application of the Grapheme_Cluster_Break specification. The material here is informative, not normative.</p> <p>The first chart shows where breaks would appear between different sample characters or strings. The sample characters are chosen mechanically to represent the different properties used by the specification.</p><p>Each cell shows the break-status for the position between the character(s) in its row header and the character(s) in its column header. The × symbol indicates no break, while the ÷ symbol indicated a break. The cells with × are also shaded to make it easier to scan the table. For example, in the cell at the intersection of the row headed by “CR” and the column headed by “LF”, there is a × symbol, indicating that there is no break between CR and LF.</p>
<p>After the heavy blue line in the table are additional rows, either with different sample characters or for sequences. Some column headers may be composed, reflecting “treat as” or “ignore” rules.</p>
<p>If your browser handles titles (tooltips), then hovering the mouse over the row header will show a sample character of that type. Hovering over a column header will show the sample character, plus its abbreviated general category and script. Hovering over the intersected cells shows the rule number that produces the break-status. For example, hovering over the cell at the intersection of LVT and T shows ×, with the rule 8.0. Checking below the table, rule 8.0 is “( LVT | T) × T”, which is the one that applies to that case. Note that a rule is invoked only when no lower-numbered rules have applied.</p>
Expand Down Expand Up @@ -39,7 +39,7 @@ <h3><a href='#table' name='table'>Table</a></h3>
<tr><th class='lbclass' title='U+0378 <reserved-0378>'>Other</th><th title='999.0' class='pairItem'>÷</th><th title='5.0' class='pairItem'>÷</th><th title='5.0' class='pairItem'>÷</th><th title='5.0' class='pairItem'>÷</th><th title='9.0' bgcolor='#CCCCFF' class='pairItem'>×</th><th title='999.0' class='pairItem'>÷</th><th title='999.0' class='pairItem'>÷</th><th title='9.1' bgcolor='#CCCCFF' class='pairItem'>×</th><th title='999.0' class='pairItem'>÷</th><th title='999.0' class='pairItem'>÷</th><th title='999.0' class='pairItem'>÷</th><th title='999.0' class='pairItem'>÷</th><th title='999.0' class='pairItem'>÷</th><th title='9.1' bgcolor='#CCCCFF' class='pairItem'>×</th><th title='999.0' class='pairItem'>÷</th><th title='999.0' class='pairItem'>÷</th><th title='999.0' class='pairItem'>÷</th><th title='999.0' class='pairItem'>÷</th><th title='9.0' bgcolor='#CCCCFF' class='pairItem'>×</th><th title='9.0' bgcolor='#CCCCFF' class='pairItem'>×</th><th title='9.0' bgcolor='#CCCCFF' class='pairItem'>×</th><th title='9.0' bgcolor='#CCCCFF' class='pairItem'>×</th></tr>
</table>
<h3><a href='#rules' name='rules'>Rules</a></h3>
<p>This section shows the rules. They are mechanically modified for programmatic generation of the tables and test code, and thus do not match the UAX rules precisely. In particular:</p><ol><li>The rules are cast into a form that is more like regular expressions.</li><li>The rules “sot ÷”, “÷ eot”, and “÷ Any” are added mechanically, and have artificial numbers.</li><li>The rules are given decimal numbers using tenths, and are written without prefix. For example, rule GB9a is given the number 9.1.</li><li>Any “treat as” or “ignore” rules are handled as discussed in UAX #29, and thus reflected in a transformation of the rules usually not visible here. In addition, final rules like “Any ÷ Any” may be recast as the equivalent expression “÷ Any”.</li><li>In some cases, the numbering and form of a rule is changed due to “treat as” rules.</li></ol><p>For the original rules, see UAX #29.</p>
<p>This section shows the rules. They are mechanically modified for programmatic generation of the tables and test code, and thus do not match the UAX rules precisely. In particular:</p><ol><li>The rules are cast into a form that is more like regular expressions.</li><li>The rules “sot ÷”, “÷ eot”, and “÷ Any” are added mechanically, and have artificial numbers.</li><li>The rules are given decimal numbers using tenths, and are written without prefix. For example, rule GB9a is given the number 9.1.</li><li>Final rules like “Any ÷ Any” may be recast as the equivalent expression “÷ Any”.</li><li></li></ol><p>For the original rules, see UAX #29.</p>
<table>
<tr><th style='text-align:right'><a href='#r0.2' name='r0.2'>0.2</a></th><td style='text-align:right'>sot </td><td>÷</td><td></td></tr>
<tr><th style='text-align:right'><a href='#r0.3' name='r0.3'>0.3</a></th><td style='text-align:right'></td><td>÷</td><td> eot</td></tr>
Expand Down
17 changes: 8 additions & 9 deletions unicodetools/data/ucd/dev/auxiliary/LineBreakTest.html

Large diffs are not rendered by default.

Loading

0 comments on commit 109fcb4

Please sign in to comment.