Skip to content
Browse files

fixed a bug in grep, make sure words starting with - are not valid.

  • Loading branch information...
1 parent f96e7f1 commit 0dfad197401682397dae4eeaaff412f9eb7253e7 @nifgraup committed Mar 11, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 makedict.sh
View
2 makedict.sh
@@ -91,7 +91,7 @@ elif [ "$1" = "packages" ]; then
elif [ "$1" != "" ]; then
echo "Downloading files..."
test -e ${TMP}/${1}wiktionary-latest-pages-articles.xml || ( wget http://dumps.wikimedia.org/${1}wiktionary/latest/${1}wiktionary-latest-pages-articles.xml.bz2 -O ${TMP}/${1}wiktionary-latest-pages-articles.xml.bz2 && bunzip2 ${TMP}/${1}wiktionary-latest-pages-articles.xml.bz2 )
- test -e ${TMP}/${1}wiktionary-latest-pages-articles.xml.texts || grep -o "{{[^.]*|[^-.][^}]*" ${TMP}/iswiktionary-latest-pages-articles.xml | grep -v "{{.*|.*[ =]" | sort | uniq > ${TMP}/iswiktionary-latest-pages-articles.xml.texts
+ test -e ${TMP}/${1}wiktionary-latest-pages-articles.xml.texts || grep -o "{{[^.|]*|[^-.][^}]*" ${TMP}/iswiktionary-latest-pages-articles.xml | grep -v "{{.*|.*[ =]" | sort | uniq > ${TMP}/iswiktionary-latest-pages-articles.xml.texts
echo "Extracting valid words from the wiktionary dump..."
rm -f ${TMP}/wiktionary.extracted

0 comments on commit 0dfad19

Please sign in to comment.
Something went wrong with that request. Please try again.