Skip to content
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

Automatically add character names to spellcheck dictionary #755

Open
dmjohnsson23 opened this issue Apr 18, 2020 · 8 comments
Open

Automatically add character names to spellcheck dictionary #755

dmjohnsson23 opened this issue Apr 18, 2020 · 8 comments

Comments

@dmjohnsson23
Copy link

A nice to have feature for this program would be to automatically add character names to the spellcheck dictionary. It's easy enough to do manually of course, but doing it automatically would be nice. It would also be better for instances where the user might change the spelling of a characters name, to have the old spelling removed from the dictionary and the new added.

It seems like this ought to be a fairly easy addition, and I'd be willing to make the change myself if someone more familiar with the project code would be willing to give me some information on how spellcheck works in Manuskript. I'm pretty handy with Python, though I mostly do web services and simple command-line scripts rather than user-facing GUI application like this. I looked over the code in the spellcheck.py module in the project, and it doesn't have a whole lot of documentation, and I'm not 100% sure what all the functions are for.

@obw
Copy link
Contributor

obw commented Apr 19, 2020

This is a very good Idea, my main Project where I use Manuskript, has 200+ Characters, still rising and a lot unusual Names in it.
This would be a nice Feature. I add normally the Name by myself, but also I have one where I checked in a Typo:(

@qantravon
Copy link

I would say don't just stop at characters, but anything that has an entry in the World references as well.

@dmjohnsson23
Copy link
Author

I've started working on this: https://github.com/dmjohnsson23/manuskript

It's an unfamiliar code base to me, so I'd love any feedback from team members. Not much done yet, but on the rare occasions when I have free time I'm working on it.

@dmjohnsson23
Copy link
Author

The code for automatically adding character names is now working on my fork above. It currently doesn't take effect right away, you have to restart the application efore it picks up the changes. So, I've still got some bugs to iron out, but if anyone wants to try it out, go for it.

I've only done character names, not world entries. I don't imagine world entries would be any harder, though that doesn't really appear like the way the word section was designed to be used. If you look at the example data, the world entries have plain English titles like "Culture", "Architecture", "Religion", and so forth; so I hesitate to add those. Any thoughts?

@TheJackiMonster
Copy link
Collaborator

@dmjohnsson23 It would be neat if you would open a pull request so this issue could be solved. I can probably look into it how to reload the dictionary without restarting the application if you need help.

@dmjohnsson23
Copy link
Author

dmjohnsson23 commented Feb 24, 2021 via email

@dmjohnsson23
Copy link
Author

I have created a work-in-progress pull request #839. The issue where the newly added names don't immediately take effect is still present. I think I now know why, but haven't come up with a good solution yet. I need to trigger the syntax highlighter used for spellchecking to rehighlight. Trouble is, getting a reference to that from the context where the name spellchecker is working seems like it might be a challenge without it making the code awkward and hacky. I will work on this some more next weekend hopefully.

@TheJackiMonster
Copy link
Collaborator

If you need more time to find a good solution for it, don't worry. Otherwise the code really is quite hacky at some points already. I currently hope that a switch from Qt to for example Gtk could help with restructuring the code. For example this would reduce the amount of GUI-generated python code in the repository.

Also I think multiple core functions have to be rewritten from scratch to get rid of the current state of performance. For example the file access could be optimized in a way that you would only have to load the files you're editing. Currently we load all files of the project on statup and keep them in memory. ^^'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants