TermExtract::JapanesePlainTextSJIS(3)

NAME
    TermExtract::JapanesePlainTextSJIS
     -- �ê–å—pŒêŽ©“®’Š�oƒ‚ƒWƒ…�[ƒ‹�i˜a•¶�uƒJƒ^ƒJƒi�EŠ¿Žš’Š�o•ûŽ®�vSJIS”Å�j

SYNOPSIS
    use TermExtract::JapanesePlainTextSJIS;

DESCRIPTION
    “ú–{Œê‚ÌƒeƒLƒXƒgƒf�[ƒ^�iSJIS)‚©‚ç‚»‚Ì‚Ü‚Ü�ê–å—pŒê‚ð’Š�o‚·‚éƒvƒ�ƒOƒ‰ƒ€�B

    “–ƒ‚ƒWƒ…�[ƒ‹‚ÌŽg—p–@‚É‚Â‚¢‚Ä‚Í�A�eƒNƒ‰ƒX�iTermExtract::Calc_Imp)‚©�A
  ˆÈ‰º‚ÌƒTƒ“ƒvƒ‹ƒXƒNƒŠƒvƒg‚ðŽQ�Æ‚Ì‚±‚Æ�B

  Sample Script
 #!/opt/local/bin/perl5.34 -w

 #
 #  ex_JPTS.pl
 #
 #  •W�€�o—Í‚É�ê–å—pŒê‚Æ‚»‚Ì�d—v“x‚ð•Ô‚·ƒvƒ�ƒOƒ‰ƒ€
 #  ˜a•¶�uƒJƒ^ƒJƒi�EŠ¿Žš’Š�o•ûŽ®�vShif-JIS”Å
 #
 #   version 0.04
 #
 #

 use TermExtract::JapanesePlainTextSJIS;
 #use strict;
 my $data = new TermExtract::JapanesePlainTextSJIS;
 my $InputFile = "JPTS_out.txt";    # “ü—Íƒtƒ@ƒCƒ‹

 # ƒvƒ�ƒZƒX‚ÌˆÙ�í�I—¹Žž�ˆ—�
 # (ƒ�ƒbƒNƒfƒBƒŒƒNƒgƒŠ‚ðŽg—p‚µ‚½�ê�‡‚Ì‚Ý�j
 $SIG{INT} = $SIG{QUIT} = $SIG{TERM} = 'sigexit';

 # �o—Íƒ‚�[ƒh‚ðŽw’è
 # 1 �¨ �ê–å—pŒê�{�d—v“x�A2 �¨ �ê–å—pŒê‚Ì‚Ý
 # 3 �¨ ƒJƒ“ƒ}‹æ�Ø‚è
 my $output_mode = 1;

 #
 # �d—v“xŒvŽZ‚Å�A˜A�ÚŒê‚Ì"‰„‚×�”"�A"ˆÙ‚È‚è�”"�A"ƒp�[ƒvƒŒƒLƒVƒeƒB"‚Ì‚¢
 # ‚¸‚ê‚ð‚Æ‚é‚©‘I‘ð�Bƒp�[ƒvƒŒƒLƒVƒeƒB‚Í�uŠw�K‹@”\�v‚ðŽg‚¦‚È‚¢
 # ‚Ü‚½�A"˜A�ÚŒê‚Ì�î•ñ‚ðŽg‚í‚È‚¢"‘I‘ð‚à‚ ‚è�A‚±‚Ì�ê�‡‚Í—pŒê�oŒ»‰ñ�”
 # (‚Æ�Ý’è‚³‚ê‚Ä‚¢‚ê‚ÎIDF‚Ì‘g‚Ý�‡‚í‚¹�j‚Å�d—v“xŒvŽZ‚ð�s‚¤
 # �iƒfƒtƒHƒ‹ƒg‚Í"‰„‚×�”"‚ð‚Æ‚é $obj->use_total)
 #
 #$data->use_total;      # ‰„‚×�”‚ð‚Æ‚é
 #$data->use_uniq;       # ˆÙ‚È‚è�”‚ð‚Æ‚é
 #$data->use_Perplexity; # ƒp�[ƒvƒŒƒLƒVƒeƒB‚ð‚Æ‚é(TermExtract 3.04 ˆÈ�ã)
 #$data->no_LR;          # —×�Ú�î•ñ‚ðŽg‚í‚È‚¢ (TermExtract 4.02 ˆÈ�ã)

 #
 # �d—v“xŒvŽZ‚Å�A˜A�Ú�î•ñ‚ÉŠ|‚¯�‡‚í‚¹‚é—pŒê�oŒ»•p“x�î•ñ‚ð‘I‘ð‚·‚é
 # $data->no_LR; ‚Æ‚Ì‘g‚Ý�‡‚í‚¹‚Å—pŒê�oŒ»•p“x‚Ì‚Ý‚Ì�d—v“x‚àŽZ�o‰Â”\
 # �iƒfƒtƒHƒ‹ƒg‚Í "Frequency" $data->use_frq)
 # TF‚Í‚ ‚é—pŒê‚ª‘¼‚Ì—pŒê‚Ìˆê•”‚ÉŽg‚í‚ê‚Ä‚¢‚½�ê�‡‚É‚àƒJƒEƒ“ƒg
 # Frequency ‚Í—pŒê‚ª‘¼‚Ì—pŒê‚Ìˆê•”‚ÉŽg‚í‚ê‚Ä‚¢‚½�ê�‡‚ÉƒJƒEƒ“ƒg‚µ‚È‚¢
 #
 #$data->use_TF;   # TF (Term Frequency) (TermExtract 4.02 ˆÈ�ã)
 #$data->use_frq;  # Frequency‚É‚æ‚é—pŒê•p“x
 #$data->no_frq;   # •p“x�î•ñ‚ðŽg‚í‚È‚¢

 #
 # �d—v“xŒvŽZ‚Å�AŠw�K‹@”\‚ðŽg‚¤‚©‚Ç‚¤‚©‘I‘ð
 # �iƒfƒtƒHƒ‹ƒg‚Í�AŽg—p‚µ‚È‚¢ $obj->no_stat)
 #
 #$data->use_stat; # Šw�K‹@”\‚ðŽg‚¤
 #$data->no_stat;  # Šw�K‹@”\‚ðŽg‚í‚È‚¢

 #
 # �d—v“xŒvŽZ‚Å�A�uƒhƒLƒ…ƒ�ƒ“ƒg’†‚Ì—pŒê‚Ì•p“x�v‚Æ�u˜A�ÚŒê‚Ì�d—v“x�v
 # ‚Ì‚Ç‚¿‚ç‚É”ä�d‚ð‚¨‚­‚©‚ð�Ý’è‚·‚é�B
 # ƒfƒtƒHƒ‹ƒg’l‚Í‚P
 # ’l‚ª‘å‚«‚¢‚Ù‚Ç�uƒhƒLƒ…ƒ�ƒ“ƒg’†‚Ì—pŒê‚Ì•p“x�v‚Ì”ä�d‚ª�‚‚Ü‚é
 #
 #$data->average_rate(0.5);

 #
 # Šw�K‹@”\—pDB‚Éƒf�[ƒ^‚ð’~�Ï‚·‚é‚©‚Ç‚¤‚©‘I‘ð
 # �d—v“xŒvŽZ‚Å�AŠw�K‹@”\‚ðŽg‚¤‚Æ‚«‚Í�AƒZƒbƒg‚µ‚Ä‚¨‚¢‚½‚Ù‚¤‚ª
 # –³“ï�B�ˆ—�‘Î�Û‚ÉŠw�K‹@”\—pDB‚É“o˜^‚³‚ê‚Ä‚¢‚È‚¢Œê‚ªŠÜ‚Ü‚ê‚é
 # ‚Æ�³‚µ‚­“®�ì‚µ‚È‚¢�B
 # �iƒfƒtƒHƒ‹ƒg‚Í�A’~�Ï‚µ‚È‚¢ $obj->no_storage�j
 #
 #$data->use_storage; # ’~�Ï‚·‚é
 #$data->no_storage;  # ’~�Ï‚µ‚È‚¢

 #
 # Šw�K‹@”\—pDB‚ÉŽg—p‚·‚éDBM‚ðSDBM_File‚ÉŽw’è
 # �iƒfƒtƒHƒ‹ƒg‚Í�ADB_File‚ÌBTREEƒ‚�[ƒh�j
 #
 #$data->use_SDBM;

 #
 # ‰ß‹Ž‚ÌƒhƒLƒ…ƒ�ƒ“ƒg‚Ì—Ý�Ï“�Œv‚ðŽg‚¤�ê�‡‚Ìƒf�[ƒ^ƒx�[ƒX‚Ì
 # ƒtƒ@ƒCƒ‹–¼‚ðƒZƒbƒg
 # �iƒfƒtƒHƒ‹ƒg‚Í "stat.db"‚Æ"comb.db"�j
 #
 #$data->stat_db("statUC.db");
 #$data->comb_db("combUC.db");

 #
 # ƒf�[ƒ^ƒx�[ƒX‚Ì”r‘¼ƒ�ƒbƒN‚Ì‚½‚ß‚ÌˆêŽžƒfƒBƒŒƒNƒgƒŠ‚ðŽw’è
 # ƒfƒBƒŒƒNƒgƒŠ–¼‚ª‹ó•¶Žš—ñ�iƒfƒtƒHƒ‹ƒg�j‚Ì�ê�‡‚Íƒ�ƒbƒN‚µ‚È‚¢
 #
 #$data->lock_dir("lock_dir");

 #
 # ƒf�[ƒ^‚ð“Ç‚Ý�ž‚Ý
 # �ê–å—pŒêƒŠƒXƒg‚ð”z—ñ‚É•Ô‚·
 # �i—Ý�Ï“�ŒvDBŽg—p�AƒhƒLƒ…ƒ�ƒ“ƒg’†‚Ì•p“xŽg—p‚ÉƒZƒbƒg�j
 #
 #my @noun_list = $data->get_imp_word($str, 'var');     # “ü—Í‚ª•Ï�”
 my @noun_list = $data->get_imp_word($InputFile); # “ü—Í‚ªƒtƒ@ƒCƒ‹

 #
 # ‘O‰ñ“Ç‚Ý�ž‚ñ‚¾ƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚ðŒ³‚É
 # ƒ‚�[ƒh‚ð•Ï‚¦‚Ä�A�ê–å—pŒêƒŠƒXƒg‚ð”z—ñ‚É•Ô‚·
 #$data->use_stat->no_frq;
 #my @noun_list2 = $data->get_imp_word();
 # ‚Ü‚½�A‚»‚ÌŒ‹‰Ê‚ð•Ê‚Ìƒ‚�[ƒh‚É‚æ‚éŒ‹‰Ê‚ÆŠ|‚¯�‡‚í‚¹‚é
 #@noun_list = $data->result_filter (\@noun_list, \@noun_list2, 30, 1000);

 #
 #  �ê–å—pŒêƒŠƒXƒg‚ÆŒvŽZ‚µ‚½�d—v“x‚ð•W�€�o—Í‚É�o‚·
 #
 foreach (@noun_list) {
    # “ú•t�EŽž��‚Í•\Ž¦‚µ‚È‚¢
    next if $_->[0] =~ /^(�º˜a)*(•½�¬)*(\d+”N)*(\d+ŒŽ)*(\d+“ú)*(Œß‘O)*(ŒßŒã)*(\d+Žž)*(\d+•ª)*(\d+•b)*$/;

    # �”’l‚Ì‚Ý‚Í•\Ž¦‚µ‚È‚¢
    next if $_->[0] =~ /^\d+$/;

    # Œ‹‰Ê•\Ž¦�i$output_mode‚É‰ž‚¶‚Ä�A�o—Í—lŽ®‚ð•Ï�X
    printf "%-60s %16.2f\n", $_->[0], $_->[1] if $output_mode == 1;
    printf "%s\n",           $_->[0]          if $output_mode == 2;
    printf "%s,",            $_->[0]          if $output_mode == 3;
 }

Methods
    ‚±‚Ìƒ‚ƒWƒ…�[ƒ‹‚Å‚Í�Aget_imp_word ‚Ì‚ÝŽÀ‘•‚µ�A‚»‚êˆÈŠO‚Ìƒ�ƒ\ƒbƒh‚Í�e
  ƒ‚ƒWƒ…�[ƒ‹ TermExtract::Calc_Imp ‚ÅŽÀ‘•‚³‚ê‚Ä‚¢‚é�B
    get_imp_word ‚ÍƒXƒgƒbƒvƒ��[ƒh‚É‚æ‚è•¶�Í‚ð•¡�‡Œê‚Ì’PˆÊ‚Ü‚Å‚É•ªŠ„‚µ‚Ä
  ‚¢‚é�B‚»‚êˆÈŠO‚Ìƒ�ƒ\ƒbƒh‚É‚Â‚¢‚Ä‚Í�ATermExtract::Calc_Imp ‚ÌPODƒhƒLƒ…
  ƒ�ƒ“ƒg‚ðŽQ�Æ‚·‚é‚±‚Æ�B

  get_imp_word
    “ú–{Œê‚Ì•¶�Í‚©‚çŽŸ‚Ìƒ‹�[ƒ‹‚É‚æ‚è•¡�‡Œê‚ð’Š�o‚·‚é�B‘æ‚Pˆø�”‚Í�A�ˆ—�
  ‘Î�Û‚Ìƒf�[ƒ^�A‘æ‚Qˆø�”‚Í‘æ‚Pˆø�”‚ÌŽí•Ê‚Å‚ ‚é�BƒfƒtƒHƒ‹ƒg‚Å‚Í�A‘æ‚Pˆø
  �”‚Í�A“ú–{ŒêŒê‚ÌƒeƒLƒXƒgƒtƒ@ƒCƒ‹‚Æ‚È‚é�B‘æ‚Qˆø�”‚É•¶Žš—ñ'var'‚ªƒZƒbƒg
  ‚³‚ê‚½‚Æ‚«‚É‚Í�A‘æˆêˆø�”‚ð“ú–{Œê‚ÌƒeƒLƒXƒgƒf�[ƒ^‚ª“ü‚Á‚½ƒXƒJƒ‰�[•Ï�”
  ‚Æ‰ðŽß‚·‚é�B

    �i‚P�j˜A‘±‚µ‚½�uŠ¿Žš�v�A�uƒJƒ^ƒJƒi�v�A�u‰pŽš‹y‚Ñ‚PƒoƒCƒg‹L�†�v‚ð’Š
�@�@�@�@�o‚·‚é�B
     (‚Q�j‰ü�s‚ª‚ ‚Á‚½�ê�‡‚Í�A‚»‚±‚Å•¡�‡Œê‚Ì‹æ�Ø‚è‚Æ‚·‚é
    �i‚R�j�uŠ¿Žš�v‚Í‚P•¶Žš’PˆÊ�A�uƒJƒ^ƒJƒi�v‹y‚Ñ�u‰pŽš‹y‚Ñ‚PƒoƒCƒg‹L�†
�@�@�@�@�v�A‚ÍŒê’PˆÊ‚Å‚Ü‚Æ‚Ü‚è‚ð�ì‚é�B
    �i‚S�j�ã‹L‚R�j‚ª‚Q’PˆÊˆÈ�ã˜A‘±‚µ‚Ä‚¢‚é�ê�‡‚É�ê–å—pŒê‚Æ‚·‚é�B
    �i‚T�j�d—v“x‚ÌŒvŽZ‚Í�A�ã‹L‚R�j‚Ì’PˆÊ‚Å�s‚¤

SEE ALSO
    TermExtract::Calc_Imp
    TermExtract::Chasen
    TermExtract::MeCab
    TermExtract::BrillsTagger
    TermExtract::EnglishPlainText
    TermExtract::ChainesPlainTextUC
    TermExtract::ChainesPlainTextGB
    TermExtract::ICTCLAS
    TermExtract::JapanesePlainTextEUC

COPYRIGHT
    ‚±‚Ìƒvƒ�ƒOƒ‰ƒ€‚Í�A“Œ‹ž‘åŠw ‘O“c˜N (maeda@lib.u-tokyo.ac.jp)‚ª�ì�¬‚µ
  ‚½‚à‚Ì‚Å‚ ‚é�B‚±‚Ì�ê–å—pŒê’Š�o‚ÌƒAƒCƒfƒA‚Í“Œ‹ž‘åŠw ’†�ì—TŽu‹³Žö‚Ì’†•¶
  ƒXƒgƒbƒvƒ��[ƒh•ûŽ®‚É‚æ‚é�ê–å—pŒê�d—v“xŒvŽZ‚Ì—�˜_‚Æ�A�u�³‹K•\Œ»‚ÆƒeƒLƒX
  ƒg�Eƒ}ƒCƒjƒ“ƒO�v(�²—Ç–Ø�¹•Ò�A�V“c‹`•F’˜ –¾�Î�‘“X 2003.10�j‚É‹L�Ú‚³‚ê‚Ä
  ‚¢‚½ƒJƒ^ƒJƒi�EŠ¿Žš’Š�o‚É‚æ‚éƒL�[ƒ��[ƒh�Ø‚è�o‚µ‚ÌƒAƒCƒfƒA‚ðŒ³‚É‚µ‚Ä‚¢‚é�B

    ‚È‚¨�A–{ƒvƒ�ƒOƒ‰ƒ€‚ÌŽg—p‚É‚¨‚¢‚Ä�¶‚¶‚½‚¢‚©‚È‚éŒ‹‰Ê‚ÉŠÖ‚µ‚Ä‚à“–•û‚Å‚Í
  ˆê�Ø�Ó”C‚ð•‰‚í‚È‚¢�B

POD ERRORS
Hey! The above document had some coding errors, which are explained below:

Around line 134:
    Non-ASCII character seen before =encoding in '�ê–å—pŒêŽ©“®’Š�oƒ‚ƒWƒ…�[ƒ‹�i˜a•¶�uƒJƒ^ƒJƒi�EŠ¿Žš’Š�o•ûŽ®�vSJIS”Å�j'. Assuming CP1252