]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
azgame plugin: sort wordlist on load
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 17 Nov 2008 14:46:39 +0000 (15:46 +0100)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 17 Nov 2008 14:46:39 +0000 (15:46 +0100)
data/rbot/plugins/games/azgame.rb

index edff909368372d50ad3b17f6005752fc2b682cc1..dd0dfe0d77fa1ba5c1d0729ad82c5153c3c1df41 100644 (file)
@@ -135,7 +135,7 @@ class AzGamePlugin < Plugin
     wordlist = @wordlist_base + lang.to_s
     if File.exist?(wordlist)
       # wordlists are assumed to be UTF-8, but we need to strip the BOM, if present
-      words = File.readlines(wordlist).map {|line| line.sub("\xef\xbb\xbf",'').strip}.uniq
+      words = File.readlines(wordlist).map {|line| line.sub("\xef\xbb\xbf",'').strip}.uniq.sort
       if(words.length >= 4) # something to guess
         rules = {
             :good => /^\S+$/,