<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>emre şahin's digital garden 🍃 - dart</title>
    <link>https://emresahin.net/tags/dart/</link>
    <description>Posts in the dart tag</description>
    <language>en</language>
    <managingEditor>contact@emresahin.net (Emre Şahin)</managingEditor>
    <lastBuildDate>Tue, 29 Sep 2026 14:57:43 +0000</lastBuildDate>
    <atom:link href="https://emresahin.net/tags/dart/rss.xml" rel="self" type="application/rss+xml"/>
    <item>
      <title>Literate Programming with Markdown</title>
      <published>2020-06-11T16:29:14+00:00</published>
      <updated>2020-06-11T16:29:14+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Thu, 11 Jun 2020 16:29:14 +0000</pubDate>
      <link>https://emresahin.net/til-june-11--24126/</link>
      <guid isPermaLink="true">https://emresahin.net/til-june-11--24126/</guid>
      <description>I return to my Ottoman language project from time to time, and most of the time I spend is spent trying to understand what I did previously. I decided that the actual parsing and simple morphological analysis modules should use Literate Programming with Markdown. I am currently using Dart to rewr...</description>
      <category>TIL</category>
      <category>tools</category>
      <category>ottoman</category>
      <category>markdown</category>
      <category>literate-programming</category>
      <category>dart</category>
      <category>knot</category>
      <content:encoded><![CDATA[<p>I return to my Ottoman language project from time to time, and most of the time I spend is spent trying to understand what I did previously. I decided that the actual parsing and simple morphological analysis modules should use <a href="https://en.wikipedia.org/wiki/Literate_programming">Literate Programming</a> with Markdown.</p>
<p>I am currently using <a href="https://dartlang.org">Dart</a> to rewrite the entire application, which is fundamentally simple. It receives words in Turkish or Ottoman and translates them to Ottoman or Turkish. However, the parsing module needs more rules to divide the words (and phrases) into roots and suffixes. There are hundreds of rules, and using only <em>code</em> to describe the reasoning behind parsing seems to be the main reason I spend so much time trying to understand my own work.</p>
<p>I decided that I can just use <a href="https://github.com/mqsoh/knot/blob/master/Dockerfile">knot</a> to write the rules in a document and generate the code from it. It will surely take more time than just writing the code, but in the end, I will have a document describing the analysis and parsing rules that even I can understand.</p>]]></content:encoded>
    </item>
    <item>
      <title>Translating Ottoman Turkish Spelling to Latin Alphabet using Surface Forms</title>
      <published>2020-05-14T21:44:25+00:00</published>
      <updated>2020-05-14T21:44:25+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Thu, 14 May 2020 21:44:25 +0000</pubDate>
      <link>https://emresahin.net/translating-ottoman-turkish-spelling-to-latin-alphabet-24600/</link>
      <guid isPermaLink="true">https://emresahin.net/translating-ottoman-turkish-spelling-to-latin-alphabet-24600/</guid>
      <description>dervaze is a project I started during my Ph.D. work in 2015 to translate Ottoman Turkish to modern Turkish spelling and to provide an OCR/ICR/handwriting recognition engine for the Ottoman language. The reason I had to stop was the lack of data, since without a considerable amount of data, statis...</description>
      <category>Language Processing</category>
      <category>Ottoman Turkish</category>
      <category>Ottoman Turkish</category>
      <category>Natural Language Processing</category>
      <category>Dart</category>
      <category>Morphology</category>
      <category>Transliteration</category>
      <content:encoded><![CDATA[<p>dervaze is a project I started during my Ph.D. work in 2015 to translate Ottoman
Turkish to modern Turkish spelling and to provide an OCR/ICR/handwriting recognition engine for the
Ottoman language.</p>
<p>The reason I had to stop was the lack of data, since without a considerable amount of data,
statistical methods for both Natural Language Processing and Computer Vision fail. Producing and
maintaining data seemed a much greater burden than providing technical solutions, so I mostly
gave up the idea that a working solution is obtainable with classical OCR techniques. The
research is still waiting for me to finish.</p>
<p>I am beginning this series of explorations in Computer Vision, Machine Learning, and related fields to
document my achievements and provide a basis for further research. From time to time, I will provide
results regarding the ideas discussed here. Currently, this is mostly a hobby/side project.</p>
<p>My current endeavor is to write a robust translation engine between Ottoman and Turkish in
Dart.<sup class="footnote-reference" id="fr-dart-1"><a href="#footnote-dart">1</a></sup></p>
<p>Instead of performing a full-fledged morphological analysis like <a href="https://github.com/coltekin/TRmorph">TRMorph</a>, <a href="https://github.com/google-research/turkish-morphology">Google Research
Morphological Analyzer</a>, or <a href="https://github.com/StarlangSoftware/TurkishMorphologicalAnalysis">Starlang Morphological Analyzer</a>, our aim is to
provide a surface-level to surface-level translation between Arabic and Turkish scripts.</p>
<p>It is true that it’s possible to use something like:</p>
<pre><code>
+-----------------+                +----------------+                 +---------------+
|                 |                |                |                 |               |
|                 |                |                |                 |               |
|    kelimeler    |    +-------&gt;   |  kelime+PLU    |  +-----------&gt;  |   کلمهلر      |
|                 |                |                |                 |               |
|                 |                |                |                 |               |
+-----------------+                +----------------+                 +---------------+

</code></pre>
<p>to translate between Turkish Latin and Ottoman, but there are two problems here:</p>
<ol>
<li>
<p>There is no Ottoman morphological analyzer, and although grammatically Turkish, surface-level
forms should be translated. Even morphological analyzers for Turkish in the Latin alphabet are
relatively recent.</p>
</li>
<li>
<p>Translating the output of a Turkish Latin morphological analyzer to Ottoman seems like more work
than writing a translation method itself.</p>
</li>
</ol>
<p>For example, for the query <code>kelimeler</code> <a href="https://github.com/coltekin/TRmorph">TRMorph</a> gives</p>
<pre><code>    kelime&lt;N&gt;&lt;pl&gt;
    kel&lt;Adj&gt;&lt;0&gt;&lt;N&gt;&lt;p1s&gt;&lt;dat&gt;&lt;0&gt;&lt;V&gt;&lt;cpl:pres&gt;&lt;3p&gt;
    kel&lt;Adj&gt;&lt;p1s&gt;&lt;Prn&gt;&lt;dat&gt;&lt;0&gt;&lt;V&gt;&lt;cpl:pres&gt;&lt;3p&gt;
    kelime&lt;N&gt;&lt;0&gt;&lt;V&gt;&lt;cpl:pres&gt;&lt;3p&gt;
    kelime&lt;N&gt;&lt;pl&gt;&lt;0&gt;&lt;V&gt;
    kelime&lt;N&gt;&lt;pl&gt;&lt;0&gt;&lt;V&gt;&lt;cpl:pres&gt;&lt;3p&gt;
    kelime&lt;N&gt;&lt;pl&gt;&lt;0&gt;&lt;V&gt;&lt;cpl:pres&gt;&lt;3s&gt;
</code></pre>
<p>and although most of the items’ surface forms are identical, we need to work through all suffixes
and their different kinds of connections. Also, as the surface form of Ottoman Turkish has less
information, Ottoman morphological analysis would yield many more results than its corresponding
counterpart.</p>
<p>Because of these hindrances and trying to come up with a quick-and-dirty yet workable solution, I
have made the following observations:</p>
<ol>
<li>
<p>Our part-of-speech system does not need to be highly specialized. Actually, we only need to have
three classes: Nouns, verbs, and proper nouns. Proper nouns are grammatically nouns, but their
orthography may require different rules. We will call these three <em>word classes.</em></p>
</li>
<li>
<p>We can get away with a set of surface-level rules to translate suffixes for each word class.
These rules use attributes that can be derived from Turkish Latin orthography.</p>
</li>
</ol>
<p>These rules are:</p>
<ul>
<li><strong>Part of Speech</strong>: The root class we discussed above.</li>
<li><strong>Last Vowel</strong>: The last vowel in a Turkish root that is required to find the actual suffix when
vowel harmony is utilized.</li>
<li><strong>Last Consonant</strong>: The last consonant of the Turkish root. This is needed to find the
palatalization/softening of certain consonants.</li>
<li><strong>Ends with Vowel</strong>: Whether the root ends with a vowel, like <em>ata</em>, or not.</li>
<li><strong>Has Single Vowel</strong>: Whether the root has a single vowel. This is important for aorist inflection
irregularities in verbs.</li>
<li><strong>Last Vowel Hard</strong>: Whether the last vowel is one of <em>a, ı, o, u</em> (back vowels) or not.</li>
<li><strong>Last Consonant Hard</strong>: Whether the last consonant is one of <em>p, ç, t, k</em> and undergoes softening
when it receives a suffix starting with a vowel.</li>
<li><strong>Has Consonant Softening</strong>: The inverse of the <em>last consonant hard</em> rule, occurring when a root ends with <em>b,
c, d, g</em> and receives a suffix.</li>
</ul>
<p>From these rules, which can be derived from the Turkish Latin forms of the words using regular
expressions, we can write rules to translate Turkish to Ottoman and vice versa.</p>
<p>To be continued.</p>
<hr>
<ol class="footnote-definition">
<li id="footnote-dart">
<p>Dart has the <em>little</em> benefit of being able to run both on mobile (in Android and iOS) and
servers with support for the web, so <em>write once, run on Linux, iOS and Android</em> is feasible
without much architecture jumping. I hope Flutter gains more traction and becomes the mainstream
way of writing mobile applications. <a href="#fr-dart-1">↩</a></p>
</li>
</ol>]]></content:encoded>
    </item>
    <item>
      <title>Anonymous functions in Dart</title>
      <published>2020-03-12T13:06:26+00:00</published>
      <updated>2020-03-12T13:06:26+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Thu, 12 Mar 2020 13:06:26 +0000</pubDate>
      <link>https://emresahin.net/anonymous-functions-in-dart-32304/</link>
      <guid isPermaLink="true">https://emresahin.net/anonymous-functions-in-dart-32304/</guid>
      <description>Sometimes we need anonymous functions for one-off tasks. Dart allows two similar syntaxes for writing these. The first one is used when there is a single expression to write: (a, b) =&gt; a + b The other is used when you need to write multiple statements in an anonymous function: (a, b) { return a +...</description>
      <category>development</category>
      <category>programming</category>
      <category>dart</category>
      <category>lambda</category>
      <category>anonymous-functions</category>
      <category>syntax</category>
      <content:encoded><![CDATA[<p>Sometimes we need anonymous functions for one-off tasks. Dart allows two similar syntaxes for writing these.</p>
<p>The first one is used when there is a single expression to write:</p>
<pre><code class="language-dart">(a, b) =&gt; a + b
</code></pre>
<p>The other is used when you need to write multiple statements in an anonymous function:</p>
<pre><code class="language-dart">(a, b) { 
  return a + b; 
}
</code></pre>]]></content:encoded>
    </item>
  </channel>
</rss>
