Add spell check to my website

微笑、不失礼 提交于 2019-12-13 16:23:38

问题


I have an asp-based website which I would like to add spell checking capabilities to the textarea elements on the page. Most of the pages are generated from an engine, though I can add JavaScript to them. So my preferred solution is a JavaScript-based one. I have tried JavaScriptSpellCheck and it works okay, though I would like to see what some of my other options may be. I also found spellchecker.net but at $3500 for a server license it seems excessive.

Spell checking can be in a separate window and must support multiple languages (the more the better). Ultimately I would like to send the spell check object a collection or delimited string of textarea names or id's (preferably names as they already exist in the pages) and have it spell check all of them, updating the text as spelling is corrected.


回答1:


Check out using Google's api for this: http://www.asp101.com/articles/jeremy/googlespell/default.asp




回答2:


Here is a free, open source Javascript library for spell checking that I authored:

https://github.com/LPology/Javascript-PHP-Spell-Checker

There's a link to a live demo at the top. It's designed to have the feel of a spell checker in a desktop word processor. I wrote it after being dissatisified with these same options.

To use, just include the JS and CSS files into your page, and then add this:

var checker = new sc.SpellChecker(
    button: 'spellcheck_button', // opens the spell checker when clicked
    textInput: 'text_box', // HTML field containing the text to spell check
    action: '/spellcheck.php' // URL of the server side script 
);

It includes a PHP script for spell checking, but it could be ported to another language fairly easily as long as it returns the correct JSON response.




回答3:


If I were you, I'd look into something like aspell - this is used as one of the supported spellchecking backends in TinyMCE. Personally, I use pspell because it's integrated into PHP.

EDIT

There's an aspell integration here that has a PHP or a Perl/CGI version; might be worth checking out.




回答4:


If I am not wrong, Firefox's English dictionary for spell checking takes around 800KB of data.

If you like to do everything in JavaScript -- for a full-featured spell checking engine, it means you need to load that 800KB data in every page load. It's really not a good idea.

So, instead of doing that in JavaScript, send the data to the server with AJAX, check it server side, and return it back; that's the best way.




回答5:


Well this is quite old question, but my answer might help people who are looking for latest options on this question.

"JavaScript SpellCheck" is the industry leading spellchecker plugin for javascript. It allows the developer to easily add and control spellchecking in almost any HTML environment. You can install it in about 5 minutes by copying a folder into your website.

http://www.javascriptspellcheck.com/

Also support multiple languages - http://www.javascriptspellcheck.com/Internationalization_Demo



来源:https://stackoverflow.com/questions/1940924/add-spell-check-to-my-website

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!