ambuda-org / vidyut

Infrastructure for Sanskrit software. For Python bindings, see `vidyut-py`.
53 stars 21 forks source link

Fix the implementation of यस्य हलः 6.4.49 #119

Closed neeleshb closed 6 months ago

neeleshb commented 7 months ago

The Vidyut implementation of यस्य हलः 6.4.49 is removing the full य (i.e. य् + अ).

Technically, the sutra यस्य हलः only removes the "य्" and not the full "य". Since "हलः" in यस्य हलः is पञ्चमी, we apply आदेः परस्य and remove only the initial "य्". The remaining "अ" component of "य" is then removed by अतो लोपः

I noticed this error in the prakriya of यङन्तकर्मणि forms of हलन्त verbs. For example, स्पर्ध्. In the very last step of पा + स्पर्ध् + य + य + ते, the full य is being removed by यस्य हलः । That should be replaced by a call to यस्य हलः followed by a call to अतो लोपः

akprasad commented 7 months ago

Thanks for filing this issue. Example prakriya, for my reference later:

https://ambuda-org.github.io/vidyullekha/?tab=dhatu&dhatu=01.0003&sanadi=4&prayoga=1&activePada=%7B%22text%22%3A%22pAsparDyate%22%2C%22type%22%3A%22tinanta%22%2C%22args%22%3A%7B%22dhatu%22%3A%7B%22code%22%3A%2201.0003%22%2C%22upadesha%22%3A%22sparDa%7E%5C%5C%22%2C%22upadeshaQuery%22%3A%22sparDa%7E%22%2C%22artha%22%3A%22saNGarze%22%7D%2C%22lakara%22%3A%220%22%2C%22prayoga%22%3A%221%22%2C%22purusha%22%3A%220%22%2C%22vacana%22%3A%220%22%2C%22pada%22%3A%221%22%2C%22sanadi%22%3A%224%22%2C%22upasarga%22%3Anull%7D%7D

I'll look into a fix soon.

akprasad commented 6 months ago

I have a local fix. Test case:

    assert_matches_prakriya(
        p,
        &[
            (A("1.3.1"), vec!["sparDa~\\"]),
            (A("1.2.4"), vec!["pA", "sparD", "ya", "ya", "te"]),
            (A("6.4.49"), vec!["pA", "sparD", "a", "ya", "te"]),
            (A("6.4.48"), vec!["pA", "sparD", "", "ya", "te"]),
            (A("8.4.68"), vec!["pA", "sparD", "", "ya", "te"]),
        ],
    );

I'll merge this in once I've fixed the error @vipranarayan14 mentioned.

akprasad commented 6 months ago

Committing and deploying. Changes will be live on the demo site within the next 30 minutes.