Skip to content

Instantly share code, notes, and snippets.

@dyrroth-11
Last active August 24, 2021 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dyrroth-11/935ce9af224d545cd3b1adb87a1795e0 to your computer and use it in GitHub Desktop.
Save dyrroth-11/935ce9af224d545cd3b1adb87a1795e0 to your computer and use it in GitHub Desktop.
GSoC'21@ Project WikiLoop - Final Report (Tibetan calendar Project - Ashish Patel)

Google Summer of Code 2021 Final report

GSOC Banner

As all good things always come to an end, Google Summer of Code 2021 is no such exception. Learning & Working with Open Source Organisation is an awesome endeavour that all people must try once. I am very happy that I was selected in Project WikiLoop for my GSOC project Adding Tibetan Calendar in Unicode Common Locale Data Repository (CLDR) and International Components for Unicode (ICU) library. I would like to report my work here.

About Project WikiLoop

GSOC Banner WikiLoop is an umbrella program for a series of technical projects intended to contribute datasets and editor tools from the technical industry back to open knowledge world. This program was originally conceived as a virtuous circle: providing data and tools to enhance human editor's productivity, and making the Wikipedia editorial input more machine-readable for open knowledge institutions, academia and researchers interested in advancing machine learning technology. It originated at Google as the missing link in the data loop: the Knowledge Graph relies on the open knowledge source to be healthy. This is the reason why the program focuses its efforts on tools that can improve the content quality of Wikipedia.

Project Title - Adding Tibetan Calendar in Unicode Common Locale Data Repository (CLDR) and International Components for Unicode (ICU) library

Student - Ashish Patel

Mentor - Elie Roux

Project description :

The goal of the project was to create some code for International Components for Unicode (ICU) Library that compute dates in Tibetan calendar and also to create a new locale and add some metadata to Unicode Common Locale Data Repository(CLDR) to ensure that CLDR can represent the Tibetan calendars and dates.

During the course of the project our primary focus was on two widespread types of Tibetan calendar calculations, Phugpa and Tsurphu.

About Tibetan Calendar and the Implemenation:

The Tibetan calendar is a lunisolar calendar used in the Tibetic Cultural area (China, India, Nepal, Bhutan, Mongolia). Its months are based on the regular cycle of the Moon's phases, but some additional intercalation rules are used to bring it into a rough agreement with the solar year and thus with the seasons. Therefore the typical sequence of days of the month in a Tibetan calendar is not a simple sequence of numbers, but instead has duplicated (leap) day numbers, and omitted ones. Here's for instance the sequence of days for the first month of 2021 in the Phugpa calendar:

1 (12 Feb 2021)
2

7
8
8 (leap)
9
...
18
20 (no 19)
21
...

So, the two intercalation patterns for days:

  1. Leap day : GSOC Banner
  2. Omitted day : GSOC Banner

The implementation of the calendar is based on the book "Kalacakra and the Tibetan Calendar" by Edward Henning. The major challenge during the implementation was to deal with leap days because the current calendar class of icu4c does not have a leap day field. We've used a +64 encoding for storing leap day and leap month info that do not require any additional calendar field.

Links to work done :

  1. This Pull Request attempts to add support for the Tibetan calendar (Phagpha & Tsurphu) in ICU4C.

  2. This Pull Request targets adding Tibetan calendar types (tibetan-phugpa and tibetan-tsurphu) to CLDR, which also completes this ticket

  3. In my fork of the icu repository, there are two different branches for tibetan calendar, which indicates different aspects of my work done.

Future Plan :

As the pull request to ICU will be inspected in the long run, I would make any changes/improvements requested by the ICU. I will also be in contact with my project mentor Elie Sir and try to help him further into the project.

Further Improvements :

These are some further improvements that can be made :

  1. Add other calendar calculations :
  • Calculations using modern astronomy.
  • Calendars from Amdo using astronomical calculations from Kepler.
  • Sherab Ling methods
  • Zhonnu Pal's corrected calculations.
  1. Build a polyfill for JavaScript's Intl.DateTimeFormat by converting Tibetan calendar's C Module to WebAssembly using "emscripten", that can directly be used by websites.

Conclusion :

It's a truly amazing experience for me to work for Project WikiLoop. Specially thanks for Project WikiLoop's Tibetan Initiative for providing me the opportunity to work on the Tibetan calendar project. The project will benefit millions of Tibetan people, It will also give us an option to display dates using the traditional Tibetan calendar instead of the Tibetan translation of the Gregorian date as it presently is. Also, thanks to the entire GSoC community for providing such an amazing environment to let me enjoy coding all summer long.

Acknowledgement :

First of all, I convey my thanks to Google for organizing this event of massive learning, networking, and experiencing the development of open-source software. I would like to thank everyone for helping me through the project. Also, I would like to express my especial thankfulness to my mentor Mr Elie Roux, I received a lot of help from him during the whole process of Google Summer of Code. Whenever I got into trouble, He would always provide useful help to me. I thank all the student developers to make this program successful, my friends and seniors for their continuous help and support, and my Parents for their belief, guidance, and support in all my endeavors.

Contact me here :

References :

  • "Kalacakra and the Tibetan Calendar" by E. Henning, which is the main English source for traditional calculations.
  • Tibetan Calendar Mathematics by Svante Janson (modern calculations of Phugpa)
  • "Calendrical Calculations", by Nachum Dershowitz and Edward M. Reingold, It is an important read to understand the context of luni-solar calendars and the importance of this project
  • http://kalacakra.org/ (by E. Henning) has a lot of resources for traditional calendar calculations, including very complete tables (ex) that can be used to test the accuracy of the code at a large scale, it also contains C code using traditional calculations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment