Switch dictionary to dictd -c5 format.
--- a/Makefile Fri Sep 02 01:01:11 2011 +0300
+++ b/Makefile Fri Sep 02 01:29:08 2011 +0300
@@ -8,87 +8,58 @@
# install-local-symlink create symlink from installed dir to user HOME dir, so dictionaries been available in stardict
# uninstall-local-symlink remove symlink from user HOME directory
-
-# On Debian Etch 'stardict-tools' package not placed tools in any system bin dir.
-export PATH := $(PATH):/usr/lib/stardict-tools
+DICTNAME_PREFIX = gadict
-DICSETNAME = gavenkoa-dicts
-
-prefix = /usr/local
+ifeq '$(origin prefix)' 'undefined'
+ ifeq '$(shell id -u)' '0'
+ prefix = /usr/local
+ else
+ prefix = $(HOME)/usr
+ endif
+endif
datarootdir = $(prefix)/share
-datadir = $(datarootdir)/stardict
-dicdir = $(datadir)/dic/$(DICSETNAME)
-
-# Per user dictionaries hold in user HOME directory.
-dicdir-local = $(HOME)/.stardict/dic/$(DICSETNAME)
+datadir = $(datarootdir)/dictd
-F_TAB_ = $(wildcard *.tab_)
+C5_FILES := $(wildcard *.c5)
+DICT_FILES := $(C5_FILES:.c5=.dict)
+DICTDZ_FILES := $(C5_FILES:.c5=.dict.dz)
+INDEX_FILES := $(C5_FILES:.c5=.index)
-F_TAB = $(patsubst %.tab_,%.tab,$(F_TAB_))
-FNAME = $(patsubst %.tab,%,$(F_TAB))
-F_DICT = $(patsubst %.tab,%.dict.dz,$(F_TAB))
-F_IFO = $(patsubst %.tab,%.ifo,$(F_TAB))
.PHONY: all
all: dist
-.PHONY: verify
-verify: dist
- @echo
- @for dic in $(F_IFO); do \
- stardict_verify $$dic; \
- done
+.PHONY: dist
+dist: $(DICTDZ_FILES) $(INDEX_FILES)
-.PHONY: dist
-dist: $(F_DICT)
+# --case-sensitive
+%.dict %.index: %.c5
+ dictfmt -c5 \
+ --headword-separator '; ' --break-headwords \
+ --utf8 --allchars \
+ -u "`sed -n '\|http://[[:print:]]\+/|{s=^.*\(http://\)=\1=;p;q;}' $<`" \
+ -s "`sed -n '/^ABOUT: /{s=ABOUT: ==;p;q;}' $<`" \
+ $* <$<
-%.tab: %.tab_
- sed -e '/^#/d' -e 's_\\n _\\n_g' > $@ < $<
-
-%.dict.dz: %.tab %.descr
- tabfile $<
- /bin/sh update-ifo.sh $*.ifo
+%.dict.dz: %.dict
+ dictzip -c $< >$@
.PHONY: install
install: dist
- mkdir -p $(dicdir)
- for dic in $(FNAME); do \
- install -m 644 $$dic.dict.dz $(dicdir); \
- install -m 644 $$dic.idx $(dicdir); \
- install -m 644 $$dic.ifo $(dicdir); \
+ mkdir -p $(datadir)
+ for f in $(DICTDZ_FILES) $(INDEX_FILES); do \
+ install -m 644 $$f $(datadir); \
done
.PHONY: uninstall
uninstall:
- rm -r -f $(dicdir)
-
-.PHONY: install-local-symlink
-install-local-symlink: # Assume use run "make install" before.
- mkdir -p $(HOME)/.stardict/dic
- ln -s $(dicdir) $(HOME)/.stardict/dic/$(DICSETNAME)
-
-.PHONY: uninstall-local-symlink
-uninstall-local-symlink: # Assume use run "make uninstall" before.
- rm -f $(HOME)/.stardict/dic/$(DICSETNAME)
-
-.PHONY: install-local
-install-local: dist
- mkdir -p $(dicdir-local)
- for dic in $(FNAME); do \
- install -m 644 $$dic.dict.dz $(dicdir-local); \
- install -m 644 $$dic.idx $(dicdir-local); \
- install -m 644 $$dic.ifo $(dicdir-local); \
- done
-
-.PHONY: uninstall-local
-uninstall-local:
- rm -f -r $(HOME)/.stardict/dic/$(DICSETNAME)
-
-.PHONY: clean
-clean:
- for dic in $(FNAME); do \
- rm -f $$dic.dict.dz $$dic.idx $$dic.ifo $$dic.tab; \
+ for f in $(DICTDZ_FILES) $(INDEX_FILES); do \
+ rm -f $(datadir)/$$f; \
done
.PHONY: distclean
distclean: clean
+
+.PHONY: clean
+clean:
+ rm -f $(DICTDZ_FILES) $(INDEX_FILES);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gadict-dictabbr.c5 Fri Sep 02 01:29:08 2011 +0300
@@ -0,0 +1,73 @@
+# -*- coding: utf-8 -*-
+
+ABOUT: Terms used in gramma of Russial and English languages.
+
+ http://localhost/gadict.html
+
+Materials placed in Public Domain.
+
+This dictionary partially checked with:
+
+ * А.А. Слободчиков - English. Учебник английского языка для X-XI классов
+ вечерней (сменной) школы - издательство "Просвящение", Москва, 1967.
+ См. стр. 232-233 "Как работать с общим англо-русским словарем".
+_____
+
+adj; adj.; adjective
+
+ ['aed...]
+ прилагательное
+
+adv; adv.; adverb
+
+ []
+ наречие
+
+cj; cj.; conjunction
+
+ []
+ союз
+_____
+
+n; n.; noun
+
+ []
+ имя существительное
+_____
+
+num; num.; numeral
+
+ []
+ числительное
+_____
+
+pron; pron.; pronoun
+
+ []
+ местоимение
+_____
+
+prep; prep.; preposition
+
+ []
+ предлог
+_____
+
+v; v.; verb
+
+ []
+ глагол
+_____
+
+IPA
+
+ abbr. International Phonetic Alphabet
+
+ Phonetic transcriptions enclosed in square brackets [əbaʊt] or slashes
+ /əbaʊt/.
+
+ Different sing used by IPA:
+
+ [θʃŋʧðʒæıʌʊɒɑɛəɜєɔˌˈːˑṃṇḷŋvɚɡˏˊˋ]
+
+ /æ ð ø ŋ œ β θ χ ɤ ˈ ˌ ː g m t z ə ɥ ɚ ø ʒ yʎ çæbɵøɑ œ ˌˌˌ xðDHɹʎʌɯɚɚʉ ç/
--- a/gavenkoa_gramma_en-ru.descr Fri Sep 02 01:01:11 2011 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-Terms used in gramma of Russial and English languages. Materials placed in Public Domain.
-
-This dictionary partially checked with:
-
- * А.А. Слободчиков - English. Учебник английского языка для X-XI классов
- вечерней (сменной) школы - издательство "Просвящение", Москва, 1967.
- См. стр. 232-233 "Как работать с общим англо-русским словарем".
-
-Local variables:
-coding: utf-8
-fill-column: 78
-End:
--- a/gavenkoa_gramma_en-ru.tab_ Fri Sep 02 01:01:11 2011 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-# -*- coding: utf-8; fill-column: 1000 -*-
-adj. adjective ['aed...]\n прилагательное
-adj adjective ['aed...]\n прилагательное
-adv. adverb []\n наречие
-adv adverb []\n наречие
-cj. conjunction []\n союз
-cj conjunction []\n союз
-n. noun []\n имя существительное
-n noun []\n имя существительное
-num. numeral []\n числительное
-num numeral []\n числительное
-pron. pronoun []\n местоимение
-pron pronoun []\n местоимение
-prep. preposition []\n предлог
-prep preposition []\n предлог
-v. verb []\n глагол
-v verb []\n глагол
-IPA abbr. International Phonetic Alphabet\n phonetic transcriptions enclosed in square brackets [əbaʊt] or slashes /əbaʊt/\n different sing used by IPA:\n [θʃŋʧðʒæıʌʊɒɑɛəɜєɔˌˈːˑṃṇḷŋvɚɡˏˊˋ]\n /æ ð ø ŋ œ β θ χ ɤ ˈ ˌ ː g m t z ə ɥ ɚ ø ʒ yʎ çæbɵøɑ œ ˌˌˌ xðDHɹʎʌɯɚɚʉ ç/