🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
15 messages
15 total messages Started by Lewis Fri, 03 Dec 2021 18:53
[slrn[ score question
#265263
Author: Lewis
Date: Fri, 03 Dec 2021 18:53
17 lines
1266 bytes
It's been a long time since I first setup my slrn scroe file, and when
looking through it today I came across this and realized I don't
remember what it manes anymore, though it seemed important at the time
as it it near the top of the score file.

Score:: -800
~Subject: \c[a-z]
       {:
               Subject: ^Re:
               ~Subject: ^Re:.*\c[a-z]
       }

Heck I can't even remember how Score:: is different from Score::

-- 
S is for SUSAN who perished of fits
T is for TITUS who flew into bits
Re: [slrn[ score question
#265265
Author: Adam Funk
Date: Sat, 04 Dec 2021 13:21
45 lines
1994 bytes
On 2021-12-03, Lewis wrote:

> It's been a long time since I first setup my slrn scroe file, and when
> looking through it today I came across this and realized I don't
> remember what it manes anymore, though it seemed important at the time
> as it it near the top of the score file.
>
> Score:: -800
> ~Subject: \c[a-z]
>        {:
>                Subject: ^Re:
>                ~Subject: ^Re:.*\c[a-z]
>        }
>
> Heck I can't even remember how Score:: is different from Score::

'Score:' is an AND (the rule fires if all the conditions are met);
'Score::' is an OR (the rule fires if any condition is met).

And you can nest the boolean operators with the brackets. Here's a
weird example I found in my score file:

Score: 45
       {::
       Subject: chemical
       Subject: chemistry
       Subject: lab
       }
       {::
       Subject: supplier
       Subject: supplies
       Subject: supply
       }

That will match any post whose Subject contains one or more word from
each list (in any order).

I don't remember what the \c in your example does, but I'm curious!


-- 
While outside on the turnpike
They got this new hit tune
Thrills become as cheap as gas
And gas as cheap as thrills
Re: [slrn[ score question
#265267
Author: Lewis
Date: Sat, 04 Dec 2021 14:13
53 lines
2382 bytes
In message <sj6s7ix9at.ln2@news.ducksburg.com> Adam Funk <a24061@ducksburg.com> wrote:
> On 2021-12-03, Lewis wrote:

>> It's been a long time since I first setup my slrn scroe file, and when
>> looking through it today I came across this and realized I don't
>> remember what it manes anymore, though it seemed important at the time
>> as it it near the top of the score file.
>>
>> Score:: -800
>> ~Subject: \c[a-z]
>>        {:
>>                Subject: ^Re:
>>                ~Subject: ^Re:.*\c[a-z]
>>        }
>>
>> Heck I can't even remember how Score:: is different from Score::

> 'Score:' is an AND (the rule fires if all the conditions are met);
> 'Score::' is an OR (the rule fires if any condition is met).

I thought the : and :: applied to subclauses like in your example. I
just didn't remember you could do it on the Score line. I usually
manually create

Score: #
 {::
   list of or matches
 }

> And you can nest the boolean operators with the brackets. Here's a
> weird example I found in my score file:

> Score: 45
>        {::
>        Subject: chemical
>        Subject: chemistry
>        Subject: lab
>       }
>        {::
>        Subject: supplier
>        Subject: supplies
>        Subject: supply
>       }

> That will match any post whose Subject contains one or more word from
> each list (in any order).

> I don't remember what the \c in your example does, but I'm curious!

Me too!

-- 
Si Hoc Legere Scis Nimium Eruditionis Habes
Re: [slrn[ score question
#265268
Author: Tavis Ormandy
Date: Sat, 04 Dec 2021 15:31
29 lines
1454 bytes
On 2021-12-03, Lewis wrote:
> ~Subject: \c[a-z]

The tilde means the rule is inverted and \c means to enable case
sensitivity, so this only matches if the subject was ALL CAPS.

>        {:

This starts a group, all of the rules in the group have to match.

>                Subject: ^Re:
>                ~Subject: ^Re:.*\c[a-z]

This is adding an exception for Re:, so Re: ALL CAPS still matches the
rule!

>        }

You can also add a comment, like Score: -100 % All CAPS, then when you
show the score view (v), it tells you which scores matched! This is
really handy if you have a bunch of complicated rules and not sure what
caused a score to be so high/low.

Tavis.

-- 
 _o)            $ lynx lock.cmpxchg8b.com
 /\\  _o)  _o)  $ finger taviso@sdf.org
_\_V _( ) _( )  @taviso
Re: [slrn[ score question
#265269
Author: Peter J Ross
Date: Sat, 04 Dec 2021 17:16
48 lines
2107 bytes
On 2021-12-03, Lewis <g.kreme@kreme.dont-email.me> wrote:
> It's been a long time since I first setup my slrn scroe file, and when
> looking through it today I came across this and realized I don't
> remember what it manes anymore, though it seemed important at the time
> as it it near the top of the score file.

Perhaps it's near the top because you added it early and then forgot
about it. :-)

> Score:: -800
> ~Subject: \c[a-z]
>        {:
>                Subject: ^Re:
>                ~Subject: ^Re:.*\c[a-z]
>        }

You adapted this from an example in the official documentation.

https://slrn.info/docs/score.txt

#v+
For writing even more complex entries, slrn now allows the grouping of
  scorefile rules. Here is a simple example:

          Score:: -1000
          ~Subject: \c[a-z]
          {:
                  Subject: ^Re:
                  ~Subject: ^Re:.*\c[a-z]
          }

  Lines enclosed in curly braces are grouped; the initial brace is
  followed by one or two colons that indicate whether only one (`::') or
  all of the lines (`:') inside the group need to match for the group to
  pass.

  As the result, the example kills subject header lines that do not
  contain lowercase characters, not counting an initial `Re:'.
#v-

> Heck I can't even remember how Score:: is different from Score::

I bet my memory of the subtleties of slrn is worse than yours. 



-- 
PJR :-)
Re: [slrn[ score question
#265270
Author: Adam Funk
Date: Sat, 04 Dec 2021 19:21
67 lines
2643 bytes
On 2021-12-04, Lewis wrote:

> In message <sj6s7ix9at.ln2@news.ducksburg.com> Adam Funk <a24061@ducksburg.com> wrote:
>> On 2021-12-03, Lewis wrote:
>
>>> It's been a long time since I first setup my slrn scroe file, and when
>>> looking through it today I came across this and realized I don't
>>> remember what it manes anymore, though it seemed important at the time
>>> as it it near the top of the score file.
>>>
>>> Score:: -800
>>> ~Subject: \c[a-z]
>>>        {:
>>>                Subject: ^Re:
>>>                ~Subject: ^Re:.*\c[a-z]
>>>        }
>>>
>>> Heck I can't even remember how Score:: is different from Score::
>
>> 'Score:' is an AND (the rule fires if all the conditions are met);
>> 'Score::' is an OR (the rule fires if any condition is met).
>
> I thought the : and :: applied to subclauses like in your example. I
> just didn't remember you could do it on the Score line. I usually
> manually create

I know Score:: is OR because I have rules that work, e.g.,

Score:: +10
	From: alice@example.com
	From: bob@example.org



> Score: #
>  {::
>    list of or matches
>  }
>
>> And you can nest the boolean operators with the brackets. Here's a
>> weird example I found in my score file:
>
>> Score: 45
>>        {::
>>        Subject: chemical
>>        Subject: chemistry
>>        Subject: lab
>>       }
>>        {::
>>        Subject: supplier
>>        Subject: supplies
>>        Subject: supply
>>       }
>
>> That will match any post whose Subject contains one or more word from
>> each list (in any order).
>
>> I don't remember what the \c in your example does, but I'm curious!
>
> Me too!

Well, let me know if you find out!


-- 
is it any wonder that my mind's on fire,
imprisoned by the thoughts of what to do?
Re: [slrn[ score question
#265271
Author: Adam Funk
Date: Sat, 04 Dec 2021 19:23
36 lines
1710 bytes
On 2021-12-04, Tavis Ormandy wrote:

> On 2021-12-03, Lewis wrote:
>> ~Subject: \c[a-z]
>
> The tilde means the rule is inverted and \c means to enable case
> sensitivity, so this only matches if the subject was ALL CAPS.
>
>>        {:
>
> This starts a group, all of the rules in the group have to match.
>
>>                Subject: ^Re:
>>                ~Subject: ^Re:.*\c[a-z]
>
> This is adding an exception for Re:, so Re: ALL CAPS still matches the
> rule!

I must be missing something --- I thought scoring patterns were
case-insensitive by default?



>>        }
>
> You can also add a comment, like Score: -100 % All CAPS, then when you
> show the score view (v), it tells you which scores matched! This is
> really handy if you have a bunch of complicated rules and not sure what
> caused a score to be so high/low.
>
> Tavis.
>


-- 
books by the blameless and by the dead
Re: [slrn[ score question
#265272
Author: Tavis Ormandy
Date: Sat, 04 Dec 2021 21:34
24 lines
1451 bytes
On 2021-12-04, Adam Funk wrote:
> On 2021-12-04, Tavis Ormandy wrote:
>
>> On 2021-12-03, Lewis wrote:
>>> ~Subject: \c[a-z]
>>
>> The tilde means the rule is inverted and \c means to enable case
>> sensitivity, so this only matches if the subject was ALL CAPS.
>>
>
> I must be missing something --- I thought scoring patterns were
> case-insensitive by default?

You're not missing anything, exactly right! They're case-insensitive by
default, but \c enables case-sensitivity.  So \c[a-z] only matches
lowercase, but the rule is inverted (the tilde) - so it only matches
*no* lowercase.

Tavis.

-- 
 _o)            $ lynx lock.cmpxchg8b.com
 /\\  _o)  _o)  $ finger taviso@sdf.org
_\_V _( ) _( )  @taviso
Re: [slrn[ score question
#265273
Author: Lewis
Date: Sun, 05 Dec 2021 05:23
19 lines
1507 bytes
In message <j11fuhF6qfdU1@mid.individual.net> Tavis Ormandy <taviso@gmail.com> wrote:
> On 2021-12-03, Lewis wrote:
>> ~Subject: \c[a-z]

> The tilde means the rule is inverted and \c means to enable case
> sensitivity, so this only matches if the subject was ALL CAPS.

Ah, that makes sense I knew that once.`

> You can also add a comment, like Score: -100 % All CAPS

Yes, I gave done that on many newer rules, but not on some of the
originals (I may not have known about commenting back then and didn't go
back and do it when I should have).

Thanks for the explanation.

-- 
Bart, don't use the Touch of Death on your sister.
Re: [slrn[ score question
#265275
Author: Adam Funk
Date: Sun, 05 Dec 2021 15:31
31 lines
1804 bytes
On 2021-12-04, Tavis Ormandy wrote:

> On 2021-12-04, Adam Funk wrote:
>> On 2021-12-04, Tavis Ormandy wrote:
>>
>>> On 2021-12-03, Lewis wrote:
>>>> ~Subject: \c[a-z]
>>>
>>> The tilde means the rule is inverted and \c means to enable case
>>> sensitivity, so this only matches if the subject was ALL CAPS.
>>>
>>
>> I must be missing something --- I thought scoring patterns were
>> case-insensitive by default?
>
> You're not missing anything,

Well actually...

> exactly right! They're case-insensitive by
> default, but \c enables case-sensitivity.  So \c[a-z] only matches
> lowercase, but the rule is inverted (the tilde) - so it only matches
> *no* lowercase.

...I forgot about the ~ NOT. Now I understand, thanks.


-- 
Master Foo once said to a visiting programmer: "There is more
Unix-nature in one line of shell script than there is in ten
thousand lines of C."                         ---Eric Raymond
Re: [slrn[ score question
#265276
Author: Adam Funk
Date: Sun, 05 Dec 2021 15:32
28 lines
1756 bytes
On 2021-12-05, Lewis wrote:

> In message <j11fuhF6qfdU1@mid.individual.net> Tavis Ormandy <taviso@gmail.com> wrote:
>> On 2021-12-03, Lewis wrote:
>>> ~Subject: \c[a-z]
>
>> The tilde means the rule is inverted and \c means to enable case
>> sensitivity, so this only matches if the subject was ALL CAPS.
>
> Ah, that makes sense I knew that once.`
>
>> You can also add a comment, like Score: -100 % All CAPS
>
> Yes, I gave done that on many newer rules, but not on some of the
> originals (I may not have known about commenting back then and didn't go
> back and do it when I should have).

It's just like putting comments in programs --- by the time you
realize you need them to figure out what you meant, it's too late.



> Thanks for the explanation.
>

-- 
Our scientific power has outrun our spiritual power. We have guided
missiles and misguided men.              ---Martin Luther King, Jr.
Re: [slrn[ score question
#265278
Author: Lewis
Date: Sun, 05 Dec 2021 23:24
27 lines
2015 bytes
In message <al2v7ix434.ln2@news.ducksburg.com> Adam Funk <a24061@ducksburg.com> wrote:
> On 2021-12-05, Lewis wrote:

>> In message <j11fuhF6qfdU1@mid.individual.net> Tavis Ormandy <taviso@gmail.com> wrote:
>>> On 2021-12-03, Lewis wrote:
>>>> ~Subject: \c[a-z]
>>
>>> The tilde means the rule is inverted and \c means to enable case
>>> sensitivity, so this only matches if the subject was ALL CAPS.
>>
>> Ah, that makes sense I knew that once.`
>>
>>> You can also add a comment, like Score: -100 % All CAPS
>>
>> Yes, I gave done that on many newer rules, but not on some of the
>> originals (I may not have known about commenting back then and didn't go
>> back and do it when I should have).

> It's just like putting comments in programs --- by the time you
> realize you need them to figure out what you meant, it's too late.

Nah, as it turns out they are better because the comments are shown when
you look at the score details while in slrn.

-- 
"Are you pondering what I'm pondering?"
"Uh, I think so Brain, but this time, you wear the tutu."
Re: [slrn[ score question
#265277
Author: Jeremy Brubaker
Date: Thu, 09 Dec 2021 18:55
31 lines
1829 bytes
On 2021-12-04, Tavis Ormandy wrote:
> On 2021-12-03, Lewis wrote:
>> ~Subject: \c[a-z]
>
> The tilde means the rule is inverted and \c means to enable case
> sensitivity, so this only matches if the subject was ALL CAPS.

Why can't the first line be Subject: \c[A-Z] instead? And doesn't that
only match one-word subjects? I've been trying to figure out how to kill
all-caps From: and Subject: and I'm not sure I have it correct.

>>        {:
>
> This starts a group, all of the rules in the group have to match.
>
>>                Subject: ^Re:
>>                ~Subject: ^Re:.*\c[a-z]
>
> This is adding an exception for Re:, so Re: ALL CAPS still matches the

And why can't this just be Subject: ^Re:.*\c[A-Z]? (with the appropriate
altering of the AND/OR blocks)

Clearly regex are not my strong suit.


-- 
() www.asciiribbon.org  | Jeremy Brubaker
/\  - against html mail | јЬruЬаkе@оrіоnаrtѕ.іо / neonrex on IRC

"Humor is a drug which it's the fashion to abuse." -- William Gilbert
Re: [slrn[ score question
#265279
Author: Tavis Ormandy
Date: Fri, 10 Dec 2021 06:37
25 lines
1557 bytes
On 2021-12-09, Jeremy Brubaker wrote:
> On 2021-12-04, Tavis Ormandy wrote:
>> On 2021-12-03, Lewis wrote:
>>> ~Subject: \c[a-z]
>>
>> The tilde means the rule is inverted and \c means to enable case
>> sensitivity, so this only matches if the subject was ALL CAPS.
>
> Why can't the first line be Subject: \c[A-Z] instead? 

That would match any subject with a capital letter (rather than any
subject *without* a lowercase letter).

You're probably thinking of something like \c^[A-Z]+$ (nothing but
capital letters)... It works, but then a space or punctuation "OH
YEAH!!!!" gets through... so "no lowercase" is just a less messy
way of saying "only uppercase or punctuation or spaces or symbols or
..." :)

Tavis.

-- 
 _o)            $ lynx lock.cmpxchg8b.com
 /\\  _o)  _o)  $ finger taviso@sdf.org
_\_V _( ) _( )  @taviso
Re: [slrn[ score question
#265280
Author: Jeremy Brubaker
Date: Fri, 10 Dec 2021 21:17
21 lines
1593 bytes
On 2021-12-10, Tavis Ormandy wrote:
> On 2021-12-09, Jeremy Brubaker wrote:
>> On 2021-12-04, Tavis Ormandy wrote:
>>> On 2021-12-03, Lewis wrote:
>>>> ~Subject: \c[a-z]
>>>
>>> The tilde means the rule is inverted and \c means to enable case
>>> sensitivity, so this only matches if the subject was ALL CAPS.
>>
>> Why can't the first line be Subject: \c[A-Z] instead? 
>
> That would match any subject with a capital letter (rather than any
> subject *without* a lowercase letter).

Oh yeah. Thanks for pointing that out.

-- 
() www.asciiribbon.org  | Jeremy Brubaker
/\  - against html mail | јЬruЬаkе@оrіоnаrtѕ.іо / neonrex on IRC

I just thought of something funny...your mother. -- Cheech Marin
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