Thread View: news.software.readers
9 messages
9 total messages
Started by me
Thu, 09 Sep 2004 15:17
[Xnews] Scoring x-posts
Author: me
Date: Thu, 09 Sep 2004 15:17
Date: Thu, 09 Sep 2004 15:17
30 lines
1592 bytes
1592 bytes
These
Score: =-5001
Xref: (.*:){5,}
Score: -4001
Xref: (.*:){4}
~Xref: (.*:){5,}
give score -4001 to all posts with
Newsgroups:
alt.drugs.psychedelics,
alt.comp.periphs.mainboard.abit,
alt.comp.periphs.mainboard.asus,
alt.comp.periphs.videocards.nvidia,
alt.comp.virus
Xref:
alt.drugs.psychedelics:426653
alt.comp.periphs.mainboard.abit:590203
alt.comp.periphs.mainboard.asus:705929
alt.comp.periphs.videocards.nvidia:409180
alt.comp.virus:364623
What am I missing / doing wrong?
(BTW, I know about the option "Kill articles posted to more
than...")
TIA
J
--
Replies to: Njk04s_130_p(at)Ojuno(dot)Tcom
Re: [Xnews] Scoring x-posts
Author: Murray Peterson
Date: Thu, 09 Sep 2004 16:39
Date: Thu, 09 Sep 2004 16:39
20 lines
1733 bytes
1733 bytes
me@tadyatam.invalid wrote in
news:Xns955F72BBEC18metadyataminvalid@netnews.worldnet.att.net:
> Score: -4001
> Xref: (.*:){4}
> ~Xref: (.*:){5,}
This isn't going to be a useful expression. Without anchors, the ".*" will
eat up more (or less) of the string until it finds a match. The (.*:){4}
will match all Xref fields with 4 or more colons. For the same reasons,
the ~Xref expression will match on almost anything.
> What am I missing / doing wrong?
What are you trying to do?
--
Murray Peterson
Email: murray_peterson@shaw.ca (remove underscore)
URL: http://members.shaw.ca/murraypeterson/
Re: [Xnews] Scoring x-posts
Author: me
Date: Thu, 09 Sep 2004 17:23
Date: Thu, 09 Sep 2004 17:23
28 lines
1887 bytes
1887 bytes
Murray Peterson <mwp@home.com.invalid> wrote in
news:Xns955F6C957AB2Dfarkle@24.71.223.159:
> me@tadyatam.invalid wrote in
> news:Xns955F72BBEC18metadyataminvalid@netnews.worldnet.att.n
> et:
>
>> Score: -4001
>> Xref: (.*:){4}
>> ~Xref: (.*:){5,}
>
> This isn't going to be a useful expression. Without
> anchors, the ".*" will eat up more (or less) of the string
> until it finds a match. The (.*:){4} will match all Xref
> fields with 4 or more colons. For the same reasons, the
> ~Xref expression will match on almost anything.
>
>> What am I missing / doing wrong?
>
> What are you trying to do?
>
Tks.
I'm trying to score posts to 'n' (5) groups, no more, no less.
(and "getting to know" regex).
J
--
Replies to: Njk04s_130_p(at)Ojuno(dot)Tcom
Re: [Xnews] Scoring x-posts
Author: Murray Peterson
Date: Thu, 09 Sep 2004 18:43
Date: Thu, 09 Sep 2004 18:43
44 lines
2757 bytes
2757 bytes
me@tadyatam.invalid wrote in
news:Xns955F881CC9AB7metadyataminvalid@netnews.worldnet.att.net:
> I'm trying to score posts to 'n' (5) groups, no more, no less.
You need to use something other than ".*", since that will eat all
characters, including your colon. e.g. (.*:){1} will match "a:b:c:d:e",
with the ".*" matching "a:b:c:d", still leaving one colon for the rest of
the regexp.
To get exact counts, you need a regexp that won't go across the desired
substring boundaries. Something like "([^:]+:\d+)", which matches one or
more "not colons", followed by a colon, followed by one or more digits.
You then need to anchor this repeated substring to the start and end of
the entire string. This forces the regexp to match the entire string,
not just some portion of it. Using the example of a:b:c:d:e, the regexp
"(.:){1}" will match, while "^(.:){1}$ will not.
One final note -- the xref field has been "munched" by Xnews before being
scored, with the current group removed. This means your counts will be
off by one (Luu does warn you about this in the manual).
The score entry that will do what you want looks like this:
Score:: -4001
Xref: ^([^:]+:\d+){4}$
> (and "getting to know" regex).
Good luck -- perserverance and practice helps.
A common "gotchas" when scoring in Xnews:
Be careful when using single colons following the Score keyword -- the
AND operator is not usually what you want when scoring, and can cause
some grief if yuo aren't careful.
--
Murray Peterson
Email: murray_peterson@shaw.ca (remove underscore)
URL: http://members.shaw.ca/murraypeterson/
Re: [Xnews] Scoring x-posts
Author: me
Date: Thu, 09 Sep 2004 19:35
Date: Thu, 09 Sep 2004 19:35
55 lines
3056 bytes
3056 bytes
Murray Peterson <mwp@home.com.invalid> wrote in
news:Xns955F8190DB64farkle@24.71.223.159:
> me@tadyatam.invalid wrote in
> news:Xns955F881CC9AB7metadyataminvalid@netnews.worldnet.att.
> net:
>
>> I'm trying to score posts to 'n' (5) groups, no more, no
>> less.
>
> You need to use something other than ".*", since that will
> eat all characters, including your colon. e.g. (.*:){1}
> will match "a:b:c:d:e", with the ".*" matching "a:b:c:d",
> still leaving one colon for the rest of the regexp.
>
> To get exact counts, you need a regexp that won't go across
> the desired substring boundaries. Something like
> "([^:]+:\d+)", which matches one or more "not colons",
> followed by a colon, followed by one or more digits.
>
> You then need to anchor this repeated substring to the
> start and end of the entire string. This forces the regexp
> to match the entire string, not just some portion of it.
> Using the example of a:b:c:d:e, the regexp "(.:){1}" will
> match, while "^(.:){1}$ will not.
>
> One final note -- the xref field has been "munched" by
> Xnews before being scored, with the current group removed.
> This means your counts will be off by one (Luu does warn
> you about this in the manual).
>
> The score entry that will do what you want looks like this:
>
> Score:: -4001
> Xref: ^([^:]+:\d+){4}$
>
>
>
>> (and "getting to know" regex).
>
> Good luck -- perserverance and practice helps.
>
> A common "gotchas" when scoring in Xnews:
>
> Be careful when using single colons following the Score
> keyword -- the AND operator is not usually what you want
> when scoring, and can cause some grief if yuo aren't
> careful.
>
Thank you very much. Now I have something to "play" with. :)
J
--
Replies to: Njk04s_130_p(at)Ojuno(dot)Tcom
Re: [Xnews] Scoring x-posts [OT]
Author: DC
Date: Thu, 09 Sep 2004 23:03
Date: Thu, 09 Sep 2004 23:03
21 lines
1813 bytes
1813 bytes
Murray Peterson wrote: > me@tadyatam.invalid wrote in > news:Xns955F881CC9AB7metadyataminvalid@netnews.worldnet.att.net: >> I'm trying to score posts to 'n' (5) groups, no more, no less. > You need to use something other than ".*", since that will eat all > characters, including your colon. [...] Ow! That sounds quite painful. Still, I'd rather have a tapeworm than cooties. };O) http://dcmoose.fateback.com/news/cooties.jpg -- DC Linux RU #1000111011000111001 Failure is not an option. It comes bundled with Windows.
Re: [Xnews] Scoring x-posts
Author: »Q«
Date: Fri, 10 Sep 2004 00:04
Date: Fri, 10 Sep 2004 00:04
30 lines
2477 bytes
2477 bytes
Murray Peterson <mwp@home.com.invalid> wrote in
<news:Xns955F8190DB64farkle@24.71.223.159>:
>> I'm trying to score posts to 'n' (5) groups, no more, no less.
>
> You need to use something other than ".*", since that will eat all
> characters, including your colon. e.g. (.*:){1} will match
> "a:b:c:d:e", with the ".*" matching "a:b:c:d", still leaving one
> colon for the rest of the regexp.
It should still work, using the AND scheme in the OP. I think the only
problem was that the colon count was off, because Xnews ignores one of
the Xref groups when scoring (as you noted).
Score: 100
Xref: (.*:){4}
~Xref: (.*:){5}
Should score articles with at least 5 Xref'd groups AND not more than
5, IOW exactly 5. The greediness of .* shouldn't matter here, but
there's always .*? when greediness does matter.
But I agree with you that it's better to avoid ANDing scoring criteria,
and I think your single regex solution is better.
--
»Q«
<http://www.cotse.net/users/putty/help.htm>
a not-quite-ready-for-prime-time guide to
Xnews resources on teh WWW
Re: [Xnews] Scoring x-posts
Author: me
Date: Fri, 10 Sep 2004 00:38
Date: Fri, 10 Sep 2004 00:38
38 lines
2428 bytes
2428 bytes
»Q« <boxcars@gmx.net> wrote in
»news:MrQ955FC1F7380E0itsmeitsQ@QsFQDN.dyndns.org:
> Murray Peterson <mwp@home.com.invalid> wrote in
> <news:Xns955F8190DB64farkle@24.71.223.159>:
>
>>> I'm trying to score posts to 'n' (5) groups, no more, no
>>> less.
>>
>> You need to use something other than ".*", since that will
>> eat all characters, including your colon. e.g. (.*:){1}
>> will match "a:b:c:d:e", with the ".*" matching "a:b:c:d",
>> still leaving one colon for the rest of the regexp.
>
> It should still work, using the AND scheme in the OP. I
> think the only problem was that the colon count was off,
> because Xnews ignores one of the Xref groups when scoring
> (as you noted).
>
> Score: 100
> Xref: (.*:){4}
> ~Xref: (.*:){5}
>
> Should score articles with at least 5 Xref'd groups AND not
> more than 5, IOW exactly 5. The greediness of .* shouldn't
> matter here, but there's always .*? when greediness does
> matter.
>
> But I agree with you that it's better to avoid ANDing
> scoring criteria, and I think your single regex solution is
> better.
>
Thanks for the info (learning never ends).
J
--
Replies to: Njk04s_130_p(at)Ojuno(dot)Tcom
Re: [Xnews] Scoring x-posts
Author: Tech Zero
Date: Fri, 10 Sep 2004 09:09
Date: Fri, 10 Sep 2004 09:09
15 lines
1656 bytes
1656 bytes
The voice of ">>Q<<" drifted in on the cyber-winds, from the sea of virtual chaos... [see the "parents" for full details] > But I agree with you that it's better to avoid ANDing scoring > criteria, and I think your single regex solution is better. Ditto... But don't discount "AND" scoring as useless. It does have it place, as a way to "test" things quickly, or when you need an exception scored with a different Header. -- The Tech Zero, Maxx "What's That Score" Pollare...
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