rulex

Форк
0
/
rebuild 
45 строк · 1.6 Кб
1
#!/bin/sh
2

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.
9

10
echo "Extracting original dictionaries"
11
../src/lexholder -f implicit.dict -M -l lexicon
12
../src/lexholder -f explicit.dict -X -l lexicon
13

14
echo "Building temporary database for further comparison"
15
../src/lexholder -f implicit.dict -X lexicon.tmp
16

17
echo "Reinserting explicit dictionary"
18
../src/lexholder -D -X lexicon
19
../src/lexholder -f explicit.dict lexicon
20

21
echo "Extracting new implicit dictionary"
22
../src/lexholder -f lexicon.dump -M -l lexicon
23

24
echo "Finding the words to be moved from implicit dictionary to the explicit one"
25
while read key value
26
do ../src/lexholder -q -s $key -x lexicon.tmp || echo "$key $value"
27
done <lexicon.dump >explicit.list
28
rm -f lexicon.tmp
29

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
36

37
echo "Moving some words from implicit dictionary to the explicit one"
38
while read key value
39
do ../src/lexholder -d $key -M lexicon
40
done <explicit.list
41
../src/lexholder -f explicit.list -X lexicon
42

43
echo "All done"
44
echo "All the words that were forced to be treated as explicit"
45
echo "are now listed in the file explicit.list."
46

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.