🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
3 messages
3 total messages Started by J.H.M. Dassen Fri, 04 Apr 1997 00:00
slrn: scoring on body text?
#32528
Author: J.H.M. Dassen
Date: Fri, 04 Apr 1997 00:00
14 lines
1006 bytes
Hi,

Is it possible in slrn to score on words in the body of messages? If so,
is there an example file available?

Also, is slrn's scoring regexp based? If so, what's the precise syntax?

TIA,
Ray
-- 
Obsig: developing a new sig

Re: slrn: scoring on body text?
#32554
Author: Jan Hlavacek
Date: Fri, 04 Apr 1997 00:00
26 lines
1382 bytes
On 4 Apr 1997 08:48:43 GMT, J.H.M. Dassen <jdassen@wi.LeidenUniv.nl> wrote:
>Hi,
>
>Is it possible in slrn to score on words in the body of messages? If so,
>is there an example file available?
>

I don't think so.  It would be extremely slow, especially if you use NNTP.

>Also, is slrn's scoring regexp based? If so, what's the precise syntax?
>

Look at

http://www.math.ohio-state.edu/~lahvak/software/slrn/scoring.html
http://www.math.ohio-state.edu/~lahvak/software/slrn/scoring_faq.html
http://www.math.ohio-state.edu/~lahvak/software/slang/regexps.html

-- 
Jan Hlav\'{a}\v{c}ek
lahvak+n@math.ohio-state.edu  (Blind Carbon Copies will bounce)
www: http://www.math.ohio-state.edu/~lahvak/  is back!


Re: slrn: scoring on body text?
#32717
Author: John E. Davis
Date: Fri, 11 Apr 1997 00:00
134 lines
4299 bytes
On 4 Apr 1997 08:48:43 GMT, J.H.M. Dassen <jdassen@wi.LeidenUniv.nl>
wrote:
>Is it possible in slrn to score on words in the body of messages? If so,
>is there an example file available?

   No, I did not add scoring on the body of the message.  It is
extremely unlikely that I would ever do so; however, you should be
able to write a macro to do body searches (see what I use below).

>Also, is slrn's scoring regexp based? If so, what's the precise syntax?

There is no official documentation for the syntax.  Here is what rgrep
produces (rgrep is a recursive grep program distributed with jed and
uses slang regular expressions):

Supported Regular Expressions:
   .                  match any character except newline
   \d                 match any digit
   \e                 match ESC char
   *                  matches zero or more occurences of previous RE
   +                  matches one or more occurences of previous RE
   ?                  matches zero or one occurence of previous RE
   ^                  matches beginning of line
   $                  matches end of line
   [ ... ]            matches any single character between brackets.
                      For example, [-02468] matches `-' or any even digit.
		      and [-0-9a-z] matches `-' and any digit between 0 and 9
		      as well as letters a through z.
   \<                 Match the beginning of a word.
   \>                 Match the end of a word.
   \{ ... \}
   \( ... \)
   \1, \2, ..., \9    matches text specified by nth \( ... \) expression.
                      For example, '\([ \t][a-zA-Z]+\)\1[ \t]' matches any
		      word repeated consecutively.

Here is the body searching macro.  See slrn/doc/README.macros for more
information. (There are actually two searches: one that searches
articles on the server and the other uses www.altavista.com)  

Note: you may need slrn/macros/util.sl loaded.


!if (is_defined ("Search_Altavista_Browser"))
{
   variable Search_Altavista_Browser = "lynx";
}

variable Search_Last_Art_Search_Str = "";
define search_newsgroup ()
{
   variable str;
   variable flags;
   
   str = read_mini ("Search for regexp", Search_Last_Art_Search_Str, "");
   !if (strlen (str))
     return;

   Search_Last_Art_Search_Str = str;
   
   uncollapse_threads ();
   
   do
     {
	flags = get_header_flags ();
	
	if (re_search_article (str))
	  {
	     pop ();
	     return;
	  }
	
	set_header_flags (flags);
	
	call ("hide_article");
     }
   while (header_down (1));
   
   error ("Not found.");
}

define search_using_altavista ()
{
   variable url = "http://www.altavista.digital.com/";
   variable cgi = "cgi-bin/query?pg=q&what=news&fmt=.&q=";
   variable str, new_str, len, ch, chlo, i;
   variable cmd;
   
   str = strcat ("+newsgroups:", current_newsgroup ());
   str = strcat (str, " +");
   
   str = read_mini ("AltaVista Search", "", str);
   
   len = strlen (str);
   !if (len) return;
   
   new_str = "";
   for (i = 0; i < len; i++)
     {
	ch = str [i];
	chlo = ch | 0x20;
	if ((chlo > 'z') or (chlo < 'a'))
	  ch = Sprintf ("%%%02X", ch, 1);
	else 
	  ch = char (ch);
	
	new_str = strcat (new_str, ch);
     }
   
   cmd = Sprintf ("%s '%s%s%s'", Search_Altavista_Browser, 
		  url, cgi, new_str, 4);
   () = system (cmd);
}

define search_easy_search ()
{
   variable rsp;
   rsp = get_select_box_response ("NewsGroup Searches",   %  title
				  "AltaVista (WWW)",
				  "search articles",
				  2);

   switch (rsp)
     { case 0: search_using_altavista (); }
     { case 1: search_newsgroup (); }
}


definekey ("search_easy_search", "$", "article");



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