Search code examples
phphtmlopen-sourcespell-checkingaspell

Source code spellcheckers is there an open-source solution or should I make my own?


I need a source code spell-checker. Of course there is a closed source ones but I'm looking for an open source solution, That can spell check html files, php source codes any further types would be better.

I also thought about making my own since there is a good libraries for spell checking, So what features you think it's good to be added to this application?

I have a very basic imagination of it:

  • Just Highlight the error words and give you suggestions without any actual modifying for the source code.
  • Support local and remote files
  • Spell check only certain parts of code like string literals (between quotations)
  • choosing between dictionaries.
  • Using the apell lib or any equivalent one.

Edit: It should have a GUI and should be cross-platform.


Solution

  • Eclipse PDT, which is one of the best IDE for PHP (and is free) supports spellchecking -- as its based on Eclipse.

    You can enable it in the preferences, and set a couple of options.

    Unfortunatly, I don't think it parses source-code, and it'll highlight as "errors" parts of code that are actually not errors :-( So that's at least one thing that will not work for you, I suppose.

    On the other hand :

    • hightlight without modifications : OK
    • local and remote files : should be OK, as Eclipse (with RSE plugin, for instance) supports remote files
    • only certain portions of code : NOT OK
    • choosing between dictionnaries : seems OK from the configuration dialog
    • apell or equivalent : I have no idea
    • GUI : OK : Eclipse
    • Cross-platform : OK as based on Eclipse

    Here is a screenshot of the configuration dialog :

    And a result of source-code spellchecking :


    (source: pascal-martin.fr)

    In red, an actual error, in a comment ; in green a not-error, in PHP code.