<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="289782" data-post-id="289782">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’m pleased to report the first hex release of <a href="https://hex.pm/packages/unicode_unihan" rel="nofollow">unicode_unihan</a>. I’m not a domain expert, but thankfully <a class="mention" href="/u/jkwchui" rel="nofollow">@jkwchui</a> is and the work and credit is all his. Thanks very much for a valuable contribution to the community.</p>
<p>I think this may be the most comprehensive introspection library of the <a href="https://unicode.org/charts/unihan.html" rel="nofollow">Unicode Unihan database</a> in any computer language.</p>
<p>You can try it out in Livebook. Just note that the Unihan database is <em>huge</em> and compile times for the library are correspondingly slow since all the parsing and decoding is done at compile time in order to present a very snappy user experience.</p>
<p><a href="https://livebook.dev/run?url=https%3A%2F%2Fraw.githubusercontent.com%2Felixir-unicode%2Funicode_unihan%2Fmain%2Fdocs%2Funihan_walkthrough.livemd" rel="nofollow"><img src="https://livebook.dev/badge/v1/blue.svg" alt="Run in Livebook" width="170" height="40"></a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="289782" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/unicode-libraries-fun-with-unicode-introspection-lookup-sets-guards-transforms/27063/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-289782" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="289782"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #21"></div>
  </section>
</div>
    <div class="postbit" id="289797" data-post-id="289797">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="jkwchui" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  jkwchui
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thank you <a class="mention" href="/u/kip" rel="nofollow">@kip</a> for doing most of the intelligent heavy-lifting, and being such a gracious teacher.  I have learnt much through this.  The code is feature-complete, and the hefty documentation should be fleshed out over the next weeks.</p>
<p>Besides shifting the burden to compile-time and hence resulting in snappy runtime performance, the Elixir Unihan library have a pair of interesting features that is more than the sum of its parts:</p>
<ol>
<li><strong>decoding details into Elixir structs</strong>.  For example, Unihan database may supply a binary of <code>1187.061</code> for a particular field, expecting the user to decode this based on the specs (then repeat for the other 90+ fields!)  In <code>Unicode.Unihan</code> we decode every field for you as a Map with suitable keys and types:</li>
</ol>
<pre data-code-wrap="elixir"><code class="lang-elixir">%{
  page: 1187,
  position: 6,
  virtual: true
}
</code></pre>
<ol start="2">
<li><strong>availability of <code>filter/1</code> and <code>reject/1</code></strong>.  These are similar to <code>Enum.filter/1</code> and <code>Enum.reject/1</code>, taking a function as the argument to return a subset of Unihan.</li>
</ol>
<p>The combination of <em>sub-fields</em> and <em>ability to act upon them</em> means you can search through and chain the outcomes into pipelines:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">filter(
  &amp;(&amp;1[:kGradeLevel] &lt;= 2 and
    &amp;1[:kCantonese][:tone] == "1")
)
|&gt; Enum.sort_by(
  fn {_codepoint, map} -&gt;
    map[:kTotalStrokes][:Hant]
  end,
  :asc
)
</code></pre>
<p>This is very flexible and, AFAIK, unique access to this trove of knowledge compiled over two decades.  The included LiveBook should offer a easy way to give this a spin with low commitment.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="289797" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/unicode-libraries-fun-with-unicode-introspection-lookup-sets-guards-transforms/27063/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-289797" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="289797"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #22"></div>
  </section>
</div>
    <div class="postbit" id="289799" data-post-id="289799">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Eiji" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Eiji/120/36743_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Eiji
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="jkwchui" data-post="23" data-topic="27063">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/j/ea666f/48.png" class="avatar"> jkwchui:</div>
<blockquote>
<pre data-code-wrap="elixir"><code class="lang-elixir">  fn {_codepoint, map} -&gt;
    map[:kTotalStrokes][:Hant]
  end,
</code></pre>
</blockquote>
</aside>
<p>How about this instead?</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">&amp;get_in(&amp;1, [Access.elem(1), :kTotalStrokes, :Hant])
</code></pre>
<p>Also <code>:asc</code> is the default, so you can leave it.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="289799" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/unicode-libraries-fun-with-unicode-introspection-lookup-sets-guards-transforms/27063/24">Post #23</a>
	                </div>
	            </div>
              <div id="likers-container-289799" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="289799"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #23"></div>
  </section>
</div>
    <div class="postbit" id="289815" data-post-id="289815">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="jkwchui" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  jkwchui
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks for the suggestion.  I’m not sure that would work.  The input is a single tuple, so <code>&amp;2</code> doesn’t apply (only one term).</p>
<p>We can rewrite this to <code>&amp;get_in(elem(&amp;1,1), [:kTotalStrokes, :Hant])</code>, or pipe it as</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">Enum.sort_by(&amp;(
    &amp;1
    |&gt; elem(1) 
    |&gt; get_in([:kTotalStrokes, :Hant])
  ))
</code></pre>
<p>but I find the original more readable.</p>
<p>(About the <code>:asc</code> — I was toggling to tinker the first-sight output of a new user.  I might be the one who got the most fun out of this <img src="https://forum.elixirforum.com/images/emoji/apple/stuck_out_tongue.png?v=15" title=":stuck_out_tongue:" class="emoji" alt=":stuck_out_tongue:" loading="lazy" width="20" height="20"> )</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="289815" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/unicode-libraries-fun-with-unicode-introspection-lookup-sets-guards-transforms/27063/25">Post #24</a>
	                </div>
	            </div>
              <div id="likers-container-289815" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="289815"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #24"></div>
  </section>
</div>
    <div class="postbit" id="289816" data-post-id="289816">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Eiji" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Eiji/120/36743_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Eiji
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>yes, my bad - I have updated my reply</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="289816" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/unicode-libraries-fun-with-unicode-introspection-lookup-sets-guards-transforms/27063/26">Post #25</a>
	                </div>
	            </div>
              <div id="likers-container-289816" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="289816"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #25"></div>
  </section>
</div>
    <div class="postbit" id="298077" data-post-id="298077">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Following on from the <a href="https://forum.elixirforum.com/t/string-capitalize-should-have-a-leave-the-rest-of-the-word-alone-option/31095" rel="nofollow">spirited conversation about string capitalisation</a> I was motivated to finish up my work on the <a href="https://www.unicode.org/versions/Unicode15.0.0/ch05.pdf#G21180" rel="nofollow">Unicode Case Mapping Algorithm</a>. A release candidate is now published as part of <a href="https://hex.pm/packages/unicode_string/1.3.0-rc.0" rel="nofollow">unicode_string version 1.3.0-rc.0</a>.</p>
<h3><a name="p-298077-difference-from-the-elixir-string-casing-functions-1" class="anchor" href="#p-298077-difference-from-the-elixir-string-casing-functions-1" aria-label="Heading link" rel="nofollow"></a>Difference from the Elixir String casing functions</h3>
<p>The implementation is locale aware and implements all of the transforms in <a href="https://unicode.org/Public/UNIDATA/SpecialCasing.txt" rel="nofollow">SpecialCasing.txt</a> including the conditional mappings for Greek, Turkish, Azeri and Lithuanian (Elixir’s string functions do not handle Lithuanian since they are conditional transforms).</p>
<ul>
<li>
<p>Supports uppercasing Greek (not specified in Unicode). <strong>Feedback is requested on the implementation</strong>, see the last section of the post on this topic.</p>
</li>
<li>
<p>Supports titlecasing the “IJ” dipthong in Dutch (also not specified in Unicode).</p>
</li>
<li>
<p>Titlecasing works on individual words which is different to <code>String.capitalize/2</code>.</p>
</li>
<li>
<p>Planned support for other languages as I learn more about common practise. Feedback and feature requests are welcome.</p>
</li>
</ul>
<h3><a name="p-298077-examples-2" class="anchor" href="#p-298077-examples-2" aria-label="Heading link" rel="nofollow"></a>Examples</h3>
<pre data-code-wrap="elixir"><code class="lang-elixir"># Basic case transformation
iex&gt; Unicode.String.upcase("the quick brown fox")
"THE QUICK BROWN FOX"

# Dotted-I in Turkish and Azeri
iex&gt; Unicode.String.upcase("Diyarbakır", locale: :tr)
"DİYARBAKIR"

# Upper case in Greek removes diacritics
iex&gt; Unicode.String.upcase("Πατάτα, Αέρας, Μυστήριο", locale: :el)
"ΠΑΤΑΤΑ, ΑΕΡΑΣ, ΜΥΣΤΗΡΙΟ"

# Lower case Greek with a final sigma
iex&gt; Unicode.String.downcase("ὈΔΥΣΣΕΎΣ", locale: :el)
"ὀδυσσεύς"

# Title case Dutch with leading dipthong
iex&gt; Unicode.String.titlecase("ijsselmeer", locale: :nl)
"IJsselmeer"
</code></pre>
<h3><a name="p-298077-seeking-feedback-on-greek-uppercasing-3" class="anchor" href="#p-298077-seeking-feedback-on-greek-uppercasing-3" aria-label="Heading link" rel="nofollow"></a>Seeking feedback on Greek uppercasing</h3>
<p>There is conflicting information on how to uppercase Greek. I would greatly welcome any feedback from native Greek speakers on what is correct in common usage.  Here is what I have consolidated (and is extracted from the docs):</p>
<h4><a name="p-298077-cldr-algorithm-current-implementation-4" class="anchor" href="#p-298077-cldr-algorithm-current-implementation-4" aria-label="Heading link" rel="nofollow"></a>CLDR algorithm (current implementation)</h4>
<p>According to CLDR all accents on all characters are are omitted when upcasing. This is based upon the CLDR <code>el-Upper</code> text transform:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  Remove 0301 following Greek, with possible intervening 0308 marks.
  ::NFD();
  For uppercasing (not titlecasing!) remove all greek accents from greek letters.
  This is done in two groups, to account for canonical ordering.
  [:Greek:] [^[:ccc=Not_Reordered:][:ccc=Above:]]*? { [\u0313\u0314\u0301\u0300\u0306\u0342\u0308\u0304] → ;
  [:Greek:] [^[:ccc=Not_Reordered:][:ccc=Iota_Subscript:]]*? { \u0345 → ;
  ::NFC();
</code></pre>
<p>That transform basically says remove all accents except a subscripted iota. It doesn’t handle dipthongs correctly.</p>
<h3><a name="p-298077-mozilla-algorithm-5" class="anchor" href="#p-298077-mozilla-algorithm-5" aria-label="Heading link" rel="nofollow"></a>Mozilla algorithm</h3>
<p>Mozilla has a thread on a <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=307039" rel="nofollow">bug report</a><br>
that:</p>
<blockquote>
<p>Greek accented letters should be converted to the respective non-accented uppercase<br>
letters. The required conversions are the following (in Unicode):</p>
<p>ά → Α<br>
έ → Ε<br>
ή → Η<br>
ί → Ι<br>
ΐ → Ϊ<br>
ό → Ο<br>
ύ → Υ<br>
ΰ → Ϋ<br>
ώ → Ω</p>
<p>Also diphthongs (two-vowel constructs) should be converted as follows, when the<br>
first vowel is accented:</p>
<p>άι → ΑΪ<br>
έι → ΕΪ<br>
όι → ΟΪ<br>
ύι → ΥΪ<br>
άυ → ΑΫ<br>
έυ → ΕΫ<br>
ήυ → ΗΫ<br>
όυ → ΟΫ</p>
</blockquote>
<p>That thread seems to align with current-day <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform" rel="nofollow">Mozilla</a> which says the rules are:</p>
<blockquote>
<p>In Greek (el), vowels lose their accent when the whole word is in<br>
uppercase (ά/Α), except for the disjunctive eta (ή/Ή). Also, diphthongs<br>
with an accent on the first vowel lose the accent and gain a diaeresis<br>
on the second vowel (άι/ΑΪ).</p>
</blockquote> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="298077" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/unicode-libraries-fun-with-unicode-introspection-lookup-sets-guards-transforms/27063/27">Post #26</a>
	                </div>
	            </div>
              <div id="likers-container-298077" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="298077"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #26"></div>
  </section>
</div>
    <div class="postbit" id="298614" data-post-id="298614">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="bottlenecked" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/bottlenecked/120/11338_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  bottlenecked
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I think I’m going to agree with the mozilla bug report (caveat: not a linguist). In common usage there’s two diacritic marks that survive:</p>
<ul>
<li>the accent (as in <code>ά</code> or <code>Ά</code> - applicable to all vowels)</li>
<li>the dialytics (as in <code>ϋ</code> or <code>Ϋ</code> - applicable to some vowels only - <code>ι</code> and <code>υ</code>) - also mentioned as <em>diaeresis</em> in the text quoted above</li>
</ul>
<p>The accent is used to denote where to stress the pronunciation. When capitalizing (e.g from <code>άλλος -&gt; Άλλος</code>) the accent survives if it’s on the first letter of the word, but not when upppercasing (e.g. from <code>άλλος -&gt; ΑΛΛΟΣ</code>)</p>
<p>The dialytics are also used to inform pronunciation: for example <code>αυλή</code> (means yard / backyard, pronounced ‘avlee’) does not require the dialytics because <code>αυ</code> is meant to be read as a diphthong, like ‘av’.</p>
<p>However in the word <code>άυλη</code> (means without matter / ethereal) notice that the accent is now on <code>ά</code> - which changes the pronunciation to something like ‘aelee’. When uppercasing we would do it as <code>ΑΫΛΗ</code> - so dialytics would be inserted to preserve the pronunciation since now there is no accent on <code>Α</code> to disambiguate (but if we were capitalizing, it would become <code>Άυλη</code> - the accent mark would be preserved because it’s on the first letter of the word and dialytics don’t have to be inserted for disambiguation)</p>
<p>There’s also the case where both an accent and dialytics are present on the same vowel - but the same rules apply as above for dialytics: the accent goes away when uppercasing, the dialytics either stay or get added as needed.</p>
<p>I hope that helps some</p>
<hr>
<p>In the word <code>ὀδυσσεύς</code> you posted above, the <code>ὀ</code> has a diacritic mark called ‘psili’ but that is no longer in use so for this and other marks you probably shouldn’t spend any time on</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="298614" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/unicode-libraries-fun-with-unicode-introspection-lookup-sets-guards-transforms/27063/28">Post #27</a>
	                </div>
	            </div>
              <div id="likers-container-298614" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="298614"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #27"></div>
  </section>
</div>
    <div class="postbit" id="320595" data-post-id="320595">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’ve just published <a href="https://hex.pm/packages/unicode_string/1.4.0" rel="nofollow">unicode_string version 1.4.0</a>. The primary update is the addition of dictionary-based word breaking for certain locales.</p>
<p>Not all languages use whitespace to separate words (most commonly East Asian languages) so a dictionary lookup is more appropriate - although not perfect.</p>
<p>The motivation to get this done now it to support the release in 2 weeks of <a href="https://github.com/elixir-cldr/cldr_person_names" rel="nofollow">ex_cldr_person_names</a>.</p>
<h3><a name="p-320595-supported-locales-for-dictionary-based-word-breaking-1" class="anchor" href="#p-320595-supported-locales-for-dictionary-based-word-breaking-1" aria-label="Heading link" rel="nofollow"></a>Supported locales for dictionary-based word breaking</h3>
<p>This implementation supports dictionary-based word breaking for:</p>
<ul>
<li>Chinese (<code>zh</code>, <code>zh-Hant</code>, <code>zh-Hans</code>, <code>zh-Hant-HK</code>, <code>yue</code>, <code>yue-Hans</code>) locales,</li>
<li>Japanese (<code>ja</code>) using the same dictionary as for Chinese,</li>
<li>Thai (<code>th</code>),</li>
<li>Lao (<code>lo</code>),</li>
<li>Khmer (<code>km</code>) and</li>
<li>Burmese (<code>my</code>).</li>
</ul>
<p>The dictionaries implemented are those used in <a href="https://cldr.unicode.org" rel="nofollow">CLDR</a> since they are under an open source license and also for consistency with <a href="https://icu.unicode.org" rel="nofollow">ICU</a>.</p>
<h3><a name="p-320595-downloading-dictionaries-2" class="anchor" href="#p-320595-downloading-dictionaries-2" aria-label="Heading link" rel="nofollow"></a>Downloading dictionaries</h3>
<p>Note that these dictionaries need to be downloaded with  <code>mix unicode.string.download.dictionaries</code> prior to use. Each dictionary will be parsed and loaded into <a href="https://www.erlang.org/doc/man/persistent_term" rel="nofollow">persistent_term</a> on demand.</p>
<h3><a name="p-320595-memory-usage-3" class="anchor" href="#p-320595-memory-usage-3" aria-label="Heading link" rel="nofollow"></a>Memory usage</h3>
<p>Note that each dictionary has a sizable memory footprint as measured by <code>:persistent_term.info/0</code>:</p>
<div class="md-table">
<table>
<thead>
<tr>
<th>Dictionary</th>
<th style="text-align:right">Memory Mb</th>
</tr>
</thead>
<tbody>
<tr>
<td>Chinese</td>
<td style="text-align:right">104.8</td>
</tr>
<tr>
<td>Thai</td>
<td style="text-align:right">9.6</td>
</tr>
<tr>
<td>Lao</td>
<td style="text-align:right">11.4</td>
</tr>
<tr>
<td>Khmer</td>
<td style="text-align:right">38.8</td>
</tr>
<tr>
<td>Burmese</td>
<td style="text-align:right">23.1</td>
</tr>
</tbody>
</table>
</div><h3><a name="p-320595-examples-4" class="anchor" href="#p-320595-examples-4" aria-label="Heading link" rel="nofollow"></a>Examples</h3>
<pre data-code-wrap="elixir"><code class="lang-elixir">iex&gt;  Unicode.String.split("明德", locale: :en) == 
["明", "德"]

iex&gt; Unicode.String.split("明德", locale: :zh_Hant_HK) == 
["明德"]

iex&gt; Unicode.String.split("สวัสดีเจ้านาย", locale: :th) 
["สวัสดี", "เจ้า", "นาย"]

iex&gt; Unicode.String.split("ສະບາຍດີນາຍຈ້າງ", locale: :lo)
["ສະບາຍດີ", "ນາຍ", "ຈ້າງ"]

iex&gt; Unicode.String.split("ສະမင်္ဂလာပါ သူဌေး", locale: :my)
["ສ", "ະ", "မင်္ဂလာ", "ပါ", " ", "သူဌေး"]

iex&gt; Unicode.String.split("ສជំរាបសួរចៅហ្វាយ", locale: :km)
["ສ", "ជំរាបសួរ", "ចៅហ្វាយ"]
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="320595" data-batch-url="/posts/batch_likers">
                        4
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/unicode-libraries-fun-with-unicode-introspection-lookup-sets-guards-transforms/27063/29">Post #28</a>
	                </div>
	            </div>
              <div id="likers-container-320595" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="320595"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #28"></div>
  </section>
</div>
    <div class="postbit" id="339527" data-post-id="339527">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a href="https://unicode.org/versions/Unicode16.0.0/" rel="nofollow">Unicode 16</a> was introduced today and with it an update to the Elixir library <a href="https://hex.pm/packages/unicode/1.20.0" rel="nofollow">Unicode version 1.20.0</a>.</p>
<h3><a name="p-339527-summary-of-changes-to-unicode-16-1" class="anchor" href="#p-339527-summary-of-changes-to-unicode-16-1" aria-label="Heading link" rel="nofollow"></a>Summary of changes to Unicode 16</h3>
<p>Unicode 16.0 adds 5,185 characters, for a total of 154,998 characters. The new additions include seven new scripts:</p>
<ul>
<li>Garay is a modern-use script from West Africa.</li>
<li>Gurung Khema, Kirat Rai, Ol Onal and Sunuwar are four modern-use scripts from Northeast India and Nepal.</li>
<li>Todhri is an historic script used for Albanian.</li>
<li>Tulu-Tigalari is an historic script from Southwest India.</li>
</ul>
<p>Other character additions include seven new emoji characters plus 3,995 additional Egyptian Hieroglyphs and over 700 symbols from legacy computing environments.</p>
<p>In addition to new characters, new “Moji Jōhō Kiban” (文字情報基盤) Japanese source references have been added for over 36,000 CJK unified ideographs. This additional data will be reflected in an upcoming release of <a href="https://hex.pm/packages/unicode_unihan" rel="nofollow">unicode_unihan</a>.</p>
<h3><a name="p-339527-do-not-emit-data-2" class="anchor" href="#p-339527-do-not-emit-data-2" aria-label="Heading link" rel="nofollow"></a>Do not emit data</h3>
<p>This is a <a href="https://www.unicode.org/Public/16.0.0/ucd/DoNotEmit.txt" rel="nofollow">new data set</a> that collects information about characters or character sequences that should not be emitted or generated in newly authored text and for which a suitable alternative sequence exists. This data could be used by applications such as input methods or autocorrect. This data will be incorporated into an upcoming update to <a href="https://hex.pm/packages/unicode" rel="nofollow">unicode</a>.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="339527" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/unicode-libraries-fun-with-unicode-introspection-lookup-sets-guards-transforms/27063/30">Post #29</a>
	                </div>
	            </div>
              <div id="likers-container-339527" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="339527"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #29"></div>
  </section>
</div>
    <div class="postbit" id="360741" data-post-id="360741">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’ve updated <a href="https://hex.pm/packages/unicode_set" rel="nofollow">unicode_set</a> and <a href="https://hex.pm/packages/unicode_string" rel="nofollow">unicode_string</a> to be compatible with OTP 28.</p>
<p>The only material change is to convert all compile-time regex’s to be runtime. In <code>unicode_string</code> this may have some performance implications since the entire string break process is an iterative application of rules that are regex’s.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="360741" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/unicode-libraries-fun-with-unicode-introspection-lookup-sets-guards-transforms/27063/31">Post #30</a>
	                </div>
	            </div>
              <div id="likers-container-360741" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="360741"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #30"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/27063/load_more?page=4">Load more posts (1 remaining)</a>
</div></template></turbo-stream>