From a7cefe6c664ca438fc3785186e814738a390b9f3 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Mon, 17 Nov 2008 15:46:39 +0100 Subject: azgame plugin: sort wordlist on load --- data/rbot/plugins/games/azgame.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'data/rbot/plugins') diff --git a/data/rbot/plugins/games/azgame.rb b/data/rbot/plugins/games/azgame.rb index edff9093..dd0dfe0d 100644 --- a/data/rbot/plugins/games/azgame.rb +++ b/data/rbot/plugins/games/azgame.rb @@ -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+$/, -- cgit v1.2.3