Thread View: news.software.readers
2 messages
2 total messages
Started by Dawn Owens-Nicholson
Sun, 16 May 1999 00:00
Re: Slrn scoring and spaces
Author: Dawn Owens-Nicholson
Date: Sun, 16 May 1999 00:00
Date: Sun, 16 May 1999 00:00
24 lines
1416 bytes
1416 bytes
Bek Oberin wrote:
> Aside from a score like
> Subject: v.*i.*r.*g.*i.*n
Unfortunately, it's not any prettier, but it will get you fewer false
positives:
Subject: \<v[ \t]*i[ \t]*r[ \t]*g[ \t]*i[ \t]*n\>
if you're looking for "virgin" as a word with any amount of whitespace
between characters.
> there any way to make slrn collapse all the spaces out of a subject
> before testing it?
Not without using S-Lang to do your scoring. There is no S-Lang regular
expression metacharacter to remove all whitespace. If you're interested in
S-Lang regular expression parsing, please read
<slrn7ju3e8.atc.bluemoon@ux6.cso.uiuc.edu>.
The referenced article can be found:
http://www.deja.com/msgid.xp?MID=%3Cslrn7ju3e8.atc.bluemoon@ux6.cso.uiuc.edu%3E
Re: Slrn scoring and spaces
Author: Peppe
Date: Sun, 16 May 1999 00:00
Date: Sun, 16 May 1999 00:00
52 lines
2301 bytes
2301 bytes
Thus wrote Dawn Owens-Nicholson <bluemoon@ux6.cso.uiuc.edu>
> Bek Oberin wrote:
> > Aside from a score like
> > Subject: v.*i.*r.*g.*i.*n
[--- snip ---]
> > there any way to make slrn collapse all the spaces out of a subject
> > before testing it?
> Not without using S-Lang to do your scoring. There is no S-Lang regular
> expression metacharacter to remove all whitespace.
How about the following quick hack:
define article_mode_hook ()
{
variable
sub, str,
die = ["makemoney", "virgin"],
score = -1234;
uncollapse_threads ();
do
{
sub = extract_article_header ("Subject");
foreach (die)
{
str = ();
while (str_replace (sub, "[ \t]", ""))
sub = ();
if (is_substr (sub, str))
set_header_score (score);
}
}
while (header_down (1));
collapse_threads ();
call ("header_bob");
}
To be placed in eg. ~/.slrn.sl. After that, add
interpret .slrn.sl
to .slrnrc
Peppe
--
Preben Guldberg c928400@student.dtu.dk http://www.student.dtu.dk/~c928400
__/-\__ Q: What happens when you play a country western song backwards?
(o o) A: Your husband/wife comes back, your children
oOOo (_) oOOo come back, you get your job back...etc. etc. etc.
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