Giter Club home page Giter Club logo

ardspellchecker's Introduction

Indonesian Spellchecker

An Indonesian spellchecker as a jquery plugins. Suitable for any online html (WYSWYG) editor.

Installation:

pip install -r requirements.txt

Run speller.py. The default port for flask is 5000

Usage:

Add this snippets to your html page:

<link rel="stylesheet" href="http://host_or_domain:port/static/css/spellcheck.css" />
<script type="text/javascript" src="http://host_or_domain:port/static/js/spellcheck.js" />

The javascript is a jquery plugins, so if you dont have jquery in your html, you can use the jquery script in /static/js/libs/. Make sure that there were no conflict between jquery and your other javascript library.

And then in your bottom page, before </body> tag, add this lines:

<script type="text/javascript">
    (function() {

      // Init the html spellchecker
      var spellchecker = new $.SpellChecker('#the_id_for_editable_content', {
        parser: 'html',
        webservice: {
          path: 'http://host_or_domain:port/',
        },
        suggestBox: {
          position: 'below'
        },
        local: {
          ignoreWord: 'Ignore word',
          ignoreAll: 'Ignore all',
          ignoreForever: 'Add to dictionary'
        }
      });

      // Bind spellchecker handler functions
      spellchecker.on('check.success', function() {
        alert('There are no incorrectly spelt words!');
      });
      var $button= $('<input/>').attr({ type: 'button', name:'spellcheck', id:'check-textarea', class:'check-textarea', value:'Check Spelling'});
      $('body').append($button);

      // Check the spelling
      $("#check-textarea").click(function(e){
        spellchecker.check();
      });

    })();
</script>

LICENSE:

It's a WTFPL. You just DO WHAT THE FUCK YOU WANT TO.

Powered By:

ardwort

ardspellchecker's People

Contributors

lantip avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.