Git Product home page Git Product logo

simple-lektor's Introduction

simple-lektor

How to start

If you are using a Debian based distribution, just run start.sh. It will install dependencies and start the backend server. When backend server is running, open admin.html and add a user. When you have some users added, open editor.html and choose a user before you continue!

How to use

After you have created a user in admin.html and chosed editor.html you can start checking your text.

  • Enter the text into the big input field and click the //check// button.
  • Bad words will be marked with red background.
  • List of bad words is available in the right sidebar
  • If a bad word isn't really bad, you can add it to you dict. It will show in the right, too.
  • When you want to //select// a bad word, you just click it. Don't select it. It will be available in //selection// field above the input. Also, suggested corrections will be availble above the input field, too.
  • You can't remove non-marked words from dictionary.

How it works

  • Your text will be reduced to list of unique words. Control chars and marks will be stripped down.
  • That list of words is sent to the backend for checking, and as response you get back list of bad words with their suggestions.
  • When backend receives request for checking list of words, it will use system dictionary and users' personal dictionary. If it's not found in any of those, it's bad. System dictionary is hunspell (serbian, latin) and personal dict is just raw list of words.
  • Suggestions are fetched only from system dictionary.
  • When frontend receives the response, a list of bad words with suggestions, it will iterate through it and apply regex which will surround each match with <span class="wrong">. Bad words can be clicked and have red background.
  • User managament is done in admin.html and for now you can only add new users and check content of their personal dictionaries.

Data persistence

  • List of users is currently stored only in memory, so restarting backend server is destroying it. On each restart, you need to re-add users you want to use.
  • Personal dictionaries are stored in /tmp/<username>.txt and they are safe until reboot or until they are deleted manually.

Known bugs && Future

  • You can't mark some good word as bad
  • You can't remove a word from personal dictionary
  • You can't move word from personal dictionary to system dict
  • Checking is ruining formating
  • Don't extract unique words in frontend, do it in backend

simple-lektor's People

Contributors

atlantic777 avatar

Watchers

 avatar James Cloos avatar wex avatar

simple-lektor's Issues

Enchant dict import error

>>> import enchant
>>> d = enchant.Dict("sh")
error: line 16: incorrect entry number
Failure loading aff file /usr/share/myspell/dicts/sh.aff

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.