#!/bin/sh DICT=/var/dict/ray_fr.txt if [ x"$1" == x ] then exit 1 fi W2RE=' s/e/[eéèêë]/g s/a/[aà]/g s/i/[iîï]/g s/u/[uû]/g s/o/[oô]/g s/c/[cç]/g ' ( WORD=`echo "$1"| sed "$W2RE"` awk ' fl_print==1 && !/\[/ { print ; } fl_print==1 && /\[/ { exit 0 ; } /^'"$WORD"'[ ,0-9]/ { print ; fl_print=1; } END { if (fl_print==0) exit 1 ; } ' $DICT || ( WORD="$1" REXP=`echo "$WORD" | sed "$W2RE"` while ! grep "^$REXP" $DICT do WORD=`echo "$WORD" | sed 's/.$//'` REXP=`echo "$WORD" | sed "$W2RE"` done ) ) |\ tr \ 'àáâãäå¸æçèéêëìíîïðñòóôõö÷øùúûüýþÿÀÁÂÃÄŨÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß' \ 'ÁÂ×ÇÄÅ£ÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝßÙØÜÀÑáâ÷çäå³öúéêëìíîïðòóôõæèãþûýÿùøüàñ' #