Skorg: Sanskrit org mode extension for emacs
- How to install
- How to use
- Plans for the future
skorg is mainly interesting for emacs users as it is a little bit complicated to set up and use correctly. This is how it looks like now in action:
- Manual part of speech-tagger
- as-you-type validation of sanskrit inflected forms
- syntax highlighting for sanskrit grammar
- automatic display of text both in devanagari and transliteration
- quick dictionary lookup by inflected verb-forms using sdcv (console version of stardict)
- Create an own sanskrit dictionary
- automatic transliteration tools
- automatic sandhi tools
- export tagged text to sanskrit-db.deGerard Huet.Some of the key features are written modular and can be used outside of skorg-mode, see for example xliterate.el for indian transliteration tools, or skorg-sandhi.el for sandhi-functions.
install it by extracting it to your elpa-folder:
In case the folder ~/.emacs.d/elpa does not exist yet, you need to create it first:
tar xfj skorg-0.0.1.tar.bz2 -C ~/.emacs.d/elpa
Copy the following to your emacs-configuration-file (usualle this is ~/.emacs):
mkdir -p ~/.emacs.d/elpa
(global-set-key (kbd "C-c d") 'skorg-sdcv-search-pointer-inflected) (global-set-key (kbd "C-c i") 'skorg-sdcv-search-input) (setq sklm-user-name "Your Name")
First you create a new file within emacs and give it the .skorg ending. This automaticly activates skorg-mode, as the mode is recognized by file-ending.
If not, just type m-x skorg-mode and it will start. First we give the new file a name:
Then we add a heading (it is necessary to have one as divisions are indexed by headings):
In order to add your first verse/sentence/block of sanskrit you just press m-enter. This creates a new division. If it is not a verse/not anustubh, just change the lines according to what you have (e.g. 'prose' instead of stanza, and 'gayatri' instead of 'anustubh')
Now the screen gets automaticly split into three frames. At the top there is the devanagari frame showing the current input in devanagari, at the bottom there is the grammar frame showing grammatical and lexical information. Both frames are updated as you type, so the cursor stays in the main frame.
You need to enter the sanskrit between the head of the current division (starting with \div) and the \trans-tag. Input is accepted in unicode or HK-transliteration, if you want to use a different transliteration this is technically possible, but not easily implemented yet.
As soon as you start to type a word you will notice that at the bottom of the screen the possible entries from the database appear. When the word resembles a real sanskrit expression, this is going to be displayed there:
Inputting words is best done without sandhi, but to some extent the engine is tolerant to sandhi and tries to dissolve as far as possible. But in order to have clean recognition of the words it is best to not apply sandhi. Compounds are entered by using vertical bars (similar to the way it is done in the sanskrit clay library):
But contrary to the sanskrit clay library, full sandhi has to be given when entering compounds!
This gets automaticly dissolved to manorathas. Not that next to every root in the grammar frame at the bottom of emacs there is a (in the beginning empty) string attached to it. You can use this string to save personal notes, such as translations etc:
This additional information gets saved every time you save the file and it is stored across sessions, so you will have your personal dictionary back the next time you run emacs.
In order to give a grammatical function to a word, use the number keys on your keyboard.
each number represents one of the seven vibhaktis, so 1 is nominative, 2 is accusative etc. 8 is for vocative, 9 is used for indeclinables and 0 is for verbs. This rough pretagging is necessary to give a general function to a word, e.h. decide wether it is a verb or a noun. Once this decision is made the database will automaticly do the fine-grained tagging. For example if you wish to enter gacchati as a verb, you type gacchati0. For gacchati as a locative present participle, you type gacchati7.
In the case that a word is not ambivalent in relation to it's grammatical function (for example devaḥ) the correct tag is assigned automaticly. After successfull tagging the number is automaticly deleted and the word is coloured. once the colour is changed the word is tagged. Different cases have different colours! Tags are stored across sessions in a persistant hashtable inside emacs, so next time you open the file the tags come back.
Once you entered a verse and have successfully tagged everything it should look this way:
The field after \trans can be used for entering a translation (but this is not necessary), the field after \notes for notes. When you want to add another verse, just move into a new line after the verse ended and press m-enter again. Quite straightforward.