Implement opcode 0x3d set animation skip point.
[scummvm-innocent.git] / tools / construct-pred-dict.pl
blob780d8843ab7e36a495416834cb7b6171f01d77c4
1 #!perl
3 # ScummVM - Scumm Interpreter
4 # Copyright (C) 2006 The ScummVM project
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; either version 2
9 # of the License, or (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 # $URL$
21 # $Id$
24 # This script constructs dictionary for use with predictive input
26 # Feed it with list of words. One word per line
28 %words = ();
30 while(<>) {
31 chomp;
33 s/[\x7f-\xff]//g; # remove unprintable characters
35 next if /^.$/; # skip one character words
36 next if $_ eq ""; # skip empty words
38 $words{$_} = 1;
41 %list = ();
43 for $_ (sort keys %words) {
44 $word = $_;
46 s/['-.&_!]/1/g;
47 s/[abc]/2/g;
48 s/[def]/3/g;
49 s/[ghi]/4/g;
50 s/[jkl]/5/g;
51 s/[mno]/6/g;
52 s/[pqrs]/7/g;
53 s/[tuv]/8/g;
54 s/[wxyz]/9/g;
56 $list{$_} .= "$word ";
59 for $k (sort keys %list) {
60 chop $list{$k};
62 print "$k $list{$k}\n";