mirror of
https://github.com/mii443/akaza.git
synced 2025-08-22 14:55:31 +00:00
30 lines
636 B
Perl
30 lines
636 B
Perl
# TUT 用のマッピングテーブルを生成する。
|
|
# Canna 用の定義ファイルから生成する。
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
use LWP::UserAgent;
|
|
use Data::Dumper;
|
|
use Encode qw/decode/;
|
|
|
|
binmode STDIN, ":utf8";
|
|
binmode STDOUT, ":utf8";
|
|
binmode STDERR, ":utf8";
|
|
|
|
my $ua = LWP::UserAgent->new();
|
|
|
|
my $url = 'https://crew-lab.sfc.keio.ac.jp/projects/tut/data/tut.kpdef';
|
|
|
|
my $res = $ua->get($url);
|
|
my @lines = split /\n/, decode('euc-jp', $res->content);
|
|
for my $line (@lines) {
|
|
if ($line =~ /^(\S+)[\t ](\S+)$/) {
|
|
my $rom = $1;
|
|
my $surface = $2;
|
|
|
|
print " \"$rom\": \"$surface\"\n";
|
|
}
|
|
}
|
|
|