Thread Tools Display Modes
09-26-11, 08:51 PM   #1
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
Looking for someone to help code a Trade Chat Filter

I'd like to find someone to help implement a Trade chat filter addon idea I have. I'm not sure I can get the GUI part done in a reasonable amount of time.

I want to use a Bayesian algorithm to classify trade chat into multiple buckets. The SpamBayes addon uses a modified algorithm that only does 3 buckets. I'd like to use the algorithm implemented in Perl by POPFile that can be trained for a large number of categories.

Each category (including "unclassified") needs GUI to display the chat in that category with the ability to re-classify each chat to any other category. Each category also needs to toggle show or not show in the regular chat window.

What will be unique about this addon is that I envision classifying trade chat into categories such as Trade, LookingFor, GoldSpam, GuildAds and once trained, leaving Trade and LookingFor turned on and turning off GoldSpam and "unclassified" which should contain almost all of the gossip, trolling, trash, etc. It would be desireable to have the ability to report players in each category which can be turned on only for GoldSpam.

I have attempted to train the Spambayes for WoW addon but my "undesireable" trade chat covers too wide a range to successfully train on it. On the other hand, I believe I can train on the "desireable" trade chat and turn off all the rest. While turned off, it still needs to be captured (in a circular buffer) so that training can still occur.

If Blizzard increased the size of the ignore list by an order of magnitude, then I might be able to get some peace. I don't want to turn Trade off completely because I like to respond to trade/profession requests. I believe this addon could actually return "my" Trade chat to what I believe was originally intended.
  Reply With Quote
09-27-11, 02:57 AM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by bsmorgan View Post
If Blizzard increased the size of the ignore list by an order of magnitude, then I might be able to get some peace. I don't want to turn Trade off completely because I like to respond to trade/profession requests. I believe this addon could actually return "my" Trade chat to what I believe was originally intended.
I'm not experienced in the field of algorithms, but I know some addons exist that bypass Blizzard's built-in ignore list and keep track of their own that can be indefinite in size. The method I would use to achieve this is to keep track of a list of players you want to ignore and register a filter through ChatFrame_AddMessageEventFilter(event,function).

Here's an example of a public channel ignore filter.
Code:
local IgnoreList={
	"Bob";
	"Tom";
};

ChatFrame_AddMessageEventFilter("CHAT_MSG_CHANNEL",function(self,event,...)
	local msg,sender=...;
	for i,j in ipairs(IgnoreList) do
		if j==sender then return true; end--	Filter out matches
	end
	return false;--	Let the message through
end);
This will filter out any player named Bob or Tom that sends a message through any public chat channel. (General, Trade, etc.)
See WoWPedia:Events/Communication for a list of events and the arguments they supply.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
09-27-11, 04:53 AM   #3
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
Slightly off-topic, what is more efficient:

1.
Code:
local t = {
  "Name1",
  "Name2",
  "Name3",
  ...,
  "NameN"
}
function f(n)
  for k, v in pairs(t) do
    if n == v then
      return 1
    end
  end
end
2.
Code:
local t = {
  ["Name1"] = 1,
  ["Name2"] = 1,
  ["Name3"] = 1,
  ...,
  ["NameN"] = 1,
}
function f(n)
  return t[n]
end
  Reply With Quote
09-27-11, 04:27 PM   #4
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
Thanks for the input. What I didn't express in the original post was that while a huge ignore list would certianly help, it isn't ideal because some of these habitual motor-mouths occasionally say something trade-appropriate, and their gold is just as good as anyone elses.

So while implementing a larger ignore list is possible, I still prefer my original approach.
  Reply With Quote
09-27-11, 04:56 PM   #5
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
If you could post a link to sorce code that uses such algorithms, it would be helpful. I'll have to analyze it to get an idea of specificly how the algorithm works and what it exactly does.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
09-28-11, 10:17 AM   #6
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
Originally Posted by SDPhantom View Post
If you could post a link to sorce code that uses such algorithms, it would be helpful. I'll have to analyze it to get an idea of specificly how the algorithm works and what it exactly does.
The inspiration for this request comes from the POPfile open source project at http://getpopfile.org/. Their website includes downloads for Windows, Linux, OS X, and a cross platform version. The sources are available, the project is implemented in Perl.

It is possible to download and install POPfile without hooking into your email client. You can then browse through the user interface. The online documentation is also excellent.
  Reply With Quote
09-28-11, 01:34 AM   #7
SaraFdS
A Fallenroot Satyr
 
SaraFdS's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 24
Originally Posted by Vladinator View Post
Slightly off-topic, what is more efficient:
Intuitively I'd choose the latter, thinking that Lua itself can do it faster than doing it in Lua. But if you have really large tables, it's probably better to benchmark it beforehand.
__________________
Sará the Insane
  Reply With Quote
09-28-11, 02:09 AM   #8
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by SaraFdS View Post
Intuitively I'd choose the latter, thinking that Lua itself can do it faster than doing it in Lua. But if you have really large tables, it's probably better to benchmark it beforehand.
The later is faster while the first would be simpler for someone that knows nothing of Lua, the end user perhaps, to maintain.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
09-28-11, 03:49 AM   #9
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
Thanks for the replies on the efficiency matter.

Just out of curiosity, how would one go about to benchmark using the WoW client? I mean, GetTime() is the only API returning milliseconds so basically call that right before and after and subtract the time difference -right?
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Looking for someone to help code a Trade Chat Filter


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off