#!/usr/bin/perl # Copyright Hong Kong University of Science and Technology (Author: Ricky Chan) 2013. if($#ARGV+1 != 2) { print "usage: perl hkust_extract_subdict.pl dict wordlist \n"; exit; } $dictfile=$ARGV[0]; $inputfile=$ARGV[1]; %dictionarylist=(); open(INFILE, $dictfile) || die("Can't open dict ".$dictfile."\n"); while(){ chomp; @line=split(/\s+/); $a=$line[0]; $b=""; for($i=1; $i) { chomp; @line = split(/\s+/); for($i=0; $i