Article View: news.software.readers
Article #36626Re: [slrn] Variables in scorefile?
From: Jan Hlavacek
Date: Mon, 13 Oct 1997 00:00
Date: Mon, 13 Oct 1997 00:00
80 lines
3751 bytes
3751 bytes
On 13 Oct 1997 05:34:39 GMT, Lloyd Zusman <ljz@asfast.com> wrote:
> On 13 Oct 1997 03:15:32 GMT, J.B. Nicholson-Owens <jbn@pop-a-wheelie.midwest.net> wrote:
> > Lloyd Zusman <ljz@asfast.com> wrote:
> > > Perhaps most of the infrastructure for something like this is already
> > > in place in slrn ... ???
> >
> > [ ... ]
> >
> > But getting back to the functional solution you've suggested, if we assume
> > that the functions are evaluated in the order they were set, converting
> > one's flatfile to a functional equivalent is a considerable job for people
> > with large scorefiles. [ ... ]
>
> A script to convert a conventional scorefile to a slang script containing
> its functional equivalant would be very easy to write, and this script
> could be supplied with the distribution of slrn.
>
>
> > [ ... ] Also, it's not clear how this would handle complex
> > logical statements any differently than the current scorefile -- I think one
> > might want a language with S-Lang's capabilities to handle complex
> > arrangements of tests to determine a score. [ ... ]
>
> Something like this would do that just fine:
>
> variable score = 1000;
>
> if (header("Subject") == "Free Money!" ||
> header("Subject") == "Ponzi scheme!") {
> score = -9999;
> }
> else if (lines() < 50000) {
> score = 100;
> }
> else if (matches(newsgroup(), "alt.spam.*")) {
> score = -100;
> }
>
> if (matches(newsgroup(), "alt.sex.*") {
> score = get_score("alt.animals.hippopotamuses");
> score -= 2000;
> }
>
> set_score(score);
>
> ... where header(), lines(), newsgroup(), matches(), get_score(), and
> set_score() are new functions that would be supplied with slrn. I'm
> sure that there would be a number of other new functions, as well.
>
You mean like current_newsgroup(), extract_article_header(),
get_header_score(), set_header_score()?
How about something like
define article_mode_hook ()
{
call ("bob");
while (header_down (1))
{
if (is_element (get_current_newsgroup (), GroupList1)
{
if (is_substr (extract_article_header ("Subject"), "blabla"))
{
score = get_header_score ();
score -= 1000;
set_header_score (score);
}
and so on?
lahvak
--
Jan Hlav\'{a}\v{c}ek <lahvak+n@math.ohio-state.edu> (BCC's will bounce)
home page: http://www.math.ohio-state.edu/~lahvak/
slrn page: http://www.math.ohio-state.edu/~lahvak/software/slrn.html
slrn documentation: http://www.math.ohio-state.edu/~lahvak/software/slrn/
Technical Details
Message-ID:
<slrn643e4a.1bj.lahvak+n@math.mps.ohio-state.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-mailReferences:
<slrn63gm05.ad.jbn@pop-a-wheelie.midwest.net> <slrn63gr84.13h.sp_robi@Elvira.home> <slrn63h1ti.ad.jbn@pop-a-wheelie.midwest.net> <slrn63rfmg.bnv.sp_robi@Elvira.home> <slrn63rp0b.411.jbn@pop-a-wheelie.midwest.net> <slrn63sjme.44k.Hubert.Canon@guenievre.irisa.fr> <slrn6429lb.65s.jbn@pop-a-wheelie.midwest.net> <slrn642k1i.fj9.ljz@ljz.asfast.net> <slrn6434a0.6ms.jbn@pop-a-wheelie.midwest.net> <slrn643cih.puh.ljz@ljz.asfast.net>Show Full Headers
Complete Article Headers
Message-ID: <slrn643e4a.1bj.lahvak+n@math.mps.ohio-state.edu> Subject: Re: [slrn] Variables in scorefile? Date: Mon, 13 Oct 1997 00:00:00 +0000 From: lahvak+n@math.ohio-state.edu (Jan Hlavacek) References: <slrn63gm05.ad.jbn@pop-a-wheelie.midwest.net> <slrn63gr84.13h.sp_robi@Elvira.home> <slrn63h1ti.ad.jbn@pop-a-wheelie.midwest.net> <slrn63rfmg.bnv.sp_robi@Elvira.home> <slrn63rp0b.411.jbn@pop-a-wheelie.midwest.net> <slrn63sjme.44k.Hubert.Canon@guenievre.irisa.fr> <slrn6429lb.65s.jbn@pop-a-wheelie.midwest.net> <slrn642k1i.fj9.ljz@ljz.asfast.net> <slrn6434a0.6ms.jbn@pop-a-wheelie.midwest.net> <slrn643cih.puh.ljz@ljz.asfast.net> 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: 280000023 Reply-To: lahvak+n@math.ohio-state.edu Organization: Department of Mathematics, The Ohio State University Newsgroups: news.software.readers