TermExtract::JapanesePlainTextEUC(3)

NAME
    TermExtract::JapanesePlainTextEUC
     -- ÀìÌçÍÑ¸ì¼«Æ°Ãê½Ð¥â¥¸¥å¡¼¥ë¡ÊÏÂÊ¸¡Ö¥«¥¿¥«¥Ê¡¦´Á»úÃê½ÐÊý¼°¡×EUCÈÇ¡Ë

SYNOPSIS
    use TermExtract::JapanesePlainTextEUC;

DESCRIPTION
    ÆüËÜ¸ì¤Î¥Æ¥­¥¹¥È¥Ç¡¼¥¿¡ÊEUC)¤«¤é¤½¤Î¤Þ¤ÞÀìÌçÍÑ¸ì¤òÃê½Ð¤¹¤ë¥×¥í¥°¥é¥à¡£

    Åö¥â¥¸¥å¡¼¥ë¤Î»ÈÍÑË¡¤Ë¤Ä¤¤¤Æ¤Ï¡¢¿Æ¥¯¥é¥¹¡ÊTermExtract::Calc_Imp)¤«¡¢
  °Ê²¼¤Î¥µ¥ó¥×¥ë¥¹¥¯¥ê¥×¥È¤ò»²¾È¤Î¤³¤È¡£

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

 #
 #  ex_JPTE.pl
 #
 #  É¸½à½ÐÎÏ¤ËÀìÌçÍÑ¸ì¤È¤½¤Î½ÅÍ×ÅÙ¤òÊÖ¤¹¥×¥í¥°¥é¥à
 #  ÏÂÊ¸¡Ö¥«¥¿¥«¥Ê¡¦´Á»úÃê½ÐÊý¼°¡×EUCÈÇ
 #
 #   version 0.05
 #
 #

 use TermExtract::JapanesePlainTextEUC;
 #use strict;
 my $data = new TermExtract::JapanesePlainTextEUC;
 my $InputFile = "JPTE_out.txt";    # ÆþÎÏ¥Õ¥¡¥¤¥ë

 # ¥×¥í¥»¥¹¤Î°Û¾ï½ªÎ»»þ½èÍý
 # (¥í¥Ã¥¯¥Ç¥£¥ì¥¯¥È¥ê¤ò»ÈÍÑ¤·¤¿¾ì¹ç¤Î¤ß¡Ë
 $SIG{INT} = $SIG{QUIT} = $SIG{TERM} = 'sigexit';

 # ½ÐÎÏ¥â¡¼¥É¤ò»ØÄê
 # 1 ¢ª ÀìÌçÍÑ¸ì¡Ü½ÅÍ×ÅÙ¡¢2 ¢ª ÀìÌçÍÑ¸ì¤Î¤ß
 # 3 ¢ª ¥«¥ó¥Þ¶èÀÚ¤ê
 my $output_mode = 1;

 #
 # ½ÅÍ×ÅÙ·×»»¤Ç¡¢Ï¢ÀÜ¸ì¤Î"±ä¤Ù¿ô"¡¢"°Û¤Ê¤ê¿ô"¡¢"¥Ñ¡¼¥×¥ì¥­¥·¥Æ¥£"¤Î¤¤
 # ¤º¤ì¤ò¤È¤ë¤«ÁªÂò¡£¥Ñ¡¼¥×¥ì¥­¥·¥Æ¥£¤Ï¡Ö³Ø½¬µ¡Ç½¡×¤ò»È¤¨¤Ê¤¤
 # ¤Þ¤¿¡¢"Ï¢ÀÜ¸ì¤Î¾ðÊó¤ò»È¤ï¤Ê¤¤"ÁªÂò¤â¤¢¤ê¡¢¤³¤Î¾ì¹ç¤ÏÍÑ¸ì½Ð¸½²ó¿ô
 # (¤ÈÀßÄê¤µ¤ì¤Æ¤¤¤ì¤ÐIDF¤ÎÁÈ¤ß¹ç¤ï¤»¡Ë¤Ç½ÅÍ×ÅÙ·×»»¤ò¹Ô¤¦
 # ¡Ê¥Ç¥Õ¥©¥ë¥È¤Ï"±ä¤Ù¿ô"¤ò¤È¤ë $obj->use_total)
 #
 #$data->use_total;      # ±ä¤Ù¿ô¤ò¤È¤ë
 #$data->use_uniq;       # °Û¤Ê¤ê¿ô¤ò¤È¤ë
 #$data->use_Perplexity; # ¥Ñ¡¼¥×¥ì¥­¥·¥Æ¥£¤ò¤È¤ë(TermExtract 3.04 °Ê¾å)
 #$data->no_LR;          # ÎÙÀÜ¾ðÊó¤ò»È¤ï¤Ê¤¤ (TermExtract 4.02 °Ê¾å)

 #
 # ½ÅÍ×ÅÙ·×»»¤Ç¡¢Ï¢ÀÜ¾ðÊó¤Ë³Ý¤±¹ç¤ï¤»¤ëÍÑ¸ì½Ð¸½ÉÑÅÙ¾ðÊó¤òÁªÂò¤¹¤ë
 # $data->no_LR; ¤È¤ÎÁÈ¤ß¹ç¤ï¤»¤ÇÍÑ¸ì½Ð¸½ÉÑÅÙ¤Î¤ß¤Î½ÅÍ×ÅÙ¤â»»½Ð²ÄÇ½
 # ¡Ê¥Ç¥Õ¥©¥ë¥È¤Ï "Frequency" $data->use_frq)
 # TF¤Ï¤¢¤ëÍÑ¸ì¤¬Â¾¤ÎÍÑ¸ì¤Î°ìÉô¤Ë»È¤ï¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¤â¥«¥¦¥ó¥È
 # Frequency ¤ÏÍÑ¸ì¤¬Â¾¤ÎÍÑ¸ì¤Î°ìÉô¤Ë»È¤ï¤ì¤Æ¤¤¤¿¾ì¹ç¤Ë¥«¥¦¥ó¥È¤·¤Ê¤¤
 #
 #$data->use_TF;   # TF (Term Frequency) (TermExtract 4.02 °Ê¾å)
 #$data->use_frq;  # Frequency¤Ë¤è¤ëÍÑ¸ìÉÑÅÙ
 #$data->no_frq;   # ÉÑÅÙ¾ðÊó¤ò»È¤ï¤Ê¤¤

 #
 # ½ÅÍ×ÅÙ·×»»¤Ç¡¢³Ø½¬µ¡Ç½¤ò»È¤¦¤«¤É¤¦¤«ÁªÂò
 # ¡Ê¥Ç¥Õ¥©¥ë¥È¤Ï¡¢»ÈÍÑ¤·¤Ê¤¤ $obj->no_stat)
 #
 #$data->use_stat; # ³Ø½¬µ¡Ç½¤ò»È¤¦
 #$data->no_stat;  # ³Ø½¬µ¡Ç½¤ò»È¤ï¤Ê¤¤

 #
 # ½ÅÍ×ÅÙ·×»»¤Ç¡¢¡Ö¥É¥­¥å¥á¥ó¥ÈÃæ¤ÎÍÑ¸ì¤ÎÉÑÅÙ¡×¤È¡ÖÏ¢ÀÜ¸ì¤Î½ÅÍ×ÅÙ¡×
 # ¤Î¤É¤Á¤é¤ËÈæ½Å¤ò¤ª¤¯¤«¤òÀßÄê¤¹¤ë¡£
 # ¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï£±
 # ÃÍ¤¬Âç¤­¤¤¤Û¤É¡Ö¥É¥­¥å¥á¥ó¥ÈÃæ¤ÎÍÑ¸ì¤ÎÉÑÅÙ¡×¤ÎÈæ½Å¤¬¹â¤Þ¤ë
 #
 #$data->average_rate(0.5);

 #
 # ³Ø½¬µ¡Ç½ÍÑDB¤Ë¥Ç¡¼¥¿¤òÃßÀÑ¤¹¤ë¤«¤É¤¦¤«ÁªÂò
 # ½ÅÍ×ÅÙ·×»»¤Ç¡¢³Ø½¬µ¡Ç½¤ò»È¤¦¤È¤­¤Ï¡¢¥»¥Ã¥È¤·¤Æ¤ª¤¤¤¿¤Û¤¦¤¬
 # ÌµÆñ¡£½èÍýÂÐ¾Ý¤Ë³Ø½¬µ¡Ç½ÍÑDB¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤¤¸ì¤¬´Þ¤Þ¤ì¤ë
 # ¤ÈÀµ¤·¤¯Æ°ºî¤·¤Ê¤¤¡£
 # ¡Ê¥Ç¥Õ¥©¥ë¥È¤Ï¡¢ÃßÀÑ¤·¤Ê¤¤ $obj->no_storage¡Ë
 #
 #$data->use_storage; # ÃßÀÑ¤¹¤ë
 #$data->no_storage;  # ÃßÀÑ¤·¤Ê¤¤

 #
 # ³Ø½¬µ¡Ç½ÍÑDB¤Ë»ÈÍÑ¤¹¤ëDBM¤òSDBM_File¤Ë»ØÄê
 # ¡Ê¥Ç¥Õ¥©¥ë¥È¤Ï¡¢DB_File¤ÎBTREE¥â¡¼¥É¡Ë
 #
 #$data->use_SDBM;

 #
 # ²áµî¤Î¥É¥­¥å¥á¥ó¥È¤ÎÎßÀÑÅý·×¤ò»È¤¦¾ì¹ç¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î
 # ¥Õ¥¡¥¤¥ëÌ¾¤ò¥»¥Ã¥È
 # ¡Ê¥Ç¥Õ¥©¥ë¥È¤Ï "stat.db"¤È"comb.db"¡Ë
 #
 #$data->stat_db("statUC.db");
 #$data->comb_db("combUC.db");

 #
 # ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÇÓÂ¾¥í¥Ã¥¯¤Î¤¿¤á¤Î°ì»þ¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄê
 # ¥Ç¥£¥ì¥¯¥È¥êÌ¾¤¬¶õÊ¸»úÎó¡Ê¥Ç¥Õ¥©¥ë¥È¡Ë¤Î¾ì¹ç¤Ï¥í¥Ã¥¯¤·¤Ê¤¤
 #
 #$data->lock_dir("lock_dir");

 #
 # ¥Ç¡¼¥¿¤òÆÉ¤ß¹þ¤ß
 # ÀìÌçÍÑ¸ì¥ê¥¹¥È¤òÇÛÎó¤ËÊÖ¤¹
 # ¡ÊÎßÀÑÅý·×DB»ÈÍÑ¡¢¥É¥­¥å¥á¥ó¥ÈÃæ¤ÎÉÑÅÙ»ÈÍÑ¤Ë¥»¥Ã¥È¡Ë
 #
 #my @noun_list = $data->get_imp_word($str, 'var');     # ÆþÎÏ¤¬ÊÑ¿ô
 my @noun_list = $data->get_imp_word($InputFile); # ÆþÎÏ¤¬¥Õ¥¡¥¤¥ë

 #
 # Á°²óÆÉ¤ß¹þ¤ó¤À¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤ò¸µ¤Ë
 # ¥â¡¼¥É¤òÊÑ¤¨¤Æ¡¢ÀìÌçÍÑ¸ì¥ê¥¹¥È¤òÇÛÎó¤ËÊÖ¤¹
 #$data->use_stat->no_frq;
 #my @noun_list2 = $data->get_imp_word();
 # ¤Þ¤¿¡¢¤½¤Î·ë²Ì¤òÊÌ¤Î¥â¡¼¥É¤Ë¤è¤ë·ë²Ì¤È³Ý¤±¹ç¤ï¤»¤ë
 #@noun_list = $data->result_filter (\@noun_list, \@noun_list2, 30, 1000);

 #
 #  ÀìÌçÍÑ¸ì¥ê¥¹¥È¤È·×»»¤·¤¿½ÅÍ×ÅÙ¤òÉ¸½à½ÐÎÏ¤Ë½Ð¤¹
 #
 foreach (@noun_list) {
    # ÆüÉÕ¡¦»þ¹ï¤ÏÉ½¼¨¤·¤Ê¤¤
    next if $_->[0] =~ /^(¾¼ÏÂ)*(Ê¿À®)*(\d+Ç¯)*(\d+·î)*(\d+Æü)*(¸áÁ°)*(¸á¸å)*(\d+»þ)*(\d+Ê¬)*(\d+ÉÃ)*$/;

    # ¿ôÃÍ¤Î¤ß¤ÏÉ½¼¨¤·¤Ê¤¤
    next if $_->[0] =~ /^\d+$/;

    # ·ë²ÌÉ½¼¨¡Ê$output_mode¤Ë±þ¤¸¤Æ¡¢½ÐÎÏÍÍ¼°¤òÊÑ¹¹
    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
    ¤³¤Î¥â¥¸¥å¡¼¥ë¤Ç¤Ï¡¢get_imp_word ¤Î¤ß¼ÂÁõ¤·¡¢¤½¤ì°Ê³°¤Î¥á¥½¥Ã¥É¤Ï¿Æ
  ¥â¥¸¥å¡¼¥ë TermExtract::Calc_Imp ¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£
    get_imp_word ¤Ï¥¹¥È¥Ã¥×¥ï¡¼¥É¤Ë¤è¤êÊ¸¾Ï¤òÊ£¹ç¸ì¤ÎÃ±°Ì¤Þ¤Ç¤ËÊ¬³ä¤·¤Æ
  ¤¤¤ë¡£¤½¤ì°Ê³°¤Î¥á¥½¥Ã¥É¤Ë¤Ä¤¤¤Æ¤Ï¡¢TermExtract::Calc_Imp ¤ÎPOD¥É¥­¥å
  ¥á¥ó¥È¤ò»²¾È¤¹¤ë¤³¤È¡£

  get_imp_word
    ÆüËÜ¸ì¤ÎÊ¸¾Ï¤«¤é¼¡¤Î¥ë¡¼¥ë¤Ë¤è¤êÊ£¹ç¸ì¤òÃê½Ð¤¹¤ë¡£Âè£±°ú¿ô¤Ï¡¢½èÍý
  ÂÐ¾Ý¤Î¥Ç¡¼¥¿¡¢Âè£²°ú¿ô¤ÏÂè£±°ú¿ô¤Î¼ïÊÌ¤Ç¤¢¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢Âè£±°ú
  ¿ô¤Ï¡¢ÆüËÜ¸ì¸ì¤Î¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤È¤Ê¤ë¡£Âè£²°ú¿ô¤ËÊ¸»úÎó'var'¤¬¥»¥Ã¥È
  ¤µ¤ì¤¿¤È¤­¤Ë¤Ï¡¢Âè°ì°ú¿ô¤òÆüËÜ¸ì¤Î¥Æ¥­¥¹¥È¥Ç¡¼¥¿¤¬Æþ¤Ã¤¿¥¹¥«¥é¡¼ÊÑ¿ô
  ¤È²ò¼á¤¹¤ë¡£

    ¡Ê£±¡ËÏ¢Â³¤·¤¿¡Ö´Á»ú¡×¡¢¡Ö¥«¥¿¥«¥Ê¡×¡¢¡Ö±Ñ»úµÚ¤Ó£±¥Ð¥¤¥Èµ­¹æ¡×¤òÃê
¡¡¡¡¡¡¡¡½Ð¤¹¤ë¡£
     (£²¡Ë²þ¹Ô¤¬¤¢¤Ã¤¿¾ì¹ç¤Ï¡¢¤½¤³¤ÇÊ£¹ç¸ì¤Î¶èÀÚ¤ê¤È¤¹¤ë
    ¡Ê£³¡Ë¡Ö´Á»ú¡×¤Ï£±Ê¸»úÃ±°Ì¡¢¡Ö¥«¥¿¥«¥Ê¡×µÚ¤Ó¡Ö±Ñ»úµÚ¤Ó£±¥Ð¥¤¥Èµ­¹æ
¡¡¡¡¡¡¡¡¡×¡¢¤Ï¸ìÃ±°Ì¤Ç¤Þ¤È¤Þ¤ê¤òºî¤ë¡£
    ¡Ê£´¡Ë¾åµ­£³¡Ë¤¬£²Ã±°Ì°Ê¾åÏ¢Â³¤·¤Æ¤¤¤ë¾ì¹ç¤ËÀìÌçÍÑ¸ì¤È¤¹¤ë¡£
    ¡Ê£µ¡Ë½ÅÍ×ÅÙ¤Î·×»»¤Ï¡¢¾åµ­£³¡Ë¤ÎÃ±°Ì¤Ç¹Ô¤¦

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

COPYRIGHT
    ¤³¤Î¥×¥í¥°¥é¥à¤Ï¡¢ÅìµþÂç³Ø Á°ÅÄÏ¯ (maeda@lib.u-tokyo.ac.jp)¤¬ºîÀ®¤·
  ¤¿¤â¤Î¤Ç¤¢¤ë¡£¤³¤ÎÀìÌçÍÑ¸ìÃê½Ð¤Î¥¢¥¤¥Ç¥¢¤ÏÅìµþÂç³Ø ÃæÀîÍµ»Ö¶µ¼ø¤ÎÃæÊ¸
  ¥¹¥È¥Ã¥×¥ï¡¼¥ÉÊý¼°¤Ë¤è¤ëÀìÌçÍÑ¸ì½ÅÍ×ÅÙ·×»»¤ÎÍýÏÀ¤È¡¢¡ÖÀµµ¬É½¸½¤È¥Æ¥­¥¹
  ¥È¡¦¥Þ¥¤¥Ë¥ó¥°¡×(º´ÎÉÌÚ¾»ÊÔ¡¢¿·ÅÄµÁÉ§Ãø ÌÀÀÐ½ñÅ¹ 2003.10¡Ë¤Ëµ­ºÜ¤µ¤ì¤Æ
  ¤¤¤¿¥«¥¿¥«¥Ê¡¦´Á»úÃê½Ð¤Ë¤è¤ë¥­¡¼¥ï¡¼¥ÉÀÚ¤ê½Ð¤·¤Î¥¢¥¤¥Ç¥¢¤ò¸µ¤Ë¤·¤Æ¤¤¤ë¡£

    ¤Ê¤ª¡¢ËÜ¥×¥í¥°¥é¥à¤Î»ÈÍÑ¤Ë¤ª¤¤¤ÆÀ¸¤¸¤¿¤¤¤«¤Ê¤ë·ë²Ì¤Ë´Ø¤·¤Æ¤âÅöÊý¤Ç¤Ï
  °ìÀÚÀÕÇ¤¤òÉé¤ï¤Ê¤¤¡£

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

Around line 139:
    Non-ASCII character seen before =encoding in 'ÀìÌçÍÑ¸ì¼«Æ°Ãê½Ð¥â¥¸¥å¡¼¥ë¡ÊÏÂÊ¸¡Ö¥«¥¿¥«¥Ê¡¦´Á»úÃê½ÐÊý¼°¡×EUCÈÇ¡Ë'. Assuming CP1252