Article View: news.software.readers
Article #48650Re: Slrn scoring and spaces
From: 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.
Technical Details
Message-ID:
<slrn7ju6qs.idm.c928400@urdybet.pbk.dk>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mailReferences:
<slrn7jqufg.pgb.bekj@mycroft.tertius.net.au> <slrn7ju3i6.atc.bluemoon@ux6.cso.uiuc.edu>Show Full Headers
Complete Article Headers
Message-ID: <slrn7ju6qs.idm.c928400@urdybet.pbk.dk> Subject: Re: Slrn scoring and spaces Date: Sun, 16 May 1999 00:00:00 +0000 From: c928400@student.dtu.dk (Peppe) References: <slrn7jqufg.pgb.bekj@mycroft.tertius.net.au> <slrn7ju3i6.atc.bluemoon@ux6.cso.uiuc.edu> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail X-Deja-AN: 478556351 X-Complaints-To: usenet@news.net.uni-c.dk X-Trace: news.net.uni-c.dk 926882559 38504 130.225.71.226 (16 May 1999 19:22:39 GMT) Organization: Home of Peppe User-Agent: slrn/0.9.5.5 (UNIX) Reply-To: c928400@student.dtu.dk NNTP-Posting-Date: 16 May 1999 19:22:39 GMT Newsgroups: news.software.readers