Spelling

G

gnat

Hello c.l.c,

Are there any spell checkers out that will go through C code and
tell me if i have misspelled anything that is in between quotes
(ie. data that may be shown to the end user)?
 
D

Darrell Grainger

Hello c.l.c,

Are there any spell checkers out that will go through C code and
tell me if i have misspelled anything that is in between quotes
(ie. data that may be shown to the end user)?

This is less about C language about more about development. You need to at
least tell us what operating system you are using. Realistically, the
moment you need to mention the OS you are off topic for c.l.c. You
probably want to ask in a newsgroul that deals with your OS.
 
P

Peter Pichler

gnat said:
Hello c.l.c,

Are there any spell checkers out that will go through C code and
tell me if i have misspelled anything that is in between quotes
(ie. data that may be shown to the end user)?

If you put so much text in between quotes that you need a spelling
checker, then you need to re-consider your data structures. What
about, for example, an external text file? That could even be
transformed into a C source. After checking spelling of course ;-)

Peter
 
G

gnat

Peter said:
If you put so much text in between quotes that you need a spelling
checker, then you need to re-consider your data structures. What
about, for example, an external text file? That could even be
transformed into a C source. After checking spelling of course ;-)

Peter

Thats an interesting idea, i think i'll try that.
 
G

gnat

Darrell said:
This is less about C language about more about development.

You may well be right.
You need to at least tell us what operating system you are using.

I was kind of hoping for an open source spell checker with the
capabilities - i run both Windows and Linux, and the target is an
embedded app without an os.
Realistically, the moment you need to mention the OS you are off
topic for c.l.c.
Agreed.

You probably want to ask in a newsgroul that deals with your OS.

I thought for a bit as to whether or not this would be off topic,
and came to the conclusion that it may well be, but as i am using
C i would need a spell checker that could parse C and understand
C at least to the level to understand that strings are to be
checked and that it should ignore anything else. So that was the
thought process, your right though, the post may have been better
placed in comp.software-eng or some other ng that deals with
tools, not language.
 
D

Darrell Grainger

You may well be right.


I was kind of hoping for an open source spell checker with the
capabilities - i run both Windows and Linux, and the target is an
embedded app without an os.

The OS you are using to develop the app would be the place to check. I
could whip something up on Linux easier than Windows. I'm sure people in
UNIX programming newsgroups would have some suggestions. Or it might be
better for something like a Perl or Python newsgroup (I'd use Perl, a
library and some cookbook algorithms to spell check the code).
I thought for a bit as to whether or not this would be off topic,
and came to the conclusion that it may well be, but as i am using
C i would need a spell checker that could parse C and understand
C at least to the level to understand that strings are to be
checked and that it should ignore anything else. So that was the
thought process, your right though, the post may have been better
placed in comp.software-eng or some other ng that deals with
tools, not language.

Think multi-tool. Use something like Perl to parse the code then pass the
text to something that can spell check straight text. I would imagine
someone has a parse routine or two you could modify and someone else has
written a library to spell check via Perl.

I like someone else's idea of putting the data into a different file and
then spell checking the file outside of the C environment. I was thinking
more of stuff I work on. Large project developed over many years. The
amount of text in it has grown to a huge amount. Writing a spell checker
to go through the legacy code would be a neat idea. We occassionally spot
a spelling mistake on a dialog or prompt. It would be nice to
systematically find all of them.

Now you got me think about something to do just for the fun of it. 8^)
Won't be in C language though.
 
D

David Rubin

gnat said:
Hello c.l.c,

Are there any spell checkers out that will go through C code and tell me
if i have misspelled anything that is in between quotes (ie. data that
may be shown to the end user)?

strings a.out | grep ' ' | spell

seems to do a reasonable job picking out words in phrases which might be spelled
incorrectly.

/david
 
G

Guillaume

He might even want a special spell checker that will perform spell
checking on C comments.
 
C

CBFalconer

gnat said:
Are there any spell checkers out that will go through C code and
tell me if i have misspelled anything that is in between quotes
(ie. data that may be shown to the end user)?

Write yourself a filter that will extract all such strings from a
source file, and outputs them with a preceding line number, as in:

1234: "This is a suspicious string"

and then spell check the resultant file. You can then do the
whole thing with a pipe something like:

filter <source.c | spellcheck

The filter probably wants to absorb \n, \t, %d, etc.
 
R

Rob Thorpe

gnat said:
You may well be right.


I was kind of hoping for an open source spell checker with the
capabilities - i run both Windows and Linux, and the target is an
embedded app without an os.


I thought for a bit as to whether or not this would be off topic,
and came to the conclusion that it may well be, but as i am using
C i would need a spell checker that could parse C and understand
C at least to the level to understand that strings are to be
checked and that it should ignore anything else. So that was the
thought process, your right though, the post may have been better
placed in comp.software-eng or some other ng that deals with
tools, not language.

There is a command to do this in the GNU Emacs editor:

M-x ispell-comments-and-strings

ask gnu.emacs.help, other editors may do it, ask comp.editors.

Alternatively write a filter to remove all the strings from a C file
and pass them through a command line spell checker such as ispell.
 
R

Robert Wessel

gnat said:
Hello c.l.c,

Are there any spell checkers out that will go through C code and
tell me if i have misspelled anything that is in between quotes
(ie. data that may be shown to the end user)?


While this is OT, Visual SlickEdit can spell check strings and
comments for any language he has a template for (which does include
C).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top