🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
1 messages
1 total messages Started by Mark Maimone Thu, 13 May 1993 15:57
trn typo patch (unofficial)
#4166
Author: Mark Maimone
Date: Thu, 13 May 1993 15:57
75 lines
4446 bytes
	Here's the header from a patch I just posted to alt.sources, for
your enjoyment.  Apologies if it's for an out-of-date version of trn, but
the changes are small enough that it should be simple to incorporate in
more recent code.

				Mark Maimone
				mwm@cmu.edu

------------------------------------------------------------------------------

Archive-name: trn-typo
Submitted-by: mwm@cmu.edu (Mark W Maimone)
Version: 1.0   13 May 1993

TRN v2.2 Typo Upgrade

	by Mark Maimone, Carnegie Mellon Computer Science
	9 May 1993

	This patch lets trn handle "g"oto command typos more gracefully.  If
you misspell a newsgroup, it'll jump to the nearest match automatically, or
give you a choice if there are multiple matches.  Names are compared using
the Edit Distance metric.

	This patch should port fairly smoothly across platforms.  On some
machines (e.g. vax, pmax) the "g" command may take measureably longer (more
than five seconds) to find the nearest match, but on others (e.g. Sun4) it's
even faster than before.  Actual amount of time taken depends on the length
of the newsgroup string you've mistyped.  Very short or very long newsgroup
names will be matched very quickly, names with the most common lengths will
take the longest.  However, the few-second wait is much less aggravating
than having to find the typo (or determine the exact newsgroup name)
manually.

	The program works by comparing the mistyped string against the
complete list of legal newsgroups.  Only those newsgroups whose length
differs by a small amount (currently +/- 5 chars) will be checked.  But
that can still entail checking thousands of names.  Here's a summary (by
name length) of the number of newsgroups available at one particular site:

Number      258|                               *                       
  of        246|                               *                       
Newsgroups  234|                               *                       
	    222|                             * *   *                   
	    210|                             * * * *                   
	    198|                             * * * *                   
	    186|                         *   * * * *                   
	    174|                         * * * * * *                   
	    162|                         * * * * * *                   
	    150|                     *   * * * * * *                   
	    138|                     * * * * * * * *                   
	    126|                     * * * * * * * *                   
	    114|                   * * * * * * * * * *                 
	    102|                 * * * * * * * * * * *                 
	     90|               * * * * * * * * * * * *                 
	     78|               * * * * * * * * * * * * *               
	     66|               * * * * * * * * * * * * * *             
	     54|             * * * * * * * * * * * * * * *   *         
	     42|           * * * * * * * * * * * * * * * * * * *       
	     30|         * * * * * * * * * * * * * * * * * * * *       
	      0 -------------------------------------------------------
	         3 4 6 7 8 9 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 
	                     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 
	  			Length of newsgroup name

So you can see why short (and even long!) typos will be matched more
quickly; far fewer match candidates.

	This patch (and future updates) can be found by anonymous-FTP to
vacation.venari.cs.cmu.edu (128.2.209.207) in trn-typo.tar (no need to
change directories).
-- 
Mark Maimone				phone: +1 (412) 268 - 7698
Carnegie Mellon Computer Science	email: mwm@cmu.edu
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