www.pudn.com > egothor-daily-cvssnapshot.zip > convert-snowball


#!/bin/sh
#
# Convert sample dictionaries of snowball project to our input format
#

PREV=""
cat $1 | while read A B
do
    if [ "$A" != "$B" ]
    then
        if [ "$PREV" != "$B" ]
	then
    	    if [ ! -z "$PREV" ]
	    then
		echo ""
	    fi
	    echo -n "$B "
	    PREV=$B
	fi
	echo -n " $A"
    fi
done