App-Greple-subst

 view release on metacpan or  search on metacpan

share/jtca-katakana-guide-3.pl  view on Meta::CPAN

    for my $cat (@{$_{categories}}) {
	my $func = $functable{$cat} or next;
	$func->() for $_{pattern};
    }

    $_{fixed} = $_{kana} eq $_{pattern};
    $_{ignore} = 1 if $opt->{ignore}->{$_{kana}};
    $_{regex} = qr/$_{pattern}/;

    for (qw(category pattern kana)) {
	$maxlen{$_} = max($maxlen{$_}, vwidth $_{$_});
    }

    # sanity check
    if ($_{kana} !~ /^$_{regex}$/) {
	warn sprintf "\"%s\" !~ /^%s\$/\n", $_{kana}, $_{pattern};
    }

#   push @data, \%_; # just in case.
    push @data, { %_ };
}

if ($opt->{reorder}) {
    use List::Util qw(first);
    for my $i (1 .. $#data) {
	my $match =
	    (first { $data[$i]->{kana} =~ $data[$_]->{regex} } 0 .. $i - 1)
	    // next;
	splice @data, $match, 0 => splice @data, $i, 1;
    }
}

for my $data (@data) {
    if ($opt->{skipfixed} and $data->{fixed}) {
	print "##";
    }
    elsif ($data->{ignore}) {
	print "# ";
    } else {
	print "  ";
    }

    if ($opt->{category}) {
	vprintf "%-*s ", $maxlen{category}, $data->{category};
    }
    vprintf "%-*s %s\n",
	$maxlen{pattern}, $data->{pattern},
	$data->{kana},
	;
}

__DATA__
#
# greple -Msubst モジュール用辞書ファイル
# https://github.com/kaz-utashiro/greple-subst
#
# 外来語(カタカナ)表記ガイドライン 第3版
# 制定:2015年8月
# 発行:2015年9月
# 一般財団法人テクニカルコミュニケーター協会 
# https://jtca.org/tcwp/wp-content/uploads/2023/06/katakana_guide_3_20171222.pdf
#
アイデア idea 4-3
アイデンティティー identity 1-1、4-1例外、4-3
アクション action 4-1
アクセサリー accessory 1-1
アクセシビリティー accessibility 1-1
アコーディオン accordion 1-4、4-2
アジャスター adjuster 1-1
アセンブラー assembler 1-1
アダプター adapter 1-1
アップグレード upgrade 1-2、4-3例外
アップデーター updater 1-2
アップロード upload 1-2
アドバイザー adviser 1-1、3
アドバイス advice 3
アドベンチャー adventure 1-3、3
アニメーション animation 1-2、4-1
アフター after 1-1
アブソーバー absorber 1-1、1-4
アプリケーション application 1-2、4-1
アベレージ average 1-2、3
アライアンス alliance 5
アラビア Arabia 5
アラート alert 1-4
アラーム alarm 1-4
アルジェリア Algeria 5
アルゼンチン Argentina 4-1
アルファ alpha 2-3
アルファベット alphabet 2-3
アンカー anchor 1-1
アンサー answer 1-1
アンダーバー under bar(和製英語) 1-1、4-3例外
アンチ anti 4-1
アンティーク antique 4-1例外
アンペア ampere 1-2例外、1-3
アンモニア ammonia 5
アーキテクチャー architecture 1-3、1-4
アーキテクト architect 1-4
アーケード arcade 1-4、4-3例外
アート art 1-4
イエロー yellow 1-2
イデオロギー ideology /ideologie [ドイツ語] 4-3
イニシアチブ initiative 3、4-1、5
イベント event 3
イミテーション imitation 1-2、4-1
イメージ image 1-4例外 
イヤホン earphone 2-4例外
イラスト illustration 1-2、4-1
イラストレーション illustration 1-2、4-1
イラストレーター illustrator 1-1、1-2
イレーサー eraser 1-1
インジケーター indicator 1-1、1-2、1-3、4-2例外
インストラクター instructor 1-1
インストーラー installer 1-1、1-4
インストール install 1-4
インタビュー interview 3
インタラクション interaction 4-1
インタラクティブ interactive 3、4-1例外
インターネット internet 1-4
インターフェイス interface 1-2例外、1-4、2-3
インターホン interphone 1-4、2-4例外
インデックス index 4-3
インデント indent 4-3
インフォメーション information 1-2、1-3、2-4、4-1
インフラストラクチャー infrastructure 1-3
ウィザード wizard 1-4、2-1例外
ウイスキー whiskey 1-1、2-1
ウイット wit 2-1
ウインドウ window 1-2、2-1
ウェア ware 1-3、2-1
ウェイト weight 1-2例外、2-1例外
ウェブ web 2-1例外
ウェールズ Wales 1-2、1-4、2-1例外



( run in 0.782 second using v1.01-cache-2.11-cpan-b16cb0d3907 )