Skip to content

thapakrish/samskritam.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 

Repository files navigation

samskritam.el

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.

Installation

This package is available on MELPA.

(use-package samskritam
  :ensure t
  :config
  (samskritam-mode 1))

Usage

Once installed and enabled, you can access all features through a transient menu or direct keybindings.

Transient Menu

  • M-x samskritam or C-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.

Direct Keybindings

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.

Key Features

Dictionary Integration

The package fetches word definitions from multiple dictionaries available on Ambuda.org, including:

  • Apte
  • Apte-Kosh
  • MW (Monier-Williams)
  • Shabdasagara
  • Vacaspatyam
  • Shabdarthakausubha
  • Amarakosha

Navigation and Folding

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.

Google Translate Integration

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.

Customization

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))
     ("^'" "")
     ("^''" "")
     ("__" "")
     )))

Inspiration

About

Sanskrit word definitions and translations

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors