🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #198993

Re: Pan and SLRN score files - The difference?

#198993
From: Peter J Ross
Date: Thu, 03 May 2007 12:44
100 lines
4492 bytes
In news.software.readers on Thu, 03 May 2007 11:39:50 GMT, Bob the
Burger-Builder <Burger@Build.dur> wrote:

> Pan is supposed to be able to use SLRN scorefiles. While this may be true
> if auto-generated scores are transfered, I've found that custom score
> files tend to crash and burn, or just do nothing.

Auto-generated scorefiles rarely contain anything complicated.

> The reason why took me some time to dig/figure out. Pan and SLRN use
> different interpreters or something, slang/pcre/?

Yes. S-Lang regular expressions use a different syntax from PCRE, and
complicated examples may be incompatible. Here's a highly artificial
example with whitespace added for clarity:

S-Lang: \C    \<  \(  \d\d\d  \)  \1  \c     Z  \>
PCRE:   (?i)  \b  (   \d{3}   )   \1  {?-i}  Z  \b

Both these expressions match a "word" of six digits and an uppercase Z
in which digits 4-6 are the same as digits 1-3, such as "123123Z", but
neither will work in the wrong language. So if you have anything in
your Slrn scorefile that uses \C or \c, \< or />, \( or \), it will
either break or not match if you try it in Pan.

Also, groups of Slrn rules that use the "{: ... }" syntax will break
in Pan. You'll have to use PCRE's OR operator "|" instead.

> and while the
> standard auto-generated score file from SLRN MAY be read successfully by
> Pan, its a matter of luck if it works at all as the syntax for the two
> application's is disarmingly similar but different.

One thing that's likely to break even in a simple scorefile is
parentheses. E.g., to match a Subject containing "(was:" in Slrn,
you'd use
	(was:
but in Pan this would have to be
	\(was:
and the Slrn version would break. 

I can't think of many other things that would break in auto-generated
scorefiles.

> This could be why Pan only scores on a simpler set of criteria that the
> more complex and customisable SLRN.

No, Pan can match fewer headers than Slrn, but the matching
capabilities for each header are at least as extensive.

> It is also why Pan just quietly
> ignores a whole scorefile if one detail is not to it's liking, a highly
> likely event judging by the number of posts I've skimmed through by folks
> trying to figure out why Pan doesn't use SLRN scorefiles as legend would
> have it.

It's a pity if Pan doesn't provide an error message when the syntax is
wrong.

> So, onto my question. (At last!)
>
> Does anybody have any info regarding the syntax required to construct
> scorefiles for *Pan*?

$ man 3 pcrepattern

> I have a selection of scorefiles for SLRN, but need to "convert" the data
> within them to make sure it does indeed work as Pan requires.

To summarise:

Change "\(" and "\)" to "(" and ")"
Change "(" and ")" to "\(" and "\)"
Change "\<" and "\>" to "\b"
Change "\C" to "(?-i)" and "\c" to "(?i)"

Change any rules that use the "{: ... }" syntax to use "|". This may
be complicated: here's a real example from my scorefile:

	Score: =10
	From: pjr@example\.invalid
	{::
		Message-ID: @pjr\.gotdns\.org
		Message-ID: @pjr\.motzarella\.org
	}

This would become:

	Score: =10
	From: pjr@example\.invalid
	Message-ID: @pjr\.(gotdns|motzarella)\.org


I hope some of that will help. I've probably missed many of the
possible problems, and if there isn't at least one typo somewhere I'll
be surprised.


-- 
PJR :-)
Technical Details
Message-ID: <slrnf3jma1.6p4.pjr@pjr.gotdns.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news-out.octanews.net!indigo.octanews.net!authen.yellow.readfreenews.net.POSTED!not-for-mail
References: <pan.2007.05.03.11.40.26.188353@Cuppa.tea>

Show Full Headers
Complete Article Headers
Message-ID: <slrnf3jma1.6p4.pjr@pjr.gotdns.org>
Subject: Re: Pan and SLRN score files - The difference?
Date: Thu, 03 May 2007 12:44:55 +0000
From: Peter J Ross <pjr@example.invalid>
References: <pan.2007.05.03.11.40.26.188353@Cuppa.tea>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news-out.octanews.net!indigo.octanews.net!authen.yellow.readfreenews.net.POSTED!not-for-mail
Newsgroups: news.software.readers
Reply-To: pjr.spam@gmail.com
User-Agent: slrn/0.9.8.1pl2 (Debian)
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 100
Organization: Read Free News
NNTP-Posting-Date: 03 May 2007 07:44:55 CDT
X-Trace: DXC=TYT[Tk6:Vja^NRDlKIUm0c]AGWjF5PjPi465Ue@WB_5oRPlCjjMR9Xm26Z<EbT:a\e2XQX54M@PfbhWjUSN4PCffY\LXEZ5=B?j