3
# This script rebuilds the database according to the new set of
4
# classification rules provided in the file lexicon.rules and tries
5
# to handle correctly possible moving entries between dictionaries.
6
# The words that were forcibly treated as the explicit entries
7
# during the process are collected in the file explicit.list
8
# and can be inspected afterwards.
10
echo "Extracting original dictionaries"
11
../src/lexholder -f implicit.dict -M -l lexicon
12
../src/lexholder -f explicit.dict -X -l lexicon
14
echo "Building temporary database for further comparison"
15
../src/lexholder -f implicit.dict -X lexicon.tmp
17
echo "Reinserting explicit dictionary"
18
../src/lexholder -D -X lexicon
19
../src/lexholder -f explicit.dict lexicon
21
echo "Extracting new implicit dictionary"
22
../src/lexholder -f lexicon.dump -M -l lexicon
24
echo "Finding the words to be moved from implicit dictionary to the explicit one"
26
do ../src/lexholder -q -s $key -x lexicon.tmp || echo "$key $value"
27
done <lexicon.dump >explicit.list
30
echo "Rebuilding the database according to the new rules"
31
../src/lexholder -D -X lexicon
32
../src/lexholder -D -M lexicon
33
../src/lexholder -f lexicon.rules -L -r lexicon
34
../src/lexholder -f implicit.dict -M lexicon
35
../src/lexholder -f explicit.dict lexicon
37
echo "Moving some words from implicit dictionary to the explicit one"
39
do ../src/lexholder -d $key -M lexicon
41
../src/lexholder -f explicit.list -X lexicon
44
echo "All the words that were forced to be treated as explicit"
45
echo "are now listed in the file explicit.list."