-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added basic support for LanguageTool via 'language_check' as advanced spellchecker #747
Added basic support for LanguageTool via 'language_check' as advanced spellchecker #747
Conversation
When I understood this correctly, this use the public avail webservice. It should be configurable to a local install of langtool for advance users. Why:
Needed fields in the configuration basic version and external start of the langtool:
Better version, in which Manuskript started langtool :
Also thanks for your effort, this is a real enhancement for me;) |
I thought so too but on Archlinux at least it installs a version of LanguageTool with language_check locally and opens a java-process running it. I will try to test it on Windows too, so that it won't be too complicated to setup. ^^' |
Without changing anything in the source I got a massive performance boost just by updating to the newest release of language_check (1.1 currently). It's still slower than the other dictionaries but I think it's usable if you don't swap scenes every second. |
@TheJackiMonster this was something to be expected... On both of my machines not Problem (8 or 16GB), but performance is a problem, when it's make Manuskript overall slower, that is definitely a Problem... One of my bigger Projects (Around 500k Words), the startup of Manuskript alone is evil, two Minutes upward, also when I go to some of the older Parts, I could make Tea in the time of switching:(... This is something we must work on soon... |
@obw Wow, my biggest project is only about 33k words.. So I guess we will only know how slow it is, when you try the final merge. ^^' |
@TheJackiMonster I think, you are right, with a own Performance Ticket... But I mention it, so that we all aware of it... |
Okay, I implemented some sort of cache for the checking with LanguageTool. So once the text was opened it can reopened faster because as long as nothing gets changed, the tool does not have to check the text again. The results are saved in memory until you close the whole application. But I think it's fine since the process of the tool alone needs much memory and it does only stores a list of suggestions for errors and others. ^^ |
Okay, I think everything is ready for review and merge now. I have added tooltips which present the messages of the suggestions for correction. Every match has a different color based on its type and the selection which was always selecting whole words picks the correct part of the text if nothing was selected on purpose. The colors aren't perfect at the moment but most matches have the type 'uncategorized' anyway. Settings for customization would probably need another, so I will leave this open for now. |
Okay, I added a commit to prevent Manuskript from crashing when selecting LanguageCheck as dictionary-library and Java is not installed. I basically disabled it as option as long as Java isn't installed properly. Java is definitive required to run LanguageTool locally. |
This should fix Issue #142. At the moment it is only very basic but if "language_check" is installed, it can be selected as dictionary which enables additional to the spellchecking some grammar- and style-checking.
Some additional mistakes in grammar and style can be solved via context-menu like the misspelling but some will only show some information. Others are just underlined/marked currently.
I would like to try to improve the performance before it gets merged since it has way more noticeable loading times at start of the program and during chapter/scene changing. ^^'