Article View: news.software.readers
Article #4166trn typo patch (unofficial)
From: Mark Maimone
Date: Thu, 13 May 1993 15:57
Date: Thu, 13 May 1993 15:57
75 lines
4446 bytes
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
Technical Details
Message-ID:
<C6z307.DC8.1@cs.cmu.edu>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!europa.eng.gtefsd.com!fs7.ece.cmu.edu!crabapple.srv.cs.cmu.edu!mwmShow Full Headers
Complete Article Headers
Message-ID: <C6z307.DC8.1@cs.cmu.edu> Subject: trn typo patch (unofficial) Date: Thu, 13 May 1993 15:57:42 GMT From: mwm+@A.GP.CS.CMU.EDU (Mark Maimone) Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!europa.eng.gtefsd.com!fs7.ece.cmu.edu!crabapple.srv.cs.cmu.edu!mwm Newsgroups: news.software.readers Originator: mwm@A.GP.CS.CMU.EDU Sender: news@cs.cmu.edu (Usenet News System) Nntp-Posting-Host: a.gp.cs.cmu.edu Organization: School of Computer Science, Carnegie Mellon Lines: 75