Skip to contentSkip to conversation

kernel source spellchecker

PATCH In review Dan Kegel 8 participants 34 messages Feb 27, 2003 – Mar 3, 2003 5 messages not in the archive

lore
Share & tools
lore

Dan Kegel

author
#0 lore raw

PATCH 1/1 kernel source spellchecker

Since the main remaining feature before release of the 2.6 kernel is fixing all the remaining spelling errors, this patch seems appropriate. This is against 2.4 but should apply to other versions as well.
It's not very smart, but should help get us to our all-important goal of 100% correctly spellt kernel source.
Todo: make it ignore names from the MAINTAINERS file, the list of signals and syscalls, and other well-known english words seem mostly in Webster's Posix edition; rewrite in Perl rather than C, or add real Makefile entry. Enjoy!
- Dan

scripts/spellcheck-kernel new file +12 -0
@@ -0,0 +1,12 @@
+#!/bin/sh
+# Script to spellcheck kernel.
+# usage: spellcheck-kernel [ sourcedir ]
+#     The source directory defaults to /usr/src/linux.
+# e.g.
+#   scripts/spellcheck-kernel .
+#      Check spelling of the kernel tree in the current directory
+
+sourcedir=${1-/usr/src/linux}
+
+make -C .. scripts/lspell
+find $sourcedir -name '*.[ch]' | xargs ./lspell
scripts/lspell.c new file +74 -0

74 lines not on this page · raw message

Signature · 3 lines
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#2 lore raw
Quoted 8 lines · Joe Perches
Quoted 3 lines · Dan Kegel

Since the main remaining feature before release of the 2.6 kernel is fixing all the remaining spelling errors, this patch seems appropriate.

Who let the comedian in? :o

At first I was jokeing, but what the heck, I figured I'd run it. Here are the mispelled words that occur in five or more files and that lookd like real misspellings to my eye. The list contains some words that are ok in British usage; I don't have a British spellchecker (that I know how to use).

Perhaps some eagr Perl monger can (after removing the British-ok words!) contribute a spellcorrect-kernel program that takes in a liste of known misspellings + corrections, and applies them to the commments in all kernel source files...
- Dan

Signature · 3 lines
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045

accomodate
Acknowledgement
acknowledgements
adaptor
adaptors
adddress
additionnal
alignement
allways
analyse
angerous
apropriate
arround
assosciated
assosiated
asyncronous
Auxillary
availible
avaliable
basicly
beeing
borken
boundry
bramaged
cacheable
callin
cancelled
capabilites
childs
choosen
comamnd
comming
commited
comparision
Compatability
compatibilty
compatiblity
completly
concurent
Continous
continous
controler
controllen
coresponding
decrementer
decriptor
defered
defintions
denormalised
denormalized
dependend
desciptor
devide
differenciate
doesnt
DONT
dont't
dugger
emptive
entrancy
entrys
everytime
explicitely
foward
fuction
funtion
guarenteed
handeling
harware
hasnt
havn't
houldn't
hysical
i'm
immediatly
implemantation
implmentation
Incomming
incomming
indice
infomation
Inifity
inital
initalization
Initalize
initalize
inited
initilization
initing
inteface
interrrupt
interrups
Interupt
intervall
intialization
Intialize
intialize
invokation
is'nt
Lenght
managment
mergeable
middelin
modelled
Modularisation
modularisation
Modularised
neccessary
negociated
Neighbour
neighbour
Noone
nuclecu
occured
occurence
occuring
organised
ouput
outputing
overriden
paramter
paramters
Passthrough
passthru
performace
popies
preceeding
promiscous
realise
realised
receving
Recieve
recieve
recieved
recognised
reenable
reentrance
registred
Regsiter
relevent
Reorganisation
reorganised
requeue
reselection
resetted
ressources
scather
serialisation
shouldnt
signalled
signalling
sleepie
specifc
specifed
speficied
sublicense
succesful
successfull
superflous
Synchronisation
synchronisation
there're
threshhold
throught
thru
timming
TORTIOUS
tranceiver
transfering
transmiting
trasfered
truely
tunables
uffer
uglyness
uncachable
unrecognised
useable
usefull
verticies
waranty
watseful
wierd
writeable
writting

#3 lore raw
Quoted 16 lines · Dan Kegel
Quoted 8 lines · Joe Perches
Quoted 3 lines · Dan Kegel

Since the main remaining feature before release of the 2.6 kernel is fixing all the remaining spelling errors, this patch seems appropriate.

Who let the comedian in? :o

At first I was jokeing, but what the heck, I figured I'd run it. Here are the mispelled words that occur in five or more files and that lookd like real misspellings to my eye. The list contains some words that are ok in British usage; I don't have a British spellchecker (that I know how to use).

Quoted 5 lines

Perhaps some eagr Perl monger can (after removing the British-ok words!) contribute a spellcorrect-kernel program that takes in a liste of known misspellings + corrections, and applies them to the commments in all kernel source files...
- Dan

I've no spelling knowledge, so the list of spellcorrections must be made by someone else. But i can volunteer the perl-snippet to correct the files. :-)

See attachment.

The programm uses this file-format:
correct=false1,false2,false3...

As there are many ways to false-write a word i think this is the best(tm) solution to get readable file.
:-)

I've only done a "quick-debug", so there might still be errors in the program. (Including spelling-bugs ;-) )

- snip -
Usage: spell_fix.pl <options>, where valid options are

    --help            # this message :-)
    --file <file>     # File(s) to be checked
    --dir <dir>       # Directory(s) to be checked (recursive!)
    --spell-file      # File with the correction-list
    --debug           # Debugging-Messages

- snip -

Bis denn

Signature · 4 lines
Real Programmers consider "what you see is what you get" to be just as
bad a concept in Text Editors as it is in women. No, the Real Programmer
wants a "you asked for it, you got it" text editor -- complicated,
cryptic, powerful, unforgiving, dangerous.
#4 lore raw

Hi

Quoted 3 lines · Matthias Schniedermeyer

I've no spelling knowledge, so the list of spellcorrections must be made by someone else. But i can volunteer the perl-snippet to correct the files. :-)

Take 1.01

A minor revision of the perl-programm. Now it ignores empty lines, removes comments and leading/trailing whitespaces.
In debug-mode it now prints what words where missspelled (3x"s"?) The spell-file (default "spell_fix.txt") is now searched also in the directory from where spell_fix.pl was started.

And the list contributed by shaheed
(minus "everytime=everytime" and "Auxillary=Auxillary")

With this list a run over 2.5.63 found 2866 spelling-errors. (counting the
+ lines in the diff.) The diff is 18690 lines long (846689 bytes)

Bis denn

Signature · 4 lines
Real Programmers consider "what you see is what you get" to be just as
bad a concept in Text Editors as it is in women. No, the Real Programmer
wants a "you asked for it, you got it" text editor -- complicated,
cryptic, powerful, unforgiving, dangerous.

accommodate=accomodate
adapter=adaptor
address=adddress
additional=additionnal
alignment=alignement
always=allways
appropriate=apropriate
around=arround associated=assosciated,assosiated asynchronous=asyncronous available=availible,avaliable
basically=basicly
being=beeing
broken=borken
boundary=boundry brain-damaged=dain-bramaged,dain bramaged calling=callin
capabilities=capabilites
chosen=choosen
command=comamnd
coming=comming
committed=commited
comparison=comparision Compatibility=Compatability compatibility=compatibilty,compatiblity completely=completly
concurrent=concurent
Continuous=Continous
continuous=continous controller=controler,controllen corresponding=coresponding decrementor=decrementer descriptor=decriptor,desciptor
deferred=defered
definitions=defintions
dependent=dependend
divide=devide
differentiate=differenciate
entries=entrys
explicitly=explicitely
forward=foward
function=fuction,funtion
guaranteed=guarenteed
handling=handeling
hardware=harware
physical=hysical
immediately=immediatly, implementation=implemantation,implmentation Incoming=Incomming
incoming=incomming
index=indice
information=infomation
Infinity=Inifity
initial=inital initialization=initalization,initilization,intialization Initialize=Initalize,Intialize initialize=initalize,intialize interface=inteface
Interrupt=Interupt
interrupt=interrrupt
interrupts=interrups
interval=intervall
invocation=invokation
Length=Lenght
management=managment
necessary=neccessary
negotiated=negociated
No-one=Noone
occurred=occured
occurrance=occurence
occurring=occuring
output=ouput
outputting=outputing
overridden=overriden
parameter=paramter
parameters=paramters
performance=performace
promiscuous=promiscous
receiving=receving
Receive=Recieve
receive=recieve
received=recieved
registered=registred
Register=Regsiter
relevant=relevent
resources=ressources
scatter=scather
specific=specifc
specified=specifed,speficied successful=succesful,successfull superfluous=superflous
threshold=threshhold
through=throught
timing=timming
transceiver=tranceiver
transferring=transfering transmitting=transmiting
transferred=trasfered
truly=truely
ugliness=uglyness
usable=useable
useful=usefull
vertices=verticies
warranty=waranty
wasteful=watseful
writing=writting

author
#5 lore raw
In reply to Matthias Schniedermeyer
Quoted 3 lines · Matthias Schniedermeyer

I've no spelling knowledge, so the list of spellcorrections must be made by someone else. But i can volunteer the perl-snippet to correct the files. :-)

Smashing! However, it should probably avoid correcting spellings in anything but C comments.
Perhaps my C comment parser should be converted to perl and incorporated into spell-fix.pl, and used to divide the source file into two streams (comment and noncomment); the comment stream would be spell-fixed and merged back with the noncomment stream to create the output.

And thanks to Shaheed for converting my list of misspellings to a correction list!

I suggest we remove the entries
broken=borken brain-damaged=dain-bramaged,dain bramaged
as we're not trying to remove humor from the comments.

Also, the words 'controllen' and 'callin', are not typos, so
calling=callin
should be removed, and
controller=controler,controllen
should be just
controller=controler

The above examples make me think the list of corrections will have to be very carefully vetted before we turn this thing loose.
- Dan

Signature · 3 lines
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045
#6 lore raw
Quoted 13 lines · Dan Kegel

I suggest we remove the entries
broken=borken brain-damaged=dain-bramaged,dain bramaged
as we're not trying to remove humor from the comments.

Also, the words 'controllen' and 'callin', are not typos, so
calling=callin
should be removed, and
controller=controler,controllen
should be just
controller=controler

Quoted 3 lines

The above examples make me think the list of corrections will have to be very carefully vetted before we turn this thing loose.
- Dan

Once you've loosed your beast upon the tree, I'd suggest that you very carefully look through the resulting diff for inappropriate corrections and redact the unnecessary hunks. In the spelling fixes which I sent to Linus, I redacted hunks which didn't need fixing. For example, Linus making fun of Sun folks' ability to spell, etc. and some comments in French or German for which the spelling was correct in those languages.

In addition to making fixes in the comments in the source, all of Documentation should be fair game.

Then you'll have to contend with the folks whose out-of-tree patches you've borked.

Steven

author
#7 lore raw
Quoted 7 lines · Steven Cole

Once you've loosed your beast upon the tree, I'd suggest that you very carefully look through the resulting diff for inappropriate corrections and redact the unnecessary hunks. In the spelling fixes which I sent to Linus, I redacted hunks which didn't need fixing. For example, Linus making fun of Sun folks' ability to spell, etc. and some comments in French or German for which the spelling was correct in those languages.

Good points.

Quoted 2 lines

In addition to making fixes in the comments in the source, all of Documentation should be fair game.

Yeah, but that's easy :-)

Quoted 2 lines

Then you'll have to contend with the folks whose out-of-tree patches you've borked.

That's a good argument for making the spellfix program polished enough that everyone can use it, I think. Those maintaining out-of-tree patches can run the tool on their tree, and regenerate diffs.

- Dan

Signature · 3 lines
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045
#8 lore raw
Quoted 16 lines · Dan Kegel
Quoted 7 lines · Steven Cole

Once you've loosed your beast upon the tree, I'd suggest that you very carefully look through the resulting diff for inappropriate corrections and redact the unnecessary hunks. In the spelling fixes which I sent to Linus, I redacted hunks which didn't need fixing. For example, Linus making fun of Sun folks' ability to spell, etc. and some comments in French or German for which the spelling was correct in those languages.

Good points.

Quoted 2 lines

In addition to making fixes in the comments in the source, all of Documentation should be fair game.

Yeah, but that's easy :-)

Quoted 7 lines
Quoted 2 lines

Then you'll have to contend with the folks whose out-of-tree patches you've borked.

That's a good argument for making the spellfix program polished enough that everyone can use it, I think. Those maintaining out-of-tree patches can run the tool on their tree, and regenerate diffs.

An ispell filter seems a simpler approach to me. (ispell -F filter) I use that (shown here to head off requests) for email so quoted content is ignored. A similar filter for C source would make this trivial.

$ grep ispell .muttrc
set ispell="ispell -F maildequote"
$ cat bin/maildequote
#!/usr/bin/perl

while (<STDIN>)

{
        /^[>|] / || /^On .* wrote:$/ and tr[A-Za-z][_];
        print $_;
}

print "\004";

Signature · 5 lines
________________________________________________________________
	J.W. Schultz            Pegasystems Technologies
	email address:		[email protected]

		Remember Cernan and Schmitt
author
#9 lore raw
In reply to Steven Cole
Quoted 11 lines
Quoted 11 lines

I suggest we remove the entries
broken=borken brain-damaged=dain-bramaged,dain bramaged
as we're not trying to remove humor from the comments.

Also, the words 'controllen' and 'callin', are not typos, so
calling=callin
should be removed, and
controller=controler,controllen
should be just
controller=controler

OK, I've combined my list with the one Matthias posted, added all the errors that occur in three or more source files, more or less carefully vetted the list against the source code, and put together a corrections file (attached).

I noticed the spellchecker I posted a couple days ago gets confused by asterisks; for some reason it thinks *foo is the word 'oo'. I've removed all the mistaken entries in the list caused by this buglet.

This corrections file is probably good enough to actually use. I'm running it against linux-2.5.63-bk5 now...
- Dan

Signature · 3 lines
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045

accessible=accesible
accessing=accesing
accommodate=accomodate,acommodate
Acknowledge=Acknowlege
acknowledged=acknoledged
acquire=aquire
across=accross
actions=actons
adapter=adapater,adaptor,adatper
additional=additionnal
Additional=Addtional
address=adddress,addresss
Address=Adress
Aggressive=Agressive
aggressively=agressively
aligned=alligned
alignment=alignement
already=allready
Always=Allways
always=allways
amount=ammount
appropriate=appropiate,approriate,apropriate arbitrarily=arbitarily,aribtrarily
Arbitrary=Arbitary
arbitrary=aribtrary
around=arround
assembler=asssembler
associated=assosciated,assosiated
assume=asume
asynchronous=asyncronous
at least=atleast
atomically=atomicly
Auxiliary=Auxilary
available=availble,availible,avaliable
Basically=Basicly
basically=basicly
because=becuase
beginning=beggining
being=beeing
boundaries=boundries
boundary=boundry
cancellation=cancelation
capabilities=capabilites
caught=catched
changeable=changable
character=charater
Characters=Characteres
chose=choosed
chosen=choosen
circumstances=cirumstances
coming=comming
command=comamnd
commence=commense
committed=commited
communication=commuication
comparison=comparision
compatibility=compability
Compatibility=Compatability compatibility=compatibilty,compatiblity completely=completly
concurrent=concurent
configuration=configration
consecutive=consequtive
constants=konstants
consumer=comsumer
contiguous=contigious,contingous
Continuous=Continous
continuous=continous
control=controll
controller=contoller,controler
controlling=controling
Converted=Coverted
corresponding=coresponding
courtesy=curteousy
deactivate=deactive
Debugging=Debuging
debugging=debuging
decrementor=decrementer
deferred=defered
definitions=defintions
dependent=dependend
deprecated=depricated
descendant=descendent
descriptor=decriptor,desciptor
developed=developped
didn't=didnt
differentiate=differenciate
discipline=discpline
discontiguous=discontigous
distinguish=distingush
divide=devide
divisor=divizor
Do not=Donot
doesn't=doens't
DOESN'T=DOESNT
doesn't=doesnt
DON'T=DONT
don't=dont't
dynamically=dynamicly
efficient=efficent
empirical=imperical
enhancements=enhandcements
enough=enought
entries=entrys
environment=enviroment
equipped=equiped
error=errror
Evaluate=Evalute
every time=everytime
excess=execess
execution=exection
existence=existance
explicitly=explicitely,explicity
extended=extented
extension=extention
firmware=firware
forward=foward function=fucntion,fuction,funcion,funciton,functin,funtion further=furthur
guaranteed=guarenteed
handling=handeling
hardware=harware
hasn't=hasnt
haven't=havn't
I'm=i'm
identical=indentical
immediately=immediatly implementation=implemantation,implemenation,implmentation Incoming=Incomming
incoming=incomming
index=indice
indices=indeces
Infinity=Inifity
information=infomation,informatation
initial=inital initialization=initalization,initilization,intialisation,intialization Initialize=Initalize
initialize=initalize Initialize=Initialyze,Initilialyze,Initilize initialize=initilize,intiailize
Initialize=Intialize
initialize=intialize
instance=isntance
instruction=intruction
interface=inteface
interrupt=interrrupt
Interrupt=Interupt
interrupt=intrrupt
interrupts=interrups
interval=intervall
invariant=invarient
invocation=invokation
isn't=is'nt
issuing=issueing
labeled=labelled
Length=Lenght
License=Licens
Licensed=Licenced
loosely=losely
management=managment,manangement miscellaneous=miscellaneaous
modeled=modelled
mystery=mistery
necessary=neccessary,necessery
negative=negativ
negotiated=negociated
negotiation=negociation,neogtiation
No-one=Noone
nonexistent=nonexistant
noticeable=noticable
occurrance=occurence
occurred=occured
occurrences=occurances
occurring=occuring
original=orignal
Originally=Originaly
output=ouput
outputting=outputing
overridden=overidden,overriden
parameter=paramter
parameters=paramaters,paramters
particular=paticular
particularly=particularily
Pending=Pendings
Performance=Perfomance
performance=performace,preformance
Peripheral=Periferial
permissible=permissable
physical=hysical,phyiscal
potentially=potentally
preceded=preceeded
preceding=preceeding
presence=presense
privilege=priviledge
promiscuous=promiscous
Propagate=Propogate
prototypes=protoypes
Pseudo=Psuedo
publicly=publically
queuing=queing
really=realy
reasonable=reasonnable,resonable
receive=recevie
Receive=Recieve
receive=recieve
received=recieved
receiving=receving
referred=refered
regardless=regarless
Register=Regsiter,Reigster
registered=registred
registration=registaration
related=releated
relevant=relevent
remaining=remaing
remember=remeber
removable=removeable
renewed=renewd
requests's=requeusts
requests=requeuing
requeue=requests's
requeuing=requeue
reselection=relection
reset=resetted
resources=ressources
responsibility=responsability
retrieve=retreive
safely=savely
safety=saftey
sample=smaple
scatter=scather
scenario=scenerio
Separate=Seperate
Shouldn't=Shouldnt
shouldn't=shouldnt
signaled=signalled
Signaling=Signalling
signaling=signalling
Similarly=Similarily
specific=specfic,specifc
Specification=Specificiation
specified=specifed,speficied
specify=specifiy
specifying=specifing
straightforward=straighforward
structures=stuctures
succeeded=succeded
success=sucess
successful=succesful,successfull
successfully=sucessfully
sufficient=sufficent
superfluous=superflous
suppress=supress
swapped=swaped
synchronize=synchronyze
synchronizing=syncronizing
synchronous=syncronous
threshold=threshhold
through=throught,throuth
timing=timming
TORTUOUS=TORTIOUS
transaction=transation
transceiver=tranceiver
transferred=trasfered
transferring=transfering
translation=tranlation transmission=transmition,transmittion transmitter=transmiter
transmitting=transmiting
triggered=tiggered,triggerred
trigging=triggerg
truly=truely
ugliness=uglyness
underrun=underrrun
undesirable=undesireable
Unfortunately=Unfortunatly
unfortunately=unfortunatly
uninitialized=unitialized
unknown=unkown
usable=useable,usuable
useful=usefull
vertices=verticies
warranty=waranty
wasteful=watseful
weird=wierd
writable=writeable
Writing=Writting
writing=writting

author
#10 lore raw

My corrections file is up at http://www.kegel.com/spell-fix-dan1.txt
and the patch that produces is
http://www.kegel.com/linux-2.5.63-bk5-spell.patch.bz2.bin
The perl script took about an hour of 450MHz cpu time. (Might be worth adding a quick path to detect and skip files with none of the misspelled words. Or just run
on a fast machine...)

I did a spot check, and it looked pretty good, but some of the fixes are just too pedantic. In particular,
decrementor=decrementer
should probably be dropped from the fix list.

Any other changes people want to see in the script
or the corrections file? Should I add fixes for
uncommon errors (those that happen only in one or two files)?

- Dan

Signature · 3 lines
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045
#11 lore raw
Quoted 1 line · Dan Kegel

My corrections file is up at http://www.kegel.com/spell-fix-dan1.txt

[snip]

Quoted 4 lines

Any other changes people want to see in the script
or the corrections file? Should I add fixes for
uncommon errors (those that happen only in one or two files)?

Correction:
transmitting=transmiting
triggered=tiggered,triggerred
trigging=triggerg
^^^^^^^^
This should be "triggering" here (I hope).

[steven@spc5 linux]$ find . -type f | xargs grep triggerg
./sound/isa/sb/emu8000_callback.c: for triggerg the voice */
./sound/isa/sb/emu8000_pcm.c: for triggerg the voice */
./sound/pci/emu10k1/emu10k1_callback.c: for triggerg the voice */

Steven

author
#12 lore raw
Quoted 3 lines · Steven Cole

trigging=triggerg
^^^^^^^^
This should be "triggering" here (I hope).

Right, thanks. (I had that one right, once, but must have dropped it on the floor.)

Quoted 1 line

Hmm, psuedo didn't get caught. Is psuedo code particularly smooth?

:-)

OK, http://www.kegel.com/spell-fix-dan2.txt is up, with the following changes:

78d77
< decrementor=decrementer
158d156
< Licensed=Licenced
198a197

Quoted 1 line

pseudo=psuedo

271c270
< trigging=triggerg
---

Quoted 1 line

triggering=triggerg

The above covers errors in three or more source files.

The next logical step was to do the words misspelled in exactly two source files. I did gather a list of them
( http://www.kegel.com/errors2.txt ) but
I don't have the energy to make a corrections file for those right now. (FWIW, the procedure is: copy to a new file, run aspell and consult original source, then use 'paste' to join input and output of aspell into a two-column file)
- Dan

Signature · 3 lines
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045
author
#14 lore raw
Quoted 10 lines · jw schultz

An ispell filter seems a simpler approach to me. (ispell -F filter) I use that (shown here to head off requests) for email so quoted content is ignored. A similar filter for C source would make this trivial.

$ grep ispell .muttrc
set ispell="ispell -F maildequote"
$ cat bin/maildequote
#!/usr/bin/perl
Quoted 6 lines

while (<STDIN>)

{
        /^[>|] / || /^On .* wrote:$/ and tr[A-Za-z][_];
        print $_;
}

print "\004";

Integrating in to existing spellcheckers is a Good Idea, though it might not totally replace the perl script Matthias wrote (does ispell have a batch mode that works on whole directory trees?).

BTW, ispell on my system is gnu aspell,
and I couldn't tell for the life of me from the manual whether it supports this kind of filter.
Nor could I find any doc on ispell filters. Where's the best place to learn about 'em?
- Dan

Signature · 3 lines
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045
#15 lore raw
Quoted 24 lines · Dan Kegel
Quoted 10 lines · jw schultz

An ispell filter seems a simpler approach to me. (ispell -F filter) I use that (shown here to head off requests) for email so quoted content is ignored. A similar filter for C source would make this trivial.

$ grep ispell .muttrc
set ispell="ispell -F maildequote"
$ cat bin/maildequote
#!/usr/bin/perl
Quoted 6 lines

while (<STDIN>)

{
       /^[>|] / || /^On .* wrote:$/ and tr[A-Za-z][_];
       print $_;
}

print "\004";

Integrating in to existing spellcheckers is a Good Idea, though it might not totally replace the perl script Matthias wrote (does ispell have a batch mode that works on whole directory trees?).

Quoted 5 lines

BTW, ispell on my system is gnu aspell,
and I couldn't tell for the life of me from the manual whether it supports this kind of filter.
Nor could I find any doc on ispell filters. Where's the best place to learn about 'em?

The manpage was my only reference. It was enough:

The -F switch specifies an external deformatter program. This program should read data from its standard input and write to its standard output. The program must produce exactly one character of output for each character of input, or ispell will lose synchronization and corrupt the
output file. Whitespace characters (especially blanks,
tabs, and newlines) and characters that should be spell- checked should be passed through unchanged. Characters that should not be spell-checked should be converted into blanks or other non-word characters. For example, an HTML deformatter might turn all HTML tags into blanks, and also blank out all text delimited by tags such as "code" or "kbd".

I don't know if aspell has filter support. I'm running International Ispell Version 3.2.06 08/01/01
It came standard on SuSE.
http://fmg-www.cs.ucla.edu/geoff/ispell.html
It isn't GPL but the license terms are not unacceptable.

Signature · 5 lines
________________________________________________________________
	J.W. Schultz            Pegasystems Technologies
	email address:		[email protected]

		Remember Cernan and Schmitt
#16 lore raw
In reply to Steven Cole
Quoted 6 lines · Steven Cole

Another correction to the corrections file:

Licensed=Licenced

         ^^^^^^^^

I think Licenced is OK in the UK.
See http://www.gsu.edu/~wwwesl/egw/jones/differences.htm

'Licenced' is not OK in the UK; it should be corrected to 'Licensed'.

In the UK, 'licence' is a noun, 'license' is a verb -- just as with practice/practise and advice/advise etc. in both variants of the language.

I think we also want to add:

Decompressing=Uncompressing

You should also refrain from 'correcting' the already-correct British spellings of 'modelled'.

It might also be worth adding a list of 'suspect' spellings -- which require human intervention. Such items might include 'indices=indexes' and 'erratum=errata' although you can't do it automatically because sometimes the right-hand side is actually correct.

Signature · 1 line
dwmw2
#17 lore raw
Quoted 9 lines · David Woodhouse
Quoted 6 lines · Steven Cole

Another correction to the corrections file:

Licensed=Licenced

         ^^^^^^^^

I think Licenced is OK in the UK.
See http://www.gsu.edu/~wwwesl/egw/jones/differences.htm

Quoted 5 lines

'Licenced' is not OK in the UK; it should be corrected to 'Licensed'.

In the UK, 'licence' is a noun, 'license' is a verb -- just as with practice/practise and advice/advise etc. in both variants of the language.

Thanks for the explanation.

Quoted 5 lines

I think we also want to add:

Decompressing=Uncompressing

Quoted 7 lines

You should also refrain from 'correcting' the already-correct British spellings of 'modelled'.

It might also be worth adding a list of 'suspect' spellings -- which require human intervention. Such items might include 'indices=indexes' and 'erratum=errata' although you can't do it automatically because sometimes the right-hand side is actually correct.

In my first pass through the tree, it looks like there are quite a few _correct_ uses of errata, but there indeed some of these:

./drivers/net/tulip/de2104x.c: /* Avoid a chip errata by prefixing a dummy entry. */

I think the errata/erratum issue requires careful editing.

Steven

#18 lore raw
Quoted 9 lines · Steven Cole
Quoted 2 lines

It might also be worth adding a list of 'suspect' spellings -- which require human intervention.

In my first pass through the tree, it looks like there are quite a few _correct_ uses of errata, but there indeed some of these:

./drivers/net/tulip/de2104x.c: /* Avoid a chip errata by prefixing a dummy entry. */

I think the errata/erratum issue requires careful editing.

Indeed -- that's my point. It's 'suspect' but not necessarily wrong. Likewise 'indexes' which can be permissible too, when used as a verb, but is more likely to just be a thinko for 'indices'.

Signature · 1 line
dwmw2
#19 lore raw
In reply to Steven Cole
Quoted 4 lines
Quoted 4 lines

I think we also want to add:

Decompressing=Uncompressing

Both are commonly used. People are going to far. Fixing typos that are confusing or blatantly daft is one thing, but if you want to pick over documentation line by line with a copy of Fowlers in hand the Gnome and KDE projects would both love to have you working over their documentation and end user manuals ;)

#20 lore raw
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines

I think we also want to add:

Decompressing=Uncompressing

Both are commonly used.

To me, 'decompressed' suggests that something was definitely once compressed, whereas 'uncompressed' suggests that it may never have been.

Quoted 1 line

People are going to far.

I totally agree. The possibility for introducing more errors is growing.

Quoted 1 line

Fixing typos that are confusing or blatantly daft is one thing

Things like teh instead of the are easily corrected, and it's useful for grepping through the kernel source.

Quoted 2 lines

but if you want to pick over documentation line by line with a copy of Fowlers

What _would_ be useful, would be a script to validate all of the email addresses in comments in the kernel source. I found a typo in an E-Mail address once, and I'm sure there are probably more.

John.

author
#21 lore raw
In reply to Alan Cox
Quoted 10 lines · Alan Cox
Quoted 3 lines
Quoted 3 lines

I think we also want to add:

Decompressing=Uncompressing

Both are commonly used. People are going to far. Fixing typos that are confusing or blatantly daft is one thing, but if you want to pick over documentation line by line with a copy of Fowlers in hand the Gnome and KDE projects would both love to have you working over their documentation and end user manuals ;)

Agreed. Confusing and blatantly daft typos are my intended target.

I've put all of my scripts and data up at
http://www.kegel.com/kerspell
including an ispell filter (haven't tried it out yet) and a stopword list.

Here's example output from my lspell.pl script using my stopword list:

linux-2.5.63-bk5.old/include/asm-s390x/atomic.h: 1

enviroment

linux-2.5.63-bk5.old/include/asm-s390x/rwsem.h: 1

consequtive

linux-2.5.63-bk5.old/include/asm-s390x/dasd.h: 3

featueres Perfomance requests's

linux-2.5.63-bk5.old/include/asm-s390x/pgtable.h: 3

lenght regiontable specifiation

...

- Dan

Signature · 3 lines
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#24 lore raw
Quoted 8 lines · Jared Daniel J. Smith

Even a single lost pun because of overenthusiastic spellchecking is
not worth the cleanup. I would prefer to see typos than lose a single
intentional 'misspelling'. It would be best if you posted all changes somewhere so that they could be verified manually.

Consider the following:

alignment=alignement
alignmement is French; is this intentional?

No. All three instances were english typos.

Quoted 2 lines

constants=konstants
konstants is German; is this intentional?

No. All three instances were english typos.

Quoted 2 lines

consumer=comsumer
comsumer is a neologism: http://www.firstmonday.dk/issues/issue5_5/henshall/

That may be, but in the neologism, it seems to be usually partially capitalized, and the C source sure looks like just a typo:
/* producer/comsumer pointers for Tx/Rx ring */

Quoted 2 lines

Converted=Coverted
is it a pun on something 'hidden' or is it something transformed?

Allan said it was a copy/paste error and should be fixed.

Quoted 2 lines

descriptor=decriptor,desciptor
is it descriptor or decrypter?

You be the judge:

     /* Initiliaze Transmit/Receive decriptor and CR3/4 */

All instances I saw were just english typos.

Quoted 2 lines

invocation=invokation
invokation is German; is this intentional?

No idea, seems to be gone in the current kernel source?

Quoted 2 lines

negative=negativ
negativ is a legitimate non-English word; is this intentional?

Where I spot-checked it, it was always just an English typo.

Quoted 4 lines

signaled=signalled
signaling=Signalling
signaling=signalling
signalled is a legitimate alternate spelling of signaled.

Thanks, fixed!

Quoted 5 lines

succeeded=succeded
succeded could also be a typo for 'succeed'

through=throught,throuth
throught could also be a typo for 'thought'

Yes. These will have to be hand-reviewed. I do recommend absolutely every change be hand-reviewed just in case.

Quoted 2 lines

writable=writeable
writeable is a legitimate alternate spelling of writable

You're right, though I had to dig to find a dictionary that agreed with you.

I've updated http://www.kegel.com/kerspell to remove the "signall*" and "writeable" corrections. (My stoplist already listed them as acceptable, fwiw.)

Thanks!
- Dan

Signature · 3 lines
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#27 lore raw
Quoted 7 lines · Steven Cole

BTW, I ran the spell-fix.pl script using only the first 10 entries of spell-fix.txt (an arbitrary choice), and got a pretty big diff:

 132 files changed, 199 insertions(+), 199 deletions(-)

My feeling is that patches should be about 1/4 that size. Otherwise, Linus may /dev/null them. Second opinion anyone?

I agree with the 1/4th, but in # of lines of spell-fix.txt, not in output size.

Looking at the changesets he's accepted, it looks like he's comfortable with changesets of 100 files (see "don't" fixes at
http://www.kernel.org/pub/linux/kernel/v2.5/testing/cset/cset-1.1025.1.38.txt ) It probably helps that this was a single kind of change.

My guess is these things need enough manual reviewing that keeping it down to just a related group of fixes per patch is a good idea (e.g.
Acknowledge=Acknowlege
acknowledged=acknoledged
together are a Good Idea, more is probably bad).

BTW Linus has been accepting so many spell fixes it's probably important to work with very fresh sources...
- Dan

Signature · 3 lines
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045
author
#28 lore raw
In reply to David Woodhouse
Quoted 4 lines · David Woodhouse

On Sun, 2003-03-02 at 04:16, 'Licenced' is not OK in the UK; it should be corrected to 'Licensed'. In the UK, 'licence' is a noun, 'license' is a verb -- just as with practice/practise and advice/advise etc. in both variants of the
language.

Thanks for the info. BTW it looks like
http://dictionary.cambridge.org/
is a good authority on whether a word is legal -- and now I understand why it liked 'licence' but not 'licenced'.

Quoted 3 lines

I think we also want to add:

Decompressing=Uncompressing

I'd prefer to leave that one alone, it seems innocent enough for me.

Quoted 2 lines

You should also refrain from 'correcting' the already-correct British spellings of 'modelled'.

OK. Any anti-british corrections are not by intent!

Quoted 4 lines

It might also be worth adding a list of 'suspect' spellings -- which require human intervention. Such items might include 'indices=indexes' and 'erratum=errata' although you can't do it automatically because sometimes the right-hand side is actually correct.

Might be, but I'll leave that for another day. I'd rather focus on correcting the uncontroversial and obvious howlers.

- Dan

Signature · 3 lines
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045
#29 lore raw
In reply to Dan Kegel
Quoted 7 lines · Dan Kegel

My corrections file is up at http://www.kegel.com/spell-fix-dan1.txt
and the patch that produces is
http://www.kegel.com/linux-2.5.63-bk5-spell.patch.bz2.bin
The perl script took about an hour of 450MHz cpu time. (Might be worth adding a quick path to detect and skip files with none of the misspelled words. Or just run
on a fast machine...)

OK. Next Take.

Changes this time:
- A bug-fix for "--dir" (Would have checked all files)
- Added a "fast-path" but this doesn't seem to make a difference

New options:
- "--[no]fix" to fix (default) or only look for errors. (This ignores the '[no]comment'-option and looks for all errors!)
- "--[no]override" to override(default) the original file or create a "<filename>.fixed"-file

Anyone wants a "--[no]ask"-option?

Bis denn

Signature · 4 lines
Real Programmers consider "what you see is what you get" to be just as 
bad a concept in Text Editors as it is in women. No, the Real Programmer
wants a "you asked for it, you got it" text editor -- complicated, 
cryptic, powerful, unforgiving, dangerous.
#30 lore raw
Quoted 15 lines · Matthias Schniedermeyer
Quoted 7 lines · Dan Kegel

My corrections file is up at http://www.kegel.com/spell-fix-dan1.txt
and the patch that produces is
http://www.kegel.com/linux-2.5.63-bk5-spell.patch.bz2.bin
The perl script took about an hour of 450MHz cpu time. (Might be worth adding a quick path to detect and skip files with none of the misspelled words. Or just run
on a fast machine...)

OK. Next Take.

Changes this time:
- A bug-fix for "--dir" (Would have checked all files)
- Added a "fast-path" but this doesn't seem to make a difference

Quoted 8 lines

New options:
- "--[no]fix" to fix (default) or only look for errors. (This ignores the '[no]comment'-option and looks for all errors!)
- "--[no]override" to override(default) the original file or create a "<filename>.fixed"-file

Anyone wants a "--[no]ask"-option?

Earlier or later the "missing-attachment"-thing must happen to anyone. :-)

Bis denn

Signature · 4 lines
Real Programmers consider "what you see is what you get" to be just as 
bad a concept in Text Editors as it is in women. No, the Real Programmer
wants a "you asked for it, you got it" text editor -- complicated, 
cryptic, powerful, unforgiving, dangerous.
#31 lore raw
In reply to Dan Kegel

On Sat, 2003-03-01 at 19:08, Dan Kegel wrote:
[snipped]

Quoted 4 lines

This corrections file is probably good enough to actually use. I'm running it against linux-2.5.63-bk5 now...
- Dan

[snippage]

Quoted 1 line

Pseudo=Psuedo

Hmm, psuedo didn't get caught. Is psuedo code particularly smooth?

Anyway, looking beyond comments only may catch real bugs. I found this a few days ago whilst looking for commonly misspelled words, a much weaker technique than your spellchecker.

[steven@spc5 linus-2.5]$ bk export -tplain ../linux
[steven@spc5 linus-2.5]$ cd ../linux
[steven@spc5 linux]$ find . -type f | xargs grep psuedo
./arch/ppc64/kernel/iSeries_IoMmTable.h:/* allocated the psuedo I/O Address. */
./drivers/base/platform.c: * platform.c - platform 'psuedo' bus for legacy devices ./drivers/scsi/aic7xxx/aic7xxx.seq: * use byte 27 of the SCB as a psuedo-next pointer and to thread a list
./drivers/scsi/g_NCR5380.c: * Perform a psuedo DMA mode read from an NCR53C400 or equivalent
./drivers/scsi/g_NCR5380.c: * Perform a psuedo DMA mode read from an NCR53C400 or equivalent
./drivers/video/skeletonfb.c: * no color palettes are supported. Here a psuedo palette is created
./drivers/video/anakinfb.c: fb_info.psuedo_palette = colreg;
----------------------------------------^^^^^^
This shouldn't even compile.

[steven@spc5 linux]$ find . -name "*.h" | xargs grep pseudo_palette
./drivers/video/i810/i810.h: u32 pseudo_palette[17];
./include/linux/fb.h: void *pseudo_palette; /* Fake palette of 16 colors and

Yep, a mistake all right. Adding the listed author to the cc list.

Steven

#32 lore raw
In reply to Dan Kegel

Hi

Quoted 7 lines
Quoted 3 lines · Matthias Schniedermeyer

I've no spelling knowledge, so the list of spellcorrections must be made by someone else. But i can volunteer the perl-snippet to correct the files. :-)

Smashing! However, it should probably avoid correcting spellings in anything but C comments.

Here we go.

Take 1.10

This versions defaults to only correct words within a comment.

Quoted 1 line

Perhaps my C comment parser should be converted to perl and

No need to make any hasled.

// Comments are easy(tm). "Everything after // until line-end".

and /* ... */ are easy(tm) too because gcc doesn't support to nest them.

Only a handfull of lines were needed to handle this. :-)

Bis denn

Signature · 4 lines
Real Programmers consider "what you see is what you get" to be just as
bad a concept in Text Editors as it is in women. No, the Real Programmer
wants a "you asked for it, you got it" text editor -- complicated,
cryptic, powerful, unforgiving, dangerous.
#33 lore raw

HI

Quoted 11 lines
Quoted 7 lines
Quoted 3 lines · Matthias Schniedermeyer

I've no spelling knowledge, so the list of spellcorrections must be made by someone else. But i can volunteer the perl-snippet to correct the files. :-)

Smashing! However, it should probably avoid correcting spellings in anything but C comments.

Here we go.

Take 1.10

Ups. A bit to "noisy".

Take 1.10b

Bis denn

Signature · 4 lines
Real Programmers consider "what you see is what you get" to be just as
bad a concept in Text Editors as it is in women. No, the Real Programmer
wants a "you asked for it, you got it" text editor -- complicated,
cryptic, powerful, unforgiving, dangerous.
author
#34 lore raw
In reply to Matthias Schniedermeyer
Quoted 4 lines · Matthias Schniedermeyer

This versions defaults to only correct words within a comment. ... // Comments are easy(tm). "Everything after // until line-end".

and /* ... */ are easy(tm) too because gcc doesn't support to nest them.

I'll be damned. I'm impressed with how easy that was in perl.
- Dan

Signature · 3 lines
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045
#35 lore raw
Quoted 7 lines · Dan Kegel
Quoted 4 lines · Matthias Schniedermeyer

This versions defaults to only correct words within a comment. ... // Comments are easy(tm). "Everything after // until line-end".

and /* ... */ are easy(tm) too because gcc doesn't support to nest them.

I'll be damned. I'm impressed with how easy that was in perl.

As long as there is no nesting involved most things a easy/trivial to achieve with REs.

Bis denn

Signature · 4 lines
Real Programmers consider "what you see is what you get" to be just as 
bad a concept in Text Editors as it is in women. No, the Real Programmer
wants a "you asked for it, you got it" text editor -- complicated, 
cryptic, powerful, unforgiving, dangerous.
#36 lore raw
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

This versions defaults to only correct words within a comment. ... // Comments are easy(tm). "Everything after // until line-end".

and /* ... */ are easy(tm) too because gcc doesn't support to nest them.

I'll be damned. I'm impressed with how easy that was in perl.

As long as there is no nesting involved most things a easy/trivial to achieve with REs.

Does it cope with:

main ()
{
// /*
printf ("hello world");
// */
}

though?

John.

#37 lore raw
Quoted 12 lines · John Bradford
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

This versions defaults to only correct words within a comment. ... // Comments are easy(tm). "Everything after // until line-end".

and /* ... */ are easy(tm) too because gcc doesn't support to nest them.

I'll be damned. I'm impressed with how easy that was in perl.

As long as there is no nesting involved most things a easy/trivial to achieve with REs.

Does it cope with:

Quoted 8 lines

main ()
{
// /*
printf ("hello world");
// */
}

though?

No. I could fix this, but i don't think it's worth it.

Bis denn

Signature · 4 lines
Real Programmers consider "what you see is what you get" to be just as 
bad a concept in Text Editors as it is in women. No, the Real Programmer
wants a "you asked for it, you got it" text editor -- complicated, 
cryptic, powerful, unforgiving, dangerous.
#38 lore raw
In reply to Dan Kegel

Dan Kegel <[email protected]> said:

[...]

Quoted 2 lines

Smashing! However, it should probably avoid correcting spellings in anything but C comments.

Right.

Quoted 5 lines

Perhaps my C comment parser should be converted to perl and incorporated into spell-fix.pl, and used to divide the source file into two streams (comment and noncomment); the comment stream would be spell-fixed and merged back with the noncomment stream to create the output.

I wouldn't go that far. Better give a list of speling mistakes (file/line) and fix them by hand. It won't need to be done more than occasionally, so the overhead is not too bad.

Signature · 4 lines
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513