Skip to content

feat(wasm): Add nyap pratipadika support to WASM bindings#223

Open
yajnadevam wants to merge 2 commits intoambuda-org:mainfrom
yajnadevam:wasm-nyap-support
Open

feat(wasm): Add nyap pratipadika support to WASM bindings#223
yajnadevam wants to merge 2 commits intoambuda-org:mainfrom
yajnadevam:wasm-nyap-support

Conversation

@yajnadevam
Copy link

Summary

  • Add nyap field to PratipadikaArgs struct in WASM bindings
  • Handle nyap pratipadika in SubantaArgs::into_rust() to call Pratipadika::nyap()

This allows JavaScript callers to correctly derive feminine nominal forms for stems with nyāp pratyayas (ṭāp, ṅīp, etc.) without needing to manipulate the stem ending.

Example usage

// Feminine -ī stem (nadī class)
vidyut.deriveSubantas({
  pratipadika: { nyap: 'nadI' },
  linga: 'Stri',
  vibhakti: 'Prathama',
  vacana: 'Eka',
})
// Returns: ['nadI']

// Feminine -ā stem
vidyut.deriveSubantas({
  pratipadika: { nyap: 'arcA' },
  linga: 'Stri',
  vibhakti: 'Prathama',
  vacana: 'Eka',
})
// Returns: ['arcA']

Test plan

  • Built WASM with make wasm_release
  • Tested nyap with -ī stems (nadI → nadI)
  • Tested nyap with -ā stems (arcA → arcA)
  • Tested nyap with -ū stems

🤖 Generated with Claude Code

…dings

Add `nyap` field to `PratipadikaArgs` struct to support feminine stems
with nyāp pratyayas (ṭāp, ṅīp, etc.) in the WebAssembly API.

Add `deriveTaddhitantas` method to support taddhita derivation, allowing
proper derivation of stems like damana + matup → damanavat.

Example usage:
```javascript
// Feminine stems with nyap
vidyut.deriveSubantas({
  pratipadika: { nyap: 'nadI' },
  linga: 'Stri',
  vibhakti: 'Prathama',
  vacana: 'Eka',
})
// Returns: ['nadI']

// Taddhita derivation
vidyut.deriveTaddhitantas({
  pratipadika: { basic: 'damana' },
  taddhita: 'matup',
})
// Returns: ['damanavat']
```

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Extends the PratipadikaArgs struct to support taddhitanta type, allowing
proper declension of taddhita-derived stems (like -vat/-mat stems from matup).

This enables stems like "amavat" (from ama + matup) to decline correctly
to "amavAn" for Nom.M.S, following proper Sanskrit grammar rules.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@akprasad
Copy link
Contributor

akprasad commented Feb 4, 2026

thanks, will look this weekend!

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.

3 participants