#!/usr/bin/perl -- # # Anthy: A Converter of some CAND_HISTORY to a corpus.txt file. # Sat,14 Mar,2009 # Copyright(C)2009 G-HAL (fenix.ne.jp) # use strict; my $argc = @ARGV; my $debug = 0; { while () { chomp( $_ ); my $input = $_; if ($input =~ /^\+([^ ]+) (.+)$/i) { my $index = $1; my $contents = $2; while ($contents =~ /^O[0-9]+ [0-9]+ "([^"]+)" (.+)$/i) { my $key = $1; $contents = $2; print "|". $index ."|" . " " . "|". $key ."|" . "\n"; } } } exit 0; } __END__ # [ EOF ]