Thread View: news.software.readers
4 messages
4 total messages
Started by NickC
Tue, 06 Feb 2007 02:25
[Xnews] Scoring on items in any order
Author: NickC
Date: Tue, 06 Feb 2007 02:25
Date: Tue, 06 Feb 2007 02:25
38 lines
1994 bytes
1994 bytes
I'd appreciate some help with scoring on two items that can appear in
any order in the Xref header.
The task is to score a hit when both items appear in any order and with
unknown characters in between, or to restate, when both items appear
somewhere within the header.
I want to kill any post that is cross-referenced to both politics and
invest groups. This could work:
Score: -9999
Xref: politics
Xref: invest
but I've had problems getting Xnews successfully to score AND
conditions on the same header, plus I'm trying to get into advanced
pcre so prefer to do it using, say, conditional and lookahead/behind
expressions. For example, in pseudo-code:
if politics
if ahead is invest or behind is invest
else if invest
if ahead is politics or behind is politics
Xref:
(?(politics)(?=.*invest|?<=invest.*)|(?(invest)(?=.*politics|?<=politic
s.*)))
but that seems clumsy to solve a problem that must come up often in reg
ex, so I think I'm missing something obvious.
BTW, if someone knows a good regex group or a website, I'd appreciate
the link.
Thanks for any help,
--
Nick
Re: [Xnews] Scoring on items in any order
Author: Tech Zero
Date: Tue, 06 Feb 2007 03:21
Date: Tue, 06 Feb 2007 03:21
24 lines
2086 bytes
2086 bytes
Reality folded in on itself, and somewhere the following words from
"NickC" appeared in history:
> I'd appreciate some help with scoring on two items that can appear
> in any order in the Xref header.
<snip>
You're thinking to advanced for a simple regex...
Presumablely your tring to filter out when BOTH groups are present in
an xposted article, but not when just one group is crossposted to. Try
using something simple, say like:
Score: -9999
Xref: politics.+invest|invest.+politics
Because the pipe is an OR both tests are run from the begining of the
string, with complecated "look forward" or "look back" hokus pokus.
--
__ __| | __ __| | __ /
| \ -_) | -_) _| \ / -_) _| _ \
_| _| _| \___| _| \___| \__| _| _| ____| \___| _| \___/
Loosing quality sleep to help others on-line since 1997...
Re: [Xnews] Scoring on items in any order
Author: NickC
Date: Tue, 06 Feb 2007 07:09
Date: Tue, 06 Feb 2007 07:09
22 lines
1723 bytes
1723 bytes
Tech Zero wrote on 06 Feb 2007: > > You're thinking to advanced for a simple regex... > > Presumablely your tring to filter out when BOTH groups are present > in an xposted article, but not when just one group is crossposted > to. Try using something simple, say like: > > Score: -9999 > Xref: politics.+invest|invest.+politics > Thanks, that works great. You're correct, I was being too complicated. What would you do if you had 3 or 4 groups? You end up with 2^N switches using simple OR pipes. I wonder how you could implement it efficiently in Xnews implementation of PCRE? -- Nick
Re: [Xnews] Scoring on items in any order
Author: Tech Zero
Date: Tue, 06 Feb 2007 08:20
Date: Tue, 06 Feb 2007 08:20
35 lines
2747 bytes
2747 bytes
Reality folded in on itself, and somewhere the following words from
"NickC" appeared in history:
>> You're thinking to advanced for a simple regex...
> Thanks, that works great. You're correct, I was being too
> complicated. What would you do if you had 3 or 4 groups?
That depends on the group sets you want to filter out...
I'd double check to see if it isn't easy to filter it out by subject
or FQDN first before trying to do it. At what level are you tring to
impliment this filter (all groups OR local group)?
It's rare to find a thread that's worth keeping when there are several
unwanted xposted groups, let alone any group worth alowing xposts too
if it comes at the pice of other unwanted groups. But it's quite
possable to impliment far more complex filtering:
- score xposts to Group "AAA" if xposted to "BBB" or "CCC"
- score xposts to Group "BBB" if xposted to "DDD" or "EEE"
- score xposts to Group "CCC" if xposted to "DDD" and "EEE"
Score:: -9999
Xref: aaa.+(bbb|ccc)|bbb.+(aaa|ddd|eee)|ccc.+aaa|(ddd|eee).+bbb
Xref: ccc.+(ddd|eee).+(eee|ddd)|ddd.+(ccc|eee).+(eee|ccc)|eee.+(ccc|ddd).+(ddd|ccc)
It all becomes mathmatic after that.
--
__ __| | __ __| | __ /
| \ -_) | -_) _| \ / -_) _| _ \
_| _| _| \___| _| \___| \__| _| _| ____| \___| _| \___/
Loosing quality sleep to help others on-line since 1997...
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads