This package provides a comprehensive interface for Sanskrit word definitions, translations, and navigation within Emacs. It uses a transient menu for easy access to all features, fetches dictionary definitions from Ambuda.org, and integrates with Google Translate.
This package is available on MELPA.
(use-package samskritam
:ensure t
:config
(samskritam-mode 1))Once installed and enabled, you can access all features through a transient menu or direct keybindings.
M-x samskritamorC-c C-s(by default) to bring up the main transient menu.- From the transient, you can:
- Look up the word at point in various dictionaries.
- Enter a word to look up.
- Translate the word at point or a new word.
- Navigate through dictionary definitions with folding, unfolding, and jumping.
For quicker access to common functions:
C-c d: Look up the definition for the word at the current point in the default dictionary.- With a prefix argument (
C-u C-c d), it will prompt for a dictionary to use. C-c D: Prompt for a word and look up its definition.C-\: Toggle the Devanagari input method.
The package fetches word definitions from multiple dictionaries available on Ambuda.org, including:
- Apte
- Apte-Kosh
- MW (Monier-Williams)
- Shabdasagara
- Vacaspatyam
- Shabdarthakausubha
- Amarakosha
When viewing dictionary definitions, you can use the following keybindings for navigation:
n: Go to the next definition.p: Go to the previous definition.j: Jump to a specific definition using completion.f: Fold all definitions.u: Unfold all definitions.t: Toggle the folding of the current definition.
The package integrates with `google-translate` to provide smooth translations. You can translate the word at point or enter a new word for translation directly from the transient menu.
You can customize the keymap prefix for the transient menu by setting the `samskritam-keymap-prefix` variable. The default is “C-c C-s”.
(setq samskritam-keymap-prefix "C-c s");; Add some missing characters to devanagari-inscript
(with-temp-buffer
(activate-input-method "devanagari-inscript") ;; the input method has to be triggered for `quail-package-alist' to be non-nil
(let ((quail-current-package (assoc "devanagari-inscript" quail-package-alist)))
(quail-define-rules ((append . t))
("^'" "॑")
("^''" "᳚")
("__" "॒")
)))