File: cache.sh

package info (click to toggle)
migemo 0.32-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,764 kB
  • ctags: 123
  • sloc: ruby: 971; sh: 541; makefile: 113
file content (23 lines) | stat: -rwxr-xr-x 642 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /bin/sh

#
# cache test
#
export USERDICT=../user-dict.sample
export REGEXDICT=../regex-dict.sample

ruby -ne 'puts $1 if /^(\w).*?	/' test-dict $USERDICT| while read line; do
     echo $line | ruby -I.. ../migemo -r $REGEXDICT -u $USERDICT test-dict\
	 > tmp.out1
     echo $line | ruby -I.. ../migemo -n -r $REGEXDICT -u $USERDICT test-dict\
	 > tmp.out2
     cmp tmp.out1 tmp.out2 || exit 1
done

for i in `ruby sample.rb ../frequent-chars`; do
    echo $i | ruby -I.. ../migemo --nocache ../migemo-dict > tmp.cache.1
    echo $i | ruby -I.. ../migemo ../migemo-dict > tmp.cache.2
    cmp tmp.cache.1 tmp.cache.2 || exit 1
done

exit 0