Subversion Repositories wimsdev

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
14 reyssat 1
#! /bin/sh
2
#
3
# Get list of reference words from last page.
4
# No input parameter is allowed.
5
 
6
if [ -z "$w_wims_session" ]; then exit; fi
7
ss=`echo $w_wims_session | tr '_' ',' | cut -d, -f1 `
8
l=$w_module_language
9
 
10
ses=../s2/$ss
11
if [ ! -d $ses ]; then exit; fi
12
if [ "$w_special_parm" = "intro" ]; then
13
 input=modules/$w_module/intro.phtml
14
else
15
 input=$ses/last.html
16
fi
17
# echo "$input" >$ses/test
18
if [ ! -f $input ]; then exit; fi
19
if [ $input = $ses/last.html ]; then
20
 awk 'BEGIN {a=0};
21
     /class=wimstail/ {a=0; exit};
22
     /<script/ {a=0};
23
     /<\/script/ {a=1};
24
     a==1 {print};
25
     /class=wimsbody/ {a=1}' $input >$ses/last.body
26
else
27
 cp $input $ses/last.body
28
fi
29
echo "$w_module_keywords, $w_module_domain" >>$ses/last.body
30
 
31
wims_exec_parm=`../bin/phtmltext $ses/last.body | sed 's/[^A-Za-z0-9,. ]/ /g'`
32
export wims_exec_parm w_dictionary w_suffix_dictionary
33
export w_translator_switch w_translator_unknown
34
w_dictionary=bases/sys/words.$l
35
w_suffix_dictionary=bases/sys/suffix.$l
36
w_translator_switch=
37
w_translator_unknown=leave
38
next=`bin/translator`
39
wims_exec_parm="$next"
40
w_dictionary=bases/wikipedia/words.$l
41
w_suffix_dictionary=
42
w_translator_unknown=
43
 
44
bin/translator | tr -d . | tr ',' '\n' | \
45
	tr -s ' ' | sed 's/^ //;s/ $//' | \
46
	grep . | sort -f | uniq | head -300 | tr '\n ' ',_'
47