<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>metamutator.github.io</title>
<link>https://metamutator.github.io/</link>
<atom:link href="https://metamutator.github.io/index.xml" rel="self" type="application/rss+xml"/>
<description>The Computational Appendix to yaksha.sg</description>
<generator>quarto-1.9.38</generator>
<lastBuildDate>Sun, 05 Jul 2026 00:00:00 GMT</lastBuildDate>
<item>
  <title>Can the Multi-Armed Subaltern Write?</title>
  <dc:creator>Akshay Regulagedda</dc:creator>
  <link>https://metamutator.github.io/posts/multi-armed-subaltern/multi_armed_subaltern.html</link>
  <description><![CDATA[ 





<div id="fig-hero" class="quarto-float quarto-figure quarto-figure-center anchored" data-fig-align="center">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-hero-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://metamutator.github.io/posts/multi-armed-subaltern/english-tamil-dict-small.jpg" class="img-fluid quarto-figure quarto-figure-center figure-img">
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-hero-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;1: Working through an English - Tamil dictionary. Photo by <a href="https://unsplash.com/@hyson?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Antony Hyson Seltran</a> on <a href="https://unsplash.com/photos/an-open-book-sitting-on-top-of-a-table-pT4Cot62pE4?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>
</figcaption>
</figure>
</div>
<section id="foreword" class="level2">
<h2 class="anchored" data-anchor-id="foreword">Foreword</h2>
<p>This is the final term project I did towards the completion of my <a href="https://www.analytics.gatech.edu">Master of Science in Analytics</a> degree from Georgia Institute of Technology.</p>
</section>
<section id="problem-statement1" class="level2">
<h2 class="anchored" data-anchor-id="problem-statement1">Problem Statement<sup>1</sup></h2>
<p>Whilst multi-lingual anglophone writers may easily find a large readership for their writing in English, they often find it hard to find a ready audience for their writings in other vernacular languages. This is particularly so if they have very niche or domain-specific interests that may not have equivalent readership across language communities. And indeed, a sufficiently large readership is a crucial signal to motivate writers to write more, especially if they would like to practise or improve their writing talent.</p>
<p>Wikipedia translation offers perhaps the most accessible medium for such writers. In this sense, we see Wikipedia as a platform that connects interested writers and readers across a hidden dimension, that of language. But the difficulty for a sufficiently motivated writer is to find articles that are at the intersection of their own interests and what reasonably large number of readers would read. We explore Wikipedia as a two-sided market balancing the demand-side (readership, as measured in page-views) and the supply-side (translator interest or effort).</p>
<p>Put simply, the question we ask ourselves is this: how can we create a recommendation model that works similar to that on TikTok or Instagram Reels, but for <em>volunteer translators on Wikipedia</em>?</p>
<p>To this end, we have implemented a model that recommends articles for an interested translator using an explore-exploit approach (“The Multi-Armed Bandit problem”). The model balances the translator’s own interest whilst optimising for readership potential. In a later section, we will share a brief literature review on this problem (Section&nbsp;3), and why the approach is unique both in its application to the problem area (motivating translators) and in its technical implementation.</p>
<p>We executed this model using Telugu Wikipedia as a primary case study, a language with 80 million native speakers yet dramatically underserved relative to comparable language communities.</p>
<p>We had previously proposed a detailed pipeline (Section&nbsp;4.1) - from seeding interest by a translator to expanding, filtering, scoring, clustering and eventually recommending articles in the English Wikipedia back to them. In this report, we will not only elaborate on that pipeline, but also discuss nuances in implementation: how the problem was broken down into 9 JIRA-style epics with associated user-stories, how we optimized processing time for data gathering by a factor of 8 through parallelisation and batch API’s, and so on. We will evaluate the implementation both from a quantitative perspective - by considering MAE’s across a range of approaches - and a qualitative evaluation of the categories chosen. We will finally recommend a set of actions in the final section on how this framework can be taken forward.</p>
</section>
<section id="sec-lit-survey" class="level2">
<h2 class="anchored" data-anchor-id="sec-lit-survey">Literature Survey &amp; Novelty</h2>
<p>Silva et al <span class="citation" data-cites="silva2022">(2022)</span> have observed that recommendation systems have “attracted a lot of attention from both industry and academia” as a response to exponential growth of digital information, which had led to “stressful situation[s]” of information overload for many users, particularly when comes to purchase decisions. Indeed, a lot of the effort has been towards recommending videos and such on Netflix <span class="citation" data-cites="ko2022a">(Ko et al. 2022)</span>, and of course, TikTok, which, Zhang et al <span class="citation" data-cites="zhang2021">(2021)</span> have found, to be “impressive” in not just improving loyalty from users, but also drawing them “into new intersecting areas”.</p>
<p>Silva et al’s <span class="citation" data-cites="silva2022">(2022)</span> systematic literature review found 230 articles on Google Scholar published between 2000 and 2020 that used the Multi-Armed Bandit approach to develop recommendation systems. The field has had a growing interest in recent years; they found that more than 50% of such works were published between 2016 and 2020. Most applications, however, deal with recommending news, users’ purchases (e.g.&nbsp;on Amazon),songs, advertisements, points-of-interest, bookmarks, food, jobs, and even jokes. None of the papers in their meta-analysis dealt with recommending articles to be translated.</p>
<p>Wulczyn et al’s three-month study did generate a model to recommend articles for translators to translate from English to French Wikipedia. However, it did so by ranking articles that it deemed “missing” (and then matched translators to them) <span class="citation" data-cites="wulczyn2016">(2016)</span>. The starting point wasn’t necessarily the translator’s own interest, but achieving a certain completeness in the French Wikipedia compared to that in English. Translators in the study had raised questions of “language imperialism”, as Wulcyzn et al themselves had documented.</p>
<p>In comparison, our approach is centered on the Telugu Wikipedia and on the personal: the goal isn’t necessarily for the Telugu Wikipedia to reach parity, so to speak, with the English Wikipedia in terms of articles. Instead, the focus is essentially writer’s own interest first: on what they would like to see in the Telugu Wikipedia primarily, whilst maximizing for readership.</p>
</section>
<section id="methodology" class="level2">
<h2 class="anchored" data-anchor-id="methodology">Methodology</h2>
<section id="sec-pipeline" class="level3">
<h3 class="anchored" data-anchor-id="sec-pipeline">Overview</h3>
<p>We proposed the pipeline in our project proposal seen in Figure&nbsp;2.</p>
<div id="fig-pipeline" class="quarto-float quarto-figure quarto-figure-center anchored">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-pipeline-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://metamutator.github.io/posts/multi-armed-subaltern/pipeline diagram.png" class="img-fluid figure-img" width="600">
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-pipeline-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;2: Pipeline
</figcaption>
</figure>
</div>
<p>The pipeline was implemented largely as proposed using the Agile methodology, as Epics with self-contained user-stories. This project was essentially done beyond work-hours and on weekend afternoons. As such, we needed a way to break the overall task down into small chunks (that can be executed over lunch for example), while at the same time, have assured code quality when we integrated it all. Having self-contained unit-tests per user-story helped us tremendously in this regard.</p>
<p>Some optimisations were later found necessary for data gathering and processing.</p>
</section>
<section id="epic-1-project-scaffolding" class="level3">
<h3 class="anchored" data-anchor-id="epic-1-project-scaffolding">Epic 1: Project Scaffolding</h3>
<p>We used the Agile methodology to breakdown the pipeline into a series of epics and JIRA-style user-stories to be implemented sequentially. Each user-story had its own set of self-contained unit-tests. The overall project has a <code>pyproject.toml</code> file declaring all dependencies and a <code>config.yaml</code> to store values for <code>alpha</code>, <code>curated_categories</code>, <code>traversal_depth</code>, <code>quality_filter_threshold</code>, <code>epsilon</code>, <code>cold_start_window_days</code></p>
</section>
<section id="sec-data-sources" class="level3">
<h3 class="anchored" data-anchor-id="sec-data-sources">Epic 2: Data Acquisition</h3>
<p>We combined manual ratings with openly available data from various Wikipedia API’s:</p>
<table class="caption-top table">
<caption>Data Sources &amp; Feature Set</caption>
<colgroup>
<col style="width: 18%">
<col style="width: 47%">
<col style="width: 32%">
</colgroup>
<thead>
<tr class="header">
<th>Source</th>
<th>Signal Type</th>
<th>Feature</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Manual Ratings</td>
<td>Supply side “seed”</td>
<td>Translator interest rating</td>
</tr>
<tr class="even">
<td>MediaWiki API</td>
<td>Relevance (Features for Step #2: Expand)</td>
<td>Article categories</td>
</tr>
<tr class="odd">
<td>MediaWiki API</td>
<td>Feasibility features</td>
<td>Article length (word count)</td>
</tr>
<tr class="even">
<td>MediaWiki API</td>
<td>Feasibility features</td>
<td>Article quality rating</td>
</tr>
<tr class="odd">
<td>Pageviews API</td>
<td>Reader demand</td>
<td>Demand gap score</td>
</tr>
</tbody>
</table>
<section id="optimisations" class="level4">
<h4 class="anchored" data-anchor-id="optimisations">Optimisations</h4>
<p>Our initial versions for client-classes for MediaWiki and Pageviews API’s called each Wikipedia article individually. In later stages, we realized that meant calling the API more than 2000 times in quick succession, especially if the constructed candidate pool was large. With enough throttling, that meant processing times of more than 45 minutes each time a candidate pool was constructed. Instead, we implemented the following:</p>
<ol type="1">
<li><strong>Batch Processing</strong>: We combined calls for multiple Wikipedia pages together into a single call. The API allowed up to 50 pages to be batched together</li>
<li><strong>Parallel Processing:</strong> We parallelized API calls into multiple threads using <code>ThreadPoolExecutor</code>.</li>
<li><strong>Throttling:</strong> Should an API call encounter a 429 error, we spaced out subsequent re-try attempts based on the message.</li>
</ol>
</section>
</section>
<section id="sec-candidate-pool" class="level3">
<h3 class="anchored" data-anchor-id="sec-candidate-pool">Epic 3: Candidate Pool Construction</h3>
<p>The candidate pool was constructed through the following inputs:</p>
<ol type="1">
<li><p><strong>Seed Articles:</strong> The user would suggest a list of 10-15 Wikipedia articles to seed the model first. In the final evaluation, we seeded the following articles:</p>
<table class="caption-top table">
<caption>Seed Articles for the Final Evaluation</caption>
<colgroup>
<col style="width: 43%">
<col style="width: 56%">
</colgroup>
<tbody>
<tr class="odd">
<td><ul>
<li>Caitika</li>
<li>1915 Singapore Mutiny</li>
<li>Ngogo chimpanzee war</li>
<li>Longest flights</li>
<li>Westray to Papa Westray flight</li>
<li>Boat Mail Express</li>
<li>Shangri-La</li>
<li>Tea Horse Road</li>
</ul></td>
<td><ul>
<li>List of tallest buildings in India</li>
<li>Longest train services of Indian Railways</li>
<li>Johor Bahru–Singapore Rapid Transit System</li>
<li>Montreal</li>
<li>Quebec</li>
<li>Montréal–Trudeau International Airport</li>
<li>Orlando: A Biography</li>
</ul></td>
</tr>
</tbody>
</table></li>
<li><p><strong>Categories:</strong> Querying the full English Wikipedia corpus of over 7 million articles is not just computationally infeasible, but semantically unfocussed. Therefore, we constrained the candidate pool of articles to a curated set of top-level Wikipedia categories specified by the user. This was defined in <code>config.yaml</code></p>
<p>We seeded the following categories in the final evaluation:</p>
<table class="caption-top table">
<caption>Categories for the Final Evaluation</caption>
<colgroup>
<col style="width: 51%">
<col style="width: 48%">
</colgroup>
<tbody>
<tr class="odd">
<td><ul>
<li>Transport-related lists of superlatives</li>
<li>Military history of Singapore</li>
<li>Named passenger trains of India</li>
<li>Mahayana sutras</li>
<li>Monks of Nalanda</li>
<li>Telugu monarchs</li>
</ul></td>
<td><ul>
<li>Novels about transgender topics</li>
<li>Metafictional novels</li>
<li>History of Andhra Pradesh</li>
<li>Chinese classic texts</li>
<li>Buddhist holy sites in Andhra Pradesh</li>
<li>Philosophical skepticism</li>
</ul></td>
</tr>
</tbody>
</table></li>
<li><p><strong>Depth of Category Traversal:</strong> The level to which the categories may be traversed can be set in <code>config.yaml</code> We initially tested the model with <code>1</code>, but executed it with <code>2</code>.</p></li>
</ol>
</section>
<section id="epic-4-feature-engineering" class="level3">
<h3 class="anchored" data-anchor-id="epic-4-feature-engineering">Epic 4: Feature Engineering</h3>
<p>The raw data collected in the previous epic is to be transformed it into model inputs here, through the following features:</p>
<section id="article-quality-rating" class="level4">
<h4 class="anchored" data-anchor-id="article-quality-rating">1. Article Quality Rating</h4>
<p>Per Wikimedia’s own guidance, articles in the English Wikipedia can be ranked using the following quality classes in order of quality: FA, GA, B, C, START, and STUB <span class="citation" data-cites="Johnson_Aragón_2022">(Johnson and Aragón 2022)</span>. Other language Wikipedias also have their own quality classifications, even if they may not exactly match those in English.</p>
<p>We grouped all quality classes into three tiers, as follows:</p>
<table class="caption-top table">
<caption>Quality Classes in English Wikipedia grouped into three tiers</caption>
<thead>
<tr class="header">
<th>Tier</th>
<th>Classes</th>
<th>Encoded Value</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>High quality</td>
<td>FA, A, GA</td>
<td>3</td>
</tr>
<tr class="even">
<td>Mid quality</td>
<td>B, C</td>
<td>2</td>
</tr>
<tr class="odd">
<td>Low quality</td>
<td>Start, Stub</td>
<td>1</td>
</tr>
</tbody>
</table>
<p>All articles in low quality (<code>encoded value = 1</code>) were excluded from the candidate pool entirely before scoring.</p>
</section>
<section id="article-length" class="level4">
<h4 class="anchored" data-anchor-id="article-length">2. Article Length</h4>
<p>MediaWiki API returns a <code>wordcount</code>, which was used to signify length of an article. However, because the range of length of articles can be very wide indeed, we normalized this metric through a log transformation (<code>log(wordcount)</code>). In general, the difference in translation effort between a 500 and 1000 word article is much more significant than that between a 9,500 word and a 10,000 word article. A log transformation would naturally account for this and compress skewness in article length distribution.</p>
</section>
<section id="category-membership" class="level4">
<h4 class="anchored" data-anchor-id="category-membership">3. Category Membership</h4>
<p>Whilst we curated the list of top-level categories to a limited set, Wikipedia articles are still classified under multiple categories. This can be challenging in encoding the information, which we have addressed in the following manner.</p>
<p>If <img src="https://latex.codecogs.com/png.latex?k"> is the number of curated top-level categories, each article would have: <img src="https://latex.codecogs.com/png.latex?%20category_i%20=%20%5Cbegin%7Bcases%7D%0A%5Ctext%7B1%7D,%20&amp;%20%5Ctext%7Bif%20article%20belongs%20to%20category%20i%7D%20%5C%5C%0A%5Ctext%7B0%7D,%20&amp;%20%5Ctext%7Bif%20it%20doesn't%7D%0A%5Cend%7Bcases%7D"> where <img src="https://latex.codecogs.com/png.latex?i%20=%201,%202,%20....%20k"></p>
<p>This gave us a sparse binary vector per article. We can avoid the curse of dimensionality because we are manually curating less than 15 top-level categories, thus ensuring <img src="https://latex.codecogs.com/png.latex?k"> is small and fixed.</p>
</section>
<section id="demand-gap-score" class="level4">
<h4 class="anchored" data-anchor-id="demand-gap-score">4. Demand Gap Score</h4>
<p>Whilst the features thus far <em>describe</em> a Wikipedia article, we also would like some demand-side signals. To this end, we used a a <strong>demand gap score</strong> to measure is how different readership is for the same page between the English and Telugu Wikipedia. The feature is derived from PageViews API as <img src="https://latex.codecogs.com/png.latex?%5Ctext%7BDemand%20Gap%20Score%7D=1-%5Cfrac%7B%5Ctext%7BTelugu%20views%7D%7D%7B%5Ctext%7BEnglish%20views%7D%7D%20"></p>
<p>This provides a normalized measure of unmet readership demand that is comparable across articles of varying popularity.</p>
</section>
<section id="cold-start-gap" class="level4">
<h4 class="anchored" data-anchor-id="cold-start-gap">5. Cold-Start Gap</h4>
<p>Whilst we can calculate a demand gap score between versions in English and Telugu Wikipedia, there is a possibility that a Telugu version may not exist at all (i.e., <img src="https://latex.codecogs.com/png.latex?%5Ctext%7BTelugu%20views%7D%20=%200">) In such a case, demand gap score will be 1 (undefined) for every untranslated article.</p>
<p>Which is to say, we may have a <em>cold start problem</em> - we will not gather sufficient pageview data for translated articles until well after the translations have been written. In such cases, we would use views for the Hindi language versions as a proxy instead:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Ctext%7BCold%20Start%20Proxy%7D%20=%201%20-%20%5Cfrac%7B%5Ctext%7BHindi%20views%7D%7D%7B%5Ctext%7BEnglish%20views%7D%7D"></p>
<p>We chose Hindi as a proxy because we have seen that Hindi readership for the Wikipedia page on the Indian city Hyderabad (where both Hindi and Telugu are spoken) was 3-4 times that of the Telugu readership.<span class="citation" data-cites="langview">(<em>Langviews Analysis</em>, n.d.)</span> There is a very good chance that Hindi and Telugu readers may have overlapping topical interests for culturally proximate subjects: indeed, in many cases, they may be the same individuals as well, as many are fluent in both languages. Once sufficient Telugu pageview data has accumulated following the 3-month window, the model will transition back to the standard demand gap score.</p>
<p>This is naturally a hypothesis; it was evaluated independently in a later section. However, we took care to build this as a feature in this epic itself.</p>
<p>We also defined the following guardrails that can be set in <code>config.yaml</code>:</p>
<ol type="1">
<li>Small constant guarding against division by zero in demand gap score: <code>epsilon: 1.0e-6</code></li>
<li>Days after a translation before switching from Hindi cold-start proxy to real Telugu views: <code>cold_start_window_days: 90</code></li>
</ol>
</section>
<section id="epic-3-4-output" class="level4">
<h4 class="anchored" data-anchor-id="epic-3-4-output">Epic 3 &amp; 4 Output</h4>
<p>An output Excel was generated at the end of executing all the stories here with a constructed candidate pool expanding on the seed articles and categories with the features listed above, whilst filtering out low-quality articles. The pool is now ready for a translator to rate. In the final execution, 78 articles were retrieved.</p>
</section>
</section>
<section id="epic-5-scoring-model" class="level3">
<h3 class="anchored" data-anchor-id="epic-5-scoring-model">Epic 5: Scoring Model</h3>
<section id="translator-rating" class="level4">
<h4 class="anchored" data-anchor-id="translator-rating">Translator Rating</h4>
<p>This “supply-side” feature, that of translator’s own interest, is captured on a scale of three, roughly on par with swiping left or right as one does on some contemporary apps: <strong>-1</strong> (<em>dislike</em>), <strong>0</strong> (<em>neutral</em>) or <strong>+1</strong> (<em>like</em>).</p>
<p>In the final execution, 29 out of the 78 retrieved articles were rated either -1, 0, or 1.</p>
</section>
<section id="target-variable-composite-score" class="level4">
<h4 class="anchored" data-anchor-id="target-variable-composite-score">Target Variable: Composite Score</h4>
<p>We first normalized the translator’s ratings to <img src="https://latex.codecogs.com/png.latex?%7B0,%200.5,%201%7D"> and then combined them with the demand gap score into a composite score:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Ctext%7BComposite%20Score%7D%20=%20%5Calpha%20%5Ccdot%20%5Cfrac%7B%5Ctext%7BTranslator%20Rating%7D+1%7D%7B2%7D%20+%20(1-%5Calpha)%5Ccdot%5Ctext%7BDemand%20Gap%20Score%7D"></p>
<p>where the coefficient <img src="https://latex.codecogs.com/png.latex?%5Calpha%20%5Cin%20%5B0,1%5D"> was tuned through cross-validation.</p>
</section>
<section id="models-baseline-and-primary" class="level4">
<h4 class="anchored" data-anchor-id="models-baseline-and-primary">Models: Baseline and Primary</h4>
<p>We generated models that tried to learn the relationship between input features such as article length, quality tier etc and the target variable, composite score. The models will then be able to predict scores for articles that had not been evaluated as yet.</p>
<p>We compared three models:</p>
<ul>
<li><strong>Naive Baseline</strong>: Demand gap score used directly as predicted composite score</li>
<li><strong>Linear Regression</strong>: This was meant to be a <em>baseline model</em> as we need a continuous variable to rank articles. Linear regression’s simplicity and interpretability via coefficients make it a natural reference point against which to measure the added value of more complex models. The model was preprocessed with continous variables standardized (with zero mean, unit variance), while binary category flags were left unscaled.</li>
<li><strong>Random Forest</strong>: This was meant to be a <em>primary model</em>, as it can capture non-linear relationships between features and the composite score, which is something that linear regression cannot do. Random Forest is also useful for understanding feature importance. No scaling required here.</li>
</ul>
<p>We will discuss the results later in Section&nbsp;5.</p>
</section>
</section>
<section id="epic-6-clustering-topical-diversity" class="level3">
<h3 class="anchored" data-anchor-id="epic-6-clustering-topical-diversity">Epic 6: Clustering (Topical Diversity)</h3>
<section id="purpose" class="level4">
<h4 class="anchored" data-anchor-id="purpose">Purpose</h4>
<p>A scoring model that ranks articles by composite score alone is not sufficient for diversity. Without clustering, the recommendations could easily collapse into a single high-scoring topic cluster. Such an outcome would defeat the purpose of a personalized recommender and will accelerate translator burnout. Instead, to ensure topical variability, we performed clustering as a diversity mechanism, sampling top candidates from each cluster, rather than take just the global top N by score.</p>
</section>
<section id="choice-of-algorithm" class="level4">
<h4 class="anchored" data-anchor-id="choice-of-algorithm">Choice of Algorithm</h4>
<p>We used spectral clustering to cluster the articles by topic. The articles may share multiple category flags out of the 10-15 curated top-level categories, that is to say they are likely to have sparse binary vectors for categories. Consequently, while the articles are topically related, their relationship is geometric in a non-Euclidean sense. Connectivity-based similarity is better handled by spectral clustering than k-means.</p>
<p>The number of clusters <img src="https://latex.codecogs.com/png.latex?k"> is determined by the eigenvalue gap: we examined the eigenvalues of the graph Laplacian and choose <img src="https://latex.codecogs.com/png.latex?k"> where there’s a natural gap between the <img src="https://latex.codecogs.com/png.latex?k">-th and <img src="https://latex.codecogs.com/png.latex?(k+1)">-th eigenvalue. The eigenvalue structure of the similarity matrix tells us how many natural topic communities exist in the article graph.</p>
</section>
<section id="feature-choice" class="level4">
<h4 class="anchored" data-anchor-id="feature-choice">Feature Choice</h4>
<p>Since the purpose of clustering is topical diversity rather than quality filtering, we excluded score and length features, and used category flags alone for clustering. This is to ensure that clusters reflect topical neighbourhoods and not quality or length neighbourhoods.</p>
</section>
</section>
<section id="epic-7-recommendation-through-explore-exploit" class="level3">
<h3 class="anchored" data-anchor-id="epic-7-recommendation-through-explore-exploit">Epic 7: Recommendation Through Explore-Exploit</h3>
<section id="takkari-donga-the-multi-armed-bandit" class="level4">
<h4 class="anchored" data-anchor-id="takkari-donga-the-multi-armed-bandit"><em>Takkari Donga</em>: The Multi-Armed Bandit</h4>
<p>With articles scored by interest and opportunity, and clustered by topic, we know what a translator’s preferences are, which are primed to be <em>exploited</em>. However, we also need to <em>explore</em> new territory to learn more about their preferences, a problem known as the Multi-Armed Bandit problem in reinforcement learning. Since we are dealing with the Telugu Wikipedia after all, one might call this the <em>Takkari Donga</em> problem<sup>2</sup>: how does the clever bandit (in Telugu) explore and exploit learned preferences and opportunities for the motivated translator?</p>
<p>A key element here is to model distribution of reader interest across topic clusters, that is to say, to ask where the latent demand is concentrated. Density estimation via Gaussian Mixture Model (GMM) was a likely approach: if GMM flagged an article as sitting in a sparse, uncertain region, that article is worth exploring. This is not to say that the translator will necessarily <em>like</em> the article, but that the user’s rating will give the most <em>new information</em> to improve the model. Consequently, a recommendation list would be a shortlist balancing exploit (articles with high composite scores) and explore (sparse GMM regions): the clever thief takes not just what is of high value, but also explores what <em>could be</em> of high value.</p>
</section>
<section id="recommendation-logic" class="level4">
<h4 class="anchored" data-anchor-id="recommendation-logic">Recommendation Logic</h4>
<p>The recommendation logic per cluster, can simply be stated as follows:</p>
<ol type="1">
<li>We take all scored, clustered unrated candidates</li>
<li>We fit GMM on feature vectors of already-rated articles</li>
<li>We then compute the log-likelihood of each candidate under GMM</li>
<li><strong>Exploit:</strong> Within each cluster, we sort articles in <em>descending order</em> of composite score, taking the top 1 as an exploit candidate</li>
<li><strong>Explore:</strong> Within each cluster, we sort articles in <em>ascending order</em> of log-likelihood, taking the top 1 as an explore candidate</li>
<li>We surface two such articles per cluster as recommendations. The total recommendations offered to the translator, therefore, would be <img src="https://latex.codecogs.com/png.latex?2k"> articles, where <img src="https://latex.codecogs.com/png.latex?k"> is the number of clusters. The translator’s ratings on these recommendations then feed into the feedback loop, updating the model for the next round.</li>
</ol>
</section>
<section id="epic-7-output" class="level4">
<h4 class="anchored" data-anchor-id="epic-7-output">Epic 7 Output</h4>
<p>An eigenvalue-gap plot using spectral clustering was generated. Having fitted a Gaussian Mixture Model, we generated 1 exploit (highest composite score) and 1 explore (lowest GMM log-likelihood).</p>
</section>
</section>
<section id="epic-8-take-feedback" class="level3">
<h3 class="anchored" data-anchor-id="epic-8-take-feedback">Epic 8: Take Feedback</h3>
<section id="feedback-loop" class="level4">
<h4 class="anchored" data-anchor-id="feedback-loop">Feedback Loop</h4>
<p>Once recommendations are made, ratings given and the translations done, the model was intended to have a feedback loop with the following elements:</p>
<ol type="1">
<li><p><strong>When an update is triggered:</strong> The model will need to learn how readers have been taking to the translations. This would need sufficient time for organic readership to discover and engage with newly translated articles. To this end, we propose making updates every 3 months.</p></li>
<li><p><strong>What gets updated:</strong> We envisage a production update cadence as follows to give sufficient time for a model to learn:</p>
<ol type="1">
<li><strong>Continuous updates:</strong> Each time new ratings are added</li>
<li><strong>Annual</strong>: Retuning <img src="https://latex.codecogs.com/png.latex?%5Calpha"> every 12 months</li>
<li><strong>Biennial</strong>: Retraining the full model</li>
</ol>
<p>This is obviously not possible within the term project cadence. But we simulated one manual update cycle using the author’s own ratings.</p></li>
</ol>
</section>
</section>
</section>
<section id="sec-eval" class="level2">
<h2 class="anchored" data-anchor-id="sec-eval">Results &amp; Observations (Epic 9)</h2>
<section id="evaluation-premise" class="level3">
<h3 class="anchored" data-anchor-id="evaluation-premise">Evaluation Premise</h3>
<p>We measured Mean Absolute Error (MAE) between predicted and actual composite scores. MAE is appropriate here because it treats all errors equally, which is appropriate given that the composite score is bounded [0,1]. For a recommendation system where consistent ranking is more important than avoiding large errors, MAE is perhaps more appropriate than other error metrics such as Root Mean Squared Error (RMSE)</p>
<p>Our assumption was that we would arrive at the following evaluation hierarchy:</p>
<ul>
<li><strong>Naive baseline</strong>: As mentioned, we used demand gap score directly as a predicted composite score and measure its error against the computed composite score. This is equivalent to setting translator interest weight, <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%200">.</li>
<li><strong>Linear Regression</strong>: MAE computed from model output and composite score via k-fold cross-validation</li>
<li><strong>Random Forest</strong>: MAE computed against composite score via k-fold cross-validation.</li>
</ul>
<p>Looking beyond MAE, feature importance scores from Random Forest could be examined to understand which signals drive recommendation quality most strongly.</p>
<p><strong>Recommendation Quality</strong></p>
<p>The model does more than predict scores, it produces a ranked list of recommendations. While we used MAE to tell us how well the model predicts scores, we will need to evaluate whether the ordering of recommendations is correct.</p>
<p>For such an evaluation, we first defined a threshold on the composite score. Given the range [0,1], we took the midpoint, 0.5, as the threshold. Articles above this score will be labelled as good candidates.</p>
<p>We then computed precision as the fraction of recommended articles exceeding this threshold, and compared this across naive baseline, Linear Regression and Random Forest.</p>
<p><strong>Single-user bias</strong></p>
<p>The approach would take a single user’s (the author) preferences (“translator ratings”) and build upon it, which could open up the chance that the translator’s niche interests could diverge from mass readership.</p>
<p>We had earlier proposed exploring this through a simple diagnostic: we compute a correlation between translator ratings and pageview gap across recommended articles. This will lead us to two possible outcomes:</p>
<ol type="1">
<li><strong>High Positive Correlation</strong>: The model’s two-sided approach is coherent: the translator’s interests and reader demand are well-aligned.</li>
<li><strong>Negative Correlation</strong>: Such an outcome would reveal a genuine tension between supply and demand - the translator’s niche interests diverge from mass readership. This is exactly the problem the model is designed to navigate (and therefore, the more interesting finding, academically speaking)</li>
</ol>
</section>
<section id="result-1-supply-demand-tension" class="level3">
<h3 class="anchored" data-anchor-id="result-1-supply-demand-tension">Result 1: Supply Demand Tension</h3>
<p>The model’s core motivation - that there could be a genuine tension between a translator’s interests from mass readership - may be validated. Pearson <code>r</code> between a translator’s ratings and demand gap scores across rated articles calculates to <code>-0.282</code>, with a <code>p=0.049</code>.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://metamutator.github.io/posts/multi-armed-subaltern/supply_demand_alignment.png" class="img-fluid figure-img" width="500"></p>
<figcaption>Supply - Demand Alignment</figcaption>
</figure>
</div>
</section>
<section id="result-2-evaluating-models" class="level3">
<h3 class="anchored" data-anchor-id="result-2-evaluating-models">Result 2: Evaluating Models</h3>
<section id="mae" class="level4">
<h4 class="anchored" data-anchor-id="mae">MAE</h4>
<p>We expected Random Forest to have the least MAE followed by Linear Regression and Naive Baseline. Fascinatingly enough, that is <strong>not</strong> what we observed:</p>
<table class="caption-top table">
<caption>MAE by Model</caption>
<thead>
<tr class="header">
<th>Model</th>
<th>Mean MAE</th>
<th>Std MAE</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>NaiveBaseline</td>
<td>0.202</td>
<td>0.122</td>
</tr>
<tr class="even">
<td>LinearRegression</td>
<td>0.217</td>
<td>0.032</td>
</tr>
<tr class="odd">
<td>RandomForest</td>
<td>0.216</td>
<td>0.042</td>
</tr>
</tbody>
</table>
<ul>
<li><p><strong>Very High Demand Gap:</strong> In effect, we found that demand gap had essentially no variance, with a mean = 0.995, STD = 0.014 and the 50th percentile at 1. The candidate pool in retrospect was scoped to categories likely to be untranslated into Telugu; consequently, every article has near-zero Telugu views. This essentially meant the demand gap <img src="https://latex.codecogs.com/png.latex?d%20%5Capprox%201.0"> everywhere.</p></li>
<li><p><strong>Model Ordering Failure</strong>: The naive baseline here was the demand gap. When the demand gap is close to constant, it is trivially hard to beat.</p></li>
<li><p><strong>Precision@0.5 = 1.000 for all models</strong>: Essentially, <code>composite_score = demand_gap</code> <img src="https://latex.codecogs.com/png.latex?%5Capprox%201.0%20%3E%200.5"> for all articles.</p></li>
<li><p><strong>CV tuning returned</strong> <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%200">: In effect, with near-constant demand gap, translator preference added no discriminating signal to the composite score on this dataset.</p></li>
</ul>
</section>
<section id="feature-importance" class="level4">
<h4 class="anchored" data-anchor-id="feature-importance">Feature Importance</h4>
<p>We found <code>log_wordcount</code> to be of overwhelming importance compared with every other feature.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://metamutator.github.io/posts/multi-armed-subaltern/rf_feature_importances_top15.png" class="img-fluid figure-img" width="500"></p>
<figcaption>Top 15 Features by Random Forest</figcaption>
</figure>
</div>
</section>
</section>
<section id="result-3-evaluating-cold-start-proxy" class="level3">
<h3 class="anchored" data-anchor-id="result-3-evaluating-cold-start-proxy">Result 3: Evaluating Cold Start Proxy</h3>
<p>We computed a Pearson <code>r</code> between the Hindi proxy demand gap and actual Telugu demand gap on a separate set of articles. If <code>r&gt; 0.7</code>, then the proxy would be justified.</p>
<p>We chose a list of generic Wikipedia articles that are likely to be available on both Hindi and Telugu Wikipedias:</p>
<table class="caption-top table">
<caption>Evaluating Cold Start Proxy</caption>
<thead>
<tr class="header">
<th>title</th>
<th>hindi_proxy</th>
<th>actual_gap</th>
<th>abs_proxy_error</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Mahabharata</td>
<td>0.836706</td>
<td>0.967915</td>
<td>0.131209</td>
</tr>
<tr class="even">
<td>Shiva</td>
<td>0.917235</td>
<td>0.988801</td>
<td>0.071566</td>
</tr>
<tr class="odd">
<td>Yoga</td>
<td>0.933242</td>
<td>0.995607</td>
<td>0.062365</td>
</tr>
<tr class="even">
<td>Telugu language</td>
<td>0.995403</td>
<td>0.943378</td>
<td>0.052025</td>
</tr>
<tr class="odd">
<td>India</td>
<td>0.952274</td>
<td>0.996127</td>
<td>0.043853</td>
</tr>
<tr class="even">
<td>Hinduism</td>
<td>0.968478</td>
<td>0.996320</td>
<td>0.027842</td>
</tr>
<tr class="odd">
<td>Hyderabad</td>
<td>0.974165</td>
<td>0.989439</td>
<td>0.015274</td>
</tr>
<tr class="even">
<td>Turmeric</td>
<td>0.980290</td>
<td>0.994050</td>
<td>0.013760</td>
</tr>
<tr class="odd">
<td>Rice</td>
<td>0.988496</td>
<td>0.997720</td>
<td>0.009223</td>
</tr>
<tr class="even">
<td>Andhra Pradesh</td>
<td>0.965983</td>
<td>0.973239</td>
<td>0.007257</td>
</tr>
</tbody>
</table>
<p>At a computed <code>r=0.474, p=0.0040</code>, the choice of a proxy was <strong>not</strong> justified:</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://metamutator.github.io/posts/multi-armed-subaltern/cold_start_validation.png" class="img-fluid figure-img" width="500"></p>
<figcaption>Validating Hindi as a choice for Cold Start Proxy</figcaption>
</figure>
</div>
</section>
<section id="result-4-gmm-exploit-explore-mechanism" class="level3">
<h3 class="anchored" data-anchor-id="result-4-gmm-exploit-explore-mechanism">Result 4: GMM Exploit/ Explore Mechanism</h3>
<p>We received the following set of recommendations from the GMM model:</p>
<table class="caption-top table">
<caption>Exploit/ Explore Results</caption>
<colgroup>
<col style="width: 31%">
<col style="width: 13%">
<col style="width: 21%">
<col style="width: 15%">
<col style="width: 13%">
</colgroup>
<thead>
<tr class="header">
<th>title</th>
<th style="text-align: center;">cluster_id</th>
<th style="text-align: center;">recommendation_<br>
type</th>
<th style="text-align: center;">composite_<br>
score</th>
<th style="text-align: center;">gmm_log_<br>
likelihood</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Hopscotch (Cortázar novel)</td>
<td style="text-align: center;">0</td>
<td style="text-align: center;">exploit</td>
<td style="text-align: center;">1.00</td>
<td style="text-align: center;">12.05</td>
</tr>
<tr class="even">
<td>The World According to Garp</td>
<td style="text-align: center;">0</td>
<td style="text-align: center;">explore</td>
<td style="text-align: center;">1.00</td>
<td style="text-align: center;">-37.75</td>
</tr>
<tr class="odd">
<td>Twenty-Four Histories</td>
<td style="text-align: center;">1</td>
<td style="text-align: center;">exploit</td>
<td style="text-align: center;">1.00</td>
<td style="text-align: center;">12.54</td>
</tr>
<tr class="even">
<td>Vijayawada</td>
<td style="text-align: center;">1</td>
<td style="text-align: center;">explore</td>
<td style="text-align: center;">0.94</td>
<td style="text-align: center;">9.91</td>
</tr>
<tr class="odd">
<td>Robert Brooke-Popham</td>
<td style="text-align: center;">2</td>
<td style="text-align: center;">exploit</td>
<td style="text-align: center;">1.00</td>
<td style="text-align: center;">10.48</td>
</tr>
<tr class="even">
<td>Royal Malay Regiment</td>
<td style="text-align: center;">2</td>
<td style="text-align: center;">explore</td>
<td style="text-align: center;">1.00</td>
<td style="text-align: center;">9.54</td>
</tr>
<tr class="odd">
<td>John Tremayne Babington</td>
<td style="text-align: center;">3</td>
<td style="text-align: center;">exploit</td>
<td style="text-align: center;">1.00</td>
<td style="text-align: center;">9.92</td>
</tr>
<tr class="even">
<td>Kalinga (region)</td>
<td style="text-align: center;">3</td>
<td style="text-align: center;">explore</td>
<td style="text-align: center;">0.98</td>
<td style="text-align: center;">9.79</td>
</tr>
<tr class="odd">
<td>Nüwa</td>
<td style="text-align: center;">4</td>
<td style="text-align: center;">exploit</td>
<td style="text-align: center;">1.00</td>
<td style="text-align: center;">9.52</td>
</tr>
<tr class="even">
<td>Michel de Montaigne</td>
<td style="text-align: center;">4</td>
<td style="text-align: center;">explore</td>
<td style="text-align: center;">1.00</td>
<td style="text-align: center;">11.19</td>
</tr>
<tr class="odd">
<td>Sextus Empiricus</td>
<td style="text-align: center;">5</td>
<td style="text-align: center;">exploit</td>
<td style="text-align: center;">1.00</td>
<td style="text-align: center;">12.57</td>
</tr>
<tr class="even">
<td>Sarvepalli Radhakrishnan</td>
<td style="text-align: center;">5</td>
<td style="text-align: center;">explore</td>
<td style="text-align: center;">0.92</td>
<td style="text-align: center;">11.52</td>
</tr>
<tr class="odd">
<td>Laozi</td>
<td style="text-align: center;">6</td>
<td style="text-align: center;">exploit</td>
<td style="text-align: center;">1.00</td>
<td style="text-align: center;">9.98</td>
</tr>
<tr class="even">
<td>Lord Mountbatten</td>
<td style="text-align: center;">6</td>
<td style="text-align: center;">explore</td>
<td style="text-align: center;">1.00</td>
<td style="text-align: center;">7.38</td>
</tr>
<tr class="odd">
<td>Jizi</td>
<td style="text-align: center;">7</td>
<td style="text-align: center;">exploit</td>
<td style="text-align: center;">1.00</td>
<td style="text-align: center;">11.44</td>
</tr>
<tr class="even">
<td>Pierre Bayle</td>
<td style="text-align: center;">8</td>
<td style="text-align: center;">exploit</td>
<td style="text-align: center;">1.00</td>
<td style="text-align: center;">13.16</td>
</tr>
<tr class="odd">
<td>Rajahmundry</td>
<td style="text-align: center;">8</td>
<td style="text-align: center;">explore</td>
<td style="text-align: center;">0.93</td>
<td style="text-align: center;">10.64</td>
</tr>
<tr class="even">
<td>Trincomalee</td>
<td style="text-align: center;">9</td>
<td style="text-align: center;">exploit</td>
<td style="text-align: center;">0.99</td>
<td style="text-align: center;">11.52</td>
</tr>
<tr class="odd">
<td>Malayan campaign</td>
<td style="text-align: center;">10</td>
<td style="text-align: center;">exploit</td>
<td style="text-align: center;">1.00</td>
<td style="text-align: center;">11.48</td>
</tr>
<tr class="even">
<td>Mazu</td>
<td style="text-align: center;">10</td>
<td style="text-align: center;">explore</td>
<td style="text-align: center;">1.00</td>
<td style="text-align: center;">11.03</td>
</tr>
</tbody>
</table>
<p>The explore/ exploit distinction has partially collapsed here: several explore candidates have composite scores of 1. This is a consequence of what we saw earlier in Results 2: composite score has lost its discriminating power, even as GMM is doing the differentiation work alone.</p>
<p>It is also notable that <em>The World According to Garp</em> has a GMM value of -37.75. This is because it is the only article in the pool whose category, <em>Novels about transgender topics</em> appears in zero rated articles. This makes it genuinely maximally out-of-distribution for the GMM.</p>
<p>That being said, it is quite fascinating to see recommendations emerging from such a diverse set. Seeding Singapore history gave us Robert Brooke-Popham (a <em>British</em> Air Marshal), and the Malay Regiment for exploit and explore from Cluster 2. Likewise, we see Nüwa (a Chinese goddess) and Michel de Montaigne (a French philosopher) for exploit and explore from the same cluster, Cluster 4.</p>
</section>
<section id="result-5-clustering" class="level3">
<h3 class="anchored" data-anchor-id="result-5-clustering">Result 5: Clustering</h3>
<p>Clustering resulted an extremely unbalanced set. While Cluster 0 has 53 out of 78 articles (68%), there were 42 disconnected components in 78 articles. This meant the category co-membership graph is very sparse. Effectively, topical diversity was largely undermined, making it one giant cluster and 11 micro-clusters.</p>
<p>This was an entirely unexpected result as we deliberately chose to seed our categories in a diverse manner. Further drilling down, we note that four of twelve curated categories - such as <em>Telugu monarchs</em> or <em>Buddhist holy sites in Andhra Pradesh</em> - contributed zero candidates after quality filtering. This is because English Wikipedia’s coverage of these topics is predominantly at stub or start tier. What is utterly fascinating here is that this is <strong>not</strong> incidental: the same structural under-representation that motivates Telugu Wikipedia expansion is reproduced on the supply side. The quality filter, which was designed to source translatable articles, inadvertently maps the contours of the original problem.</p>
<p>In effect, our clever multi-armed bandit - the <em>takkari donga -</em> needs to operate in English as well as Telugu. We will not just need to find articles to translate <em>to</em> Telugu, we also would need to find articles a few degrees removed from Telugu culture in English Wikipedia and perhaps work towards improving their quality as well.</p>
</section>
</section>
<section id="summary" class="level2">
<h2 class="anchored" data-anchor-id="summary">Summary</h2>
<p>In this paper, we have confirmed our core motivation: that there is a genuine tension between supply (articles in the English Wikipedia that a translator would like to translate) and demand (what gets read in Telugu Wikipedia). We have seen that the demand gap had collapsed in this evaluation - either interesting articles of high quality had no translations at all to Telugu, or that categories likely to be of interest to Telugu readers did not have high quality articles in English Wikipedia. The cold start proxy hypothesis - that we may use Hindi pageviews as a proxy for Telugu pageviews while Telugu pageviews build up - was not empirically justifiable.</p>
<section id="next-steps" class="level3">
<h3 class="anchored" data-anchor-id="next-steps">Next Steps</h3>
<p>The code pipeline exists, and can be generated for any Wikipedia translator across any language pair. An immediate next step could be try the model out with more focussed categories or seed articles, whilst bearing in mind the quality of the articles. Other languages such as Kannada or Tamil could also be used as a cold start proxy.</p>
<p>Alternatively, replacing the language-proxy demand gap with a normalized quality tier score (<code>quality_tier/3.0)</code> provides a content-based signal that is immune to the pageview degeneracy problem. Indeed, doing so gives us the following fallback shortlist:</p>
<table class="caption-top table">
<caption>Fallback Shortlist</caption>
<thead>
<tr class="header">
<th>title</th>
<th>cluster_id</th>
<th>composite_score</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Zuo Zhuan</td>
<td>0</td>
<td>1.000000</td>
</tr>
<tr class="even">
<td>Vijayawada</td>
<td>1</td>
<td>0.943860</td>
</tr>
<tr class="odd">
<td>Robert Brooke-Popham</td>
<td>2</td>
<td>0.666667</td>
</tr>
<tr class="even">
<td>Kalinga (region)</td>
<td>3</td>
<td>0.983580</td>
</tr>
<tr class="odd">
<td>Michel de Montaigne</td>
<td>4</td>
<td>0.666667</td>
</tr>
<tr class="even">
<td>Sarvepalli Radhakrishnan</td>
<td>5</td>
<td>0.923803</td>
</tr>
<tr class="odd">
<td>Lord Mountbatten</td>
<td>6</td>
<td>0.999332</td>
</tr>
<tr class="even">
<td>Jizi</td>
<td>7</td>
<td>0.666667</td>
</tr>
<tr class="odd">
<td>Rajahmundry</td>
<td>8</td>
<td>0.925769</td>
</tr>
<tr class="even">
<td>Trincomalee</td>
<td>9</td>
<td>0.666667</td>
</tr>
<tr class="odd">
<td>Malayan campaign</td>
<td>10</td>
<td>0.666667</td>
</tr>
</tbody>
</table>
<p>(Scores of 0.067 reflect <code>quality_tier = 2</code> normalized to 2/3, while 1 reflects <code>quality_tier = 3</code>)</p>
</section>
<section id="conclusion" class="level3">
<h3 class="anchored" data-anchor-id="conclusion">Conclusion</h3>
<p>Whilst such tweaks can address some limitations in the model, to this multi-lingual writer, the problem perhaps is larger and must be seen across languages. The challenge here is not to bring English Wikipedia articles to Telugu Wikipedia, but to bring articles of interest to a Telugu-speaking milieu to <em>both</em> English and Telugu Wikipedias. <em>Takkari donga</em>, the clever multi-armed bandit, was multi-lingual all along. They need to write not just in Telugu, but in that other Indian language spoken and read widely, English.</p>
</section>
</section>
<section id="bibliography" class="level2">




</section>


<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">Bibliography</h2><div id="refs" class="references csl-bib-body hanging-indent">
<div id="ref-Johnson_Aragón_2022" class="csl-entry">
Johnson, Isaac, and Pablo Aragón. 2022. <span>“Research:cross-Lingual Article Quality Assessment - Meta-Wiki.”</span> In <em>Meta</em>. <a href="https://meta.wikimedia.org/wiki/Research:Cross-lingual_article_quality_assessment">https://meta.wikimedia.org/wiki/Research:Cross-lingual_article_quality_assessment</a>.
</div>
<div id="ref-ko2022a" class="csl-entry">
Ko, Hyeyoung, Suyeon Lee, Yoonseo Park, and Anna Choi. 2022. <span>“A Survey of Recommendation Systems: Recommendation Models, Techniques, and Application Fields.”</span> <em>Electronics</em> 11 (1). <a href="https://doi.org/10.3390/electronics11010141">https://doi.org/10.3390/electronics11010141</a>.
</div>
<div id="ref-langview" class="csl-entry">
<em>Langviews Analysis</em>. n.d. <a href="https://pageviews.wmcloud.org/langviews/?project=en.wikipedia.org&amp;platform=all-access&amp;agent=user&amp;start=2015-07-01&amp;end=2026-03-15&amp;page=Hyderabad&amp;sort=views&amp;direction=1&amp;view=list&amp;page=Hyderabad">https://pageviews.wmcloud.org/langviews/?project=en.wikipedia.org&amp;platform=all-access&amp;agent=user&amp;start=2015-07-01&amp;end=2026-03-15&amp;page=Hyderabad&amp;sort=views&amp;direction=1&amp;view=list&amp;page=Hyderabad</a>.
</div>
<div id="ref-silva2022" class="csl-entry">
Silva, Nícollas, Heitor Werneck, Thiago Silva, Adriano C. M. Pereira, and Leonardo Rocha. 2022. <span>“Multi-Armed Bandits in Recommendation Systems: A Survey of the State-of-the-Art and Future Directions.”</span> <em>Expert Systems with Applications</em> 197: 116669. https://doi.org/<a href="https://doi.org/10.1016/j.eswa.2022.116669">https://doi.org/10.1016/j.eswa.2022.116669</a>.
</div>
<div id="ref-Spivak1988" class="csl-entry">
Spivak, Gayatri Chakravorty. 1988. <em>Can the Subaltern Speak?</em> 271–313.
</div>
<div id="ref-wulczyn2016" class="csl-entry">
Wulczyn, Ellery, Robert West, Leila Zia, and Jure Leskovec. 2016. <span>“WWW ’16: 25th International World Wide Web Conference.”</span> (Montréal Québec Canada), April 11, 975–85. <a href="https://doi.org/10.1145/2872427.2883077">https://doi.org/10.1145/2872427.2883077</a>.
</div>
<div id="ref-zhang2021" class="csl-entry">
Zhang, Min, and Yiqun Liu. 2021. <span>“A Commentary of TikTok Recommendation Algorithms in MIT Technology Review 2021.”</span> <em>Fundamental Research</em> 1 (6): 846–47. https://doi.org/<a href="https://doi.org/10.1016/j.fmre.2021.11.015">https://doi.org/10.1016/j.fmre.2021.11.015</a>.
</div>
</div></section><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>With tongue firmly in cheek, the title makes a pun to not just the Multi-Armed Bandit problem, but also to Gayatri Chakravorty Spivak’s seminal essay, <em>Can the Subaltern Speak?</em> <span class="citation" data-cites="Spivak1988">(Spivak 1988)</span>. In that piece, Spivak famously questioned whether subalterns - colonial populations excluded from hierarchies of power - could express their native thought / reasoning without conforming to Western ways.↩︎</p></li>
<li id="fn2"><p><em>Takkari Donga,</em> or the clever bandit, is also as a reference to much forgotten Telugu belter from early 2000’s where the singer celebrates the fact that he finds success going off the beaten path.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>multi-armed bandit</category>
  <category>wikipedia</category>
  <category>translations</category>
  <category>GMM</category>
  <category>spectral-clustering</category>
  <category>recommendation model</category>
  <guid>https://metamutator.github.io/posts/multi-armed-subaltern/multi_armed_subaltern.html</guid>
  <pubDate>Sun, 05 Jul 2026 00:00:00 GMT</pubDate>
  <media:content url="https://metamutator.github.io/posts/multi-armed-subaltern/english-tamil-dict-small.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Taking Delight in the Scripts of Humans</title>
  <dc:creator>Akshay Regulagedda</dc:creator>
  <link>https://metamutator.github.io/posts/brahmi-scripts/</link>
  <description><![CDATA[ 





<div id="fig-hero" class="quarto-float quarto-figure quarto-figure-center anchored" data-fig-align="center">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-hero-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://metamutator.github.io/posts/brahmi-scripts/angkor-wat.jpg" class="img-fluid quarto-figure quarto-figure-center figure-img">
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-hero-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;1: Sanskrit verse even here: Sun rise at Angkor Wat. Photo by <a href="https://unsplash.com/@sebalatorre?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Sebastian Latorre</a> on <a href="https://unsplash.com/photos/lrG4nki2kYM?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>
</figcaption>
</figure>
</div>
<section id="sanskrit-the-language" class="level2">
<h2 class="anchored" data-anchor-id="sanskrit-the-language">Sanskrit: The Language</h2>
<p>I haven’t had a formal education in Sanskrit. But it is a <em>liturgical</em> language that I chant in every day, not just for Hindu slokas from the <em>Gitā</em> and the Vedas, but also for Buddhist sutras such as the <em>Prajñaparamita Hrdaya Sūtra</em>. A lot of Sanskrit words have made their way into contemporary languages in both South and South East Asia, so I do understand many words.</p>
<section id="same-same-but-different" class="level3">
<h3 class="anchored" data-anchor-id="same-same-but-different">Same-same but different</h3>
<p>But those familiar waters can sometimes be treacherous. The same word could have different meanings in Sanskrit and other languages. <a href="https://en.wikipedia.org/wiki/False_friend">False Friends</a> is a Thing, more so in Indic languages than in other language families. I often need to rely on guard-rails such as <a href="https://andhrabharati.com/dictionary/sanskrit/index.php">Sanskrit Dictionary Collections</a> to keep me safe.</p>
<p>Then there are <a href="https://en.wikipedia.org/wiki/Sandhi">sandhi’s</a>, liasons between words to form compound words. Whilst the individual word may be understandable, the compound word could feel and sound new; you will need to know how the sandhi has been formed in order to untangle the compound word into its constituents.</p>
</section>
<section id="same-same-not-same-as-sama-sama" class="level3">
<h3 class="anchored" data-anchor-id="same-same-not-same-as-sama-sama">Same-same not same as sama-sama</h3>
<p>Sanskrit has been historically written in range of scripts, down from the earliest <a href="https://en.wikipedia.org/wiki/Brahmi_script">Brahmi</a> and <a href="https://en.wikipedia.org/wiki/Kharosthi">Kharosthi</a> scripts, to more contemporary scripts across Asia.</p>
<p>Here’s a good example of how it all intersects. Consider this quote from Kālidāsa mentioned in Wikipedia, written in various Asian scripts:</p>
<div id="fig-sanskrit" class="quarto-float quarto-figure quarto-figure-center anchored" data-fig-align="center">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-sanskrit-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://metamutator.github.io/posts/brahmi-scripts/Phrase_sanskrit.svg" class="img-fluid quarto-figure quarto-figure-center figure-img">
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-sanskrit-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;2: <em>‘May Śiva bless those who take delight in the language of gods’</em> - Kālidāsa. (From<a href="https://commons.wikimedia.org/wiki/File:Phrase_sanskrit.svg">Wikipedia</a>)
</figcaption>
</figure>
</div>
<p>Sanskrit is written in each of these scripts for liturgical needs in South and South East Asia. The first word is easily understood: it clearly refers to Siva, one of the gods in the Hindu pantheon. The second word is also easily understood: it’s clearly a conjugation of the word <em>raksha</em> or <em>to protect</em>. But wait: how did <em>to protect</em> become <em>bless</em>?</p>
<p>It gets more difficult with the next word, a multi-letter monster in every script mentioned in the graphic. It is a <em>compound</em> word: among others, words meaning ‘language’, ‘god’ and ‘delight’ have been somehow strung together to form a single word. This is where it starts to become complex.</p>
</section>
<section id="haksara-wrehastra-conjunct-letters" class="level3">
<h3 class="anchored" data-anchor-id="haksara-wrehastra-conjunct-letters">Haksara Wrehastra: Conjunct Letters</h3>
<p>For, untangling conjunct words is not just a matter of giving the right amount of spaces. Most Brahmi-originated scripts have <a href="https://en.wikipedia.org/wiki/Abugida#General_description">conjunct letters</a>, complex rules where letters may be combined in certain combinations to form new letters. 36 consonants can be combined to form <a href="https://en.wikipedia.org/wiki/Devanagari_conjuncts">1296 two-letter combinations</a> in Sanskrit, but that is not all. Each of these combinations can be combined with 16 vowels to form even more complex conjuncts. There is no grammatical limit to the number of letters you can combine. At the most extreme, the word कार्त्स्न्य (“entirety”) consists of a five-letter conjunct, र्त्स्न्य <span class="citation" data-cites="stiehl2017devanagari">(Stiehl 2017)</span>.</p>
<p>Whilst I can read many of the scripts listed in Figure&nbsp;2, I find it easier break conjunct vowels and therefore words into their constituent parts in Telugu script. But that may not be your experience; perhaps you’re used to reading about Ghatōtgacha’s exploits in Balinese script. Which brings us to our first computational challenge: can we transliterate a Sanskrit string into a script of our choice?</p>
</section>
</section>
<section id="writing-sanskrit" class="level2">
<h2 class="anchored" data-anchor-id="writing-sanskrit">1. Writing Sanskrit</h2>
<section id="methods-for-transliteration" class="level3">
<h3 class="anchored" data-anchor-id="methods-for-transliteration">1.1 Methods for Transliteration</h3>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p>Transliteration is to convert a string from one script to another without changing the word. This is different from translation, which is to convert a string from one language to another.</p>
</div>
</div>
<p>A naive suggestion could be that an LLM could draft us a quick method in transliterate Telugu strings to Sanskrit. We tried to get Anthropic Claude 2 to do just that:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode numberSource javascript number-lines code-with-copy"><code class="sourceCode javascript"><span id="cb1-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> { Observable } <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'observable-fns'</span></span>
<span id="cb1-2"></span>
<span id="cb1-3"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> teluguToDevanagari <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Observable<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">create</span>((teluguText) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">=&gt;</span> {</span>
<span id="cb1-4"></span>
<span id="cb1-5">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">const</span> mappings <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb1-6">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'అ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'अ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ఆ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'आ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ఇ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'इ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ఈ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ई'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ఉ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'उ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> </span>
<span id="cb1-7">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ఊ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ऊ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ఋ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ऋ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ఌ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ऌ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ఎ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ए'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ఏ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ऐ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> </span>
<span id="cb1-8">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ఐ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ऑ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ఒ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ओ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ఓ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'औ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ఔ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'अउ'</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-9">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// ...add remaining mappings</span></span>
<span id="cb1-10">  }</span>
<span id="cb1-11"></span>
<span id="cb1-12">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> devanagariText <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">''</span></span>
<span id="cb1-13"></span>
<span id="cb1-14">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span>(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span>teluguText<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">length</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">++</span>) {</span>
<span id="cb1-15">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span>(mappings<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">hasOwnProperty</span>(teluguText[i])) {</span>
<span id="cb1-16">      devanagariText <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> mappings[teluguText[i]]</span>
<span id="cb1-17">    } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb1-18">      devanagariText <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> teluguText[i] </span>
<span id="cb1-19">    }</span>
<span id="cb1-20">  }</span>
<span id="cb1-21"></span>
<span id="cb1-22">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> devanagariText</span>
<span id="cb1-23"></span>
<span id="cb1-24">})</span>
<span id="cb1-25"></span>
<span id="cb1-26"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">export</span> { teluguToDevanagari }</span></code></pre></div></div>
<p>This obviously doesn’t work.</p>
<p>For one, Claude didn’t complete the <code>mappings</code> constant, and instead, provided a lazy <code>// ...add remaining mappings</code> comment, which isn’t helpful. For another, this approach won’t work with conjunct vowels at all, unless you list every single one of the combination there is.</p>
<p>We tried again, this time asking for it to be in Python:</p>
<div id="f99570a5" class="cell" data-execution_count="2">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb2-1">telugu_ranges <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [</span>
<span id="cb2-2">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'0C00'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'0C7F'</span>), <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Telugu</span></span>
<span id="cb2-3">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'0C80'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'0CFF'</span>), <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Telugu Supplementary</span></span>
<span id="cb2-4">] </span>
<span id="cb2-5"></span>
<span id="cb2-6">devanagari_ranges <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [</span>
<span id="cb2-7">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'0900'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'097F'</span>), <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Devanagari</span></span>
<span id="cb2-8">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'A8E0'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'A8FF'</span>), <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Devanagari Extended</span></span>
<span id="cb2-9">]</span>
<span id="cb2-10"></span>
<span id="cb2-11">telugu_to_devanagari_map <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb2-12"></span>
<span id="cb2-13"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> start, end <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> telugu_ranges:</span>
<span id="cb2-14">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> char <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(start, base<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(end, base<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>):</span>
<span id="cb2-15">        telugu_char <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">chr</span>(char)</span>
<span id="cb2-16">        devanagari_char <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> unicodedata.normalize(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'NFKC'</span>, telugu_char)</span>
<span id="cb2-17">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> devanagari_char <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> devanagari_ranges:</span>
<span id="cb2-18">            telugu_to_devanagari_map[telugu_char] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> devanagari_char</span>
<span id="cb2-19"></span>
<span id="cb2-20"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> transliterate(text):</span>
<span id="cb2-21">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">''</span>.join([telugu_to_devanagari_map.get(char, char) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> char <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> text])</span></code></pre></div></div>
</details>
</div>
<p>Except that… this doesn’t work either. Here’s what happens when we execute the function:</p>
<div id="d4db3c1b" class="cell" data-execution_count="3">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb3-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(transliterate(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"అందరికీ నమస్కారం"</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>అందరికీ నమస్కారం</code></pre>
</div>
</div>
<p>… which is exactly the same text as the input. I asked Claude what the problem was, and to its credit, it did identify the error: <code>unicodedata.normalize('NFKC')</code> doesn’t convert from the Telugu character-set to Devanagari.</p>
<p>But it didn’t fix the error directly. Only after a few rounds of hallucinations and corrections, did we arrive at this version, where we offset the Telugu character-set by 0x0900 - 0x0C00, which is the difference between the Devanagari and Telugu character-sets:</p>
<div id="72b9f9a4" class="cell" data-execution_count="4">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb5-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> transliterate(text):</span>
<span id="cb5-2">  </span>
<span id="cb5-3">  devanagari_offset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0900</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0C00</span></span>
<span id="cb5-4">  </span>
<span id="cb5-5">  output <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb5-6">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> char <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> text:</span>
<span id="cb5-7">    char_code <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">ord</span>(char)</span>
<span id="cb5-8">    </span>
<span id="cb5-9">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0C00</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> char_code <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0CFF</span>:</span>
<span id="cb5-10">      dev_code <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> char_code <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> devanagari_offset</span>
<span id="cb5-11">      output <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">chr</span>(dev_code)</span>
<span id="cb5-12">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb5-13">      output <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> char</span>
<span id="cb5-14">        </span>
<span id="cb5-15">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> output</span></code></pre></div></div>
</details>
</div>
<p>Let’s run this method against a few examples:</p>
<div id="2b63050e" class="cell" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb6-1">unit_tests <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"అందరికీ నమస్కారం"</span>, <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># "Hello world" in Telugu</span></span>
<span id="cb6-2">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"శివో రక్షతు గీర్వాణభాషారసాస్వాదతత్పరాన్"</span>, <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#The Kalidasa quote above</span></span>
<span id="cb6-3">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"యెలహంక"</span> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># See below</span></span>
<span id="cb6-4">            ]</span>
<span id="cb6-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#loop through the unit tests</span></span>
<span id="cb6-6"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>[transliterate(test) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> test <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> unit_tests], sep<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>अंदरिकी नमस्कारं
शिवो रक्षतु गीर्वाणभाषारसास्वादतत्परान्
यॆलहंक</code></pre>
</div>
</div>
<p>These work! A key point here is that you should not trust output from LLM’s to work blindly; you must test and validate them, not just with unit-tests, but also with real-world examples. We’ll come back to this point again soon.</p>
<p>A linguistic point in our “unit-tests”. The last example there, <code>యెలహంక</code>, is the Telugu spelling of a Bangalore suburb, also written in Kannada as <code>ಯೇಲಹಂಕ</code>. Transliterating Kannada to Telugu is quite straightforward, as was transliterating to Sanskrit (Devanagari) as <code>येलहंक</code>. But if you read the Devanagari version with Hindi pronunciation in mind, you’ll end up reading it as ‘Yelhank’. That’s incorrect; it should be read as ‘Yelahanka’. This is a good example of False Friends among South Asian languages; Hindi and Sanskrit may be written in the same script, Devanagari, but are to be pronounced differently.</p>
<p>But really, this method needs to be generalized for any South (East) Asian script to any other (whilst noting the potential for False Friends). Let’s expand the method to include Unicode ranges for all scripts.</p>
<div id="eede36e8" class="cell" data-code-snippet="true" data-execution_count="6">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb8-1">script_unicode_ranges <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb8-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#north</span></span>
<span id="cb8-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'assamese'</span>: [(<span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0980</span>, <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x09FF</span>)],</span>
<span id="cb8-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bengali'</span>: [(<span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0980</span>, <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x09FF</span>)],</span>
<span id="cb8-5">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'devanagari'</span>: [(<span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0900</span>, <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x097F</span>), (<span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0xA8E0</span>, <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0xA8FF</span>)],</span>
<span id="cb8-6">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'gujarati'</span>: [(<span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0A80</span>, <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0AFF</span>)],</span>
<span id="cb8-7">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'gurmukhi'</span>: [(<span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0A00</span>, <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0A7F</span>)],  </span>
<span id="cb8-8">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'oriya'</span>: [(<span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0B00</span>, <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0B7F</span>)],</span>
<span id="cb8-9">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'tibetan'</span>: [(<span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0F00</span>, <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0FFF</span>)],</span>
<span id="cb8-10">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#south</span></span>
<span id="cb8-11">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'tamil'</span>: [(<span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0B80</span>, <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0BFF</span>)],</span>
<span id="cb8-12">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'telugu'</span>: [(<span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0C00</span>, <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0C7F</span>), (<span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0C80</span>, <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0CFF</span>)],</span>
<span id="cb8-13">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'kannada'</span>: [(<span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0C80</span>, <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0CFF</span>)],</span>
<span id="cb8-14">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'malayalam'</span>: [(<span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0D00</span>, <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0D7F</span>)],</span>
<span id="cb8-15">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sinhala'</span>: [(<span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0D80</span>, <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0DFF</span>)],</span>
<span id="cb8-16">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#SE Asia mainland</span></span>
<span id="cb8-17">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'thai'</span>: [(<span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0E00</span>, <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0E7F</span>)],</span>
<span id="cb8-18">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lao'</span>: [(<span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0E80</span>, <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x0EFF</span>)],</span>
<span id="cb8-19">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'myanmar'</span>: [(<span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x1000</span>, <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x109F</span>)],</span>
<span id="cb8-20">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'khmer'</span>: [(<span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x1780</span>, <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x17FF</span>), (<span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x19E0</span>, <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x19FF</span>)],</span>
<span id="cb8-21">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#SE Asia maritime</span></span>
<span id="cb8-22">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'balinese'</span>: [(<span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x1B00</span>, <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x1B7F</span>)],</span>
<span id="cb8-23">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'javanese'</span>: [(<span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0xA980</span>, <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0xA9DF</span>)],</span>
<span id="cb8-24">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sundanese'</span>: [(<span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x1B80</span>, <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x1BBF</span>)]</span>
<span id="cb8-25">}</span>
<span id="cb8-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># write script_unicode_ranges to a file</span></span>
<span id="cb8-27"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">with</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">open</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'script_unicode_ranges.json'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'w'</span>) <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> fp:</span>
<span id="cb8-28">    json.dump(script_unicode_ranges, fp)</span>
<span id="cb8-29"></span>
<span id="cb8-30"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> transliterate(text, source_script, target_script):</span>
<span id="cb8-31">  source_range <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> script_unicode_ranges[source_script]</span>
<span id="cb8-32">  target_range <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> script_unicode_ranges[target_script]</span>
<span id="cb8-33"></span>
<span id="cb8-34">  output <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb8-35">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> char <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> text:</span>
<span id="cb8-36">   </span>
<span id="cb8-37">    source_char_code <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">ord</span>(char)</span>
<span id="cb8-38">    </span>
<span id="cb8-39">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> in_range(source_char_code, source_range):</span>
<span id="cb8-40">       target_char_code <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> map_to_target(source_char_code, source_range, target_range)</span>
<span id="cb8-41">       <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> target_char_code <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0xFFFD</span>:</span>
<span id="cb8-42">        output <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">chr</span>(target_char_code)</span>
<span id="cb8-43">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb8-44">       output <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> char</span>
<span id="cb8-45">       </span>
<span id="cb8-46">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> output</span>
<span id="cb8-47"></span>
<span id="cb8-48"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> in_range(char_code, ranges):</span>
<span id="cb8-49">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">any</span>([start <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> char_code <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> end <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> start, end <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ranges])</span>
<span id="cb8-50"></span>
<span id="cb8-51"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> map_to_target(source_char_code, source_range, target_range):</span>
<span id="cb8-52"></span>
<span id="cb8-53">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Calculate target code point</span></span>
<span id="cb8-54">  target_char_code <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> source_char_code <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (target_range[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> source_range[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb8-55"></span>
<span id="cb8-56">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Check if it is an assigned Unicode character</span></span>
<span id="cb8-57">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (unicodedata.category(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">chr</span>(target_char_code)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Cn'</span>):</span>
<span id="cb8-58">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> target_char_code </span>
<span id="cb8-59"></span>
<span id="cb8-60">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># If not, map to unspecified character code point</span></span>
<span id="cb8-61">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0xFFFD</span></span></code></pre></div></div>
</details>
</div>
<p>Quite a few pieces happening in there. To start with, whilst Brahmi-based scripts are <em>similar</em> to each other, they aren’t <em>same</em> ; for instance, the Bengali script does not have a letter equivalent to the Telugu letter వ, whilst Devanagari and other southern and western scripts do. So we have a check to see if the mapped character is a valid Unicode character; if not, we map it to the Unicode replacement character, <code>0xFFFD</code>.</p>
<p>Let’s first repeat our “unit-tests”.</p>
<div id="5fc01a6c" class="cell" data-execution_count="7">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode numberSource python code-overflow-wrap number-lines code-with-copy"><code class="sourceCode python"><span id="cb9-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#print transliterate for all unit_tests</span></span>
<span id="cb9-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>[transliterate(test, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'telugu'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'devanagari'</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> test <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> unit_tests], sep<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>अंदरिकी नमस्कारं
शिवो रक्षतु गीर्वाणभाषारसास्वादतत्परान्
यॆलहंक</code></pre>
</div>
</div>
<p>These work, but let’s try to the Kālidāsa quote with the scripts in Figure&nbsp;2.</p>
<div class="cell" data-execution_count="8">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb11-1">kalidasa_quote <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> unit_tests[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb11-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#iterate through keys in script_unicode_ranges</span></span>
<span id="cb11-3">scripts <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [script <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> script <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> script_unicode_ranges.keys() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> script <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'devanagari'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'telugu'</span>]]</span>
<span id="cb11-4">table_row_list <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>script<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">| </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>transliterate(kalidasa_quote, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'telugu'</span>, script)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> script <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> script_unicode_ranges.keys()]</span>
<span id="cb11-5">table_row_text <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(table_row_list)</span>
<span id="cb11-6">display_markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"| Script | Transliteration |</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">| --- | --- |</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>table_row_text<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, raw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span></code></pre></div></div>
</details>
<div id="tbl-kalidasa" class="cell quarto-float quarto-figure quarto-figure-center anchored" data-execution_count="8">
<figure class="quarto-float quarto-float-tbl figure">
<figcaption class="quarto-float-caption-top quarto-float-caption quarto-float-tbl" id="tbl-kalidasa-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Table&nbsp;1: Recreated List of Scripts showing the Kalidasa quote
</figcaption>
<div aria-describedby="tbl-kalidasa-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div class="cell-output cell-output-display cell-output-markdown">
<table class="cell caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>Script</th>
<th>Transliteration</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>assamese</td>
<td>শিো রক্ষতু গীর্াণভাষারসাস্াদতত্পরান্</td>
</tr>
<tr class="even">
<td>bengali</td>
<td>শিো রক্ষতু গীর্াণভাষারসাস্াদতত্পরান্</td>
</tr>
<tr class="odd">
<td>devanagari</td>
<td>शिवो रक्षतु गीर्वाणभाषारसास्वादतत्परान्</td>
</tr>
<tr class="even">
<td>gujarati</td>
<td>શિવો રક્ષતુ ગીર્વાણભાષારસાસ્વાદતત્પરાન્</td>
</tr>
<tr class="odd">
<td>gurmukhi</td>
<td>ਸ਼ਿਵੋ ਰਕ੍ਤੁ ਗੀਰ੍ਵਾਣਭਾਾਰਸਾਸ੍ਵਾਦਤਤ੍ਪਰਾਨ੍</td>
</tr>
<tr class="even">
<td>oriya</td>
<td>ଶିଵୋ ରକ୍ଷତୁ ଗୀର୍ଵାଣଭାଷାରସାସ୍ଵାଦତତ୍ପରାନ୍</td>
</tr>
<tr class="odd">
<td>tibetan</td>
<td>༶༿༵ཋ ༰༕ཌྷ༷༤ཁ ༗ཀ༰ཌྷ༵༾༣༭༾༷༾༰༸༾༸ཌྷ༵༾༦༤༤ཌྷ༪༰༾༨ཌྷ</td>
</tr>
<tr class="even">
<td>tamil</td>
<td>ஶிவோ ரக்ஷது ீர்வாணாஷாரஸாஸ்வாதத்பராந்</td>
</tr>
<tr class="odd">
<td>telugu</td>
<td>శివో రక్షతు గీర్వాణభాషారసాస్వాదతత్పరాన్</td>
</tr>
<tr class="even">
<td>kannada</td>
<td>ಶಿವೋ ರಕ್ಷತು ಗೀರ್ವಾಣಭಾಷಾರಸಾಸ್ವಾದತತ್ಪರಾನ್</td>
</tr>
<tr class="odd">
<td>malayalam</td>
<td>ശിവോ രക്ഷതു ഗീര്വാണഭാഷാരസാസ്വാദതത്പരാന്</td>
</tr>
<tr class="even">
<td>sinhala</td>
<td>බඵ ධඕභඤශ වධඵඣතභධමමඵඦඤඤඪධඨ</td>
</tr>
<tr class="odd">
<td>thai</td>
<td>ึ฿ี๋ ะตํืฤแ ทเะํีรอืะุุํีฦฤฤํสะศํ</td>
</tr>
<tr class="even">
<td>lao</td>
<td>ຶີ໋ ະຕໍືແ ທເະໍີຣອືະຸຸໍີໍສະຨໍ</td>
</tr>
<tr class="odd">
<td>myanmar</td>
<td>ံဿဵ။ ူပ၍့ဤ၁ ဗ၀ူ၍ဵှဣိှ့ှူးှး၍ဵှဦဤဤ၍ဪူှဨ၍</td>
</tr>
<tr class="even">
<td>khmer</td>
<td>ាឿ឵់ ឰផ៍ិឤេ ភៀឰ៍឵ើឣឭើិើឰីើី៍឵ើឦឤឤ៍ឪឰើឨ៍</td>
</tr>
<tr class="odd">
<td>balinese</td>
<td>ᬶᭁᭋ ᬰᬕᬷᬤᭁ ᬗᭀᬰᬵᬾᬣᬭᬾᬷᬾᬰᬸᬾᬸᬵᬾᬦᬤᬤᬪᬰᬾᬨ</td>
</tr>
<tr class="even">
<td>javanese</td>
<td>ꦶꦿꦵ꧋ ꦰꦕ꧍ꦷꦤ꧁ ꦗ꧀ꦰ꧍ꦵꦾꦣꦭꦾꦷꦾꦰꦸꦾꦸ꧍ꦵꦾꦦꦤꦤ꧍ꦪꦰꦾꦨ꧍</td>
</tr>
<tr class="odd">
<td>sundanese</td>
<td>᮶ᮿ᮵ᯋ ᮰ᮕᯍ᮷ᮤᯁ ᮗᯀ᮰ᯍ᮵ᮾᮣᮭᮾ᮷ᮾ᮰᮸ᮾ᮸ᯍ᮵ᮾᮦᮤᮤᯍ᮪᮰ᮾᮨᯍ</td>
</tr>
</tbody>
</table>
</div>
</div>
</figure>
</div>
</div>
<p>The approach seems to work for some South Asian scripts, but didn’t for Assamese, Bengali, Tamil, Tibetan or the South East Asian scripts or Tibetan. Some additional characters (zero-width joiners, and vowel diatrical marks, among others) were rendered there. One reason could be because some of the rendered glyphs may not map one-to-one. We will come back to those in a later post. I also have no way of knowing whether it is accurate for Oriya or Sinhala. If you read either, please let me know in the comments if the transliteration is accurate.</p>
</section>
<section id="next-steps-trying-it-out" class="level3">
<h3 class="anchored" data-anchor-id="next-steps-trying-it-out">1.2 Next Steps: Trying it Out</h3>
<p>In a subsequent post, I will share this out via either Observable.js or by somehow getting the Python methods to work on the web (mostly via Gradio, perhaps). We will also investigate further why the method didn’t work for some scripts. For now, consider a simple method that allows us to transliterate text from (some) Brahmi-based scripts to others.</p>



</section>
</section>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent">
<div id="ref-stiehl2017devanagari" class="csl-entry">
Stiehl, Ulrich. 2017. <em>Devanagari-Schreibübungen</em>. <a href="https://www.sanskritweb.net/deutsch/devanagari.pdf" class="uri">Https://www.sanskritweb.net/deutsch/devanagari.pdf</a>.
</div>
</div></section></div> ]]></description>
  <category>llm</category>
  <category>ai</category>
  <category>Sanskrit</category>
  <category>bhagavad-gita</category>
  <category>anthropic</category>
  <category>linguistics</category>
  <category>indic-scripts</category>
  <guid>https://metamutator.github.io/posts/brahmi-scripts/</guid>
  <pubDate>Tue, 22 Aug 2023 00:00:00 GMT</pubDate>
  <media:content url="https://metamutator.github.io/posts/brahmi-scripts/angkor-wat.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>I am Time, Destroyer of Worlds</title>
  <dc:creator>Akshay Regulagedda</dc:creator>
  <link>https://metamutator.github.io/posts/i_am_time/</link>
  <description><![CDATA[ 





<div id="fig-hero" class="quarto-float quarto-figure quarto-figure-center anchored" data-fig-align="center">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-hero-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://metamutator.github.io/posts/i_am_time/viswarupa.jpg" class="img-fluid quarto-figure quarto-figure-center figure-img" style="width:80.0%">
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-hero-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;1: <strong>I am Time</strong>: A 19th century painting of Krishna in his <em>viswarūpa</em>. <sup>1</sup>
</figcaption>
</figure>
</div>
<section id="executive-summary" class="level2">
<h2 class="anchored" data-anchor-id="executive-summary">Executive Summary</h2>
<p>You may have watched in the new Nolan movie, or read it the <a href="https://archive.org/details/americanpromethe00bird/mode/1up">2005 biography</a> <span class="citation" data-cites="bird2005american">(Bird and Sherwin 2005)</span> on which the movie is based, or indeed, or have read it in the original interview <span class="citation" data-cites="barnett1949j">(Barnett 1949)</span> with <em>Life</em> magazine. Or may be you’ve known it all along. Julius Robert Oppenheimer is famously said to have <del>quoted</del> thought of a quote from the <em>Bhagavad Gitā</em> upon witnessing the first nuclear explosion:</p>
<blockquote class="blockquote">
<p>If the radiance of a thousand suns were to burst at once into the sky, that would be like the splendo[u]r of the mighty one</p>
<p>Now I am become Death, the shatterer of worlds.</p>
</blockquote>
<p>There’s a lot of scholarship already published on this and indeed <em>Bhagavad Gita</em> in itself. This post doesn’t aim to add anything novel to that discussion, other than as a quick linguistic exploration through AI.</p>
</section>
<section id="the-original-verses" class="level2">
<h2 class="anchored" data-anchor-id="the-original-verses">The Original Verses</h2>
<p>Oppenheimer was translating Slokas 12 and 32 in Chapter 11 of the <em>Gita</em>. The verses read as follows in the original Sanskrit:</p>
<p><strong>Chapter 11, Verse 12</strong>:</p>
<div class="line-block">divi sūrya-sahasrasya bhaved yugapad utthitā<br>
yadi bhāḥ sadṛiśhī sā syād bhāsas tasya mahātmanaḥ</div>
<p><strong>Chapter 11, Verse 32</strong>:</p>
<div class="line-block"><em>śhrī-bhagavān uvācha</em>:<br>
&nbsp;&nbsp;&nbsp;kālósmi loka-kṣhaya-kṛit pravṛiddho<br>
&nbsp;&nbsp;&nbsp;lokān samāhartum iha pravṛittaḥ<br>
&nbsp;&nbsp;&nbsp;ṛitépi tvāṁ na bhaviṣhyanti sarve<br>
&nbsp;&nbsp;&nbsp;yévasthitāḥ pratyanīkeṣhu yodhāḥ</div>
<p>Historically, one learns classical Sanskrit (and classical Telugu) poetry through both a <code>prati padārtham</code> (word-by-word) translation, and a <code>bhāvam</code> (prose translation). Let’s try both here with AI.</p>
</section>
<section id="the-meaning" class="level2">
<h2 class="anchored" data-anchor-id="the-meaning">The Meaning</h2>
<section id="calling-claude-2" class="level3">
<h3 class="anchored" data-anchor-id="calling-claude-2">Calling Claude 2</h3>
<p>The advent of LLM’s now mean that you can write a quick function in Python that can take in any verse in Sanskrit and return both the <code>prati padārtham</code> and the <code>bhāvam</code> in JSON.</p>
<p>Here’s how.</p>
<div id="cell-6" class="cell" data-execution_count="64">
<details open="" class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> generate_sloka_meaning(sloka):</span>
<span id="cb1-2">    prompt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb1-3"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>HUMAN_PROMPT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> Consider the following verse in Sanskrit enclosed in single quotes. Please give a JSON response with the following key/ value pairs:</span></span>
<span id="cb1-4"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    1. 'prati padartham': Aword for word translation in English in the form of a markdown table. </span></span>
<span id="cb1-5"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    The table should have the following columns: Word in Devanagari script, Word in Telugu script, Word in Roman Script, English Translation.</span></span>
<span id="cb1-6"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    Return the table alone as the value.</span></span>
<span id="cb1-7"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    2. 'bhavam': The overall meaning of the verse in English sentences. Return the meaning alone as the value.</span></span>
<span id="cb1-8"></span>
<span id="cb1-9"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    Please give the response in the following JSON format: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'{"prati padartham": "table", "bhavam": "meaning"}'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> This is important: do not give anything beyond the JSON response.</span></span>
<span id="cb1-10"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    The verse: '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sloka<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span></span>
<span id="cb1-11"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AI_PROMPT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> Can I check through my answer to ensure I have not missed anything?</span></span>
<span id="cb1-12"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>HUMAN_PROMPT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> Yes, please do. Make sure you have not missed anything. Particularly check if you're outputting the right script in the right column. </span></span>
<span id="cb1-13"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AI_PROMPT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-14"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">            """</span></span>
<span id="cb1-15">    anthropic <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Anthropic()</span>
<span id="cb1-16">    completion <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> anthropic.completions.create(</span>
<span id="cb1-17">        model<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"claude-2"</span>,</span>
<span id="cb1-18">        max_tokens_to_sample<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40000</span>,</span>
<span id="cb1-19">        prompt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>prompt,</span>
<span id="cb1-20">    )</span>
<span id="cb1-21">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> completion.completion</span>
<span id="cb1-22"></span>
<span id="cb1-23"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> extract_prati_padartham(sloka_meaning):</span>
<span id="cb1-24">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#extract json value with the key 'prati padartham'</span></span>
<span id="cb1-25">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> json.loads(sloka_meaning)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prati padartham"</span>]</span>
<span id="cb1-26"></span>
<span id="cb1-27"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> extract_bhavam(sloka_meaning):</span>
<span id="cb1-28">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#extract json value with the key 'bhavam'</span></span>
<span id="cb1-29">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> json.loads(sloka_meaning)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bhavam"</span>]</span></code></pre></div></div>
</details>
</div>
<p>The function <code>generate_sloka_meaning</code> calls Claude 2 and gets it to generate a <code>prati padartham</code> and <code>bhavam</code>. The former is returned as a Markdown table, while the latter is plain text. We also got Claude 2 to check through the response before returning it to us (per suggestion in Anthropic’s <a href="https://docs.anthropic.com/claude/docs/ask-claude-to-think-step-by-step">docs</a>). This is because it did not generate the full meaning on some executions.</p>
<p>Let’s now input both verses and see what Claude 2 generates for us.</p>
<div id="cell-8" class="cell" data-execution_count="65">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode numberSource python code-overflow-wrap number-lines code-with-copy"><code class="sourceCode python"><span id="cb2-1">verses <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb2-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11.12"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"divi sūryasahasrasya bhaved yugapad utthitā</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">yadi bhāḥ sadṛśī sā syād bhāsas tasya mahātmanaḥ"</span>,</span>
<span id="cb2-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11.32"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"śhrī-bhagavān uvācha</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">kālo’smi loka-kṣaya-kṛt pravṛddho</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">lokan samāhartum iha pravṛttaḥ</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">ṛte ’pi tvāṁ na bhaviṣyanti sarve</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">ye ’vasthitāḥ pratyanīkeṣu yodhāḥ"</span>,</span>
<span id="cb2-4">}</span>
<span id="cb2-5"></span>
<span id="cb2-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># for each verse, generate the meaning</span></span>
<span id="cb2-7">sloka_meanings <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb2-8"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> verse <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> verses:</span>
<span id="cb2-9">    sloka_meanings[verse] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> generate_sloka_meaning(verses[verse])</span></code></pre></div></div>
</details>
</div>
</section>
<section id="results" class="level3">
<h3 class="anchored" data-anchor-id="results">Results</h3>
<p>This is what we see for the two verses that Oppenheimer quoted:</p>
<div class="cell" data-execution_count="66">
<div id="tbl-1112" class="cell quarto-float quarto-figure quarto-figure-center anchored" data-execution_count="66">
<figure class="quarto-float quarto-float-tbl figure">
<figcaption class="quarto-float-caption-top quarto-float-caption quarto-float-tbl" id="tbl-1112-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Table&nbsp;1: Word-for-word translation of Verse 11.12
</figcaption>
<div aria-describedby="tbl-1112-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div class="cell-output cell-output-display cell-output-markdown">
<table class="cell caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Word in Devanagari</th>
<th>Word in Telugu</th>
<th>Word in Roman</th>
<th>English Translation</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>दिवि</td>
<td>దివి</td>
<td>divi</td>
<td>in the sky</td>
</tr>
<tr class="even">
<td>सूर्यसहस्रस्य</td>
<td>సూర్యసహస్రస్య</td>
<td>sūryasahasrasya</td>
<td>of thousands of suns</td>
</tr>
<tr class="odd">
<td>भवेत्</td>
<td>భవేత్</td>
<td>bhavet</td>
<td>would be</td>
</tr>
<tr class="even">
<td>युगपत्</td>
<td>యుగపత్</td>
<td>yugapat</td>
<td>simultaneously</td>
</tr>
<tr class="odd">
<td>उत्थिता</td>
<td>ఉత్థితా</td>
<td>utthitā</td>
<td>risen</td>
</tr>
<tr class="even">
<td>यदि</td>
<td>యది</td>
<td>yadi</td>
<td>if</td>
</tr>
<tr class="odd">
<td>भाः</td>
<td>భాः</td>
<td>bhāḥ</td>
<td>light</td>
</tr>
<tr class="even">
<td>सदृशी</td>
<td>సదృశీ</td>
<td>sadṛśī</td>
<td>similar</td>
</tr>
<tr class="odd">
<td>सा</td>
<td>సా</td>
<td>sā</td>
<td>that</td>
</tr>
<tr class="even">
<td>स्यात्</td>
<td>స్యాత్</td>
<td>syāt</td>
<td>would be</td>
</tr>
<tr class="odd">
<td>भासस्</td>
<td>భాసస్</td>
<td>bhāsas</td>
<td>the light</td>
</tr>
<tr class="even">
<td>तस्य</td>
<td>తస్య</td>
<td>tasya</td>
<td>his</td>
</tr>
<tr class="odd">
<td>महात्मनः</td>
<td>మహాత్మనః</td>
<td>mahātmanaḥ</td>
<td>of the noble one</td>
</tr>
</tbody>
</table>
</div>
</div>
</figure>
</div>
</div>
<div class="cell" data-execution_count="67">
<div id="tbl-1132" class="cell quarto-float quarto-figure quarto-figure-center anchored" data-execution_count="67">
<figure class="quarto-float quarto-float-tbl figure">
<figcaption class="quarto-float-caption-top quarto-float-caption quarto-float-tbl" id="tbl-1132-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Table&nbsp;2: Word-for-word translation of Verse 11.32
</figcaption>
<div aria-describedby="tbl-1132-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div class="cell-output cell-output-display cell-output-markdown">
<table class="cell caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Word in Devanagari</th>
<th>Word in Telugu</th>
<th>Word in IAST</th>
<th>English Translation</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>श्री-भगवान्</td>
<td>శ్రీ-భగవాన్</td>
<td>śrī-bhagavān</td>
<td>Lord Krishna</td>
</tr>
<tr class="even">
<td>उवाच</td>
<td>ఉవాచ</td>
<td>uvāca</td>
<td>said</td>
</tr>
<tr class="odd">
<td>कालः</td>
<td>కాలః</td>
<td>kālaḥ</td>
<td>time</td>
</tr>
<tr class="even">
<td>अस्मि</td>
<td>అస్మి</td>
<td>asmi</td>
<td>I am</td>
</tr>
<tr class="odd">
<td>लोक-क्षय-कृत्</td>
<td>లోక-క్షయ-కృత్</td>
<td>loka-kṣaya-kṛt</td>
<td>the destroyer of the worlds</td>
</tr>
<tr class="even">
<td>प्रवृद्धः</td>
<td>ప్రవృద్ధః</td>
<td>pravṛddhaḥ</td>
<td>grown</td>
</tr>
<tr class="odd">
<td>लोकान्</td>
<td>లోకాన్</td>
<td>lokān</td>
<td>the worlds</td>
</tr>
<tr class="even">
<td>समाहर्तुम्</td>
<td>సమాహర్తుమ్</td>
<td>samāhartum</td>
<td>to destroy</td>
</tr>
<tr class="odd">
<td>इह</td>
<td>ఇహ</td>
<td>iha</td>
<td>here</td>
</tr>
<tr class="even">
<td>प्रवृत्तः</td>
<td>ప్రవృత్తః</td>
<td>pravṛttaḥ</td>
<td>engaged</td>
</tr>
<tr class="odd">
<td>ऋते</td>
<td>ఋతే</td>
<td>ṛte</td>
<td>without</td>
</tr>
<tr class="even">
<td>अपि</td>
<td>అపి</td>
<td>api</td>
<td>even</td>
</tr>
<tr class="odd">
<td>त्वाम्</td>
<td>త్వామ్</td>
<td>tvām</td>
<td>you</td>
</tr>
<tr class="even">
<td>न</td>
<td>న</td>
<td>na</td>
<td>not</td>
</tr>
<tr class="odd">
<td>भविष्यन्ति</td>
<td>భవిష్యన్తి</td>
<td>bhaviṣyanti</td>
<td>will be</td>
</tr>
<tr class="even">
<td>सर्वे</td>
<td>సర్వే</td>
<td>sarve</td>
<td>all</td>
</tr>
<tr class="odd">
<td>ये</td>
<td>యే</td>
<td>ye</td>
<td>who</td>
</tr>
<tr class="even">
<td>अवस्थिताः</td>
<td>అవస్థితాః</td>
<td>avasthitāḥ</td>
<td>arrayed</td>
</tr>
<tr class="odd">
<td>प्रत्यनीकेषु</td>
<td>ప్రత్యనీకేషు</td>
<td>pratyanīkeṣu</td>
<td>on the opposing</td>
</tr>
<tr class="even">
<td>योधाः</td>
<td>యోధాః</td>
<td>yodhāḥ</td>
<td>warriors</td>
</tr>
</tbody>
</table>
</div>
</div>
</figure>
</div>
</div>
<p>( <em>Do note that Claude 2 has gotten a few Roman transliterations wrong.</em> )</p>
<div id="cell-13" class="cell" data-execution_count="56">
<div class="cell-output cell-output-display cell-output-markdown">
<p>Here are the meanings of both verses:</p>
<blockquote class="blockquote">
<p><strong>11.12</strong>: If thousands of suns were to rise simultaneously in the sky, that brilliance would be similar to the radiance of that noble soul.</p>
<p><strong>11.32</strong>: In this verse, Lord Krishna reveals that He is time, the destroyer of worlds. He says that the time has come for Him to destroy the worlds, and He has set out to do so. He declares that even without you (Arjuna), all the warriors arrayed on the opposing side will cease to exist.</p>
</blockquote>
</div>
</div>
</section>
</section>
<section id="analysis" class="level2">
<h2 class="anchored" data-anchor-id="analysis">Analysis</h2>
<p>Let’s compare the versions one by one.</p>
<div class="cell" data-execution_count="81">
<div id="tbl-comparison" class="cell quarto-float quarto-figure quarto-figure-center anchored" data-execution_count="81">
<figure class="quarto-float quarto-float-tbl figure">
<figcaption class="quarto-float-caption-top quarto-float-caption quarto-float-tbl" id="tbl-comparison-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Table&nbsp;3: Comparing meanings for both verses
</figcaption>
<div aria-describedby="tbl-comparison-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div class="cell-output cell-output-display cell-output-markdown">
<table class="cell caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 8%">
<col style="width: 14%">
<col style="width: 77%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: center;">Verse</th>
<th style="text-align: center;">Version By</th>
<th style="text-align: center;">Meaning</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: center;">11.12</td>
<td style="text-align: center;">Oppenheimer</td>
<td style="text-align: center;">If the radiance of a thousand suns were to burst at once into the sky, that would be like the splendo[u]r of the mighty one</td>
</tr>
<tr class="even">
<td style="text-align: center;">11.12</td>
<td style="text-align: center;">Claude 2</td>
<td style="text-align: center;">If thousands of suns were to rise in the sky simultaneously, that light would be similar to the light of that noble one.</td>
</tr>
<tr class="odd">
<td style="text-align: center;">11.32</td>
<td style="text-align: center;">Oppenheimer</td>
<td style="text-align: center;">Now I am become Death, the shatterer of worlds.</td>
</tr>
<tr class="even">
<td style="text-align: center;">11.32</td>
<td style="text-align: center;">Claude 2</td>
<td style="text-align: center;">Lord Krishna said: I am time, the destroyer of worlds, fully grown for destroying the worlds. Now I am engaged here to destroy them. Even without you, all the warriors arrayed on the opposing side shall not exist.</td>
</tr>
</tbody>
</table>
</div>
</div>
</figure>
</div>
</div>
<p>One may note the following:</p>
<section id="light-from-a-noble-or-mighty-one" class="level3">
<h3 class="anchored" data-anchor-id="light-from-a-noble-or-mighty-one">1. Light from a Noble or Mighty One</h3>
<p>Oppenheimer’s translation focusses on <em>bursting</em> of light from a thousand suns, like in a nuclear explosion, while Claude 2’s translation focuses on thousands of suns <em>rising</em> in the sky (“<em>utthitā</em>”). Oppenheimer translated <em>mahātma</em> as “mighty one”, while the Claude 2 translation renders it as “noble one”.</p>
<p>Which is to say: while in Oppenheimer’s translation, the narrator is in awe of a sudden display of immense power, in the latter, the narrator also ascribes a sense of nobility to a gentle - if less scary - display of power.</p>
</section>
<section id="death-or-time" class="level3">
<h3 class="anchored" data-anchor-id="death-or-time">2. Death or Time</h3>
<p>Oppenheimer translated <em>kālaḥ</em> as “Death”, while the Claude 2 translation rendered it as “Time”. A quick search across multiple Sanskrit dictionaries suggests that <a href="https://andhrabharati.com/dictionary/sanskrit/index.php?w=%E0%A4%95%E0%A4%BE%E0%A4%B2">kālaḥ</a> can indeed mean both “Death” and “Time”, but the latter is more common.</p>
<p>In particular, Monier Williams 2nd Edition (1899) tried to reconcile both meanings by suggesting that <em>kālaḥ</em> could mean “death by age”, or time as an entity that “destroys all things” <span class="citation" data-cites="andhrabharati2023kala">(Bharati 2023)</span></p>
<p>Time has been worshipped as entity in Hinduism since the Vedic Era. Rig Veda Mandala 10, Sukta 190 suggests Time originated first from the Great Ocean in the sky, and only then did the Sun and the Moon come into existence:</p>
<div id="cell-17" class="cell" data-execution_count="93">
<div class="cell-output cell-output-display cell-output-markdown">
<p><br>సముద్రాద్ అర్ణవాద్ అధి సంవత్సరో అజయాత<br><br>అహో రాత్రాణి విదధద్ విశ్వస్య మిషతో వశీ<br><br>సూర్యా చంద్రమసో ధాతా యథాపూర్వం అకల్పయత్<br><br>దివం చ ప్రథివీంచ అంతరిక్షం ఆతో స్వాహః<br><br></p>
</div>
</div>
<p>Yes, of course, this too needs to be translated with the function we wrote above.</p>
<div class="cell" data-execution_count="90">
<div id="tbl-rigveda" class="cell quarto-float quarto-figure quarto-figure-center anchored" data-execution_count="90">
<figure class="quarto-float quarto-float-tbl figure">
<figcaption class="quarto-float-caption-top quarto-float-caption quarto-float-tbl" id="tbl-rigveda-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Table&nbsp;4: Claude 2’s translation of Rig Veda Mandala 10 Sukta 190
</figcaption>
<div aria-describedby="tbl-rigveda-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div class="cell-output cell-output-display cell-output-markdown">
<table class="cell caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>Word in Devanagari</th>
<th>Word in Telugu</th>
<th>Word in Roman</th>
<th>English Translation</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>समुद्रात्</td>
<td>సముద్రాద్</td>
<td>samudrāt</td>
<td>from the ocean</td>
</tr>
<tr class="even">
<td>अर्णवात्</td>
<td>అర్ణవాద్</td>
<td>arṇavāt</td>
<td>and from the sky</td>
</tr>
<tr class="odd">
<td>अधि</td>
<td>అధి</td>
<td>adhi</td>
<td>above</td>
</tr>
<tr class="even">
<td>संवत्सर:</td>
<td>సంవత్సరో</td>
<td>saṃvatsaro</td>
<td>year</td>
</tr>
<tr class="odd">
<td>अजयात्</td>
<td>అజయాత</td>
<td>ajayāt</td>
<td>unceasingly</td>
</tr>
<tr class="even">
<td>अहो</td>
<td>అహో</td>
<td>aho</td>
<td>O!</td>
</tr>
<tr class="odd">
<td>रात्राणि</td>
<td>రాత్రాణి</td>
<td>rātrāṇi</td>
<td>nights</td>
</tr>
<tr class="even">
<td>विदधत्</td>
<td>విదధద్</td>
<td>vidadhat</td>
<td>placing</td>
</tr>
<tr class="odd">
<td>विश्वस्य</td>
<td>విశ్వస్య</td>
<td>viśvasya</td>
<td>of the universe</td>
</tr>
<tr class="even">
<td>मिषत:</td>
<td>మిషతో</td>
<td>miṣataḥ</td>
<td>properly</td>
</tr>
<tr class="odd">
<td>वशी</td>
<td>వశీ</td>
<td>vaśī</td>
<td>the controller</td>
</tr>
<tr class="even">
<td>सूर्या:</td>
<td>సూర్యా</td>
<td>sūryāḥ</td>
<td>sun</td>
</tr>
<tr class="odd">
<td>चन्द्रमस:</td>
<td>చంద్రమసో</td>
<td>candramasaḥ</td>
<td>and moon</td>
</tr>
<tr class="even">
<td>धाता</td>
<td>ధాతా</td>
<td>dhātā</td>
<td>placing</td>
</tr>
<tr class="odd">
<td>यथापूर्वम्</td>
<td>యథాపూర్వం</td>
<td>yathāpūrvam</td>
<td>as before</td>
</tr>
<tr class="even">
<td>अकल्पयत्</td>
<td>అకల్పయత్</td>
<td>akalpayat</td>
<td>imagined</td>
</tr>
<tr class="odd">
<td>दिवम्</td>
<td>దివం</td>
<td>divam</td>
<td>heaven</td>
</tr>
<tr class="even">
<td>च</td>
<td>చ</td>
<td>ca</td>
<td>and</td>
</tr>
<tr class="odd">
<td>पृथिवीम्</td>
<td>ప్రథివీంచ</td>
<td>pṛthivīṃ</td>
<td>earth</td>
</tr>
<tr class="even">
<td>च</td>
<td>చ</td>
<td>ca</td>
<td>and</td>
</tr>
<tr class="odd">
<td>अन्तरिक्षम्</td>
<td>అంతరిక్షం</td>
<td>antarikṣam</td>
<td>space</td>
</tr>
<tr class="even">
<td>आत:</td>
<td>ఆతో</td>
<td>ātaḥ</td>
<td>then</td>
</tr>
<tr class="odd">
<td>स्वा:</td>
<td>స్వాహః</td>
<td>svāḥ</td>
<td>himself</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>Meaning</strong>:</p>
<blockquote class="blockquote">
<p>The verse describes how the creator (Brahma), after bringing forth the universe consisting of the sky, heavens, earth and space between them, then created the regulating principles exemplified by the sun and moon, which go on continuously, year after year, placing day and night properly in their assigned places just as before.</p>
</blockquote>
</div>
</div>
</figure>
</div>
</div>
<p><em>Note that the Claude 2 translation is non-deterministic; each execution has produced a different result.</em></p>
<p>Time is one of the four primary forms of Vishnu per the Vishnu Purana, the other three being matter (<code>pradhāna</code>), visible substance (<code>vyakta</code>), and spirit (<code>purusha</code>) (via <a href="https://en.wikipedia.org/wiki/Kāla">Wikipedia</a>)</p>
<p>In that sense, Krishna telling Arjuna that He is Time is not to say he <em>will</em> destroy the world, but that both creation and destruction are part of the same process, and that Krishna is the source of both.</p>
</section>
</section>
<section id="conclusion" class="level2">
<h2 class="anchored" data-anchor-id="conclusion">Conclusion</h2>
<p>There is no single correct interpretation of the <em>Gita</em> or any other Sanskrit verse. The context of the narrator matters as much as the words. Oppenheimer used verses from the <em>Gita</em> to describe <em>his</em> feelings about a scary new power that could bring about destruction of the world. Death, clearly, was on his mind. Another narrator (me) in a different context would interpret the same verses differently. These could very well be describing a more benevolent power over which one has no agency, but one that encompasses not just destruction but also creation.</p>
<p>A quick lexical analysis through the traditional approach of seeing a word-for-word translation and then a sentence-wise translation can assist in this regard. Whilst this was traditionally done by hand, now you can script it out in Python by relying on LLM’s. However, output from LLM’s can be subjective too - biased by training, and also non-deterministic. You still need to think this through for yourself.</p>



</section>


<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent">
<div id="ref-barnett1949j" class="csl-entry">
Barnett, Lincoln. 1949. <span>“J. Robert Oppenheimer.”</span> <em>Life</em>, 133.
</div>
<div id="ref-andhrabharati2023kala" class="csl-entry">
Bharati, Andhra. 2023. <em>Kala</em>. <a href="https://andhrabharati.com/dictionary/sanskrit/index.php?w=%E0%A4%95%E0%A4%BE%E0%A4%B2" class="uri">Https://andhrabharati.com/dictionary/sanskrit/index.php?w=%E0%A4%95%E0%A4%BE%E0%A4%B2</a>.
</div>
<div id="ref-bird2005american" class="csl-entry">
Bird, Kai, and Martin J Sherwin. 2005. <em>American Prometheus: The Triumph and Tragedy of j. Robert Oppenheimer</em>. Alfred A. Knopf.
</div>
</div></section><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>The image is taken from <a href="https://collections.vam.ac.uk/item/O154643/vishnu-as-vishvarupa-cosmic-or-painting-unknown/">V&amp;A’s website</a>. It used to be shown in the India collection along with other works of art the British Raj stole from the sub-continent, but now is no longer on public display. Infuriatingly, V&amp;A somehow asserts copyright and therefore conditions over an image of this 200-year-old painting.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>oppenheimer</category>
  <category>llm</category>
  <category>ai</category>
  <category>Sanskrit</category>
  <category>bhagavad-gita</category>
  <category>anthropic</category>
  <category>linguistics</category>
  <guid>https://metamutator.github.io/posts/i_am_time/</guid>
  <pubDate>Wed, 09 Aug 2023 00:00:00 GMT</pubDate>
  <media:content url="https://metamutator.github.io/posts/i_am_time/viswarupa.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Panchanga Tantra: The Magic of the Indic Calendar System</title>
  <dc:creator>Akshay Regulagedda</dc:creator>
  <link>https://metamutator.github.io/posts/panchanga-tantra/panchanga_tantra.html</link>
  <description><![CDATA[ 





<div id="fig-kalachakra" class="quarto-float quarto-figure quarto-figure-left anchored" data-fig-align="left">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-kalachakra-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://metamutator.github.io/posts/panchanga-tantra/kala-chakra.png" class="img-fluid quarto-figure quarto-figure-left figure-img">
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-kalachakra-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;1: Kala Chakra
</figcaption>
</figure>
</div>
<section id="foreword" class="level2">
<h2 class="anchored" data-anchor-id="foreword">0. Foreword</h2>
<section id="th-anniversary-edition-2023" class="level3">
<h3 class="anchored" data-anchor-id="th-anniversary-edition-2023">20th Anniversary Edition (2023)</h3>
<p>This is a “20th anniversary edition” of a thesis I wrote in 2002 for the Undergraduate Research Opportunities Programme (UROP), as part of my mathematics minor in the National University of Singapore. This is also a word-for-word republishing of the thesis, but with updates to embed graphics and tables within the text. All errors (if any) are mine, and have existed for 20+ years.</p>
<p>For the longest time, this thesis was up on my then supervisor, Dr Helmer Aslaksen’s website at the Mathematics Department’s webpage. During this time, a great many had downloaded the PDF, but very few presumably understood it. For, this undergrad thesis found it its way to websites talking about dark magic and other related mystical concepts. Probably they got confused with the “tantra” in the title. Didn’t help that I made this mystical-looking, but perfectly scientific, graphic alluding to kaala chakra’s that would presumably sound woo-woo to unsuspecting audiences. Incidentally, I just re-did this graphic (Figure&nbsp;1) to more exacting design standards, and perhaps would warrant another detailed explanation.</p>
<p>Dr Aslaksen returned to Oslo many many moons ago (pun intended). His old webpage at NUS’ website was still active for many years later, but now that it too has gone, I’m now back on the Internet to say this: nothing tantric about it. I was just punning between the Sanskrit terms ‘panchatantra’ and ‘panchangam’. In fact, this is all mathematic exploration and research, by way of Vedanga Jyotisa, Surya Siddhanta, and modelling all of those principles in Java and LISP. This is me doing that roots thing but via math. This is me claiming expertise in Indic, Chinese and Islamic calendars, of being able to tell when Chinese New Year and Deepavali can fall. Akshay researching kshaya months, if you will. That is all there is to it. Magical, but no black magic.</p>
<p>There is one literary conceit, though.</p>
</section>
<section id="second-edition-2002" class="level3">
<h3 class="anchored" data-anchor-id="second-edition-2002">Second Edition (2002)</h3>
<p>The fable of Apara Ganita and the Mystical Garden of Enchanted Numbers is obviously fictional. The inspiration is <em>Leelavati Ganitam</em>, a chapter in the ancient mathematical treatise, the <em>Siddhanta Siromani</em>, written by Bhaskaracharya in 1150 CE. The <em>Leelavati Ganitam</em> is fascinating not only for its treatment of indeterminate analysis and a method to solve Pell’s Equation, but also, as a Canadian university’s website on mathematical history puts it<span class="citation" data-cites="simonfraser">(University 2002)</span>, for its poetic conversation between the narrator and a narratee named Leelavati. The similarity between this poetic construct and the conversation between Apara Ganita and the dwara palika is probably noticeable.</p>
<p>Frame stories are not common for scientific research papers, but they certainly have a historical precedent.</p>
</section>
</section>
<section id="prologue-the-mystical-garden-of-enchanted-numbers" class="level2">
<h2 class="anchored" data-anchor-id="prologue-the-mystical-garden-of-enchanted-numbers">1. <em>Prologue</em>: The Mystical Garden of Enchanted Numbers</h2>
<p><em>Once upon a time, in the magical mystical city of Suvarnapuri<sup>1</sup>, there lived a student called Apara Ganita<sup>2</sup>. Apara Ganita was virtuous and devoted to his sciences. Having spent considerable amount of time learning the shastras from his guru, he was surprised when one day his guru called him up. “You have performed well, O sishya⁴ mine”, the guru said, “but the time has now come for you to take leave”.</em></p>
<p><em>Apara Ganita was at once sad, for he had learned a lot under him. But he remained quiet and continued listening to his guru.</em></p>
<p><em>“Listen, Apara Ganita, I shall now tell you something that my guru told me when I finished my studies. For, a study in Ganita Sastra (mathematics) is not complete, unless one visits the Mystical Garden of Enchanted Numbers”</em></p>
<p><em>“You must go and find this place for your education to be truly complete”.</em></p>
<p><em>And so Apara Ganita went about searching for this place. Indeed, after much travelling and searching, he was finally shown the way to the Mystical Garden of Enchanted Numbers.</em></p>
<p><em>And lo, what a beautiful sight it was! For it was situated in the midst of a lush green valley, saddled by mountains on either side. Down there, Apara Ganita could see famous mathematicians expositing their theories and skills, like hawkers on a bazaar street. There was Euclid standing on a rectangle, explaining the beauty of the Golden Ratio in classic Greco Caldean architecture. Pythagoras was standing next to him as a part of the Greek exhibit, explaining the virtues of a right-angled triangle to a curious crowd. From the far end of the Orator’s Corner, Zhao Jun Qing looked at Pythagoras and smiled. He was himself holding a right-angled triangle and was explaining his proof for the Pythagoras’ Theorem. Mandelbrot was decorating the Garden with flowers of fractallate beauty. John Nash was close by; he was pointing at a group of women, probably explaining game theory to onlookers around him. In another corner of the garden, (Sector 1729), Srinivasa Ramanujan was vociferously arguing a point with Thomas Hardy.</em></p>
<p><em>It was such an environment that Apara Ganita wanted to enter.</em></p>
<p><em>However, as he was about to enter through the great doors guarding the garden, he heard a sonorous voice calling out his name.</em></p>
<p><em>He stopped and turned around to see who was calling him only to saw a young woman coming towards him. With eyes burning with curiosity and a voice sweeter than a nightingale, she said:</em></p>
<div class="line-block">&nbsp;&nbsp;O Student Erudite,<br>
&nbsp;&nbsp;What is it that you study tonight?</div>
<p><em>Just what I needed, a mystical </em>dwara palika <em>(female door keeper), he said to himself. Shaking his head in wry amusement, he looks at the books in his hand and takes a deep breath to begin his dissertation.</em></p>
</section>
<section id="sthaana-prakarana-how-the-calendar-is-different-in-different-regions" class="level2">
<h2 class="anchored" data-anchor-id="sthaana-prakarana-how-the-calendar-is-different-in-different-regions">2. <em>Sthaana Prakarana</em>: How the calendar is different in different regions</h2>
<div class="line-block"><em>In a sonorous voice, the dwara palika said,</em><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;In order to ascertain your dissertation’s veracity,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;can I hear you talk about the calendar’s regional complexity?<br>
<em>To which Apara Ganita listened to the multitudes of voices in the Garden, and replied thus:</em></div>
<p>Probably the easiest way to classify Indian calendars is by the region of usage. It must be reiterated though, that such an exercise might be misleading. The classification is indeed not watertight; all calendars are intrinsically inter-linked with one another. A flowchart of the various Indian calendars and the links between them can be seen below (Figure&nbsp;2).</p>
<div id="fig-caluml" class="quarto-float quarto-figure quarto-figure-left anchored" data-fig-align="left">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-caluml-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://metamutator.github.io/posts/panchanga-tantra/calendar-uml.png" class="img-fluid quarto-figure quarto-figure-left figure-img">
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-caluml-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;2: Indic Calendar System as a quasi-UML diagram
</figcaption>
</figure>
</div>
<p>With this caveat, we’ll now traverse India on a calendrical vehicle of sorts. In particular, we try to ascertain the following elements in each region’s calendrical practices: - * Basis of the Calendar * Local Variation * When does the year begin? * Era Followed</p>
<p>We’ll find the following calendars defined with these metrics: -</p>
<section id="the-southern-amaanta-calendar" class="level3">
<h3 class="anchored" data-anchor-id="the-southern-amaanta-calendar">2.1 The Southern Amaanta Calendar</h3>
<p>The Southern Amaanta Lunisolar Calendar is predominantly followed in the South and South-West Indian states of Andhra Pradesh, Karnataka and Maharashtra. It is essentially a lunisolar one; i.e., its days and months are calculated based on the motions of the moon. Like the Chinese calendar, the month is calculated from new moon to new moon. It however, differs from the Chinese calendar in that the lunar day (“<em>thithi</em>”) of the new moon is considered the last day of the previous month. Again, as in the Chinese calendar, a leap month, an <em>adhika maasa</em>, is added to the calendar every 2.7 years on an average to offset the disparity in lengths between the lunar year and the sidereal year. In addition, a month, the <em>kshaya maasa</em>, is occasionally subtracted. This is discussed in a later segment.</p>
<p>The Southern Amaanta Calendar differs from the Western Amaanta Calendar in its treatment of <em>kshaya maasas</em>, the New Year Day and the Era followed. We believe that the Southern Amaanta Calendar follows the Southern School for treating kshaya maasas. Saha and Lahiri suggest that it follows the Salivahana Saka Era starting with Chaitra Sukla Pratipada <span class="citation" data-cites="chakravarty1985indian">(Chakravarty and Chatterjee 1985, 304)</span>, the lunar day after the last new moon before <em>Mesha Sankranti</em>. The years are also named according to the names of the Jovian years (Southern School <span class="citation" data-cites="saha1992report">(Saha and Lahiri 1992, 270)</span>). The Eras and handling of <em>kshaya maasas</em> will be discussed in detail in their respective segments.</p>
</section>
<section id="western-amaanta-calendar" class="level3">
<h3 class="anchored" data-anchor-id="western-amaanta-calendar">2.2 Western Amaanta Calendar</h3>
<p>As already mentioned, we believe it’s important to distinguish between the Amaanta calendar practised in South and West India. In West India, specifically, in the state of Gujarat, the Amaanta calendar is of two forms<span class="citation" data-cites="chakravarty1985indian">(Chakravarty and Chatterjee 1985, 304)</span>, one that starts with Aashaadha (followed in the Kathiawar region) and one that starts with Kartika (followed all throughout Gujarat). Both calendars follow the Vikrama Era and both also possibly follow the North Western School for <em>kshaya</em> months.</p>
</section>
<section id="purnimaanta-calendar" class="level3">
<h3 class="anchored" data-anchor-id="purnimaanta-calendar">2.3 Purnimaanta Calendar</h3>
<p>The Purnimaanta Calendar is followed in most of North India, i.e., in the states of Bihar, Himachal Pradesh, Uttar Pradesh, Haryana, Punjab, Jammu and Kashmir and Rajasthan <span class="citation" data-cites="chatterjee1988indian">(Chatterjee 1988, 42)</span>. (Earlier literature fails to mention Uttaranchal, Chattisgarh, Jharkhand and Delhi, but they are off-shots of bigger states and would necessarily follow the same calendar). The last of the three Indian lunisolar calendars, this one differs from the Amaanta calendar in that the months are reckoned from full moon to full moon. Therefore, the Purnimaanta calendar starts two weeks before the Amaanta calendar does; that is, it starts with the lunar day after the last full-moon before Mesha Sankranti. The Vikrama Era is followed <span class="citation" data-cites="chakravarty1985indian">(Chakravarty and Chatterjee 1985, 305)</span>, along with the Northern School of Jovian-year names <span class="citation" data-cites="saha1992report">(Saha and Lahiri 1992, 270)</span>.</p>
</section>
<section id="the-malayali-calendar" class="level3">
<h3 class="anchored" data-anchor-id="the-malayali-calendar">2.5 The Malayali&nbsp;Calendar</h3>
<p>We now come to the list of Solar Calendars. The Malayali Calendar is predominantly followed in the South Indian state of Kerala. It is essentially a solar calendar; as we shall see later, the months are defined according to the raasis. The year starts with the Simha Sankranti and follows the Kollam Era.<span class="citation" data-cites="chakravarty1985indian">(Chakravarty and Chatterjee 1985, 304)</span> The month begins on the same day as a Sankranti if it occurs before aparahna, i.e., three-fifths of a day. Otherwise, it begins on the next day.</p>
</section>
<section id="tamil-calendar" class="level3">
<h3 class="anchored" data-anchor-id="tamil-calendar">2.6 Tamil Calendar</h3>
<p>The Tamil calendar is followed in Tamil Nadu. This calendar is also solar; the month begins on the same day as a Sankranti if it occurs before sunset <span class="citation" data-cites="chatterjee1988indian">(Chatterjee 1988, 14)</span>. The Kali Era is followed along with the Southern Jovian cycle. One peculiarity about the Tamil calendar is that its month names start with Chittirai<span class="citation" data-cites="chatterjee1988indian">(Chatterjee 1988, 9)</span> (Chaitra).</p>
</section>
<section id="bengali-calendar" class="level3">
<h3 class="anchored" data-anchor-id="bengali-calendar">2.7 Bengali Calendar</h3>
<p>The Bengali calendar is predominantly followed in West Bengal, Assam and Tripura. The Era is the Bengali San. The rule for the beginning of the month is again different; the month begins on the day after a Sankranti, if it occurs before midnight. Otherwise, it begins on the third day. <span class="citation" data-cites="chatterjee1988indian">(Chatterjee 1988, 14)</span></p>
</section>
<section id="oriya-calendar" class="level3">
<h3 class="anchored" data-anchor-id="oriya-calendar">2.8 Oriya Calendar</h3>
<p>The Oriya calendar is followed in the Eastern state of Orissa. In addition to the Bengali San, the Saka, Vilayati and Amli eras are followed. <span class="citation" data-cites="saha1992report">(Saha and Lahiri 1992, 258)</span> The month begins on the same day as that of the respective Sankranti. <span class="citation" data-cites="chatterjee1988indian">(Chatterjee 1988, 14)</span></p>
</section>
<section id="the-nanakshahi-calendar" class="level3">
<h3 class="anchored" data-anchor-id="the-nanakshahi-calendar">2.9 The Nanakshahi Calendar</h3>
<p>Promulgated in 1998 CE, the Nanakshahi Calendar is followed in Punjab. It’s intrinsically linked to the Gregorian calendar, except in its usage of the Nanakshahi Era.<span class="citation" data-cites="purewal">(Purewal 2002)</span></p>
</section>
<section id="national-calendar-of-1957" class="level3">
<h3 class="anchored" data-anchor-id="national-calendar-of-1957">2.10 National Calendar of&nbsp;1957</h3>
<p>Proposed by the Calendar Reform Committee of 1952 and promulgated in 1957 CE, the National Calendar is a tropical calendar with fixed lengths of days and months. However, because it was totally different from the traditional calendars, it did not find much acceptance. <span class="citation" data-cites="chatterjee1988indian">(Chatterjee 1988, 18)</span></p>
<p>We may thus summarize Indian calendars thus:</p>
<div class="cell" data-execution_count="1">
<div id="tbl-indian-calendars" class="cell quarto-float quarto-figure quarto-figure-center anchored" data-execution_count="1">
<figure class="quarto-float quarto-float-tbl figure">
<figcaption class="quarto-float-caption-top quarto-float-caption quarto-float-tbl" id="tbl-indian-calendars-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Table&nbsp;1: Various Indic Calendars
</figcaption>
<div aria-describedby="tbl-indian-calendars-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div class="cell-output cell-output-display" data-execution_count="1">
<table class="cell caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th></th>
<th style="text-align: left;">State</th>
<th style="text-align: left;">Calendar</th>
<th style="text-align: left;">Era</th>
<th style="text-align: left;">New Year</th>
<th style="text-align: left;">Further Local Variation</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>0</td>
<td style="text-align: left;">Andhra Pradesh</td>
<td style="text-align: left;">Southern Amaanta</td>
<td style="text-align: left;">Salivahana Saka, Jovian cycle (Southern School)</td>
<td style="text-align: left;">One day after the last new moon before Mesha Sankranti</td>
<td style="text-align: left;">Possible Jugma month for kshaya</td>
</tr>
<tr class="even">
<td>1</td>
<td style="text-align: left;">Assam</td>
<td style="text-align: left;">Solar</td>
<td style="text-align: left;">Kali, Bengali San</td>
<td style="text-align: left;">Solar Day after Mesha Sankranti</td>
<td style="text-align: left;">Bengali rules for beginning of month</td>
</tr>
<tr class="odd">
<td>2</td>
<td style="text-align: left;">Bihar</td>
<td style="text-align: left;">Purnimaanta</td>
<td style="text-align: left;">Vikrama Era (Chaitradi)</td>
<td style="text-align: left;">One day after the last full moon before Mesha Sankranti</td>
<td style="text-align: left;"></td>
</tr>
<tr class="even">
<td>3</td>
<td style="text-align: left;">Chattisgarh</td>
<td style="text-align: left;">Purnimaanta</td>
<td style="text-align: left;">Vikrama Era (Chaitradi)</td>
<td style="text-align: left;">One day after the last full moon before Mesha Sankranti</td>
<td style="text-align: left;"></td>
</tr>
<tr class="odd">
<td>4</td>
<td style="text-align: left;">Delhi</td>
<td style="text-align: left;">Purnimaanta</td>
<td style="text-align: left;">Vikrama Era (Chaitradi)</td>
<td style="text-align: left;">One day after the last full moon before Mesha Sankranti</td>
<td style="text-align: left;"></td>
</tr>
<tr class="even">
<td>5</td>
<td style="text-align: left;">Goa</td>
<td style="text-align: left;">Southern Amaanta</td>
<td style="text-align: left;">Salivahana Saka, Jovian cycle (Southern School)</td>
<td style="text-align: left;">One day after the last new moon before Mesha Sankranti</td>
<td style="text-align: left;">Possible Jugma month for kshaya</td>
</tr>
<tr class="odd">
<td>6</td>
<td style="text-align: left;">Gujarat</td>
<td style="text-align: left;">Western Amaanta</td>
<td style="text-align: left;">Vikrama Karthikaadi</td>
<td style="text-align: left;">One day after Deepavali</td>
<td style="text-align: left;">North-western school for kshaya possible</td>
</tr>
<tr class="even">
<td>7</td>
<td style="text-align: left;">Himachal Pradesh</td>
<td style="text-align: left;">Purnimaanta</td>
<td style="text-align: left;">Vikrama Era (Chaitradi)</td>
<td style="text-align: left;">One day after the last full moon before Mesha Sankranti</td>
<td style="text-align: left;"></td>
</tr>
<tr class="odd">
<td>8</td>
<td style="text-align: left;">Jammu and Kashmir</td>
<td style="text-align: left;">Purnimaanta</td>
<td style="text-align: left;">Saptarishi, Laukika</td>
<td style="text-align: left;">One day after the last full moon before Mesha Sankranti</td>
<td style="text-align: left;"></td>
</tr>
<tr class="even">
<td>9</td>
<td style="text-align: left;">Jharkhand</td>
<td style="text-align: left;">Purnimaanta</td>
<td style="text-align: left;">Vikrama Era (Chaitradi)</td>
<td style="text-align: left;">One day after the last full moon before Mesha Sankranti</td>
<td style="text-align: left;"></td>
</tr>
<tr class="odd">
<td>10</td>
<td style="text-align: left;">(Kathiawar)</td>
<td style="text-align: left;">Western Amaanta</td>
<td style="text-align: left;">Vikrama Aashaadhadi</td>
<td style="text-align: left;">Ashaadha S 1</td>
<td style="text-align: left;">North-western school for kshaya possible</td>
</tr>
<tr class="even">
<td>11</td>
<td style="text-align: left;">Karnataka</td>
<td style="text-align: left;">Southern Amaanta</td>
<td style="text-align: left;">Salivahana Saka, Jovian cycle (Southern School)</td>
<td style="text-align: left;">One day after the last new moon before Mesha Sankranti</td>
<td style="text-align: left;">Possible Jugma month for kshaya</td>
</tr>
<tr class="odd">
<td>12</td>
<td style="text-align: left;">Kerala</td>
<td style="text-align: left;">Solar</td>
<td style="text-align: left;">Kollam Era</td>
<td style="text-align: left;">Simha Sankranti</td>
<td style="text-align: left;">1)&nbsp;&nbsp;&nbsp;&nbsp;Kerala rules for beginning of month</td>
</tr>
<tr class="even">
<td></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
<td style="text-align: left;">2) Months named after raasis</td>
</tr>
<tr class="odd">
<td>13</td>
<td style="text-align: left;">Madhya Pradesh</td>
<td style="text-align: left;">Purnimaanta</td>
<td style="text-align: left;">Vikrama Era (Chaitradi)</td>
<td style="text-align: left;">One day after the last new moon before Mesha Sankranti</td>
<td style="text-align: left;"></td>
</tr>
<tr class="even">
<td>14</td>
<td style="text-align: left;">Maharashtra</td>
<td style="text-align: left;">Southern Amaanta</td>
<td style="text-align: left;">Salivahana Saka, Jovian cycle (Southern School)</td>
<td style="text-align: left;">One day after the last new moon before Mesha Sankranti</td>
<td style="text-align: left;">Possible Jugma month for kshaya</td>
</tr>
<tr class="odd">
<td>15</td>
<td style="text-align: left;">Orissa</td>
<td style="text-align: left;">Solar</td>
<td style="text-align: left;">Saka, Vilaayati, Aamli, Bengali San</td>
<td style="text-align: left;">Mesha Sankranti</td>
<td style="text-align: left;"></td>
</tr>
<tr class="even">
<td>16</td>
<td style="text-align: left;">Punjab</td>
<td style="text-align: left;">Purnimaanta</td>
<td style="text-align: left;">Vikrama Era (Chaitradi)</td>
<td style="text-align: left;">One day after the last new moon before Mesha Sankranti</td>
<td style="text-align: left;"></td>
</tr>
<tr class="odd">
<td>17</td>
<td style="text-align: left;">Punjab – Nanakshahi</td>
<td style="text-align: left;">Sidereal; fixed relative to Gregorian calendar</td>
<td style="text-align: left;">Nanakshahi</td>
<td style="text-align: left;">14th March</td>
<td style="text-align: left;">Uses traditional names for Punjabi months</td>
</tr>
<tr class="even">
<td>18</td>
<td style="text-align: left;">Rajasthan</td>
<td style="text-align: left;">Purnimaanta</td>
<td style="text-align: left;">Vikrama Era (Chaitradi)</td>
<td style="text-align: left;">One day after the last new moon before Mesha Sankranti</td>
<td style="text-align: left;"></td>
</tr>
<tr class="odd">
<td>19</td>
<td style="text-align: left;">Tamil Nadu</td>
<td style="text-align: left;">Solar</td>
<td style="text-align: left;">Kali, Jovian cycle (Southern School)</td>
<td style="text-align: left;">Mesha Sankranti</td>
<td style="text-align: left;"></td>
</tr>
<tr class="even">
<td>20</td>
<td style="text-align: left;">Tripura</td>
<td style="text-align: left;">Solar</td>
<td style="text-align: left;">Kali, Bengali San</td>
<td style="text-align: left;">Solar Day after Mesha Sankranti</td>
<td style="text-align: left;">Bengali rules for beginning of month</td>
</tr>
<tr class="odd">
<td>21</td>
<td style="text-align: left;">Uttaranchal</td>
<td style="text-align: left;">Purnimaanta</td>
<td style="text-align: left;">Vikrama Era (Chaitradi)</td>
<td style="text-align: left;">One day after the last new moon before Mesha Sankranti</td>
<td style="text-align: left;"></td>
</tr>
<tr class="even">
<td>22</td>
<td style="text-align: left;">Uttar Pradesh</td>
<td style="text-align: left;">Purnimaanta</td>
<td style="text-align: left;">Vikrama Era (Chaitradi)</td>
<td style="text-align: left;">One day after the last new moon before Mesha Sankranti</td>
<td style="text-align: left;"></td>
</tr>
<tr class="odd">
<td>23</td>
<td style="text-align: left;">West Bengal</td>
<td style="text-align: left;">Solar</td>
<td style="text-align: left;">Kali, Bengali San</td>
<td style="text-align: left;">Solar Day after Mesha Sankranti</td>
<td style="text-align: left;">Bengali rules for beginning of month</td>
</tr>
</tbody>
</table>
</div>
</div>
</figure>
</div>
</div>
<p>Do note that: 1. The table is not exhaustive terms of calendars nor in terms of states. Among others, Arunachal Pradesh, Manipur, Meghalaya, Mizoram, Nagaland and Sikkim were left out. 2. Chatterjee mentions that the Orissa School for deciding the beginning of the solar month is also used in Punjab and Haryana “where the solar calendar is also used”. <span class="citation" data-cites="chatterjee1988indian">(Chatterjee 1988, 14)</span></p>
</section>
</section>
<section id="maasa-naamakarana-how-the-months-got-their-names." class="level2">
<h2 class="anchored" data-anchor-id="maasa-naamakarana-how-the-months-got-their-names.">3. <em>Maasa Naamakarana</em>: How the Months got their&nbsp;Names.</h2>
<div class="line-block"><em>Listening to this, she said,</em><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Since we are deep in this game,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Might I ask how each month got its name?<br>
<em>To which Apara Ganita stared at a gulmohar flower with twenty-seven buds and replied thus:</em></div>
<p>The complexity of the Indian calendar system is not just in the plethora of calendars available, but also in the manner in which they link up with one another. A principal point of linkage of most Indian calendars is in their names of the months; as we shall see, the similar sets of month names are used in more than one calendar. In this section, we aim to formulate rules determining the naming of the months. Our motivation is not just taxonomic; month names, we shall see, are critical to understanding the Indian calendar system.</p>
<p>We propose that there are two types of month names: -</p>
<section id="months-named-after-nakshatras" class="level3">
<h3 class="anchored" data-anchor-id="months-named-after-nakshatras">3.1 Months named after Nakshatras</h3>
<p>The set of month names named after <em>nakshatras</em> is used by both solar and lunisolar calendars, adding to seeming complexity of the Indian calendar system. Indeed, as we shall see, this type should actually called as ‘Months <em>initially</em> named after <em>Nakshatras</em>’; there has been an infusion of solar rules into an essentially lunar convention.</p>
<p>Let us then, first consider the original rule. Saha and Lahiri mention that pakshas or fortnights were differentiated based on the nakshatra “where the moon is full”.<span class="citation" data-cites="saha1992report">(Saha and Lahiri 1992, 221)</span> That is to say, if a particular full moon occurs near, say, the lunar asterism, Visakha, the full moon would be called as Vaisakha Purnimaasi, and the month would be Vaisakha. The earliest lunisolar months, then, were purnimaanta, that is, the name of the full moon corresponded to the name of the month. Of course, the full moon occurs at all nakshatras. Fifteen were taken into account for naming of the month, spaced more or less equally.</p>
<p>We thus have the following set of names along with their respective nakshatras<span class="citation" data-cites="saha1992report">(Saha and Lahiri 1992, 221)</span>:</p>
<div class="cell" data-execution_count="2">
<div id="tbl-nakshatra-months" class="cell quarto-float quarto-figure quarto-figure-center anchored" data-execution_count="2">
<figure class="quarto-float quarto-float-tbl figure">
<figcaption class="quarto-float-caption-top quarto-float-caption quarto-float-tbl" id="tbl-nakshatra-months-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Table&nbsp;2: Nakshtras and Months
</figcaption>
<div aria-describedby="tbl-nakshatra-months-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div class="cell-output cell-output-display" data-execution_count="2">
<table class="cell caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th></th>
<th style="text-align: left;">Nakshatra on Purnima</th>
<th style="text-align: left;">Month Name</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>0</td>
<td style="text-align: left;">Chitra</td>
<td style="text-align: left;">Chaitra</td>
</tr>
<tr class="even">
<td>1</td>
<td style="text-align: left;">Visakha</td>
<td style="text-align: left;">Vaisakha</td>
</tr>
<tr class="odd">
<td>2</td>
<td style="text-align: left;">Jyestha</td>
<td style="text-align: left;">Jyaistha</td>
</tr>
<tr class="even">
<td>3</td>
<td style="text-align: left;">(Purva &amp; Uttara) Aashaadha</td>
<td style="text-align: left;">Aashaadha</td>
</tr>
<tr class="odd">
<td>4</td>
<td style="text-align: left;">Sravana</td>
<td style="text-align: left;">Sraavana</td>
</tr>
<tr class="even">
<td>5</td>
<td style="text-align: left;">(Uttara &amp; Purva) Bhaadrapada</td>
<td style="text-align: left;">Bhaadrapada</td>
</tr>
<tr class="odd">
<td>6</td>
<td style="text-align: left;">Asvini</td>
<td style="text-align: left;">Asvayuja (Aasvina)</td>
</tr>
<tr class="even">
<td>7</td>
<td style="text-align: left;">Krittika</td>
<td style="text-align: left;">Kaarthika</td>
</tr>
<tr class="odd">
<td>8</td>
<td style="text-align: left;">Mrugasira</td>
<td style="text-align: left;">Maarghasira</td>
</tr>
<tr class="even">
<td>9</td>
<td style="text-align: left;">Pushyami</td>
<td style="text-align: left;">Pausa (Pushyam)</td>
</tr>
<tr class="odd">
<td>10</td>
<td style="text-align: left;">Maghaa</td>
<td style="text-align: left;">Maagha</td>
</tr>
<tr class="even">
<td>11</td>
<td style="text-align: left;">(Uttara and Purva) Phalguni</td>
<td style="text-align: left;">Phalguna</td>
</tr>
</tbody>
</table>
</div>
</div>
</figure>
</div>
</div>
<p>It may be noted that the months of <em>Aashaadha</em>, <em>Bhadrapada</em> and <em>Phalguna</em> are linked to two <em>nakshatras</em> respectively. Chatterjee and Chakravarthy give the following criteria for choosing <em>nakshatras</em> for month names<span class="citation" data-cites="chakravarty1985indian">(Chakravarty and Chatterjee 1985, 281)</span>:</p>
<ol type="1">
<li>The yogataaras or the identifying stars of the nakshatras are prominent or have traditional significance.</li>
<li>They are spaced equidistant from one another.</li>
</ol>
<p>It must be mentioned that this rule is now an approximation largely due to Earth’s precession; for instance, this year’s Chitra Purnimaasi had Swati as its nakshatra. Also, possibly for historical reasons, and allowing for regional variation in pronunciation, the Oriya, Bengali, Assamese, Punjabi and Tamil solar calendars also use the same set of month names.</p>
<p>To reconcile all this, we might frame a new rule, that, the amaanta lunar month takes its number from the solar month that starts in it, but its name from the solar month in which it starts, while following the purnimaanta months in chronological order. That is to say, since Chitra occurred during the purnima of this year’s first purnimaanta month, we call this month as ‘Chaitra’. Consequently, the first amaanta month would also be ‘Chaitra’, which also would be the name of the solar month during which the amaanta ‘Chaitra’ started. However, the ‘number’ of the solar month (‘1’ in the case of amaanta and purnimaanta Chaitra) is not quite the same; the solar Chaitra is the last (i.e., 12th) month of the year. The lunisolar Chaitra’s number is taken by the solar month that begins in it, namely the solar Vaisakha. All this can be seen in the graphic in the next page.</p>
<p>The relationships for all the months may be mapped according to the following table <span class="citation" data-cites="chakravarty1985indian">(Chakravarty and Chatterjee 1985, 280)</span> (Punjabi month names <span class="citation" data-cites="purewal">(Purewal 2002)</span>):</p>
<div class="cell" data-execution_count="3">
<div id="tbl-month-relationships" class="cell quarto-float quarto-figure quarto-figure-center anchored" data-execution_count="3">
<figure class="quarto-float quarto-float-tbl figure">
<figcaption class="quarto-float-caption-top quarto-float-caption quarto-float-tbl" id="tbl-month-relationships-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Table&nbsp;3: Raasis and Months in various parts of India
</figcaption>
<div aria-describedby="tbl-month-relationships-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div class="cell-output cell-output-display" data-execution_count="3">
<table class="cell caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th></th>
<th style="text-align: left;">Raasi</th>
<th style="text-align: left;">Approximate Nakshatra on Purnima</th>
<th style="text-align: left;">Lunar Month Name</th>
<th style="text-align: left;">Solar Month Name</th>
<th style="text-align: left;">Assamese Version</th>
<th style="text-align: left;">Tamil Version</th>
<th style="text-align: left;">Punjabi Version</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>0</td>
<td style="text-align: left;">Mesha</td>
<td style="text-align: left;">Chitra</td>
<td style="text-align: left;">Chaitra</td>
<td style="text-align: left;">Vaisakha</td>
<td style="text-align: left;">Bahag</td>
<td style="text-align: left;">Chittarai</td>
<td style="text-align: left;">Vaisakh</td>
</tr>
<tr class="even">
<td>1</td>
<td style="text-align: left;">Vrshava</td>
<td style="text-align: left;">Visakha</td>
<td style="text-align: left;">Vaisakha</td>
<td style="text-align: left;">Jyaishta</td>
<td style="text-align: left;">Jeth</td>
<td style="text-align: left;">Vaikasi</td>
<td style="text-align: left;">Jeth</td>
</tr>
<tr class="odd">
<td>2</td>
<td style="text-align: left;">Mithuna</td>
<td style="text-align: left;">Jyestha</td>
<td style="text-align: left;">Jaishta</td>
<td style="text-align: left;">Aashaadha</td>
<td style="text-align: left;">Ahar</td>
<td style="text-align: left;">Aani</td>
<td style="text-align: left;">Harh</td>
</tr>
<tr class="even">
<td>3</td>
<td style="text-align: left;">Karkata</td>
<td style="text-align: left;">(Purva &amp; Uttara) Ashaadha</td>
<td style="text-align: left;">Aashaadha</td>
<td style="text-align: left;">Sraavana</td>
<td style="text-align: left;">Saon</td>
<td style="text-align: left;">Aadi</td>
<td style="text-align: left;">Sawan</td>
</tr>
<tr class="odd">
<td>4</td>
<td style="text-align: left;">Simha</td>
<td style="text-align: left;">Sravana</td>
<td style="text-align: left;">Sraavana</td>
<td style="text-align: left;">Bhaadrapada</td>
<td style="text-align: left;">Bhad</td>
<td style="text-align: left;">Aavani</td>
<td style="text-align: left;">Bhadon</td>
</tr>
<tr class="even">
<td>5</td>
<td style="text-align: left;">Kanya</td>
<td style="text-align: left;">(Purva &amp; Uttara) Bhaadrapada</td>
<td style="text-align: left;">Bhaadrapada</td>
<td style="text-align: left;">Asvayuja (Aasvina)</td>
<td style="text-align: left;">Ahin</td>
<td style="text-align: left;">Purattaasi</td>
<td style="text-align: left;">Asu</td>
</tr>
<tr class="odd">
<td>6</td>
<td style="text-align: left;">Tula</td>
<td style="text-align: left;">Asvini</td>
<td style="text-align: left;">Asvayuja (Aasvina)</td>
<td style="text-align: left;">Kaarthika</td>
<td style="text-align: left;">Kati</td>
<td style="text-align: left;">Arppisi</td>
<td style="text-align: left;">Katik</td>
</tr>
<tr class="even">
<td>7</td>
<td style="text-align: left;">Vrischika</td>
<td style="text-align: left;">Krittika</td>
<td style="text-align: left;">Kaarthika</td>
<td style="text-align: left;">Maarghasira</td>
<td style="text-align: left;">Aghon</td>
<td style="text-align: left;">Karthigai</td>
<td style="text-align: left;">Maghar</td>
</tr>
<tr class="odd">
<td>8</td>
<td style="text-align: left;">Dhanus</td>
<td style="text-align: left;">Mrugasira</td>
<td style="text-align: left;">Maarghasira</td>
<td style="text-align: left;">Pushyam (Pausa)</td>
<td style="text-align: left;">Puha</td>
<td style="text-align: left;">Maargali</td>
<td style="text-align: left;">Poh</td>
</tr>
<tr class="even">
<td>9</td>
<td style="text-align: left;">Makara</td>
<td style="text-align: left;">Pushyami</td>
<td style="text-align: left;">Pushyam (Pausa)</td>
<td style="text-align: left;">Maagha</td>
<td style="text-align: left;">Magh</td>
<td style="text-align: left;">Thaai</td>
<td style="text-align: left;">Magh</td>
</tr>
<tr class="odd">
<td>10</td>
<td style="text-align: left;">Kumbha</td>
<td style="text-align: left;">Maagha</td>
<td style="text-align: left;">Maagha</td>
<td style="text-align: left;">Phalguna</td>
<td style="text-align: left;">Phagun</td>
<td style="text-align: left;">Maasi</td>
<td style="text-align: left;">Phagun</td>
</tr>
<tr class="even">
<td>11</td>
<td style="text-align: left;">Mina</td>
<td style="text-align: left;">(Uttara &amp; Purva) Phalguni</td>
<td style="text-align: left;">Phalguna</td>
<td style="text-align: left;">Chaitra</td>
<td style="text-align: left;">Chait</td>
<td style="text-align: left;">Panguni</td>
<td style="text-align: left;">Chet</td>
</tr>
</tbody>
</table>
</div>
</div>
</figure>
</div>
</div>
<p>The Assamese, Punjabi and Tamil versions have been provided to give an idea of the linguistic variation. It is also interesting to observe that the National Calendar suggested by Saha and Lahiri also uses the same set of month names, increasing the potential confusion. As is probably obvious by now, the rule does not correspond to the Tamil, National and Nanakshahi calendars.</p>
</section>
<section id="months-named-after-raasis" class="level3">
<h3 class="anchored" data-anchor-id="months-named-after-raasis">3.2 Months named after Raasis</h3>
<p>Only solar months share their names with <em>raasis</em>. SK Chatterjee and Apurba Kumar Chakravarthy give the following names along with the associated <em>raasis</em><span class="citation" data-cites="chakravarty1985indian">(Chakravarty and Chatterjee 1985, 280)</span>:</p>
<div class="cell" data-execution_count="4">
<div id="tbl-raasi-months" class="cell quarto-float quarto-figure quarto-figure-center anchored" data-execution_count="4">
<figure class="quarto-float quarto-float-tbl figure">
<figcaption class="quarto-float-caption-top quarto-float-caption quarto-float-tbl" id="tbl-raasi-months-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Table&nbsp;4: Malayalam months named after <em>raasis</em>
</figcaption>
<div aria-describedby="tbl-raasi-months-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div class="cell-output cell-output-display" data-execution_count="4">
<table class="cell caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th></th>
<th style="text-align: left;">Raasi</th>
<th style="text-align: left;">Sanskritised Version</th>
<th style="text-align: left;">Malayalam Version</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>0</td>
<td style="text-align: left;">Mesha</td>
<td style="text-align: left;">Mesha</td>
<td style="text-align: left;">Medam</td>
</tr>
<tr class="even">
<td>1</td>
<td style="text-align: left;">Vrshava</td>
<td style="text-align: left;">Vrshava</td>
<td style="text-align: left;">Edavam</td>
</tr>
<tr class="odd">
<td>2</td>
<td style="text-align: left;">Mithuna</td>
<td style="text-align: left;">Mithuna</td>
<td style="text-align: left;">Midhunam</td>
</tr>
<tr class="even">
<td>3</td>
<td style="text-align: left;">Karkata</td>
<td style="text-align: left;">Karkata</td>
<td style="text-align: left;">Karitaka</td>
</tr>
<tr class="odd">
<td>4</td>
<td style="text-align: left;">Simha</td>
<td style="text-align: left;">Simha</td>
<td style="text-align: left;">Chingam</td>
</tr>
<tr class="even">
<td>5</td>
<td style="text-align: left;">Kanya</td>
<td style="text-align: left;">Kanya</td>
<td style="text-align: left;">Kanni</td>
</tr>
<tr class="odd">
<td>6</td>
<td style="text-align: left;">Tula</td>
<td style="text-align: left;">Tula</td>
<td style="text-align: left;">Thulam</td>
</tr>
<tr class="even">
<td>7</td>
<td style="text-align: left;">Vrischika</td>
<td style="text-align: left;">Vrischika</td>
<td style="text-align: left;">Vrischikam</td>
</tr>
<tr class="odd">
<td>8</td>
<td style="text-align: left;">Dhanus</td>
<td style="text-align: left;">Dhanus</td>
<td style="text-align: left;">Dhanu</td>
</tr>
<tr class="even">
<td>9</td>
<td style="text-align: left;">Makara</td>
<td style="text-align: left;">Makara</td>
<td style="text-align: left;">Makaram</td>
</tr>
<tr class="odd">
<td>10</td>
<td style="text-align: left;">Kumbha</td>
<td style="text-align: left;">Kumbha</td>
<td style="text-align: left;">Kumbham</td>
</tr>
<tr class="even">
<td>11</td>
<td style="text-align: left;">Mina</td>
<td style="text-align: left;">Mina</td>
<td style="text-align: left;">Minam</td>
</tr>
<tr class="odd">
<td>12</td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
</tr>
</tbody>
</table>
</div>
</div>
</figure>
</div>
</div>
<p>That is to say, the month shares its name with that of its corresponding <em>Sankranti</em>. For instance, if <em>Mesha Sankranti</em> occurs on a certain day, then the period until the next <em>Sankranti</em> would be <em>Mesha maasa (Medham maasam)</em>.</p>
<p>This naming rule is followed primarily in the Malayalam calendar. Incidentally, Abhayankar says that the Oriya calendar also follows this rule. <span class="citation" data-cites="abhayankar1993debts">(Abhayankar 1993, 55)</span></p>
</section>
</section>
<section id="parva-dina-nirnaya-how-the-days-of-festivals-are-decided." class="level2">
<h2 class="anchored" data-anchor-id="parva-dina-nirnaya-how-the-days-of-festivals-are-decided.">4. <em>Parva Dina&nbsp;Nirnaya</em>: How the days of festivals are&nbsp;decided.</h2>
<div class="line-block"><em>Hearing him speak, she asked,</em><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The cultural complexity is interesting,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;but perhaps you have a festivals listing?<br>
<em>To which Apara Ganita looked at birds chirping and replied thus:</em></div>
<p>We provide a list of Indian festivals, along with their (Indic) dates and the calendar used to reckon the particular festival. The list of festivals is by no means exhaustive; the entries are mostly public holidays in India.</p>
<div class="cell" data-execution_count="5">
<div id="tbl-indian-festivals" class="cell quarto-float quarto-figure quarto-figure-center anchored" data-execution_count="5">
<figure class="quarto-float quarto-float-tbl figure">
<figcaption class="quarto-float-caption-top quarto-float-caption quarto-float-tbl" id="tbl-indian-festivals-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Table&nbsp;5: Various Indic Festivals <span class="citation" data-cites="chatterjee1988indian">(Chatterjee 1988, 60–68)</span>
</figcaption>
<div aria-describedby="tbl-indian-festivals-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div class="cell-output cell-output-display" data-execution_count="5">
<table class="cell caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th></th>
<th style="text-align: left;">Festival</th>
<th style="text-align: left;">Indic Date</th>
<th style="text-align: left;">Additional Rules</th>
<th style="text-align: left;">Calendar Used</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>0</td>
<td style="text-align: left;">Makara Sankranti/ Pongal</td>
<td style="text-align: left;">Makara Sankranti</td>
<td style="text-align: left;"></td>
<td style="text-align: left;">Solar</td>
</tr>
<tr class="even">
<td>1</td>
<td style="text-align: left;">Maha Siva Raatri</td>
<td style="text-align: left;">Magha K 14</td>
<td style="text-align: left;">Must cover a nisita</td>
<td style="text-align: left;">Lunisolar</td>
</tr>
<tr class="odd">
<td>2</td>
<td style="text-align: left;">Holi</td>
<td style="text-align: left;">Phalguna Purnima</td>
<td style="text-align: left;">Holika Dahana is observed on the night of the Purnima; Holi is observed on the solar day after Holika Dahana.</td>
<td style="text-align: left;">Lunisolar</td>
</tr>
<tr class="even">
<td>3</td>
<td style="text-align: left;">Ugadi / Gudi Padwa</td>
<td style="text-align: left;">Chaitra S 1</td>
<td style="text-align: left;"></td>
<td style="text-align: left;">Lunisolar</td>
</tr>
<tr class="odd">
<td>4</td>
<td style="text-align: left;">Rama Navami</td>
<td style="text-align: left;">Chaitra S 9</td>
<td style="text-align: left;">Must cover Madyahna</td>
<td style="text-align: left;"></td>
</tr>
<tr class="even">
<td>5</td>
<td style="text-align: left;">Tamil New Year, Vishu, Bengali New Year</td>
<td style="text-align: left;">Mesha Sankranti</td>
<td style="text-align: left;">Respective Sankranti rules</td>
<td style="text-align: left;">Solar</td>
</tr>
<tr class="odd">
<td>6</td>
<td style="text-align: left;">Ganesh Chaturti</td>
<td style="text-align: left;">Bhadrapada S 4</td>
<td style="text-align: left;">Must cover Madyahna</td>
<td style="text-align: left;">Lunisolar</td>
</tr>
<tr class="even">
<td>7</td>
<td style="text-align: left;">Buddha Purnima</td>
<td style="text-align: left;">Vaisakhi Purnima</td>
<td style="text-align: left;"></td>
<td style="text-align: left;">Lunisolar</td>
</tr>
<tr class="odd">
<td>8</td>
<td style="text-align: left;">Raksha Bandan</td>
<td style="text-align: left;">Sravana Purnima</td>
<td style="text-align: left;"></td>
<td style="text-align: left;">Lunisolar</td>
</tr>
<tr class="even">
<td>9</td>
<td style="text-align: left;">Janmashtami</td>
<td style="text-align: left;">Sravana K 8</td>
<td style="text-align: left;"></td>
<td style="text-align: left;">Lunisolar</td>
</tr>
<tr class="odd">
<td>10</td>
<td style="text-align: left;">Onam</td>
<td style="text-align: left;">Moon is in Sravana nakshatra in Solar Bhadrapada</td>
<td style="text-align: left;"></td>
<td style="text-align: left;">Lunisolar and Solar</td>
</tr>
<tr class="even">
<td>11</td>
<td style="text-align: left;">Mahanavami <span class="citation" data-cites="sarma2002interview">(Sivasri Sarma 2002)</span></td>
<td style="text-align: left;">Asvayuja S 9</td>
<td style="text-align: left;">(Mahanavami is reckoned before the other 8 days of Dussehra)</td>
<td style="text-align: left;">Lunisolar</td>
</tr>
<tr class="odd">
<td>12</td>
<td style="text-align: left;">Vijayadasami <span class="citation" data-cites="sarma2002interview">(Sivasri Sarma 2002)</span></td>
<td style="text-align: left;">(The thithi after Mahanavami)</td>
<td style="text-align: left;">Must cover a Nisita</td>
<td style="text-align: left;">Lunisolar</td>
</tr>
<tr class="even">
<td>13</td>
<td style="text-align: left;">Deepavali</td>
<td style="text-align: left;">Asvayuja Amavasya</td>
<td style="text-align: left;">Must cover pradosha</td>
<td style="text-align: left;">Lunisolar</td>
</tr>
</tbody>
</table>
</div>
</div>
</figure>
</div>
</div>
<p>A bit of explanation is necessary. First, the terms. “<em>Nisita</em>” is defined to be a time- period measured by two <em>ghatikas</em> (1/60th of a solar day; approximately 20 minutes) stretching on either side of midnight. “<em>Pradosha</em>” is the time-period stretching for two <em>muhurtas</em> (1/15th of the time between sunrise and sunset; approximately 1 hour 36 minutes) after sunset. “<em>Madhyahna</em>” is one-third of the time-period between sunrise and sunset. This fraction covers mid-day.</p>
<p>Second, these dates are valid only on non-intercalary <em>thithis</em> for all lunisolar festivals. Both leap days and non-leap days in leap months are deemed unfit for festivals. (<em>Kshaya maasas</em> are not an issue here because a) <em>jugma</em> months are deemed fit for religious observance and b) in the Eastern and Northwestern schools, the extra intercalary month is deemed to be normal).</p>
<p>And finally, if the given <em>thithi</em> doesn’t cover the given time, or covers the given time on two solar days, then the second solar day is reckoned to be the respective festival.</p>
</section>
<section id="samvad-sandesha-how-eras-come-into-play" class="level2">
<h2 class="anchored" data-anchor-id="samvad-sandesha-how-eras-come-into-play">5. <em>Samvad Sandesha</em>: How Eras come into play</h2>
<div class="line-block"><em>Perceiving the response, she questioned:</em><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I do not know if this is an important part,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;but from when do all calendars start?<br>
<em>To which Apara Ganita looked at a foundation stone and replied thus:</em></div>
<p>The Indian calendar system follows a wide range of eras, some of historical interest. Also, we do not attempt to link individual calendars to eras, for the same calendar may be reckoned with two different eras in two different places.</p>
<p>Here’s the listing:</p>
<div class="cell" data-execution_count="6">
<div id="tbl-indian-eras" class="cell quarto-float quarto-figure quarto-figure-center anchored" data-execution_count="6">
<figure class="quarto-float quarto-float-tbl figure">
<figcaption class="quarto-float-caption-top quarto-float-caption quarto-float-tbl" id="tbl-indian-eras-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Table&nbsp;6: Various Indic Eras <span class="citation" data-cites="saha1992report">(Saha and Lahiri 1992, 252–58)</span>
</figcaption>
<div aria-describedby="tbl-indian-eras-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div class="cell-output cell-output-display" data-execution_count="6">
<table class="cell caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th></th>
<th style="text-align: left;">Era</th>
<th style="text-align: left;">Zero Year</th>
<th style="text-align: left;">Beginning of Era with respect to individual year</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>0</td>
<td style="text-align: left;">Saka</td>
<td style="text-align: left;">78 CE</td>
<td style="text-align: left;">Mesha Sankranti, Chaitra S 1</td>
</tr>
<tr class="even">
<td>1</td>
<td style="text-align: left;">Vikrama</td>
<td style="text-align: left;">57 CE</td>
<td style="text-align: left;">Mesha Sankranti, Chaitra S 1, Karthika S 1, Ashadha S 1</td>
</tr>
<tr class="odd">
<td>2</td>
<td style="text-align: left;">Kali</td>
<td style="text-align: left;">3101 BCE</td>
<td style="text-align: left;">Mesha Sankranti, Chaitra S 1</td>
</tr>
<tr class="even">
<td>3</td>
<td style="text-align: left;">Kollam</td>
<td style="text-align: left;">824 CE</td>
<td style="text-align: left;">Kanya Sankranti, Simha Sankranti</td>
</tr>
<tr class="odd">
<td>4</td>
<td style="text-align: left;">Bengali San</td>
<td style="text-align: left;">963 + solar years since 1556 CE</td>
<td style="text-align: left;">Mesha Sankranti</td>
</tr>
</tbody>
</table>
</div>
</div>
</figure>
</div>
</div>
<p>In addition, some regions also name their years according to the names of the Jovian years. Saha and Lahiri point out that there are two schools for this; the Southern school names its years in continuous succession, while the Northern school names its years corresponding to the present Jovian year. <span class="citation" data-cites="saha1992report">(Saha and Lahiri 1992, 272)</span></p>
</section>
<section id="kshaya-sutra-how-certain-months-are-dropped" class="level2">
<h2 class="anchored" data-anchor-id="kshaya-sutra-how-certain-months-are-dropped">6. <em>Kshaya Sutra</em>: How certain months are&nbsp;dropped</h2>
<div class="line-block"><em>Observing the reaction, she enquired:</em><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;To calendars you seem an active saakshya <sup>3</sup>,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;but from when do all calendars start?<br>
<em>To which, Apara Ganita looked at some fallen leaves and replied thus:</em></div>
<p>One of the most interesting aspects of the Indian lunisolar calendar is its <em>kshaya maasas</em>, literally “decayed months”. Occasionally, certain months are dropped from the lunisolar calendar. We now try to understand the modalities behind this omission; we try to answer how, why, when and where it happens.</p>
<p>First, let us try to define a kshaya month. Chatterjee, in his work on Indian calendars, says that a certain lunar month “may completely overlap any of the short three nirayana solar months of Margasira, Pausha and Magha”, with the result that there will be no new moon in the respective solar month. Consequently, there will be no lunar month named “after […] this solar month”. <span class="citation" data-cites="chatterjee1988indian">(Chatterjee 1988, 34)</span> This interaction may be visualized in Figure&nbsp;1.</p>
<p>We learn the following from this statement:  1. That the solar months of Margasira, Pausa and Magha are small, 2. That at a certain time, there might be no new moon in these months, and 3. The corresponding lunar month is dropped from the calendar.</p>
<p>Note that Chatterjee is silent on whether the dropped lunar month is amaanta or purnimaanta; a naïve assumption would be that since he talks about new moons, the month would be amaanta. But a study of the (Chaitradi) amaanta and purnimaanta calendars for the present year reveals that the difference between these two calendars is still two weeks. Therefore, it’s safe to conclude that kshaya months were dropped from the purnimaanta calendar as well.</p>
<p>Moreover, the statement about “corresponding lunar month” is unclear; are we talking about the lunar month with the same number as the new-moon-lacking solar month? Or are we talking about the lunar month with the same name of the solar month? Running the <em>calendrica</em> code provided by Dershowitz and Reingold with their book <em>Calendrical Calculations - The Millenium Edition</em> (see table for values), we see that it is the lunar month with the same name that gets dropped.</p>
<p>To account for a purnimaanta kshaya, and to further clarify which month to drop, we re-phrase the definition of a kshaya month to be thus:</p>
<blockquote class="blockquote">
<p>“In any given lunar year, if two consecutive Sankrantis occur between two consecutive new moons, then the lunar month, whether amaanta or purnimaanta, with the same name as the solar month in which this occurs, is dropped.”</p>
</blockquote>
<p>As we shall see, such a re-phrasing is useful for computational purposes.</p>
<p>Indeed, as we mentioned earlier, we ran the Dershowitz and Reingold’s calendrica package to get values for the occurrence of a kshaya month. Since searching for a kshaya month is computationally very heavy<span class="citation" data-cites="deshowitz2002calendar">(Dershowitz and Reingold 2002, 24)</span>, we used a table prepared by Saha and Lahiri (table 22 in the book)<span class="citation" data-cites="saha1992report">(Saha and Lahiri 1992, 250)</span> as a starting point. We also tabulated results for non- kshaya months, specifically years with gaps of 19, 46, 65, 76, 122 and 141 years respectively. The results and the graphs from these results are tabulated in Table&nbsp;8.</p>
<p>It must be noted that all cases tabulated previously have been calculated according to Surya Siddhantic rules and that we may get a different set of results if calculated according to ephemeris calculations. Indeed, as Chatterjee has pointed out, there was a difference in 1964 CE; ephemeris calculations showed Margasira to be kshaya (and Karthika, Chaitra to be adhika), while as we’ve seen, Surya Siddhantic computation showed Pausa to be kshaya (and Asvina and Chaitra to be adhika) <span class="citation" data-cites="chatterjee1988indian">(Chatterjee 1988, 38)</span> Chatterjee, however, seems to be in agreement with Dershowitz and Reingold in saying that there was a kshaya in Magha in 1983 CE <span class="citation" data-cites="deshowitz2001calendrical">(Deshowitz and Reingold 2001, 269)</span>, despite his use of ephemeris calculations.</p>
<p>What do we get from all this? We see that a kshaya month can occur every 19, 46, 65, 76, 122 or 141 years. Indeed, Saha and Lahiri’s tabulation provide us with the following frequencies of occurrences for gaps between kshaya months <span class="citation" data-cites="saha1992report">(Saha and Lahiri 1992, 250)</span>:</p>
<div id="tbl-kshaya-gap" class="quarto-float quarto-figure quarto-figure-center anchored">
<figure class="quarto-float quarto-float-tbl figure">
<figcaption class="quarto-float-caption-top quarto-float-caption quarto-float-tbl" id="tbl-kshaya-gap-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Table&nbsp;7: Number of times a particular interval gap occurred
</figcaption>
<div aria-describedby="tbl-kshaya-gap-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<table class="caption-top table">
<thead>
<tr class="header">
<th>Interval</th>
<th>Number of times occuring</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>19</td>
<td>11</td>
</tr>
<tr class="even">
<td>46</td>
<td>3</td>
</tr>
<tr class="odd">
<td>65</td>
<td>1</td>
</tr>
<tr class="even">
<td>76</td>
<td>1</td>
</tr>
<tr class="odd">
<td>122</td>
<td>1</td>
</tr>
<tr class="even">
<td>141</td>
<td>6</td>
</tr>
</tbody>
</table>
</div>
</figure>
</div>
<p>We therefore see that between 525 CE and 1985 CE, kshaya occurred 11 times with a gap of 19 years, thrice with a gap of 46 years, six times with a gap of 141 years, and once each with gaps of 65, 76 and 122 years. The obvious question one would like to ask would be why. Why does kshaya occur only in these gaps?</p>
<p>To answer this better, we re-iterate what causes kshaya in the first place. We already said that a kshaya would occur when two consecutive Sankrantis occur between two Amavasyas. That is to say, when a solar month is shorter in length than, and is completely enclosed by, a (an Amaanta) lunar month. Saha and Lahiri go on to say that the “maximum duration of a lunar month exceeds the lengths of the solar months only in the case of Margasira, Pausa and Magha” <span class="citation" data-cites="saha1992report">(Saha and Lahiri 1992, 250)</span> and that, therefore, kshaya is possible only in these months.</p>
<p>This would explain the solar month part, but what of lunar? How can the lunar month be bigger than the solar month? Ala’a Juwad has some answers; in his article, he suggests that the canonical synodic month, a lunar month between two consecutive phases of the moon, is not constant in length. Indeed, he goes on to say that between 1600 and 2400 CE, the synodic month extends in length from 29 days 6 hours and 31 minutes to 29 days 19 hours and 59 minutes. <span class="citation" data-cites="jawad1993long">(Jawad 1993, 76)</span> Moreover, he says that the “longest lunar months&nbsp;… occur when the date of the new Moon coincides with apogee”.<span class="citation" data-cites="jawad1993long">(Jawad 1993, 76)</span> A brute-force search for the longest synodic month definitely won’t give us a kshaya; for kshaya to occur, the lunar month needs to be only bigger than its solar counterpart and more importantly, completely encompass it. Indeed, Jawad says that the longest synodic month occurred in 1610 CE, a year which occurs within the 141 year long kshaya hiatus between 1540–1541 CE and 1680–81 CE.</p>
<p>We therefore search for other clues to unscramble kshaya. On a purely arithmetic perspective, we observe the following: -</p>
<pre><code>19 = 19 * 1
46 = 19 * 2 + 8
65 = 19 * 3 + 8
76 = 19 * 4
122 = 19 * 6 + 8
141 = 19 * 7 + 8</code></pre>
<p>Is it possible then, that the kshaya month has something to do with the Metonic cycle? The Metonic Cycle is a fairly well documented phenomenon; first observed by the Greek astronomer Metos, every 19 years, the lunar dates overlap with the tropical ones. The underlying mathematical reason is simple: 19 sidereal years contain <code>19*365.242189 = 6939.6</code> solar days, while 235 synodic months (with a mean of 29.53 solar days) contain <code>235*29.530588853 = 6939.68</code> solar days. The lengths overlap. But this obviously is neither necessary nor sufficient; it might be useful for the dates to repeat, but it definitely does not fulfil the requirement for kshaya.</p>
<p>One suggestion therefore, might be that the kshaya occurs when the number of solar days of a sidereal year is equal to that of a synodic month, which in turn is equal to that from an anomalistic month. An anomalistic month is defined to be the time - period between two consecutive perigee passages and has a mean value of 27.55455 days. Taking these average values, we calculate the average values of solar days in whole numbers of synodic and anomalistic months: -</p>
<table class="caption-top table">
<colgroup>
<col style="width: 14%">
<col style="width: 14%">
<col style="width: 14%">
<col style="width: 14%">
<col style="width: 14%">
<col style="width: 14%">
<col style="width: 14%">
</colgroup>
<thead>
<tr class="header">
<th>Interval</th>
<th>Occurrence</th>
<th>Modulo</th>
<th>Solar Year</th>
<th>Synodic Months</th>
<th>Anomalistic Months</th>
<th>Canonical Kshaya Year</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>19</td>
<td>11</td>
<td>1*19</td>
<td>6939.601591</td>
<td>6939.68838</td>
<td>6943.7466</td>
<td>Kshaya</td>
</tr>
<tr class="even">
<td>27</td>
<td>0</td>
<td>1*19+8</td>
<td>9861.539103</td>
<td>9863.216677</td>
<td>9864.5289</td>
<td></td>
</tr>
<tr class="odd">
<td>38</td>
<td>0</td>
<td>2*19</td>
<td>13879.20318</td>
<td>13879.37676</td>
<td>13887.4932</td>
<td></td>
</tr>
<tr class="even">
<td>46</td>
<td>3</td>
<td>2*19+8</td>
<td>16801.14069</td>
<td>16802.90506</td>
<td>16808.2755</td>
<td>Kshaya</td>
</tr>
<tr class="odd">
<td>57</td>
<td>0</td>
<td>3*19</td>
<td>20818.80477</td>
<td>20819.06514</td>
<td>20831.2398</td>
<td></td>
</tr>
<tr class="even">
<td>65</td>
<td>1</td>
<td>3*19+8</td>
<td>23740.74229</td>
<td>23742.59344</td>
<td>23752.0221</td>
<td>Kshaya</td>
</tr>
<tr class="odd">
<td>76</td>
<td>1</td>
<td>4*19</td>
<td>27758.40636</td>
<td>27758.75352</td>
<td>27774.9864</td>
<td>Kshaya</td>
</tr>
<tr class="even">
<td>84</td>
<td>0</td>
<td>4*19+8</td>
<td>30680.34388</td>
<td>30682.28182</td>
<td>30695.7687</td>
<td></td>
</tr>
<tr class="odd">
<td>95</td>
<td>0</td>
<td>5*19</td>
<td>34698.00796</td>
<td>34698.4419</td>
<td>34718.733</td>
<td></td>
</tr>
<tr class="even">
<td>103</td>
<td>0</td>
<td>5*19+8</td>
<td>37619.94547</td>
<td>37621.9702</td>
<td>37639.5153</td>
<td></td>
</tr>
<tr class="odd">
<td>114</td>
<td>0</td>
<td>6*19</td>
<td>41637.60955</td>
<td>41638.13028</td>
<td>41634.92505</td>
<td></td>
</tr>
<tr class="even">
<td>122</td>
<td>1</td>
<td>6*19+8</td>
<td>44559.54706</td>
<td>44561.65858</td>
<td>44555.70735</td>
<td>Kshaya</td>
</tr>
<tr class="odd">
<td>133</td>
<td>0</td>
<td>7*19</td>
<td>48577.21114</td>
<td>48577.81866</td>
<td>48578.67165</td>
<td></td>
</tr>
<tr class="even">
<td>141</td>
<td>6</td>
<td>7*19+8</td>
<td>51499.14865</td>
<td>51501.34696</td>
<td>51499.45395</td>
<td>Kshaya</td>
</tr>
</tbody>
</table>
<p>Broadly speaking, we might summarize the above table as thus: - for the most part, the number of solar days in solar years, synodic and anomalistic months overlap in kshaya years. However, this overlap doesn’t occur only in kshaya years; as the table shows, there’s an overlap for 133 years as well. Does this, then, explain the kshaya phenomenon? We might summarize it as being strongly suggestive, but definitely not conclusive.</p>
<section id="treatment-of-kshaya-months" class="level3">
<h3 class="anchored" data-anchor-id="treatment-of-kshaya-months">6.1 Treatment of Kshaya Months</h3>
<p>We may complete our discussion of kshaya months by describing the three Kshaya Schools of thought. <span class="citation" data-cites="chatterjee1988indian">(Chatterjee 1988, 37–40)</span></p>
<p>The <em>North Western School</em> is followed in the north-western part of the country, presumably in Gujarat and/ or Rajasthan, where the lunisolar calendar is used. Essentially, the North Western School treats the adhika month before kshaya as a normal month and the one after the kshaya month to be intercalary.</p>
<p>This contrasts with the <em>Eastern School</em> where the reverse is followed; the adhika month before the kshaya is deemed intercalary, while the one after it is deemed normal. The Eastern School is followed in the eastern parts of the country, where the lunisolar calendar is followed.</p>
<p>The final of the trio, the <em>Southern School</em>, treats both adhika maasas as intercalary, instead reckoning the kshaya month as a “jugma”, i.e., the first half of the thithi of this month is deemed to be that of the first month, and the second half as that of the second month. This is presumably followed in the Southern parts of the country where the lunisolar calendar is followed.</p>
</section>
</section>
<section id="epilogue" class="level2">
<h2 class="anchored" data-anchor-id="epilogue">7. Epilogue</h2>
<p><em>By this time, onlookers all sides gathered around the two. They were attentively listening to the conversation between them. Along with Apara Ganita, they were waiting for the dwara palika to ask once again. But she didn’t. She stood and smiled. Her face was radiant, glowing like the moon on a Purnima and the harsh summer sun entering the Mithuna raasi.</em></p>
<p><em>She still said nothing. She got up and walked away from the crowd. Still smiling. Still graceful.</em></p>
<p><em>The sparks came slowly, but suddenly. All around them, the landscape was changing. The gate was melting into the walls, the walls into the ground. The ground was changing into grass, the grass covering the entire ground.</em></p>
<p><em>Except the ground underneath Apara Ganita. He found himself standing on an elevated podium, facing listeners all around him, all waiting to hear him speak.</em></p>
<p><em>For once, he didn’t know what to say.</em></p>
</section>
<section id="references" class="level2">
<h2 class="anchored" data-anchor-id="references">8. References</h2>
<div id="refs" class="references csl-bib-body hanging-indent">
<div id="ref-abhayankar1993debts" class="csl-entry">
Abhayankar, KD. 1993. <span>“Our Debts to Our Ancestors.”</span> In <em>Treasures of Ancient Indian Astronomy</em>, edited by KD Abhayankar and Dr. BG Sidharth. Ajanta Publications, Delhi.
</div>
<div id="ref-chakravarty1985indian" class="csl-entry">
Chakravarty, Apurba Kumar, and SK Chatterjee. 1985. <span>“Indian Calendar from Post-Vedic Period to AD 1900.”</span> In <em>History of Astronomy in India</em>. Indian National Science Academy.
</div>
<div id="ref-chatterjee1988indian" class="csl-entry">
Chatterjee, SK. 1988. <em>Indian Calendric System</em>. Publications Division, Ministry of Information; Broadcasting, Government of India.
</div>
<div id="ref-deshowitz2002calendar" class="csl-entry">
Dershowitz, Nachum, and Reingold. 2002. <em>Calendar Tabulations - 1900 to 2200</em>. Cambridge University Press.
</div>
<div id="ref-deshowitz2001calendrical" class="csl-entry">
Deshowitz, Nachum, and Edward M Reingold. 2001. <em>Calendrical Computations: The Millennium Edition</em>. Cambridge Univeristy Press, Cambridge.
</div>
<div id="ref-jawad1993long" class="csl-entry">
Jawad, Ala’a H. 1993. <span>“How Long Is a Lunar Month?”</span> <em>Sky and Telescope</em>.
</div>
<div id="ref-purewal" class="csl-entry">
Purewal, Pal Singh. 2002. <span>“Nanakshahi Samat.”</span> <a href="http://www.sikh.net/sikhism/Nanakshahi.htm">http://www.sikh.net/sikhism/Nanakshahi.htm</a>.
</div>
<div id="ref-saha1992report" class="csl-entry">
Saha, MH, and NC Lahiri. 1992. <em>Report of the Calendar Reform Committee</em>. Council of Scientific; Industrial Research, New Delhi.
</div>
<div id="ref-sarma2002interview" class="csl-entry">
Sivasri Sarma, Madugula. 2002. <em>Interview by Author</em>. Hyderabad, India.
</div>
<div id="ref-simonfraser" class="csl-entry">
University, Simon Fraser. 2002. <span>“Bhaskaracharya.”</span> <a href="http://www.math.sfu.ca/histmath/India/12thCenturyAD/Bhaskara.html">http://www.math.sfu.ca/histmath/India/12thCenturyAD/Bhaskara.html</a>.
</div>
</div>
</section>
<section id="appendix" class="level2">
<h2 class="anchored" data-anchor-id="appendix">9. Appendix</h2>
<div class="cell" data-execution_count="8">
<div id="tbl-kshaya-timings" class="cell quarto-float quarto-figure quarto-figure-center anchored" data-execution_count="8">
<figure class="quarto-float quarto-float-tbl figure">
<figcaption class="quarto-float-caption-top quarto-float-caption quarto-float-tbl" id="tbl-kshaya-timings-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Table&nbsp;8: Sankranti and Amavasya timings from Margasira, Pausa, Magha and Phalguna for various years.
</figcaption>
<div aria-describedby="tbl-kshaya-timings-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div class="cell-output cell-output-display" data-execution_count="8">
<table class="cell caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th></th>
<th style="text-align: left;">Indic Solar (Saka Era)</th>
<th style="text-align: left;">Gregorian (CE)</th>
<th style="text-align: left;">Indic Lunar (Vikrama Era)</th>
<th style="text-align: left;">Leap Month?</th>
<th style="text-align: left;">Leap Day?</th>
<th style="text-align: left;">Sankranti</th>
<th style="text-align: left;">Amavasya</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>0</td>
<td style="text-align: left;">1237/8/1</td>
<td style="text-align: left;">1315/11/6</td>
<td style="text-align: left;">1372/8/1</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">07:50:07.603</td>
<td style="text-align: left;">05:47:04.872</td>
</tr>
<tr class="even">
<td>1</td>
<td style="text-align: left;">1237/9/1</td>
<td style="text-align: left;">1315/12/5</td>
<td style="text-align: left;">1372/8/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">19:36:46.043</td>
<td style="text-align: left;">19:48:11.479</td>
</tr>
<tr class="odd">
<td>2</td>
<td style="text-align: left;">1256/9/1</td>
<td style="text-align: left;">1334/12/5</td>
<td style="text-align: left;">1391/8/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">17:36:21.429</td>
<td style="text-align: left;">11:17:01.381</td>
</tr>
<tr class="even">
<td>3</td>
<td style="text-align: left;">1256/10/1</td>
<td style="text-align: left;">1335/1/3</td>
<td style="text-align: left;">1391/9/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">01:14:16.038</td>
<td style="text-align: left;">03:48:04.528</td>
</tr>
<tr class="odd">
<td>4</td>
<td style="text-align: left;">1302/8/1</td>
<td style="text-align: left;">1380/11/5</td>
<td style="text-align: left;">1437/8/30</td>
<td style="text-align: left;">True</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">03:29:37.170</td>
<td style="text-align: left;">02:34:46.447</td>
</tr>
<tr class="even">
<td>5</td>
<td style="text-align: left;">1302/9/1</td>
<td style="text-align: left;">1380/12/5</td>
<td style="text-align: left;">1437/8/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">15:16:26.115</td>
<td style="text-align: left;">21:15:12.204</td>
</tr>
<tr class="odd">
<td>6</td>
<td style="text-align: left;">1321/9/1</td>
<td style="text-align: left;">1399/12/6</td>
<td style="text-align: left;">1456/8/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">13:16:01.519</td>
<td style="text-align: left;">07:32:11.950</td>
</tr>
<tr class="even">
<td>7</td>
<td style="text-align: left;">1321/10/1</td>
<td style="text-align: left;">1400/1/4</td>
<td style="text-align: left;">1456/9/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">20:53:56.115</td>
<td style="text-align: left;">00:39:59.510</td>
</tr>
<tr class="odd">
<td>8</td>
<td style="text-align: left;">1397/10/1</td>
<td style="text-align: left;">1476/1/6</td>
<td style="text-align: left;">1532/9/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">12:52:28.218</td>
<td style="text-align: left;">11:39:20.696</td>
</tr>
<tr class="even">
<td>9</td>
<td style="text-align: left;">1397/11/1</td>
<td style="text-align: left;">1476/2/4</td>
<td style="text-align: left;">1532/10/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">23:36:42.517</td>
<td style="text-align: left;">00:05:00.597</td>
</tr>
<tr class="odd">
<td>10</td>
<td style="text-align: left;">1443/8/1</td>
<td style="text-align: left;">1521/11/9</td>
<td style="text-align: left;">1578/8/30</td>
<td style="text-align: left;">True</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">15:07:49.331</td>
<td style="text-align: left;">14:22:17.756</td>
</tr>
<tr class="even">
<td>11</td>
<td style="text-align: left;">1443/9/1</td>
<td style="text-align: left;">1521/12/8</td>
<td style="text-align: left;">1578/8/29</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">True</td>
<td style="text-align: left;">02:54:38.328</td>
<td style="text-align: left;">09:59:51.334</td>
</tr>
<tr class="odd">
<td>12</td>
<td style="text-align: left;">1462/9/1</td>
<td style="text-align: left;">1540/12/8</td>
<td style="text-align: left;">1597/8/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">00:54:13.716</td>
<td style="text-align: left;">17:36:31.986</td>
</tr>
<tr class="even">
<td>13</td>
<td style="text-align: left;">1462/10/1</td>
<td style="text-align: left;">1541/1/7</td>
<td style="text-align: left;">1597/9/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">08:32:08.341</td>
<td style="text-align: left;">12:29:37.136</td>
</tr>
<tr class="odd">
<td>14</td>
<td style="text-align: left;">1603/9/1</td>
<td style="text-align: left;">1681/12/10</td>
<td style="text-align: left;">1738/9/1</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">12:32:25.884</td>
<td style="text-align: left;">05:14:33.480</td>
</tr>
<tr class="even">
<td>15</td>
<td style="text-align: left;">1603/10/1</td>
<td style="text-align: left;">1682/1/8</td>
<td style="text-align: left;">1738/9/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">20:10:20.531</td>
<td style="text-align: left;">01:11:37.994</td>
</tr>
<tr class="odd">
<td>16</td>
<td style="text-align: left;">1744/9/1</td>
<td style="text-align: left;">1822/12/13</td>
<td style="text-align: left;">1879/8/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">00:10:27.526</td>
<td style="text-align: left;">17:52:00.161</td>
</tr>
<tr class="even">
<td>17</td>
<td style="text-align: left;">1744/9/1</td>
<td style="text-align: left;">1822/12/13</td>
<td style="text-align: left;">1879/8/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">00:10:27.526</td>
<td style="text-align: left;">17:52:00.161</td>
</tr>
<tr class="odd">
<td>18</td>
<td style="text-align: left;">1744/10/1</td>
<td style="text-align: left;">1823/1/12</td>
<td style="text-align: left;">1879/9/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">07:48:32.677</td>
<td style="text-align: left;">13:46:57.632</td>
</tr>
<tr class="even">
<td>19</td>
<td style="text-align: left;">1744/10/1</td>
<td style="text-align: left;">1823/1/12</td>
<td style="text-align: left;">1879/9/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">07:48:32.677</td>
<td style="text-align: left;">13:46:57.632</td>
</tr>
<tr class="odd">
<td>20</td>
<td style="text-align: left;">1763/9/1</td>
<td style="text-align: left;">1841/12/13</td>
<td style="text-align: left;">1898/9/1</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">22:10:02.920</td>
<td style="text-align: left;">02:02:04.954</td>
</tr>
<tr class="even">
<td>21</td>
<td style="text-align: left;">1763/10/1</td>
<td style="text-align: left;">1842/1/11</td>
<td style="text-align: left;">1898/9/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">05:48:08.110</td>
<td style="text-align: left;">20:30:22.804</td>
</tr>
<tr class="odd">
<td>22</td>
<td style="text-align: left;">1763/11/1</td>
<td style="text-align: left;">1842/2/10</td>
<td style="text-align: left;">1898/10/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">16:32:11.852</td>
<td style="text-align: left;">16:06:10.978</td>
</tr>
<tr class="even">
<td>23</td>
<td style="text-align: left;">1763/12/1</td>
<td style="text-align: left;">1842/3/12</td>
<td style="text-align: left;">1898/11/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">12:14:30.094</td>
<td style="text-align: left;">10:53:27.932</td>
</tr>
<tr class="odd">
<td>24</td>
<td style="text-align: left;">1790/9/1</td>
<td style="text-align: left;">1868/12/13</td>
<td style="text-align: left;">1925/09/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">21:50:32.239</td>
<td style="text-align: left;">06:09:24.227</td>
</tr>
<tr class="even">
<td>25</td>
<td style="text-align: left;">1790/10/1</td>
<td style="text-align: left;">1869/1/11</td>
<td style="text-align: left;">1925/10/29</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">05:28:37.402</td>
<td style="text-align: left;">23:17:43.494</td>
</tr>
<tr class="odd">
<td>26</td>
<td style="text-align: left;">1790/11/1</td>
<td style="text-align: left;">1869/2/10</td>
<td style="text-align: left;">1925/11/29</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">16:12:41.144</td>
<td style="text-align: left;">18:05:11.108</td>
</tr>
<tr class="even">
<td>27</td>
<td style="text-align: left;">1790/12/1</td>
<td style="text-align: left;">1869/3/12</td>
<td style="text-align: left;">1925/12/29</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">11:54:48.881</td>
<td style="text-align: left;">13:00:01.825</td>
</tr>
<tr class="odd">
<td>28</td>
<td style="text-align: left;">1809/9/1</td>
<td style="text-align: left;">1887/12/14</td>
<td style="text-align: left;">1944/09/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">19:50:18.190</td>
<td style="text-align: left;">00:36:07.304</td>
</tr>
<tr class="even">
<td>29</td>
<td style="text-align: left;">1809/10/1</td>
<td style="text-align: left;">1888/1/12</td>
<td style="text-align: left;">1944/10/29</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">03:28:12.797</td>
<td style="text-align: left;">13:35:00.591</td>
</tr>
<tr class="odd">
<td>30</td>
<td style="text-align: left;">1809/11/1</td>
<td style="text-align: left;">1888/2/11</td>
<td style="text-align: left;">1944/11/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">14:12:16.539</td>
<td style="text-align: left;">04:16:12.013</td>
</tr>
<tr class="even">
<td>31</td>
<td style="text-align: left;">1809/12/1</td>
<td style="text-align: left;">1888/3/12</td>
<td style="text-align: left;">1944/12/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">09:54:34.781</td>
<td style="text-align: left;">20:22:28.399</td>
</tr>
<tr class="odd">
<td>32</td>
<td style="text-align: left;">1820/9/1</td>
<td style="text-align: left;">1898/12/14</td>
<td style="text-align: left;">1955/09/01</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">19:50:18.190</td>
<td style="text-align: left;">00:36:07.304</td>
</tr>
<tr class="even">
<td>33</td>
<td style="text-align: left;">1820/10/1</td>
<td style="text-align: left;">1899/1/12</td>
<td style="text-align: left;">1955/10/01</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">23:46:54.268</td>
<td style="text-align: left;">04:05:28.667</td>
</tr>
<tr class="odd">
<td>34</td>
<td style="text-align: left;">1820/11/1</td>
<td style="text-align: left;">1899/2/11</td>
<td style="text-align: left;">1955/11/01</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">10:31:08.567</td>
<td style="text-align: left;">14:31:57.701</td>
</tr>
<tr class="even">
<td>35</td>
<td style="text-align: left;">1820/12/1</td>
<td style="text-align: left;">1899/3/12</td>
<td style="text-align: left;">1955/12/01</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">06:13:16.303</td>
<td style="text-align: left;">00:51:14.516</td>
</tr>
<tr class="odd">
<td>36</td>
<td style="text-align: left;">1866/9/1</td>
<td style="text-align: left;">1944/12/15</td>
<td style="text-align: left;">2001/09/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">13:49:04.331</td>
<td style="text-align: left;">19:41:30.672</td>
</tr>
<tr class="even">
<td>37</td>
<td style="text-align: left;">1866/10/1</td>
<td style="text-align: left;">1945/01/13</td>
<td style="text-align: left;">2001/10/29</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">21:27:09.517</td>
<td style="text-align: left;">10:16:11.944</td>
</tr>
<tr class="odd">
<td>38</td>
<td style="text-align: left;">1866/11/1</td>
<td style="text-align: left;">1945/02/12</td>
<td style="text-align: left;">2001/11/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">08:11:13.259</td>
<td style="text-align: left;">22:40:48.473</td>
</tr>
<tr class="even">
<td>39</td>
<td style="text-align: left;">1866/12/1</td>
<td style="text-align: left;">1945/03/13</td>
<td style="text-align: left;">2001/12/29</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">03:53:20.996</td>
<td style="text-align: left;">09:06:03.927</td>
</tr>
<tr class="odd">
<td>40</td>
<td style="text-align: left;">1885/9/1</td>
<td style="text-align: left;">1963/12/16</td>
<td style="text-align: left;">2020/09/01</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">11:48:39.726</td>
<td style="text-align: left;">06:32:25.892</td>
</tr>
<tr class="even">
<td>41</td>
<td style="text-align: left;">1885/9/1</td>
<td style="text-align: left;">1963/12/16</td>
<td style="text-align: left;">2020/09/01</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">11:48:39.726</td>
<td style="text-align: left;">06:32:25.892</td>
</tr>
<tr class="odd">
<td>42</td>
<td style="text-align: left;">1885/10/1</td>
<td style="text-align: left;">1964/01/14</td>
<td style="text-align: left;">2020/09/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">19:26:34.354</td>
<td style="text-align: left;">01:20:25.252</td>
</tr>
<tr class="even">
<td>43</td>
<td style="text-align: left;">1885/10/1</td>
<td style="text-align: left;">1964/01/14</td>
<td style="text-align: left;">2020/09/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">19:26:34.354</td>
<td style="text-align: left;">01:20:25.252</td>
</tr>
<tr class="odd">
<td>44</td>
<td style="text-align: left;">1885/11/1</td>
<td style="text-align: left;">1964/02/12</td>
<td style="text-align: left;">2020/11/29</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">06:10:38.096</td>
<td style="text-align: left;">17:47:57.629</td>
</tr>
<tr class="even">
<td>45</td>
<td style="text-align: left;">1885/12/1</td>
<td style="text-align: left;">1964/03/13</td>
<td style="text-align: left;">2020/12/29</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">01:52:56.390</td>
<td style="text-align: left;">07:20:04.127</td>
</tr>
<tr class="odd">
<td>46</td>
<td style="text-align: left;">1904/10/01</td>
<td style="text-align: left;">1983/01/14</td>
<td style="text-align: left;">2039/09/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">17:26:09.739</td>
<td style="text-align: left;">09:03:57.421</td>
</tr>
<tr class="even">
<td>47</td>
<td style="text-align: left;">1904/11/01</td>
<td style="text-align: left;">1983/02/12</td>
<td style="text-align: left;">2039/10/30</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">False</td>
<td style="text-align: left;">04:10:13.481</td>
<td style="text-align: left;">04:45:33.318</td>
</tr>
</tbody>
</table>
</div>
</div>
</figure>
</div>
</div>
<hr>


</section>


<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p><em>Suvrnapuri</em> = City of Gold↩︎</p></li>
<li id="fn2"><p><em>Apara Ganita</em> = One with a lot of mathematical talent.↩︎</p></li>
<li id="fn3"><p><em>saakshya</em> = witness (in Sanskrit)↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>mathematics</category>
  <category>astronomy</category>
  <category>calendar</category>
  <guid>https://metamutator.github.io/posts/panchanga-tantra/panchanga_tantra.html</guid>
  <pubDate>Sun, 23 Jul 2023 00:00:00 GMT</pubDate>
  <media:content url="https://metamutator.github.io/posts/panchanga-tantra/kala-chakra.png" medium="image" type="image/png" height="130" width="144"/>
</item>
<item>
  <title>Bonjour Tout Le Monde!</title>
  <dc:creator>Akshay Regulagedda</dc:creator>
  <link>https://metamutator.github.io/posts/hello-world/hello.html</link>
  <description><![CDATA[ 





<p><img src="https://metamutator.github.io/posts/hello-world/hello_world.jpg" class="img-fluid" alt="Hello"> Photo by <a href="https://unsplash.com/@artturijalli?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Artturi Jalli</a> on <a href="https://unsplash.com/photos/g5_rxRjvKmg?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></p>
<section id="executive-summary" class="level2">
<h2 class="anchored" data-anchor-id="executive-summary">Executive Summary</h2>
<p>At long last, we have finally re-launched a new blog at great expense. I’m writing this in Markdown in Visual Studio Code, but can choose to add in visualisations or AI results through code-chunks. I can even write mathematical equations such as this easily: <img src="https://latex.codecogs.com/png.latex?f(c)=%5Cdfrac%7B1%7D%7Bb%E2%88%92a%7D%E2%88%AB%5Eb_af(x)%5C,dx.%20%5Cnonumber%20"></p>
<p>(That’s the equation for the Mean Value Theorem, if you’re wondering)</p>
<p>When I’m done, I push the changes to Github Pages, which through the magic of Quarto, somehow publishes it for free under my own quirky domain. I control my content fully, and choose to move it anywhere I want to.</p>
<p>Here’s how I did it.</p>
</section>
<section id="the-setup" class="level2">
<h2 class="anchored" data-anchor-id="the-setup">The Setup</h2>
<p>I’ve set this blog up using the <a href="https://quarto.org">Quarto</a> framework, which is a new way of writing documents that are a mix of code and text. It’s like Jupyter Notebooks, but with a lot more flexibility. The official documentation was reasonably clear, but really, the crux was to publish it to <em>Github Pages</em>. Albert Rapp’s <a href="https://albert-rapp.de/posts/13_quarto_blog_writing_guide/13_quarto_blog_writing_guide.html">guide</a> was very helpful in this regard, as was Bea Milz’s <a href="https://beamilz.com/posts/2022-06-05-creating-a-blog-with-quarto/en/">10 step formulation</a> Some bits over and above Quarto’s official documentation include getting comments (look below), and also setting up a newsletter (to be done). Lots of good content there, won’t be repeating it here. Instead, let me tell you about features and gotchas.</p>
</section>
<section id="the-features" class="level2">
<h2 class="anchored" data-anchor-id="the-features">The Features</h2>
<section id="comments" class="level3">
<h3 class="anchored" data-anchor-id="comments">1. Comments</h3>
<p>I have set up comments using <a href="https://utteranc.es/">Utterances</a>. It’s a free open-source service that uses Github Issues to store comments. You can see the comments on the bottom of this page. Pretty neat, <em>non</em> ?</p>
</section>
<section id="search" class="level3">
<h3 class="anchored" data-anchor-id="search">2. Search</h3>
<p>Just love the built-in search in Quatro. Simple but works.</p>
</section>
<section id="visual-studio-code" class="level3">
<h3 class="anchored" data-anchor-id="visual-studio-code">3. Visual Studio Code</h3>
<p>Now this is mainly for me, but I don’t have to context-switch away from Visual Studio Code just to make a post. In fact, I can even write code in the same document, and it will be executed and the results shown. This also means… I have AI enabled automatically, through GitHub Copilot. Not that it’s helpful, mind you, in fact, for long-form writing, it’s quite annoying. But hey, it exists, and is particularly helpful in all those settings files, and of course, code-chunks.</p>
</section>
<section id="code-chunks" class="level3">
<h3 class="anchored" data-anchor-id="code-chunks">4. Code Chunks</h3>
<p>Need I say more? How cool is this, that I can just write this and it’ll be executed inline?</p>
<div class="cell" data-execution_count="1">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode numberSource python number-lines code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Hello World!"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Hello World!</code></pre>
</div>
</div>
</section>
<section id="table-of-contents" class="level3">
<h3 class="anchored" data-anchor-id="table-of-contents">5. Table of Contents</h3>
<p>See the nice bar to the right listing down all the sections? That’s the Table of Contents. It’s automatically generated, and is a nice way to navigate through the document.</p>
</section>
<section id="internationalisation" class="level3">
<h3 class="anchored" data-anchor-id="internationalisation">6. Internationalisation</h3>
<p>తెలుగు, తదితర భాషలలో కూడా సునాయాసంగా టపాయించచ్చు! Je peux facilement écrire en français aussi!</p>
</section>
</section>
<section id="the-gotchas" class="level2">
<h2 class="anchored" data-anchor-id="the-gotchas">The Gotchas</h2>
<p>It’s not all roses though, there are a few gotchas too.</p>
<section id="rss-feed" class="level3">
<h3 class="anchored" data-anchor-id="rss-feed"><del>1. RSS Feed</del></h3>
<p><del>The RSS feed somehow <em>should</em> work, but doesn’t. I’m still trying to figure out why.</del> Fixed it.</p>
</section>
<section id="posting-comments" class="level3">
<h3 class="anchored" data-anchor-id="posting-comments">2. Posting Comments</h3>
<p>You need to have a GitHub account to post comments. I’m not sure if that’s a good thing or a bad thing for you; it certainly is a good thing for me, as I can leverage on GitHub’s plumbing to manage comments. It also acts as a sort of gatekeeper for spam, for now at least.</p>
<p>Also, I really really REALLY wanted <a href="https://giscus.app/">Giscus</a> to work, but it doesn’t. Comments on one page show up on all pages. I’m not sure why; presuming it’s a settings thing, but I can’t figure out how to fix it.</p>
<p>Instead, I’m using <a href="https://utteranc.es/">Utterances</a>, which is a free open-source service that uses Github Issues to store comments. Same-same for you, but different for me in that Giscus uses GitHub Discussions and not Issues. Ah well.</p>
</section>
<section id="no-wysiwyg" class="level3">
<h3 class="anchored" data-anchor-id="no-wysiwyg">3. No WYSIWYG</h3>
<p>There’s no WYSIWYG editor, so you have to write in Markdown. I don’t mind it, but you might.</p>
</section>
<section id="executing-python-code-chunks" class="level3">
<h3 class="anchored" data-anchor-id="executing-python-code-chunks">4. Executing Python code-chunks</h3>
<p>Oh boy, this one was a doozy.</p>
<p>So the main attraction for Quarto/ QMD is that you can write code-chunks in any language, and it’ll be executed and the results shown. However, in Python, I typically create a new conda virtual environment for each project, with a limited set of packages for that project. Now, in the Visual Studio Code - Jupyter notebook world, this is crystal-clear; there’s a convenient dropdown to select the environment. But in Quarto, it’s not so clear.</p>
<p>This is made even harder by the fact that the Quarto plug-in for Visual Studio Code pops up an interactive window when you execute a code-chunk. And that window somehow <em>does</em> have a dropdown to select the environment. But hitting Render on the QMD file doesn’t use that selected environment. Instead, you need to hit command/ctrl-shift-p and select the environment there.</p>
<p>It’s all listed in this <a href="https://github.com/quarto-dev/quarto/issues/27">issue</a> raised in August 2022. Some helpful checks there too. If you hit an error reading the following:</p>
<p><code>No module named 'nbformat'</code></p>
<p>.. then it’s very likely that Quarto is referencing the wrong Python executable. On Macs, this is likely to be the flavour that comes with the OS, <em>not</em> Miniconda/ Anaconda or the environment you just chose. You can check on that by running the following in a code-chunk:</p>
<p><code>import sys</code></p>
<p><code>print(sys.executable)</code></p>
<p>If the output (in the render) is not the virtual environment you expect, then you know what the problem is. Hit command/ctrl-shift-p and select the right environment.</p>
</section>
</section>
<section id="conclusion" class="level2">
<h2 class="anchored" data-anchor-id="conclusion">Conclusion</h2>
<p>So there you have it. A new blog, with all the bells and whistles, and a few gotchas. I’m sure I’ll find more as I go along, but for now, I’m partying like it’s 1999.</p>


</section>

 ]]></description>
  <category>quarto</category>
  <category>hello-world</category>
  <category>setup</category>
  <category>english</category>
  <guid>https://metamutator.github.io/posts/hello-world/hello.html</guid>
  <pubDate>Fri, 21 Jul 2023 00:00:00 GMT</pubDate>
  <media:content url="https://metamutator.github.io/posts/hello-world/hello_world.jpg" medium="image" type="image/jpeg"/>
</item>
</channel>
</rss>
