--- Makefile.orig	Tue Oct 19 23:58:46 1999
+++ Makefile	Tue May  1 03:28:34 2001
@@ -22,7 +22,22 @@
 	cp russian.hash russian.aff $(LIB)
 
 russian.dict.koi: $(DICT)
-	cat $^ $(YO2E) | ./sortkoi8 | uniq > $@
+	cat $(DICT) > distwords.tmp
+ifdef LOCAL_DICT
+	cut -f 1 -d / < $(LOCAL_DICT) | sed "s/.*/^&(\/.*)?$$/" > mywords.tmp
+	egrep -v -f mywords.tmp < distwords.tmp > repwords.tmp
+	rm -f distwords.tmp mywords.tmp
+else
+	mv distwords.tmp repwords.tmp
+endif
+ifndef YO
+	grep -h "[]" repwords.tmp $(LOCAL_DICT) $(YO2E) > ewords.tmp
+else
+	cp /dev/null ewords.tmp
+endif
+	cat repwords.tmp $(LOCAL_DICT) ewords.tmp | ./sortkoi8 | uniq > $@
+	rm -f repwords.tmp ewords.tmp
+
 
 check_dict: $(DICT)
 	for i in `cat $(DICT) | sed 's,/.*$$,,' | sort | uniq -d`; do \
