Spelling

Discussion in 'C Programming' started by gnat, Feb 20, 2004.

  1. gnat

    gnat Guest

    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)?
    --
    gnat.
    gnat, Feb 20, 2004
    #1
    1. Advertising

  2. On Fri, 20 Feb 2004, gnat wrote:

    > 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.

    --
    Send e-mail to: darrell at cs dot toronto dot edu
    Don't send e-mail to
    Darrell Grainger, Feb 20, 2004
    #2
    1. Advertising

  3. "gnat" <> wrote in message
    news:66rZb.41748$Hy3.29354@edtnps89...
    > 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
    Peter Pichler, Feb 20, 2004
    #3
  4. gnat

    gnat Guest

    Peter Pichler wrote:
    > "gnat" <> wrote in message
    > news:66rZb.41748$Hy3.29354@edtnps89...
    >
    >>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
    >
    >


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

    --
    gnat.
    gnat, Feb 20, 2004
    #4
  5. gnat

    gnat Guest

    Darrell Grainger wrote:

    > On Fri, 20 Feb 2004, gnat wrote:
    >>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 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.

    --
    gnat.
    gnat, Feb 20, 2004
    #5
  6. On Fri, 20 Feb 2004, gnat wrote:

    > Darrell Grainger wrote:
    >
    > > On Fri, 20 Feb 2004, gnat wrote:
    > >>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 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.


    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).

    > > 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.


    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.

    --
    Send e-mail to: darrell at cs dot toronto dot edu
    Don't send e-mail to
    Darrell Grainger, Feb 20, 2004
    #6
  7. gnat

    David Rubin Guest

    [OT] Re: Spelling

    gnat wrote:

    > 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

    --
    Andre, a simple peasant, had only one thing on his mind as he crept
    along the East wall: 'Andre, creep... Andre, creep... Andre, creep.'
    -- unknown
    David Rubin, Feb 20, 2004
    #7
  8. gnat

    Guillaume Guest

    He might even want a special spell checker that will perform spell
    checking on C comments.
    Guillaume, Feb 20, 2004
    #8
  9. gnat

    CBFalconer Guest

    gnat wrote:
    >
    > 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.

    --
    Chuck F () ()
    Available for consulting/temporary embedded and systems.
    <http://cbfalconer.home.att.net> USE worldnet address!
    CBFalconer, Feb 20, 2004
    #9
  10. gnat

    Rob Thorpe Guest

    gnat <> wrote in message news:<wqtZb.41875$Hy3.22071@edtnps89>...
    > Darrell Grainger wrote:
    >
    > > On Fri, 20 Feb 2004, gnat wrote:
    > >>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 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.


    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.
    Rob Thorpe, Feb 21, 2004
    #10
  11. gnat <> wrote in message news:<66rZb.41748$Hy3.29354@edtnps89>...
    > 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).
    Robert Wessel, Feb 21, 2004
    #11
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. George

    spelling problem

    George, Aug 9, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    404
    George
    Aug 9, 2005
  2. KraftDiner

    Spelling mistakes!

    KraftDiner, Jan 6, 2006, in forum: Python
    Replies:
    54
    Views:
    1,137
    Antoon Pardon
    Jan 13, 2006
  3. Walter S. Leipold

    Re: Spelling mistakes!

    Walter S. Leipold, Jan 9, 2006, in forum: Python
    Replies:
    2
    Views:
    294
    Sybren Stuvel
    Jan 9, 2006
  4. Drew
    Replies:
    4
    Views:
    295
  5. William LaMartin

    Spelling Check

    William LaMartin, Dec 5, 2003, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    98
    Jan Tielens
    Dec 5, 2003
Loading...

Share This Page