英語で数字が聞き取れないので練習スクリプト書いた

ビジネス英語で一番最初につまづくのが、数字が全然聞き取れないこと。3 桁ずつに区切ってるのは頭では理解してるんですが、そもそも 3 桁の数字が全然把握できない。。。

そういえば Mac にはsayコマンドというしゃべらせるコマンドがあったなぁというわけで、超やっつけですがそれを使ってひたすら延々と数字を聞きとっては答えるスクリプト作りました。

使い方はこんな感じ。以下では分からないですがターミナルでは正解だと緑、間違ってると赤色になります。

$ perl practice.pl
What is the number?[NUM|r|e] : 201
[0.986 sec] Right! (201)
What is the number?[NUM|r|e] : 241
[1.060 sec] Right! (241)
What is the number?[NUM|r|e] : 865
[2.861 sec] Wrong! (expect:864 got:865)
What is the number?[NUM|r|e] : 346
[1.650 sec] Right! (346)
What is the number?[NUM|r|e] : ^C
---------------------------------------
rate: 75% (3/4)
time: 1.639 sec

最後は Ctrl+C かeと入力すると終了して、正答率と平均回答所用時間を出力します。

一応引数で from と to が指定できて、あと入力の最後が r だったらリピートしてくれます。100 万以上は難しいですね。。。

$ perl practice.pl 1000000 9999999
What is the number?[NUM|r|e] : 2960199
[6.260 sec] Wrong! (expect:2,916,199 got:2,960,199)
What is the number?[NUM|r|e] : r
What is the number?[NUM|r|e] : 28r
What is the number?[NUM|r|e] : 2850804
[19.788 sec] Wrong! (expect:2,085,804 got:2,850,804)
What is the number?[NUM|r|e] : 1r
What is the number?[NUM|r|e] : 1063r
What is the number?[NUM|r|e] : 1063362
[26.731 sec] Right! (1,063,362)
What is the number?[NUM|r|e] : ^C^C
---------------------------------------
rate: 33% (1/3)
time: 17.593 sec

英語がんばろう!