Skip to content

Provides and administers MetaCPAN's App::App-chartimes. This module provides a UNIX-like command `chartimes'. (The frequency of lines sorted out by the each frequency number of each character will be shown in a matrix like form.))

Notifications You must be signed in to change notification settings

tulamili/App-chartimes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This module provides a Unix-like command `chartimes'.

各文字iをj個持つ行が、入力全体にいくつ発生したか(c(i,j))を 行列状に表示するコマンド chartimes を提供するCPANモジュールである。

下記の用途に使える。他にも幅広い用途に使えるであろう。

  • どんな文字が使われたかが一覧できるので、特別値や特殊文字の発見も容易である。

  • 小数点が2回以上を持つ数値であるべきデータの検出が確実に可能。 ピリオドに対応する出力行において、j=1でなくて2以上の箇所に非0が出現するため。

  • 括弧の対応が取れていないデータの検出もある程度容易に可能。 「(」と「)」の個数が異なる行が存在すれば、食い違いが出力に現れ易いため。

  • 使われた文字の種類が多い場合には、各文字iにおいて c(i,j) > 0 となる j の 最大値の下限値をオプション(-y Nの形)で指定することで、出力行数を低減可能。

  • 各文字iが、入力全体の各行lにおいて、連続して繰り返し発生した場合の最大長 r(i,l) =: j と考えて、あらゆる(i,j)に対して該当する行数を計数する オプション(-R)も提供している。このことで、キーボード連打等もしくは通信の 不具合によるデータの異常を検出しやすくしている。

実行例を以下に示す(データはTRC新刊図書オープンデータを用いた)。コマンドラインで3回実行している:

(1) ISBN番号で、0,1,5の3文字がそれぞれ4個連続して出現する入力行が見つかった。(-Rのオプションで連続する最大長を算出している。)

(2) 半角空白,「ル」,「ー」(カタカナの長母音)のそれぞれが最大3個も出現する入力行が見つかった。

(3) 出現した文字が全て分かるし、各行に最大1回しか出現しない文字(0,4,5,7,c,m,x)も分かるので、書式も推定できる。

image

Copyright (c) 2024 Toshiyuki SHIMONO. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

About

Provides and administers MetaCPAN's App::App-chartimes. This module provides a UNIX-like command `chartimes'. (The frequency of lines sorted out by the each frequency number of each character will be shown in a matrix like form.))

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages