[SimBot-commits] CVS: simbot/plugins aspell.pl,1.6,1.7 sqlite-logger.pl,1.45,1.46
Status: Abandoned
Brought to you by:
kstange
|
From: Kevin S. <ks...@us...> - 2005-07-25 09:34:34
|
Update of /cvsroot/simbot/simbot/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3144/plugins Modified Files: aspell.pl sqlite-logger.pl Log Message: This reworks the base word score for "interesting" words to compensate for the long-term growth of the database. The formula may need some work, but this is already better. I also beat up some debug code a little bit. Index: aspell.pl =================================================================== RCS file: /cvsroot/simbot/simbot/plugins/aspell.pl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -p -r1.6 -r1.7 --- aspell.pl 4 May 2005 20:39:05 -0000 1.6 +++ aspell.pl 25 Jul 2005 09:34:18 -0000 1.7 @@ -33,7 +33,7 @@ package SimBot::plugin::aspell; # for more information on the different modes. use constant SUGGESTION_MODE => 'fast'; -use constant CORRECT_SPELLING_BONUS => 50; +use constant CORRECT_SPELLING_BONUS => 0.01; use warnings; use strict; @@ -97,10 +97,11 @@ sub get_spelling { # SCORE_WORD: gives a score modifier to a word sub score_word { if(CORRECT_SPELLING_BONUS) { - my $word = $_[1]; + my $word = $_[1]; + my $score = $_[2]; if($SPELLER->check($word)) { - &SimBot::debug(4, "$word:+" . CORRECT_SPELLING_BONUS . '(aspell) '); - return CORRECT_SPELLING_BONUS; + &SimBot::debug(4, "$word:+" . int(CORRECT_SPELLING_BONUS * $score) . '(aspell) ', SimBot::DEBUG_NO_PREFIX); + return int(CORRECT_SPELLING_BONUS * $score); } } return 0; Index: sqlite-logger.pl =================================================================== RCS file: /cvsroot/simbot/simbot/plugins/sqlite-logger.pl,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -p -r1.45 -r1.46 --- sqlite-logger.pl 19 Jul 2005 02:26:39 -0000 1.45 +++ sqlite-logger.pl 25 Jul 2005 09:34:18 -0000 1.46 @@ -728,15 +728,15 @@ sub update_nick_context { } # SCORE_WORD: Gives a score modifier to a word -# for seen, we give a 40 point bonus to words that are the +# for seen, we give bonus to words that are the # nicknames of people we have seen. sub score_word { my $word = $_[1]; if (get_nickchan_id($word)) { - &SimBot::debug(4, "${word}:+1000(sqlite-logger) "); + &SimBot::debug(4, "${word}:+1000(sqlite-logger) ", SimBot::DEBUG_NO_PREFIX); return 1000; } - &SimBot::debug(5, "${word}:+0(sqlite-logger) "); + &SimBot::debug(5, "${word}:+0(sqlite-logger) ", SimBot::DEBUG_NO_PREFIX); return 0; } |