Missing two tables & some clarrifications (Real author is Richard Cattermole, name changed while rebasing)

This commit is contained in:
Ate Eskola 2023-01-14 17:06:20 +02:00
parent fce7d2f6e8
commit e53a0aba9f
3 changed files with 44 additions and 18 deletions

File diff suppressed because one or more lines are too long

View file

@ -6974,8 +6974,8 @@ private static bool isRegionalIndicator(dchar ch) @safe pure @nogc nothrow
template genericDecodeGrapheme(bool getValue)
{
alias extend = graphemeExtendTrie;
alias spacingMark = mcTrie;
alias graphemeExtend = graphemeExtendTrie;
alias spacingMark = spacingMarkTrie;
alias prepend = prependTrie;
alias ccTrie = graphemeControlTrie;
alias xpicto = xpictoTrie;
@ -10642,10 +10642,10 @@ private:
}
//grapheme breaking algorithm tables
auto mcTrie()
auto spacingMarkTrie()
{
import std.internal.unicode_grapheme : SpacingMarkTrieEntries;
static immutable res = asTrie(SpacingMarkTrieEntries);
import std.internal.unicode_grapheme : spacingMarkTrieEntries;
static immutable res = asTrie(spacingMarkTrieEntries);
return res;
}

View file

@ -920,12 +920,26 @@ void writeNormalizationTries(File sink)
void writeGraphemeTries(File sink)
{
auto table = graphemeBreaks.table;
//few specifics for grapheme cluster breaking algorithm
//
auto props = general.table;
writeBest3Level(sink, "hangulLV", hangul.table["LV"]);
writeBest3Level(sink, "hangulLVT", hangul.table["LVT"]);
foreach(key; table.byKey)
{
writeBest3Level(sink, key, table[key]);
}
// Grapheme specific information
writeBest3Level(sink, "prepend", graphemeBreaks.table["Prepend"]);
writeBest3Level(sink, "control", graphemeBreaks.table["Control"]);
// We use Grapheme_Cluster_Break=SpacingMark instead of GC=Mc,
// Grapheme_Cluster_Break=SpacingMark is derived from GC=Mc and includes other general category values
writeBest3Level(sink, "spacingMark", graphemeBreaks.table["SpacingMark"]);
// We use the Grapheme_Cluster_Break=Extend instead of Grapheme_Extend,
// Grapheme_Cluster_Break=Extend is derived from Grapheme_Extend and is more complete
writeBest3Level(sink, "graphemeExtend", graphemeBreaks.table["Extend"]);
// emoji related data
writeBest3Level(sink, "Extended_Pictographic", emojiData.table["Extended_Pictographic"]);
sink.writeln();