Skip to content

dharmamitra/dharmamitra-emacs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

dharmamitra-emacs

An Emacs package for translating and analyzing Sanskrit, Pāli, Tibetan, and Chinese texts using the Dharmamitra.org API.

Screenshot of Dharmamitra grammar analysis

Features

  • Grammar analysis for Sanskrit
  • English translations for Sanskrit, Chinese, Tibetan, Pali
  • Segmentation and lemmatization
  • Detailed grammatical analysis with meanings

Installation

  1. Download dharmamitra.el to your local system
  2. Add the following to your .emacs or init.el:
;; Add the directory containing dharmamitra.el to load-path
(add-to-list 'load-path "/path/to/directory/containing/dharmamitra")
(require 'dharmamitra)

Configuration

Translation Settings

By default, translations are included in the analysis output. To disable translations (which makes the system significantly faster), add this to your .emacs:

(setq dharmamitra-text-include-translation nil)

To re-enable translations:

(setq dharmamitra-text-include-translation t)

Key Bindings

In order to enable the key binding, add this to your .emacs:

;; Bind to a different key globally
(global-set-key (kbd "C-c g") #'dharmamitra-text-analyze-grammar)

;; Or bind for specific modes
(add-hook 'sanskrit-mode-hook
          (lambda ()
            (local-set-key (kbd "C-c g") #'dharmamitra-text-analyze-grammar)))

Usage

  1. Select the text you want to analyze
  2. Press C-c g (or your custom keybinding)
  3. The analysis will appear in a separate buffer showing:
    • Original text
    • Segmented form
    • Lemmatized form
    • Translation (if enabled)
    • Detailed grammatical analysis

The analysis buffer will be named *Dharmamitra Text Grammar*.

Requirements

  • Emacs 26.1 or later
  • curl (for API requests)
  • Internet connection to access dharmamitra.org

Note

This package requires access to the Dharmamitra.org API. Make sure you have a working internet connection when using it.

Citation

The preprint to this system is available on arxiv. There is also a github repository with the actual models and description on their use here.
If you like our work and use it in your research, feel free to cite the paper:

@inproceedings{
nehrdichetal2024,
title={One Model is All You Need: ByT5-Sanskrit, a Unified Model for Sanskrit {NLP} Tasks},
author={Nehrdich, Sebastian and Hellwig, Oliver and Keutzer, Kurt},
booktitle={Findings of the 2024 Conference on Empirical Methods in Natural Language Processing},
year={2024},
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published