Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Commit for Vidyut-Chandas #82

Closed
wants to merge 8 commits into from

Conversation

MSSRPRAD
Copy link
Contributor

@MSSRPRAD MSSRPRAD commented Nov 18, 2023

Added JSON data files and the code to parse them using serde. Added basic structs for Aksharas, Input, etc. Minimal structs for matching because I didn't know how to proceed.

Think it's a good starting point overall. Probably code organisation is bad (overusing pub for example)....

Added initial JSON data files and implemented serde for parsing. Introduced basic structs for Aksharas, Input, etc. Minimal structs for matching because I didn't know how to proceed.

Think it's a good starting point overall. Probably code organisation is bad (pub vs private methods/structs)....
@MSSRPRAD
Copy link
Contributor Author

LGTM

@MSSRPRAD MSSRPRAD changed the title Initial Commit Initial Commit for Vidyut-Chandas Nov 18, 2023
Rustfmt giving weird error and refusing to format when the keyword 'crate' is used.
…ad of doing .chars().nth() each time.

Not sure about whether I am handling the last syllable properly.
Implemented the correct to_aksharas function which groups the characters and also finds the G-L scheme.
@akprasad
Copy link
Contributor

Thank you very much for your PR! Forgive my very delayed response.

I've made a few changes on top of this PR, but I want to make a few more before merging so that we have a clean end-to-end API.

I tried pushing on top of this branch but wasn't able to some for reason. Instead, you can find my changes here. Briefly, my changes include:

  • Using simple TSVs instead of JSON, which means that we don't need a heavy dependency on serde and serde_json
  • using name instead names since at this stage, names is extra complexity for little gain
  • simplifying some of the to_aksharas logic
  • adding a few comments here and there
  • simplifying the Chandas API

I'll continue on this branch for a bit before merging, with a goal of having a simple frontend as well.

@MSSRPRAD
Copy link
Contributor Author

I am going ahead and closing this pull request then.

@MSSRPRAD MSSRPRAD closed this Dec 29, 2023
akprasad added a commit that referenced this pull request Jan 1, 2024
This commit adds a basic implementation of `vidyut-chandas` along with
some starter documentation. `vidyut-chandas` is pre-alpha code that I'm
shipping as a scaffold for future work.

Currently, `vidyut-chandas` supports a variety of vrtta meters, but it
has no support for jAti meters, which is the next major feature to
implement. Our documentation is also lacking, but it's a promising
start.

This commit was prepared primarily by me but with major contributions
from Pradyumna Malladi (@MSSRPRAD), who created a [first draft][1] of
the code based on a design document we collaborated on [here][2].

My contributions were:

- some cleanup to the input data format to use simple TSVs instead of
  JSON files with serde. We currently have a serde dependency to support
  our frontend, but this is not a core part of the crate and can be
  removed in a future refactor.

- some simplification to the API, particularly the use of a single
  `name` instead of `names` for each meter and the avoidance of some
  intermediate structs during serde

- the `classify` method and its matching logic

- some tweaks to our logic for calculating meter ganas

- most of the documentation, including the README, docstrings, and
  sample code

- most unit tests, especially for classifying different meters

- our WebAssembly bindings and frontend

Pradyuma's contributions were:

- a partial first draft of an end-to-end solution, including the basic
  data model for meters and aksharas

- data management, including sourcing our original meters file and
  writing the logic to read this file into our data structures

- a first draft of logic to calculate meter ganas

- a partial port of some of Vidyut's utility functions for testing
  Sanskrit sounds

- suggestions to make the returned matching object richer in order to
  support future ranking use-cases

All errors in recollection are my own.

[1]: #82
[2]: https://paper.dropbox.com/doc/Metrical-recognizer-API-v0--CCgFzji5rgBZYEMJkWAt_j5bAg-pZGhBvlQQBFcPx7SeWSE9

Co-authored-by: Pradyumna Malladi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants