eduSteem: Spell Checking

in #utopian-io6 years ago

Repository

https://github.com/bflanagin/EduSteem

A special thanks goes out to manassharma07 who made the dictionary files I'm using for this feature.

New Feature: Spell Checking

Screenshot from 2018-09-10 16-00-25.png

After my last post, and the subsequent comments on the spelling of contemplate and the missing r in yourself. I decided the next update needed the all important spell checker. This feature caused me to have to re-work a lot of my code in most areas of the program. Thankfully, I use the same qml object file FieldEdit.qml for most of the editing operations.

Implementation

The core of the feature is found in the plugins directory in the spellcheck.js file. This file depends on the files found in "Dictionary in csv" folder found in the same directory as spellcheck.js for word search. This javascript file has only one function checkspelling(string) the logic is pretty straight foreword her is the complete loop sans code.

  • Split the string into an array
  • change case, trim, and remove special characters, from the array object to standardize input
  • check the first letter of the word to choose proper dictionary file to load
  • Load dictionary file
  • Split the file into individual definitions.
  • Split this array object into just the word.
  • change case, trim, and remove special characters from this array object and check it against the word within the original string.
  • If strings match break and go to the next item
  • If no strings match highlight the word in red

The last part of the function required me to reformat the text area within FieldEdit.qml, and most of the files in the Template directory, changing the plain text into rich text which then required me to change the markdown.js file to look for and interpret the different versions of the data now in the database. Unfortunately and most likely due to the fact that this data isn't in a database but in files that must be read each time the spellcheck function is run I had to resort to creating a timer (see code below) to wait for typing to stop before the function is run.


    Timer {
        id:checker
        interval: 2000
        repeat: false
        running: true
        onTriggered: {
            thestring = changeBox.getText(0,changeBox.length).replace(/<font color='red'>/g,"").replace(/<\/font>/g,"")
            changeBox.text = Spelling.checkspelling(thestring)
            changeBox.cursorPosition = changeBox.length
        }
    }


Other changes

There were a few minor changes to how things at some timing issues were tweaked and the weekly report template is slowly coming together. I've been trying to keep my updates and work more focused as I now have limited time to code on this or any project. However, the next update should have a good amount of features in it as they will be built around the above as well as clearing out tickets in the system.

Banner.png

Find out more

This project is first and foremost for my classroom and the benefit of my students. It is my hope that when complete other families and schools will adopt the software, and use it in their homes as well. The feature list isn't set in stone but here are a few of its current and planned features:

  • School management including calendars, Courses, Students, and Teachers
  • Lesson plan creation and publishing to STEEM and to an in application store for other teachers to download
  • Student reports created and published by the students through an semi-automated process
  • Auto review (Quizzes) based on review questions added to lessons
  • media storage via IPFS
  • Student rewards based on completion of assignments
  • Micro-scholarships provided by the up-votes the student receives on their weekly posts

As with all my projects eduSteem is open source. Most if not all proceeds from utopian and steem are used for the continued development of this and my other software's and projects.

For further reading check out these other posts here on Steemit.

I also have a Patreon page here if you would like to show your support for the project. The proceeds will be used to maintain the house and my students education as Steemit and Patreon are my sole sources of income.

As always it is my hope that this software along with any of the other projects I have undertaken will be found useful to the community. I do this for the love of the challenge and the need for the software.

GitHub Account

https://github.com/bflanagin

Sort:  

Thank you for your contribution. Spell check is necessary for any application, though instead of relying over some library you can try Grammerly API, if they provide. There are a lot of indentation as well as white space in your files, is better to use some kind of automatic linting like eslint or so. Code commenting can be improved.

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Thank you for your review, @codingdefined!

So far this week you've reviewed 2 contributions. Keep up the good work!

Thank you for your review, @codingdefined!

So far this week you've reviewed 2 contributions. Keep up the good work!

I'm sure it could be implemented, I'll look into it.

Hey, @bflanagin!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Hi @bflanagin!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 0.622 which ranks you at #65655 across all Steem accounts.
Your rank has improved 224 places in the last three days (old rank 65879).

In our last Algorithmic Curation Round, consisting of 487 contributions, your post is ranked at #467.

Evaluation of your UA score:
  • Only a few people are following you, try to convince more people with good work.
  • You have already convinced some users to vote for your post, keep trying!
  • Try to work on user engagement: the more people that interact with you via the comments, the higher your UA score!

Feel free to join our @steem-ua Discord server

Coin Marketplace

STEEM 0.30
TRX 0.11
JST 0.033
BTC 64223.84
ETH 3158.34
USDT 1.00
SBD 4.29