www.xbdev.net
xbdev - software development
Monday March 31, 2025
Home | Contact | Support | JavaScript... so much power in such a few lines of code.. | HTML5 and Javascript Example based approach ....
     
 

HTML5 and Javascript

Example based approach ....

 


A Standalone Browser Based Writing Tool

by Kenwright

This initial version was to get the basic 'features' working - such as identifying keywords, simple lookups, interface tools (right click on words). Once these core features are working, the next level is to add in advanced writing analysis tools - such as, machine learning, sentence quality analysis, word repeat, poor word usage and so on. All of the standard stuff you would expect today. But you want a really nice interface that communicates details as you're writing along (above words, underlining or colored words). Features:
* Dictionary (spell checking)
* Thesaurus (syms/adjs)
* Runs client (no need for server)
* Identifies 'sentences' (draws yellow line under sentences for debugging).
   This is for extracting all the sentences in a text quickly for writing analysis.
* Puts recommended words above words that aren't in the dictionary (also option to click and auto replace)


Details:
* 'Browser' based - doesn't require an active server to run (including spell check/thesaurus words)
* Typo class for the spell checking/dictionary/recommended corrections
* Very easy to add in extra features, to identify synonyms and weak words.
* Can be optimized to load libraries/dictionaries on the fly
* The lookup system can be improved to use a binary search for example (performance)
* Just for fun, there is interactive editor below, so you can type in words - error words are highlighted yellow
* Checks the text in real-time (as you type) - as it gets slower (large documents) - this might need to be changed to a button (run checks)



Try typing some words here (checks words on-the-fly and displays feedback as you write):

Type here

Startup Debug Output
Synonyms: 5453 words
Antonyms: 4841 words
Intializing Typo
Typo dictionary: 126839 words
Typo Ready!
check "there:"true
check "thera:"false
suggestions there: there,here,thee,theme,therm
suggestions thera: there,therm,theta,ether,ethers






Further Tasks

* Add new words to the dictionary (e.g., right click and select 'ignore' or 'add')
* Optimizations (runs faster)
* Search and highlight specific words
* Add more 'checks' to evaluate common writing/grammar problems
* In addition to simple single word checking, add in more advanced features (e.g., sentence analyser, neighbouring words, word-context, and so on)
* Highlight sentences (underline in yellow, different colors depending on their 'quality', green is good, red is poor)
* Word color (if it's a vowel/noun?) - educational tool as well?
* ..
* (Feel free to email me any other simple ideas/tweaks (community support/allow plugins?)...)



References

* Typo (Spell Checker Javascript) [Link]
* Misc Javascript Tutorials [Link]
* Online Editor/Compiler [Link]
* Beautiful Code Highlighting [Link]






 
Advert (Support Website)

 
 Visitor:
Copyright (c) 2002-2025 xbdev.net - All rights reserved.
Designated articles, tutorials and software are the property of their respective owners.