inkle / inky

An editor for ink: inkle's narrative scripting language
http://www.inklestudios.com/ink
2.42k stars 296 forks source link

Suggestion: Add a spelling / grammar check functionality #385

Open JeffDoka opened 2 years ago

JeffDoka commented 2 years ago

It's easy to export these files to another editor and re-import, but it would be nice to implement one of the many open-libraries for spell checking etc.

ajitzero commented 2 years ago

The Ace editor (which Inky uses) has support for auto-correct now: Wiki

blurymind commented 2 years ago

the link is for autocomplete, not autocorrect

blurymind commented 2 years ago

btw yarn-editor already implements autocorrect and even suggests correct spelling of words if you highlight and rightclick. It also supports ink mode. Give it a try at https://yarnspinnertool.github.io/YarnEditor/

One thing to note with autocorrect - especially ace-editor (which yarn uses too) - it works fine for english, but struggles in some other languages. There appears to be a problem with nspell locking up everything when loading a dictionary from some languages (russian, french, etc) https://github.com/YarnSpinnerTool/YarnEditor/blob/master/src/js/libs/spellcheck_ace.js#L6

One thing I would suggest for inky is to try to avoid using some external implementation like nspell and attempt to do it with electron's built in dictionaries - you already have a heavy dependency on electron - might as well further take advantage of it https://www.electronjs.org/docs/latest/tutorial/spellchecker

since yarn editor is trying to get away from electron, I opted not to use this -even when we do have an electron version