Thread View: news.software.readers
17 messages
17 total messages
Started by Gruebait
Sat, 08 Mar 2003 13:38
[slrn] scoring on subject in replies
Author: Gruebait
Date: Sat, 08 Mar 2003 13:38
Date: Sat, 08 Mar 2003 13:38
17 lines
1329 bytes
1329 bytes
I think I've mostly got it wrt scorefiles, except for regexes, but I have
this question:
With a rule like:
Score:: =-9999
Subject: Xnews
Subject: X-news
why do headers with: "Subject: Re: [X-news]" still get through?
TIA
--
"You are in a maze of twisty passages, all alike." - Will Crowther
perl -e '$_="prxryyl\@qiby.pbz <Cenvt Kryyl>\n";tr/a-z/n-za-m/;print;'
Re: [slrn] scoring on subject in replies
Author: SINNER
Date: Sat, 08 Mar 2003 16:10
Date: Sat, 08 Mar 2003 16:10
30 lines
2149 bytes
2149 bytes
While strolling through news.software.readers, Gruebait was overheard plotting:
> I think I've mostly got it wrt scorefiles, except for regexes, but I have
> this question:
>
> With a rule like:
> Score:: =-9999
> Subject: Xnews
> Subject: X-news
>
> why do headers with: "Subject: Re: [X-news]" still get through?
>
> TIA
>
I just make everything lower case, that makes it case insensitive I have
a similar one it covers all variations of the below. I am no regex pro
but the dash may need to be escaped or something.
[news.software.readers]
Score: -100
{::
Subject: dialog
Subject: gravity
Subject: agent
}
--
David
There goes the good time that was had by all.
-- Bette Davis, remarking on a passing starlet
Re: [slrn] scoring on subject in replies
Author: Gruebait
Date: Sat, 08 Mar 2003 16:35
Date: Sat, 08 Mar 2003 16:35
40 lines
2127 bytes
2127 bytes
On Sat, 08 Mar 2003 16:10:17 GMT, someone, possibly SINNER, scribed:
> While strolling through news.software.readers, Gruebait was overheard plotting:
[snip]
>>
>> With a rule like:
>> Score:: =-9999
>> Subject: Xnews
>> Subject: X-news
>>
>> why do headers with: "Subject: Re: [X-news]" still get through?
>>
>> TIA
>>
>
> I just make everything lower case, that makes it case insensitive I have
> a similar one it covers all variations of the below. I am no regex pro
> but the dash may need to be escaped or something.
Ah...yes, being inside square brackets looks like a character class, which
would likely include a dash. At least in Perl...I really have to get to
the bash manual (I'm a refugee from billg's world)
> [news.software.readers]
> Score: -100
> {::
> Subject: dialog
> Subject: gravity
> Subject: agent
> }
Thanks - I'll go fiddle with it some more
--
"You are in a maze of twisty passages, all alike." - Will Crowther
perl -e '$_="prxryyl\@qiby.pbz <Cenvt Kryyl>\n";tr/a-z/n-za-m/;print;'
Re: [slrn] scoring on subject in replies
Author: Allodoxaphobia
Date: Sat, 08 Mar 2003 16:51
Date: Sat, 08 Mar 2003 16:51
27 lines
1561 bytes
1561 bytes
On 8 Mar 2003 07:38:55 -0600, Gruebait hath writ:
> I think I've mostly got it wrt scorefiles, except for regexes, but I have
> this question:
>
> With a rule like:
> Score:: =-9999
> Subject: Xnews
> Subject: X-news
>
> why do headers with: "Subject: Re: [X-news]" still get through?
>
> TIA
KISS:
Score: =-9999
Subject: x.?news
Anyway, I think you would've needed to escape the "-", as it
is used in some RE constructs.
HTH,
Jonesy
--
| Marvin L Jones | jonz | W3DHJ | OS/2
| Gunnison, Colorado | @ | Jonesy | linux __
| 7,703' -- 2,345m | frontier.net | DM68mn SK
Re: [slrn] scoring on subject in replies
Author: Gruebait
Date: Sat, 08 Mar 2003 18:37
Date: Sat, 08 Mar 2003 18:37
40 lines
1866 bytes
1866 bytes
On 8 Mar 2003 16:51:50 GMT, someone, possibly Allodoxaphobia, scribed: > On 8 Mar 2003 07:38:55 -0600, Gruebait hath writ: >> I think I've mostly got it wrt scorefiles, except for regexes, but I have >> this question: >> >> With a rule like: >> Score:: =-9999 >> Subject: Xnews >> Subject: X-news >> >> why do headers with: "Subject: Re: [X-news]" still get through? > > KISS: That's my goal in life :-) > Score: =-9999 > Subject: x.?news Yes, this should do it. > > Anyway, I think you would've needed to escape the "-", as it > is used in some RE constructs. Yeah, that's what I guessed, later. > HTH, Yup. Thanks -- "You are in a maze of twisty passages, all alike." - Will Crowther perl -e '$_="prxryyl\@qiby.pbz <Cenvt Kryyl>\n";tr/a-z/n-za-m/;print;'
Re: [slrn] scoring on subject in replies
Author: J.B. Nicholson-Owens
Date: Sat, 08 Mar 2003 19:59
Date: Sat, 08 Mar 2003 19:59
25 lines
1310 bytes
1310 bytes
Gruebait wrote:
> With a rule like:
> Score:: =-9999
> Subject: Xnews
> Subject: X-news
>
> why do headers with: "Subject: Re: [X-news]" still get through?
Because you did not specify a set of groups to apply the score to.
Try
[*]
Score:: =-9999
Subject: Xnews
Subject: x-news
instead or the simpler version
[*]
Score: =-9999
Subject: x-?news
which is equivalent.
Re: [slrn] scoring on subject in replies
Author: J.B. Nicholson-Owens
Date: Sat, 08 Mar 2003 20:06
Date: Sat, 08 Mar 2003 20:06
26 lines
1555 bytes
1555 bytes
SINNER wrote:
> I just make everything lower case, that makes it case insensitive [...]
slrn's scorefile regular expressions are case-insensitive unless you specify
\c to make them case-sensitive. So
Subject: xnews
Subject: Xnews
Subject: XnEwS
are all equivalent and will match the same thing. You can also use \C to
turn off the case sensitivity within a regular expression. So
Subject: \cxnew\Cs
Subject: xnew[sS]
are equivalent.
> {::
> Subject: dialog
> Subject: gravity
> Subject: agent
> }
This is equivalent to "Score::".
Re: [slrn] scoring on subject in replies
Author: J.B. Nicholson-Owens
Date: Sat, 08 Mar 2003 20:23
Date: Sat, 08 Mar 2003 20:23
25 lines
2237 bytes
2237 bytes
Gruebait wrote:
> [...] why do headers with: "Subject: Re: [X-news]" still get through?
>
> Ah...yes, being inside square brackets looks like a character class (1),
> which would likely include a dash. At least in Perl (2)...I really have to
> get to the bash manual (I'm a refugee from billg's world) (3)
I think you misunderstand how the scoring process works in slrn. I have
taken the liberty of numbering the misunderstandings above for reference.
(1) No, this does not look like a character class because the regular
expression does not have square brackets. slrn does not treat the
Subject: header in the article as if it were a regular expression. The
article's headers are treated as a string. You did not specify a
character class in your score entry regular expression, so this whole
issue does not really exist.
(2) Perl would not have a problem here either. See (1).
(3) The bash manual won't help you understand S-Lang regular expressions.
The bash manual will help you understand bash shell wildcards. However
bash shell wildcards don't come into play in this problem, so reading
the bash manual to better understand what's going on with this problem
doesn't make sense to me.
Re: [slrn] scoring on subject in replies
Author: J.B. Nicholson-Owens
Date: Sat, 08 Mar 2003 20:35
Date: Sat, 08 Mar 2003 20:35
29 lines
1763 bytes
1763 bytes
Allodoxaphobia wrote:
> KISS:
> Score: =-9999
> Subject: x.?news
Do you really want to match "xynews" or "xxnews"? I think it would be
simpler to match an optional hyphen "x-?news", but that depends on what one
is trying to match.
> Anyway, I think you would've needed to escape the "-", as it
> is used in some RE constructs.
Where would you need to escape a hyphen in an S-Lang regular expression?
Perhaps you were thinking of the location of a hyphen in a character class
("[-az]" is not the same as "[a-z]"), but this requires no escaping:
(I'm using a caret on the following line to indicate the highlighted
characters)
$ echo abc | rgrep -h '[-az]*'
abc
^
$ echo abc | rgrep -h '[a-z]*'
abc
^^^
rgrep comes with jed, a text editor that uses S-Lang.
Re: [slrn] scoring on subject in replies
Author: Gruebait
Date: Sat, 08 Mar 2003 20:56
Date: Sat, 08 Mar 2003 20:56
53 lines
2239 bytes
2239 bytes
On 8 Mar 2003 19:59:02 GMT, someone, possibly J.B. Nicholson-Owens, scribed:
> Gruebait wrote:
>> With a rule like:
>> Score:: =-9999
>> Subject: Xnews
>> Subject: X-news
>>
>> why do headers with: "Subject: Re: [X-news]" still get through?
>
> Because you did not specify a set of groups to apply the score to.
Well, I did in my scorefile, but I only cited the test in question when I
posted my question. The relevant section in my file was:
[news.software.readers]
# All slrn articles
Score: =9999
Subject: slrn
# Clutter
Score:: =-9999
Subject: Xnews
Subject: X-news
> Try
>
> [*]
> Score:: =-9999
> Subject: Xnews
> Subject: x-news
"Subject: X-news" (note capitalization) is exactly what did not work.
> instead or the simpler version
>
> [*]
> Score: =-9999
> Subject: x-?news
>
> which is equivalent.
"x-?news" looks like the pattern I need...
Thanks.
I suppose I'll just have to learn about S-lang pattern matching (sigh)
--
"You are in a maze of twisty passages, all alike." - Will Crowther
perl -e '$_="prxryyl\@qiby.pbz <Cenvt Kryyl>\n";tr/a-z/n-za-m/;print;'
Re: [slrn] scoring on subject in replies
Author: Gruebait
Date: Sat, 08 Mar 2003 21:08
Date: Sat, 08 Mar 2003 21:08
42 lines
2887 bytes
2887 bytes
On 8 Mar 2003 20:23:47 GMT, someone, possibly J.B. Nicholson-Owens, scribed: > Gruebait wrote: >> [...] why do headers with: "Subject: Re: [X-news]" still get through? >> >> Ah...yes, being inside square brackets looks like a character class (1), >> which would likely include a dash. At least in Perl (2)...I really have to >> get to the bash manual (I'm a refugee from billg's world) (3) > > I think you misunderstand how the scoring process works in slrn. I have > taken the liberty of numbering the misunderstandings above for reference. > > (1) No, this does not look like a character class because the regular > expression does not have square brackets. slrn does not treat the > Subject: header in the article as if it were a regular expression. The > article's headers are treated as a string. You did not specify a > character class in your score entry regular expression, so this whole > issue does not really exist. Okay. > > (2) Perl would not have a problem here either. See (1). Quite right. It's just that I'm somewhat familiar with Perl, not with Bash or S-lang. > > (3) The bash manual won't help you understand S-Lang regular expressions. > The bash manual will help you understand bash shell wildcards. However > bash shell wildcards don't come into play in this problem, so reading > the bash manual to better understand what's going on with this problem > doesn't make sense to me. When I posted, it wasn't clear to me whether slrn was using S-lang pattern matching or shell conventions. Thanks for clearing that up. Back to the manual(s). -- "You are in a maze of twisty passages, all alike." - Will Crowther perl -e '$_="prxryyl\@qiby.pbz <Cenvt Kryyl>\n";tr/a-z/n-za-m/;print;'
Re: [slrn] scoring on subject in replies
Author: Gruebait
Date: Sat, 08 Mar 2003 21:31
Date: Sat, 08 Mar 2003 21:31
38 lines
2463 bytes
2463 bytes
On 8 Mar 2003 20:35:24 GMT, someone, possibly J.B. Nicholson-Owens, scribed:
> Allodoxaphobia wrote:
>> KISS:
>> Score: =-9999
>> Subject: x.?news
>
> Do you really want to match "xynews" or "xxnews"? I think it would be
> simpler to match an optional hyphen "x-?news", but that depends on what one
> is trying to match.
>
>> Anyway, I think you would've needed to escape the "-", as it
>> is used in some RE constructs.
>
> Where would you need to escape a hyphen in an S-Lang regular expression?
> Perhaps you were thinking of the location of a hyphen in a character class
> ("[-az]" is not the same as "[a-z]"), but this requires no escaping:
[snip]
The moment I posted a followup (elsewhere in this thread), I realized
where I acquired the notion that the patterns being matched might
need regex metacharacters to be escaped - when slrn interactively creates
an entry in a scorefile, it escapes dots and question-marks with a '\'.
As in:
Subject: Re: The Missing Two Thermal Analysis Cases -- Found\?
^
and
From: "KNIGHT TEMPLAR" <mining_pioneer@hotmail\.com>
^
So, what's up with that?
--
"You are in a maze of twisty passages, all alike." - Will Crowther
perl -e '$_="prxryyl\@qiby.pbz <Cenvt Kryyl>\n";tr/a-z/n-za-m/;print;'
Re: [slrn] scoring on subject in replies
Author: Allodoxaphobia
Date: Sat, 08 Mar 2003 23:30
Date: Sat, 08 Mar 2003 23:30
42 lines
2170 bytes
2170 bytes
On 8 Mar 2003 14:56:30 -0600, Gruebait hath writ: > On 8 Mar 2003 19:59:02 GMT, someone, possibly J.B. Nicholson-Owens, scribed: >> Gruebait wrote: >>> With a rule like: >>> Score:: =-9999 >>> Subject: Xnews >>> Subject: X-news >>> >>> why do headers with: "Subject: Re: [X-news]" still get through? >> >> Because you did not specify a set of groups to apply the score to. > > Well, I did in my scorefile, but I only cited the test in question when I > posted my question. The relevant section in my file was: > > [news.software.readers] > # All slrn articles > Score: =9999 > Subject: slrn > > # Clutter > Score:: =-9999 > Subject: Xnews > Subject: X-news Well, again (if I see what you're trying to do): KISS | [news.software.readers, alt.lang.s-lang] | Score: =-9999 |% This kills all but "s-lang", "slang", and "slrn" | ~Subject: \<s-?l[ar]ng? | Of course -- someone will come along now and point out.... HTH Jonesy -- | Marvin L Jones | jonz | W3DHJ | OS/2 | Gunnison, Colorado | @ | Jonesy | linux __ | 7,703' -- 2,345m | frontier.net | DM68mn SK
Re: [slrn] scoring on subject in replies
Author: Blinky the Shark
Date: Sun, 09 Mar 2003 01:18
Date: Sun, 09 Mar 2003 01:18
14 lines
1465 bytes
1465 bytes
Gruebait wrote: > When I posted, it wasn't clear to me whether slrn was using S-lang > pattern matching or shell conventions. Thanks for clearing that up. I believe you'll find that the (sl) in the slrn (r)eader for (n)ews stand for S-lang. -- Blinky Hot! New! Windows RG Released: http://snurl.com/WinRG (SWF Req'd) Have A Safe Trip: http://snurl.com/ubj (SWF Req'd)
Re: [slrn] scoring on subject in replies
Author: J.B. Nicholson-Owens
Date: Sun, 09 Mar 2003 03:06
Date: Sun, 09 Mar 2003 03:06
42 lines
2881 bytes
2881 bytes
Gruebait wrote:
> The relevant section in my file was:
>
> [news.software.readers]
> # All slrn articles
You should change the comment notation to percent signs ("%") instead of
pound signs/hashes ("#"). Unlike Perl and shell scripts (which use "#" to
mark comments), S-Lang uses "%". So the following score entry
[news.software.readers] % this is a comment
% this is also a comment
Score: 10 % This too is a comment
Subject: text % not a comment
will increase the score of any post in news.software.readers by 10 points if
that article's Subject: header matches the "text % not a comment" regular
expression. You cannot put comments on the same line as a regular
expression in a slrn scorefile and have slrn parse out both the regular
expression and the comment.
If you require comments on the same line as a regular expression in a slrn
scorefile you'll need to pre-process the scorefile before slrn reads it.
> I suppose I'll just have to learn about S-lang pattern matching (sigh)
Don't worry, it's not hard and it's not very time consuming. If you
understand Perl's regular expressions (including pcre's, which are designed
to be the same as Perl's), or Emacs' regular expressions you already
understand far more than S-Lang will currently handle. I expect this will
change in the next major revision of S-Lang (see
<slrnb69tfc.hu8.davis@aluche.mit.edu> for more details from John E. Davis,
primary developer of S-Lang).
The main difference between the regular expressions you use in slrn's
scorefile and anywhere else you would use S-Lang's regular expressions
(e.g., what you would use in a slrn macro) is that slrn's scorefile uses
case-*in*sensitive regular expressions while other S-Lang applications use
case-sensitive regular expressions.
Happy newsreading.
Re: [slrn] scoring on subject in replies
Author: Gruebait
Date: Sun, 09 Mar 2003 13:29
Date: Sun, 09 Mar 2003 13:29
42 lines
2550 bytes
2550 bytes
On 9 Mar 2003 03:06:52 GMT, someone, possibly J.B. Nicholson-Owens, scribed:
> Gruebait wrote:
>> The relevant section in my file was:
>>
>> [news.software.readers]
>> # All slrn articles
>
> You should change the comment notation to percent signs ("%") instead of
> pound signs/hashes ("#"). Unlike Perl and shell scripts (which use "#" to
> mark comments), S-Lang uses "%". So the following score entry
Hmm- I have two files, 'score', and an included file, 'static.score'. I
let all the clutter from interactive scoring accumulate in 'score', and
reserve 'static.score' for a mostly unchanging killfile.I run cleanscore
on 'score'. From the README for cleanscore:
"Comments beginning with the '#'-sign are not removed, so you can write
your own comments beginning with that sign."
From that I gathered that '#' was synonymous with '%'.
[snip]
> You cannot put comments on the same line as a regular
> expression in a slrn scorefile and have slrn parse out both the regular
> expression and the comment.
Aha! I'd missed that, on first reading the man.
[snip]
Well, a second look at S-lang and shell regexes shows very few
differences, so I've pretty much got it.
Thanks for the reply.
--
"You are in a maze of twisty passages, all alike." - Will Crowther
perl -e '$_="prxryyl\@qiby.pbz <Cenvt Kryyl>\n";tr/a-z/n-za-m/;print;'
Re: [slrn] scoring on subject in replies
Author: Felix Schueller
Date: Sun, 09 Mar 2003 22:25
Date: Sun, 09 Mar 2003 22:25
15 lines
1510 bytes
1510 bytes
At 9 Mar 2003 03:06:52 GMT, J.B. Nicholson-Owens wrote:
>> The relevant section in my file was:
>> [news.software.readers]
>> # All slrn articles
> You should change the comment notation to percent signs ("%") instead of
> pound signs/hashes ("#"). Unlike Perl and shell scripts (which use "#" to
> mark comments), S-Lang uses "%".
No, slrn use both chars ('#' and '%') to mark comment in its
scorefile.
Bye
Felix
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