qae*_*epk 3 java selenium-webdriver
是否可以使用 selenium webdriver 对网页中显示的内容进行拼写检查。或者您可以建议任何相同的 API 吗?问候,埃利亚斯
尝试使用 Google API 进行拼写检查。解决方案适用于java - https://code.google.com/p/google-api-spelling-java/
(以下内容来自链接)
示例代码:
SpellChecker checker = new SpellChecker();
SpellResponse spellResponse = checker.check( "helloo worlrd" );
for( SpellCorrection sc : spellResponse.getCorrections() )
System.out.println( sc.getValue() );
Run Code Online (Sandbox Code Playgroud)
这将打印文本“hello world”的所有可用更正。
还可以为请求设置更多选项,
// 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() );
Run Code Online (Sandbox Code Playgroud)
更新:发现更多拼写检查器:
| 归档时间: |
|
| 查看次数: |
5386 次 |
| 最近记录: |