Thread View: news.software.readers
8 messages
8 total messages
Started by Mike Dee
Thu, 06 Sep 2007 01:10
[Xnews] A tale of case sensitivity
Author: Mike Dee
Date: Thu, 06 Sep 2007 01:10
Date: Thu, 06 Sep 2007 01:10
44 lines
3481 bytes
3481 bytes
Those of you know of the Xnews score file syntax, will know that is case insensitive by default. So if you want to score on an uppercase "A" and not a lowercase "a", you need to turn case sensitivity on to run that score. What brought this about was seeing post subjects in all-caps, the "YOU MUST READ THIS NOW AND THIS IPOD WILL BE YOURS FOR FREE" kind of thing. - I don't even want to read the subject line of these posts... Time to create a case sensitive score entry. I remembered that case sensitivity could be toggled on/off in Xnews but had forgotten how, it was RTFM time again for me ;-) And in the fine manual under Regular Expression, section: 8) Case sensitivity: "In the score file, you can make regex case sensitive by specifying Keyword= expression rather than Keyword: expression." Cool, that was easy. Then I spent another 5 minutes or so trying to figure out the syntax of the expression to use. Nothing was looking too elegant (or working how I'd like) so off to the good old slrn regex repository I go. I use this for simple but really useful tips on regular expressions. Conversion to work on Xnews is easy too. --------------------------------------- http://slrn.sourceforge.net/manual/slrn-FAQ-4.html [...] 4.18 How do I score subjects that contain only uppercase characters? Use something like: Score: -9999 ~Subject: \c[a-z] --------------------------------------- Brilliant. I hadn't thought to use a NOT condition here. Converting for use in Xnews it looks exactly like this: Score: -9999 ~Subject= [a-z] In other words, if a subject does not have one lowercase letter, then kill it dead. Its the little things in life that bring about the greatest pleasures :-) -- dee
Re: [Xnews] A tale of case sensitivity
Author: Robert Singers
Date: Thu, 06 Sep 2007 09:22
Date: Thu, 06 Sep 2007 09:22
10 lines
2094 bytes
2094 bytes
Between saving the world and having a spot of tea Mike Dee said > Its the little things in life that bring about the greatest pleasures :-) Very clever. -- rob singers pull finger to reply Foemina Erit Ruina Tua
Re: [Xnews] A tale of case sensitivity
Author: Tony Raven
Date: Thu, 06 Sep 2007 11:33
Date: Thu, 06 Sep 2007 11:33
36 lines
2635 bytes
2635 bytes
Mike Dee <mikedee@emteedee.invalid> wrote in
news:Xns99A37BDA4F03Aemteedee@203.26.24.228:
>
> Brilliant. I hadn't thought to use a NOT condition here. Converting
> for use in Xnews it looks exactly like this:
>
> Score: -9999
> ~Subject= [a-z]
>
> In other words, if a subject does not have one lowercase letter, then
> kill it dead.
>
> Its the little things in life that bring about the greatest pleasures
> :-)
>
Don't want to burst the bubble but the file sample-score.ini has the
following lines in it:
% kill if subject doesn't contain at least 1 lower case letter
% i.e., kill all caps subject
Score:: -9999
~Subject= [a-z]
% kill followup to all caps subject while we're at it.
Score: -9999
Subject= ^[Rr][Ee]: [^a-z]*$
Subject= ^[Rr][Ee]: .*[A-Z]
--
Tony
" I would never die for my beliefs because I might be wrong."
Bertrand Russell
Re: [Xnews] A tale of case sensitivity
Author: Ted S.
Date: Thu, 06 Sep 2007 12:09
Date: Thu, 06 Sep 2007 12:09
13 lines
1354 bytes
1354 bytes
On 6 Sep 2007 21:22:33 +1200, Robert Singers wrote: > Between saving the world and having a spot of tea Mike Dee said > >> Its the little things in life that bring about the greatest pleasures :-) > > Very clever. Size does matter.... -- Ted S. fedya at bestweb dot net
Re: [Xnews] A tale of case sensitivity
Author: Mike Dee
Date: Fri, 07 Sep 2007 01:45
Date: Fri, 07 Sep 2007 01:45
18 lines
2535 bytes
2535 bytes
Tony Raven <junk@raven-family.invalid> wrote: > Don't want to burst the bubble but the file sample-score.ini has > the following lines in it: > > % kill if subject doesn't contain at least 1 lower case > letter > % i.e., kill all caps subject > Score:: -9999 > ~Subject= [a-z] Ouch, my bubble was burst ;-) I didn't think to look in the example score file. Oh well, at least I came to the same conclusion as Luu :-) -- dee
Re: [Xnews] A tale of case sensitivity
Author: Mike Dee
Date: Fri, 07 Sep 2007 02:16
Date: Fri, 07 Sep 2007 02:16
14 lines
2277 bytes
2277 bytes
Robert Singers <rsingers@finger.hotmail.com> wrote: > Between saving the world and having a spot of tea Mike Dee said > >> Its the little things in life that bring about the greatest >> pleasures :-) > > Very clever. Thanks, Robert. Not overly clever tho', the clues were all around and some even closer than I'd realised ;-) -- dee
Re: [Xnews] A tale of case sensitivity
Author: me
Date: Fri, 07 Sep 2007 23:52
Date: Fri, 07 Sep 2007 23:52
39 lines
1961 bytes
1961 bytes
Mike Dee <emteedee@invalid.invalid> wrote in news:Xns99A477A112E2Eemteedee@85.214.62.108: > Tony Raven <junk@raven-family.invalid> wrote: > >> Don't want to burst the bubble but the file >> sample-score.ini has the following lines in it: >> >> % kill if subject doesn't contain at least 1 lower >> case >> letter >> % i.e., kill all caps subject >> Score:: -9999 >> ~Subject= [a-z] > > Ouch, my bubble was burst ;-) > > I didn't think to look in the example score file. Oh well, > at least I came to the same conclusion as Luu :-) > Perhaps .. [ quot scoring.txt ] -snip- If you want the expression-to-match to be case sensitive, then put an equal sign instead of of a : after the keyword, e.g. [.] Score: -9999 ~Subject= .*[a-z] -snip- Luu Tran Feb 23, 1999 [ /quot ] J -- Replies to: Nherr1professor2doktor31109(at)Oyahoo(dot)Tcom
Re: [Xnews] A tale of case sensitivity
Author: Mike Dee
Date: Sat, 08 Sep 2007 00:51
Date: Sat, 08 Sep 2007 00:51
50 lines
3302 bytes
3302 bytes
me@tadyatam.invalid wrote: >Mike Dee <emteedee@invalid.invalid> wrote in > news:Xns99A477A112E2Eemteedee@85.214.62.108: > >> Tony Raven <junk@raven-family.invalid> wrote: >> >>> Don't want to burst the bubble but the file >>> sample-score.ini has the following lines in it: >>> >>> % kill if subject doesn't contain at least 1 lower >>> case >>> letter >>> % i.e., kill all caps subject >>> Score:: -9999 >>> ~Subject= [a-z] >> >> Ouch, my bubble was burst ;-) >> >> I didn't think to look in the example score file. Oh well, >> at least I came to the same conclusion as Luu :-) >> > Perhaps .. Perhaps yes. > [ quot scoring.txt ] > -snip- > If you want the expression-to-match to be case sensitive, > then put an equal sign instead of of a : after the keyword, > e.g. > > [.] > Score: -9999 > ~Subject= .*[a-z] > -snip- > Luu Tran > Feb 23, 1999 > [ /quot ] You could take a look at "sample-score.ini" The example there, has been modified to drop the .* from the example used in scoring.txt. It works equally as well if not more efficiently than the scoring.txt example, so .* in this case has become redundant. Luu. You need to update scoring.txt -- dee
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