Skip to content
This repository has been archived by the owner on Nov 16, 2024. It is now read-only.

Decoding scheme for katapayadi number system used by mathematicians of India

License

Notifications You must be signed in to change notification settings

vinayakakv/katapayadi_decoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deprecated in favour of Akshara

katapayadi_decoder

Kaṭapayādi system is a character to number encoding scheme, which was developed and used by mathematicians of India to encode large numbers into meaningful, and easy-to-remember verses. Read more about it at blog. Its demo is available here

Implementation details

This decoder depends on Kannada Tokenizer. Therefore it is possible to decode the text only in Kannada script. However, it is possible to use a transliteration service, such as Aksharamukha to first convert any script into Kannada, and then apply the decoding operation.

Including the script in your webpage

The decoder is written as a ES6 Module, which you need to import in your code. This can be done as follows.

<script type="module">
        import { katapayadi_decode } from "https://cdn.jsdelivr.net/gh/vinayakakv/katapayadi_decoder@1.0.0/katapayadi_decoder.js"
        .
        .
        .
</script>

Documentation

katapayadi_decode(String) -> String

  • Input is a string in Kannada Script
  • Output is a string of numbers decoded according to Kaṭapayādi scheme

Examples

You can see a demo webpage at project site, whose source code is available at index.html.

Contributing

You can contribute to this repository by two means

  1. Source code improvements -- Improving the decoder and companion webpage
  2. Adding more examples to examples.json

Adding examples

examples.json is a list of example objects consisting of 3 fields

  1. verse - A string consiting of Kaṭapayādi-encoded value. Each number has to be seperated by a comma(,). The lines of the verse should be seperated by newline(\n).
  2. description - A string containing description about the verse. This string can include valid HTML tags to support formatting. For links (<a>), remember to use (target="_blank") in order to prevent them opening in same tab.
  3. reverse - A boolean (either true or false) indicating whether or not to apply reversing to the numbers after decoding.