Created
June 18, 2019 06:56
-
-
Save prostoiChelovek/5214cfb66aabb632a81ed18aa10e8c31 to your computer and use it in GitHub Desktop.
simple script that makes custom dict using big language dict
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
while read p; do | |
word=`echo $p | sed 's/ .*//'` | |
if [[ ${word} == "" ]]; then | |
continue | |
fi | |
if [[ ${word} == *"("* ]]; then | |
continue | |
fi | |
wordInDict=`sed -n -e "/^${word} /p" ${2}` | |
alt=`sed -n -e "/^${word}(/p" ${2}` | |
echo ${word} | |
if [[ ${wordInDict} != "" ]]; then | |
echo ${wordInDict} | |
echo ${wordInDict} >> ${3} | |
else | |
echo ${p} | |
echo ${p} >> ${3} | |
fi | |
if [[ ${alt} != "" ]]; then | |
echo ${alt} | |
echo ${alt} >> ${3} | |
fi | |
done <${1} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment