TermExtract::MeCab(3)

NAME
    TermExtract::MeCab -- ÀìÌçÍÑ¸ìÃê½Ð¥â¥¸¥å¡¼¥ë¡Ê¡ÖÏÂÉÛÉó¡×ÈÇ)

SYNOPSIS
    use TermExtract::MeCab;

DESCRIPTION
    ÆþÎÏ¥Æ¥­¥¹¥È¤ò¡¢¡ÖÏÂÉÛÉó¡×¡ÊÆàÎÉÀèÃ¼Âç³Ø¤ÇºîÀ®¤·¤Æ¤¤¤ëÆüËÜ
    ¸ì·ÁÂÖÁÇ²òÀÏ¥×¥í¥°¥é¥à¡Ë¤Ë¤«¤±¡¢¤½¤Î·ë²Ì¤ò¤â¤È¤ËÆþÎÏ¥Æ¥­¥¹
    ¥È¤«¤éÀìÌçÍÑ¸ì¤òÃê½Ð¤¹¤ë¥×¥í¥°¥é¥à¡£
      ¤Ê¤ª¡¢¡ÖÏÂÉÛÉó¡×¤Î½ÐÎÏ¤Ï¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥©¡¼¥Þ¥Ã¥È»ØÄê¤òÁ°
    Äó¤È¤·¤Æ¤¤¤ë¡£
      »ÈÍÑË¡¤Ë¤Ä¤¤¤Æ¤Ï¡¢¿Æ¥¯¥é¥¹¡ÊTermExtract::Calc_Imp)¤«¡¢°Ê²¼¤Î
    ¥µ¥ó¥×¥ë¥¹¥¯¥ê¥×¥È¤ò»²¾È¤Î¤³¤È¡£

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

 #
 #  ex_mecab.pl
 #
 #¡¡¥Õ¥¡¥¤¥ë¤«¤é¡ÖÏÂÉÛÉó¡×¤Î·ÁÂÖÁÇ²òÀÏºÑ¤ß¤Î¥Ç¡¼¥¿¤òÆÉ¤ß¼è¤ê
 #  É¸½à½ÐÎÏ¤ËÀìÌçÍÑ¸ì¤È¤½¤Î½ÅÍ×ÅÙ¤òÊÖ¤¹¥×¥í¥°¥é¥à
 #
 #   version 0.32
 #
 #   maeda@lib.u-tokyo.ac.jp

 use TermExtract::MeCab;
 #use strict;
 my $data = new TermExtract::MeCab;
 my $InputFile = "mecab_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("stat.db");
 #$data->comb_db("comb.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+$/;

    # ·ë²ÌÉ½¼¨
    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;
 }

 # ¥×¥í¥»¥¹¤Î°Û¾ï½ªÎ»»þ¤ËDB¤Î¥í¥Ã¥¯¤ò²ò½ü
 # (¥í¥Ã¥¯¥Ç¥£¥ì¥¯¥È¥ê¤ò»ÈÍÑ¤·¤¿¾ì¹ç¤Î¤ß¡Ë
 sub sigexit {
    $data->unlock_db;
 }

Methods
    ¤³¤Î¥â¥¸¥å¡¼¥ë¤Ç¤Ï¡¢get_imp_word ¤Î¤ß¼ÂÁõ¤·¡¢¤½¤ì°Ê³°¤Î¥á¥½¥Ã¥É¤Ï¿Æ
  ¥â¥¸¥å¡¼¥ë TermExtract::Calc_Imp ¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£
    get_imp_word ¤Ï·ÁÂÖÁÇ²òÀÏ¤ò¹Ô¤¤Ãê½Ð¤µ¤ì¤¿Ã±¸ì¤ò¡¢¸Ä¡¹¤ÎÃ±¸ì¤Î¸ì½ç¤È
  ÉÊ»ì¾ðÊó¤ò¸µ¤ËÊ£¹ç¸ì¤ËÀ¸À®¤·¤Æ¤¤¤ë¡£¤½¤ì°Ê³°¤Î¥á¥½¥Ã¥É¤Ë¤Ä¤¤¤Æ¤Ï¡¢
  TermExtract::Calc_Imp ¤ÎPOD¥É¥­¥å¥á¥ó¥È¤ò»²¾È¤¹¤ë¤³¤È¡£

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

    £±¡¥¼¡¤ÎÉÊ»ì¤ò¤â¤ÄÃ±Ì¾»ì¤¬Ï¢Â³¤Ç¸½¤ì¤¿¤È¤­¤Ï·ë¹ç¤¹¤ë
       ¡¦Ì¾»ì    °ìÈÌ
       ¡¦Ì¾»ì    ¥µÊÑÀÜÂ³
       ¡¦Ì¾»ì    ÀÜÈø            °ìÈÌ
       ¡¦Ì¾»ì    ÀÜÈø            ¥µÊÑÀÜÂ³
       ¡¦Ì¾»ì    ¸ÇÍ­Ì¾»ì
       ¡¦µ­¹æ    ¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È

          ASCII¤Îµ­¹æ¤¬¤¢¤é¤ï¤ì¤¿¤È¤­¤Ï¡¢Á°¸å¤Î¸ì¤ò·ë¹ç¤·¤Æ½èÍý¤¹¤ë¤è¤¦
          ¤Ë¤·¤Æ¤¤¤ë¡£¤¿¤À¤·¡¢¼¡¤Îµ­¹æ¤Ï½ü¤¯¡£
            ()[]<>|"';,

    £²¡¥¼¡¤ÎÉÊ»ì¤ò¤â¤ÄÃ±Ì¾»ì¤¬¸½¤ì¤¿¤È¤­¤Ï¡¢¼¡¤ËÂ³¤¯¸ì¤¬¾åµ­£±¤ÎÌ¾»ì¤«¤É
      ¤¦¤«È½Äê¤·¡¢°Û¤Ê¤ë¤È¤­¤ÏÊ£¹ç¸ì¤È¤·¤Æ°·¤ï¤Ê¤¤

       ¡¦Ì¾»ì    ·ÁÍÆÆ°»ì¸ì´´
       ¡¦Ì¾»ì    ¥Ê¥¤·ÁÍÆ»ì¸ì´´

    £³¡¥¼¡¤ÎÉÊ»ì¤ò¤â¤ÄÃ±Ì¾»ì¤¬¸½¤ì¤¿¤È¤­¤Ï¡¢¼¡¤ËÂ³¤¯¸ì¤¬¾åµ­£±¤ÎÌ¾»ì¤«¤É
      ¤¦¤«È½Äê¤·¡¢°Û¤Ê¤ë¤È¤­¤ÏÊ£¹ç¸ì¤È¤·¤Æ°·¤ï¤Ê¤¤¡£¤Þ¤¿¡¢Ê£¹ç¸ì¤ÎÀèÆ¬¤Ë
      ¤­¤¿¾ì¹ç¤ÏÇÑ´þ¤¹¤ë¡£

        ¡¦Ì¾»ì    ÀÜÈø         ·ÁÍÆÆ°»ì¸ì´´

    £´¡¥ÉÊ»ì¤¬Æ°»ì¤Î¾ì¹ç¤Ï¡¢Ê£¹ç¸ì¤òÇÑ´þ¤¹¤ë

    £µ¡¥¼¡¤Î£±Ê¸»ú¤Î¡ÖÌ¤ÃÎ¸ì¡×¤Ï¸ì¤Î¶èÀÚ¤ê¤È¤¹¤ë¡£¤Þ¤¿¡¢¡ÖÌ¤ÃÎ¸ì¡×¤¬ ,
      ¤Ç ½ª¤ï¤ë¤È¤­¤Ë¤â¸ì¤Î¶èÀÚ¤ê¤È¤¹¤ë¡£

        !"#$%&'()*+,-./{|}:;<>[]

    £¶¡¥Ê£¹ç¸ì¤ò¤Ê¤¹¸ìÆ¬¤ÎÃ±Ì¾»ì¤¬¡ÖËÜ¡×¤Î¾ì¹ç¤Ï¡¢¡ÖËÜ¡×¤Î¤ßºï½ü¤¹¤ë¡£

    £·¡¥Ê£¹ç¸ì¤ò¤Ê¤¹Ã±Ì¾»ì¤Î¤¦¤Á¡¢ËöÈø¤¬¼¡¤Î¸ì¤Î¾ì¹ç¤Ï¡¢¤½¤ÎËöÈø¤Î¤ßºï½ü
      ¤¹¤ë¡£¤Þ¤¿ËöÈø¤¬¶õÇò¤Î¾ì¹ç¤âºï½ü¤¹¤ë¡£

      "¤Ê¤É", "¤é", "¾å", "Æâ", "·¿", "´Ö", "Ãæ", "Ëè" ,"Åù"

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

COPYRIGHT
    ¤³¤Î¥×¥í¥°¥é¥à¤Ï¡¢ÅìµþÂç³Ø¡¦ÃæÀîÍµ»Ö¶µ¼ø¡¢²£ÉÍ¹ñÎ©Âç³Ø¡¦¿¹Ã¤Â§½õ¶µ¼ø
  ¤¬ºîÀ®¤·¤¿¡ÖÀìÌçÍÑ¸ì¼«Æ°Ãê½Ð¥·¥¹¥Æ¥à¡×¤Îtermex.pl¤ò»²¹Í¤Ë¡¢¡ÖÏÂÉÛÉó¡×ÍÑ
  ¤ËºîÀ®¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£
     ¤³¤Îºî¶È¤Ï¡¢ÅìµþÂç³Ø¡¦Á°ÅÄÏ¯ (maeda@lib.u-tokyo.ac.jp)¤¬¹Ô¤Ã¤¿¡£

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

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

Around line 120:
    Non-ASCII character seen before =encoding in 'ÀìÌçÍÑ¸ìÃê½Ð¥â¥¸¥å¡¼¥ë¡Ê¡ÖÏÂÉÛÉó¡×ÈÇ)'. Assuming CP1252