3

Is there a possibility to spell check on content displayed in web page with selenium webdriver. or can you suggest any API for the same. Regards, Eliyas

qaepk
  • 427
  • 1
  • 7
  • 12

1 Answers1

5

Try the Google API for spell checking. Solution is for java - https://code.google.com/p/google-api-spelling-java/

(Below content is from the link)

Sample code:

SpellChecker checker = new SpellChecker();
SpellResponse spellResponse = checker.check( "helloo worlrd" );
for( SpellCorrection sc : spellResponse.getCorrections() )
System.out.println( sc.getValue() );

This will print all the corrections available for the text "helloo worlrd".

It is also possible to set more options to the request,

// Proxy settings
Configuration config = new Configuration();
config.setProxy( "my_proxy_host", 8080, "http" );

SpellChecker checker = new SpellChecker( config );
checker.setOverHttps( true ); // Use https (default true from v1.1)
checker.setLanguage( Language.ENGLISH ); // Use English (default)

SpellRequest request = new SpellRequest();
request.setText( "helloo helloo worlrd" );
request.setIgnoreDuplicates( true ); // Ignore duplicates

SpellResponse spellResponse = checker.check( request );

for( SpellCorrection sc : spellResponse.getCorrections() )
System.out.println( sc.getValue() );

Update: Found some more spell checkers:

  1. JSpell - https://www.jspell.com/java-spell-checker.html
  2. JOrtho (free) - http://jortho.sourceforge.net/
  3. Jazzy (free) - http://sourceforge.net/projects/jazzy/
LittlePanda
  • 2,496
  • 1
  • 21
  • 33
  • Interesting. Is there a C# equivalence APIs exist ? – Saifur Mar 30 '15 at 16:40
  • 1
    I saw a few questions discussing spell checkers for C# -http://stackoverflow.com/questions/16141985/what-is-good-for-spell-checker-google-spell-checker-or-hunspell, http://stackoverflow.com/questions/12439204/google-spell-checker-api. – LittlePanda Mar 30 '15 at 16:43