[PHP] detecting spam keywords with stripos

2009-05-29 Thread Merlin Morgenstern
Hi there, I am matching text against an array of keywords to detect spam. Unfortunatelly there are some false positives due to the fact that stripos also finds the keyword inside a word. E.G. Bewerbung - Werbung First thought: use strpos, but this does not help in all cases Second thought:

Re: [PHP] detecting spam keywords with stripos

2009-05-29 Thread Per Jessen
Merlin Morgenstern wrote: Hi there, I am matching text against an array of keywords to detect spam. Unfortunatelly there are some false positives due to the fact that stripos also finds the keyword inside a word. E.G. Bewerbung - Werbung First thought: use strpos, but this does not help

Re: [PHP] detecting spam keywords with stripos

2009-05-29 Thread Tom Worster
On 5/29/09 5:36 AM, Merlin Morgenstern merli...@fastmail.fm wrote: Does somebody have an idea on how to make my function better in terms of not detecting the string inside a word? i agree with per. learn pcre: http://us.php.net/manual/en/book.pcre.php as for successfully filtering spam by

Re: [PHP] detecting spam keywords with stripos

2009-05-29 Thread Merlin Morgenstern
Per Jessen wrote: Merlin Morgenstern wrote: Hi there, I am matching text against an array of keywords to detect spam. Unfortunatelly there are some false positives due to the fact that stripos also finds the keyword inside a word. E.G. Bewerbung - Werbung First thought: use strpos, but

Re: [PHP] detecting spam keywords with stripos

2009-05-29 Thread Stuart
2009/5/29 Merlin Morgenstern merli...@fastmail.fm: Per Jessen wrote: Merlin Morgenstern wrote: Hi there, I am matching text against an array of keywords to detect spam. Unfortunatelly there are some false positives due to the fact that stripos also finds the keyword inside a word. E.G.

Re: [PHP] detecting spam keywords with stripos

2009-05-29 Thread Bastien Koert
On Fri, May 29, 2009 at 10:02 AM, Merlin Morgenstern merli...@fastmail.fmwrote: Per Jessen wrote: Merlin Morgenstern wrote: Hi there, I am matching text against an array of keywords to detect spam. Unfortunatelly there are some false positives due to the fact that stripos also finds

Re: [PHP] detecting spam keywords with stripos

2009-05-29 Thread Per Jessen
Stuart wrote: I'm sure you could integrate SpamAssassin or similar because at the end of the day all those systems expect is a bunch of text. Exactly. You can run SA as a daemon (spamd) and feed data to it using spamc. Works very well. The full ruleset is probably too much, but it's easy to