App-numero2bgc-0.020/000755 000765 000024 00000000000 14327211431 015275 5ustar00tshimonostaff000000 000000 App-numero2bgc-0.020/PaxHeader/INSTALL000644 000765 000024 00000000613 14327171327 020310 xustar00tshimonostaff000000 000000 29 mtime=1667035863.08207681 133 LIBARCHIVE.xattr.com.apple.macl=BACvTvofDT1JCbIHgji3s2EgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 105 SCHILY.xattr.com.apple.macl=¯Nú =I ²‚8·³a 69 LIBARCHIVE.xattr.com.apple.lastuseddate#PS=/vVcYwAAAABYlakmAAAAAA 59 SCHILY.xattr.com.apple.lastuseddate#PS=þõ\cX•©& App-numero2bgc-0.020/INSTALL000644 000765 000024 00000000227 14327171327 016340 0ustar00tshimonostaff000000 000000 INSTALL memo for "App::numero2bgc" : cpanm App::numero2bgc # For installing (^_^) cpanm -U App::numero2bgc # For uninstalling (;_;) App-numero2bgc-0.020/PaxHeader/numero2bgc.pm000644 000765 000024 00000000614 14327172750 021662 xustar00tshimonostaff000000 000000 30 mtime=1667036648.202552706 133 LIBARCHIVE.xattr.com.apple.macl=BACvTvofDT1JCbIHgji3s2EgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 105 SCHILY.xattr.com.apple.macl=¯Nú =I ²‚8·³a 69 LIBARCHIVE.xattr.com.apple.lastuseddate#PS=/vVcYwAAAACajzkoAAAAAA 59 SCHILY.xattr.com.apple.lastuseddate#PS=þõ\cš9( App-numero2bgc-0.020/numero2bgc.pm000644 000765 000024 00000001317 14327172750 017712 0ustar00tshimonostaff000000 000000 package App::numero2bgc ; our $VERSION = '0.020' ; our $DATE = '2022-10-29T18:23+09:00' ; =encoding utf8 =head1 NAME App::numero2bgc - Put colors on the background of each number from input text. =head1 SYNOPSIS numero2bgc 入力ã®ãƒ†ã‚­ã‚¹ãƒˆã‚’読ã¿å–ã‚Šã€æ•°å€¤ã®éƒ¨åˆ†ã‚’ (Regexp::Commons::number を使ã£ã¦) 抽出ã—ã¦ã€èƒŒæ™¯ã« ANSIエスケープシーケンスã«ã‚ˆã‚‹è‰²ã‚’付ã‘る。 最å°å€¤ã¯é’ã€ç·‘を経由ã—ã¦ã€æœ€å¤§å€¤ã¯èµ¤ã€‚15段階。 (出ç¾æ•°å€¤ã‚’uniq化ã—ãŸä¸Šã§ã€28分ä½ç‚¹ã‚’ã¨ã‚Šã€å¥‡æ•°ç•ªç›®ã®å€¤14個を抽出ã—ã¦ã€ ãれを閾値ã¨ã—ã¦ã€è‰²ã¯æ®µéšŽçš„ã«å¤‰åŒ–ã•ã›ã‚‹ã€‚) =head1 DESCRIPTION =head1 SEE ALSO =cut 1 ; App-numero2bgc-0.020/PaxHeader/Changes000644 000765 000024 00000000614 14327171350 020547 xustar00tshimonostaff000000 000000 30 mtime=1667035880.442503424 133 LIBARCHIVE.xattr.com.apple.macl=BACvTvofDT1JCbIHgji3s2EgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 105 SCHILY.xattr.com.apple.macl=¯Nú =I ²‚8·³a 69 LIBARCHIVE.xattr.com.apple.lastuseddate#PS=/vVcYwAAAAADTHomAAAAAA 59 SCHILY.xattr.com.apple.lastuseddate#PS=þõ\cLz& App-numero2bgc-0.020/Changes000644 000765 000024 00000000334 14327171350 016575 0ustar00tshimonostaff000000 000000 Revision history for the module "App::numero2bgc" : ----- 以å‰ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚り。2020å¹´é ƒã‹ã‚‰ä½œã£ã¦ã„る。colorbackã¨ã„ã†åå‰ã§ã€‚ 0.020 2022-10-29 (sat) 一旦機能ã™ã‚‹ã‚‚ã®ã‚’作æˆã€‚ App-numero2bgc-0.020/MANIFEST000644 000765 000024 00000000402 14327211431 016422 0ustar00tshimonostaff000000 000000 Changes numero2bgc numero2bgc.pm INSTALL Makefile.PL MANIFEST This list of files README META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) App-numero2bgc-0.020/PaxHeader/README000644 000765 000024 00000000614 14327172640 020137 xustar00tshimonostaff000000 000000 30 mtime=1667036576.263607461 133 LIBARCHIVE.xattr.com.apple.macl=BACvTvofDT1JCbIHgji3s2EgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 105 SCHILY.xattr.com.apple.macl=¯Nú =I ²‚8·³a 69 LIBARCHIVE.xattr.com.apple.lastuseddate#PS=/vVcYwAAAAAxVEUnAAAAAA 59 SCHILY.xattr.com.apple.lastuseddate#PS=þõ\c1TE' App-numero2bgc-0.020/README000644 000765 000024 00000001226 14327172640 016166 0ustar00tshimonostaff000000 000000 This module provides a Unix-like command `expskip'. 入力ã®ãƒ†ã‚­ã‚¹ãƒˆã‚’読ã¿å–ã‚Šã€æ•°å€¤ã®éƒ¨åˆ†ã‚’ (Regexp::Commons::number を使ã£ã¦) 抽出ã—ã¦ã€èƒŒæ™¯ã« ANSIエスケープシーケンスã«ã‚ˆã‚‹è‰²ã‚’付ã‘る。 最å°å€¤ã¯é’ã€ç·‘を経由ã—ã¦ã€æœ€å¤§å€¤ã¯èµ¤ã€‚15段階。 (出ç¾æ•°å€¤ã‚’uniq化ã—ãŸä¸Šã§ã€28分ä½ç‚¹ã‚’ã¨ã‚Šã€å¥‡æ•°ç•ªç›®ã®å€¤14個を抽出ã—ã¦ã€ ãれを閾値ã¨ã—ã¦ã€è‰²ã¯æ®µéšŽçš„ã«å¤‰åŒ–ã•ã›ã‚‹ã€‚) Copyright (c) 2021 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. App-numero2bgc-0.020/META.yml000644 000765 000024 00000000761 14327211430 016551 0ustar00tshimonostaff000000 000000 --- abstract: unknown author: - unknown build_requires: ExtUtils::MakeMaker: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010' license: unknown meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: App-numero2bgc no_index: directory: - t - inc requires: {} version: '0.020' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' App-numero2bgc-0.020/PaxHeader/Makefile.PL000644 000765 000024 00000000614 14327172664 021237 xustar00tshimonostaff000000 000000 30 mtime=1667036596.072206431 133 LIBARCHIVE.xattr.com.apple.macl=BACvTvofDT1JCbIHgji3s2EgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 105 SCHILY.xattr.com.apple.macl=¯Nú =I ²‚8·³a 69 LIBARCHIVE.xattr.com.apple.lastuseddate#PS=/vVcYwAAAAD84xMnAAAAAA 59 SCHILY.xattr.com.apple.lastuseddate#PS=þõ\cüã' App-numero2bgc-0.020/Makefile.PL000644 000765 000024 00000000444 14327172664 017267 0ustar00tshimonostaff000000 000000 use ExtUtils::MakeMaker; WriteMakefile ( NAME => 'App::numero2bgc' , VERSION_FROM => 'numero2bgc.pm' , EXE_FILES => [ 'numero2bgc' ] , PREREQ_PM => { } , PREREQ_FATAL => not 1 , AUTHOR => 'Toshiyuki SHIMONO (bin4tsv at gmail.com)' , LICENSE => 'perl_5' ) ; App-numero2bgc-0.020/PaxHeader/numero2bgc000755 000765 000024 00000000236 14327172763 021256 xustar00tshimonostaff000000 000000 30 mtime=1667036659.017503119 69 LIBARCHIVE.xattr.com.apple.lastuseddate#PS=/vVcYwAAAACyT+InAAAAAA 59 SCHILY.xattr.com.apple.lastuseddate#PS=þõ\c²Oâ' App-numero2bgc-0.020/numero2bgc000755 000765 000024 00000007524 14327172763 017314 0ustar00tshimonostaff000000 000000 #!/usr/bin/perl use 5.012 ; use strict ; use warnings ; use Getopt::Std ; getopts '~2:M:r:u:' , \my%o ; use Regexp::Common qw [ number ] ; use Term::ANSIColor qw[ :constants color ] ; $Term::ANSIColor::AUTORESET = 1 ; use List::Util qw [ min max uniq ] ; use Data::Dumper ; use POSIX qw [floor ceil ] ; my $M = $o{M} // 15 ; # 段階ã®æ•° my ($v1,$v2,$v3) = split /,/, $o{r} //'' , 3 ; # -r ã‹ã‚‰æŠ½å‡ºã€‚å…¨ã¦ã¾ãŸã¯æœ«å°¾1個ãŒundefã®å ´åˆã‚り。 sub numExtract ($) { my @tmp = grep /$RE{num}{real}/o , @{$_[0]} ; @tmp = grep { $v1 <= $_ && $_ <= $v2 } @tmp if defined $v1 ; @tmp = sort { $a <=> $b } @tmp ; @tmp = uniq @tmp if 0 ne ($o{u}//'') ; return @tmp ; } undef $/ ; my $text = <> ; my @parts = split /($RE{num}{real})/o , $text , -1 ; # 読んã ãƒ†ã‚­ã‚¹ãƒˆã‚’ã€æ•°å€¤ã®éƒ¨åˆ†ã¨ãれ以外ã«ãƒãƒ©ãƒãƒ©ã«ã€‚ my @nums = numExtract \@parts ; my @chop = ('-inf', map $nums[ $#nums * (2*$_-1)/(2*$M-2) ] , 1..$M-1 ) ; # <-- - $M==1ã®æ™‚?? #say CYAN join ":" , @chop ; my %n2c ;#= do{ my $c=0; map{while($chop[$c++]>$_){1}; say($_,":",$c-1) } uniq @nums }; # 数値を色レベルã«å¤‰æ›ã™ã‚‹ãŸã‚ã®ãƒãƒƒã‚·ãƒ¥ do { my $c = 0 ; # 色ã®æ®µéšŽã®åˆæœŸå€¤ for ( uniq @nums ) { $c++ while $c <= $#chop && $chop [ $c ] < $_ ; # <= 㯠< ã ã¨ä¸éƒ½åˆã£ã½ã„。 $n2c { $_ } = $c - 1 ; } } ; #for ( sort {$a<=>$b} keys %n2c ) { say CYAN "$_ : $n2c{$_}"} ; exit ; my %usedC ; #使ã‚ã‚ŒãŸè‰²ã‚’記録 for ( @parts ) { if ( /$RE{num}{real}/o ){ my $c ; if ( defined $v1 and $_ < $v1 || $v2 < $_ ) { do { print ; next } if 0 eq ( $v3 // '' ) ; $c = $_ < $v1 ? 0 : $M - 1 ; } $c //= $n2c{$_} ;#say RED $c ; my $R = ceil max 0 , min 5 , $c - ($M/2-.5) ; my $G = max 0, ceil min 2 , ($M/2-.5) - abs ( ($M/2-.5) - $c ) ; my $B = ceil max 0 , min 5, ($M/2-.5) - $c ; ($R,$B)=($B,$R) if $o{'~'} ; my $color = "bold on_rgb$R$G$B" ; $usedC { $color }++; #print "$R$G$B"; #print "$c-$R$G$B" .color( 'reset' ) ; #print "$_:$c-$R$G$B" .color( 'reset' ) ; #print color( $color ) . "$_:$c-$R$G$B" .color( 'reset' ) ; print color( "$color" ) . "$_" .color( 'reset' ) ; } else { print $_ ; } } END { exit if 0 eq ($o{2}//'') ; #my @tmp = sort {$a <=> $b } values %n2c ; #@tmp = uniq @tmp ; #my $difc = scalar @tmp ; my $difc = scalar keys %usedC ; print STDERR FAINT "$difc different background colors used ; " ; #my $alv = scalar uniq @chop ; #print STDERR FAINT "Different $alv are prepared ; " ; print STDERR FAINT "Threadsholds = { " . join(" : ",@chop[1..$#chop])." } with the length $#chop." ; say FAINT " ($0)" ; } ; #exit ; exit ; ## ヘルプã¨ãƒãƒ¼ã‚¸ãƒ§ãƒ³æƒ…å ± sub HELP_MESSAGE { use FindBin qw[ $Script ] ; $ARGV[1] //= '' ; open my $FH , '<' , $0 ; while(<$FH>){ s/\$0/$Script/g ; print $_ if $ARGV[1] eq 'opt' ? m/^\ +\-/ : s/^=head1// .. s/^=cut// ; } close $FH ; exit 0 ; } =encoding utf8 =head1 $0 入力ã®ãƒ†ã‚­ã‚¹ãƒˆã‚’読ã¿å–ã‚Šã€æ•°å€¤ã®éƒ¨åˆ†ã‚’ (Regexp::Commons::number を使ã£ã¦) 抽出ã—ã¦ã€èƒŒæ™¯ã« ANSIエスケープシーケンスã«ã‚ˆã‚‹è‰²ã‚’付ã‘る。 最å°å€¤ã¯é’ã€ç·‘を経由ã—ã¦ã€æœ€å¤§å€¤ã¯èµ¤ã€‚15段階。 (出ç¾æ•°å€¤ã‚’uniq化ã—ãŸä¸Šã§ã€28分ä½ç‚¹ã‚’ã¨ã‚Šã€å¥‡æ•°ç•ªç›®ã®å€¤14個を抽出ã—ã¦ã€ ãれを閾値ã¨ã—ã¦ã€è‰²ã¯æ®µéšŽçš„ã«å¤‰åŒ–ã•ã›ã‚‹ã€‚) 閾値ã«å¯¾ã—ã¦ã€Œä»¥ä¸‹ã€ã§åˆ¤å®šã€‚「未満ã€ã«ã‚ˆã‚‹åˆ¤å®šã§ã¯ãªã„。 オプション: -u 0 : 数値ã«å¯¾ã—㦠uniq ã®å‡¦ç†ã‚’ã—ãªã„。 -g L,U[,0] : ç€è‰²ã™ã‚‹æ•°å€¤ç¯„囲を指定ã™ã‚‹ã€‚3番目ã«0を入れるã¨ã€ç¯„囲外ã®æ•°å€¤ã¯ç€è‰²ã‚’ã—ãªã„。 -~ : 色ã®ã€èµ¤ã¨é’ã®å‚¾å‘ã‚’å転ã™ã‚‹ã€‚ -M num ; numã¯è‰²ã®å€‹æ•°ã€‚最大15。 -2 0 ; 2次情報ã®å‡ºåŠ›ã®æŠ‘制 =cut App-numero2bgc-0.020/META.json000644 000765 000024 00000001517 14327211431 016722 0ustar00tshimonostaff000000 000000 { "abstract" : "unknown", "author" : [ "unknown" ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010", "license" : [ "unknown" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "App-numero2bgc", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : {} } }, "release_status" : "stable", "version" : "0.020", "x_serialization_backend" : "JSON::PP version 4.02" }