![]() |
Thanks for all these suggestions and comments. When I get time, I will look at implementing some of the ideas presented above:
@Doitsu: Thanks for the directory code and experimental plugin - I will experiment with your plugin as soon as I have time. @gipsy: Thanks for the code for Greek ePubs. I will incorporate this code in the next version of the plugin. @DiapDealer: As you do not really recommended accessing script properties/methods directly, I will try the solution offered by Doitsu; I will update from Doitsu's solution when the hunspell/dictionaries is incorporated into the plugin launcher framework. |
Quote:
|
Quote:
|
The plugin has been updated so that it will automatically find the folder for the spelling dictionary using code suggested by Doitsu and DiapDealer.
I have also incorporated code from gipsy to manage Greek letters. @gipsy:I had to represent the Greek characters as unicode numbers since my editor cannot handle unicode characters! If you get time, please check that the code works for Greek texts in case I have mistyped the unicode numbers. |
@CalibUser
Change them to this and there are fine :) EDIT: Sorry they didn't work with the replace in unicode code For example the "γΰρω" is changed to "γ\u03CDρω" EDIT 2: For some reason the hyphen doesn't work at me now. :blink: I think I found the reason... In windows... The ePubTidyTool.json has the DictFile path as Code:
"DictFile": "C:\\Users\\pm\\AppData\\Local\\sigil-ebook\\sigil\\user_dictionaries\\WordDictionary.txt",Code:
"DictFile": "C:/Users/pm/AppData/Local/sigil-ebook/sigil/hunspell_dictionaries/WordDictionary.txt", |
Quote:
Change the following line from: Code:
CorrectText("Changed \u03CD to \u03B0", r'\u03B0', r'\u03CD')Code:
CorrectText("Changed \u03CD to \u03B0", r'ΰ', r'ύ') |
That's correct Doitsu :P
i'm gonna send the code to CalibUser because his editor cannot handle greek characters. |
CalibUser if you can copy-paste them in your editor those are some fixes for now.
Or tell me how to send them to you :) Code:
#------------------------ Greek character corrections ------------- |
I have updated the plugin to process Greek errors as suggested by Gipsy - I haven't been able to test the update using a Greek text as I am not familiar with this language.
|
Quote:
Thanks CalibUser They work fine. The only problem is that it doesn't process the Hyphens. Maybe windows doesn't recognize the path in ePubTidyTool.json Code:
"DictFile": "C:\\Users\\owner\\AppData\\Local\\sigil-ebook\\sigil\\user_dictionaries\\WordDictionary.txt", |
@gipsy: Strange that hyphens are not being processed. I have tested this facility on a Windows 7 PC and it is working (for English text). Are you having problems with Greek texts only, or are you also having problems with English text? Perhaps I need to go back to enabling the user to select the path for a the dictionary....however, when the new version of Sigil is published I will be looking at using the built-in dictionaries and hopefully that will resolve the problem.
|
Quote:
I make a WordDictionary.txt with only 2 english words and a epub with the 2 words hyphened. It doesn't change them. Maybe it's a Windows 8 issue, I'm gonna test it in a Windows 7 virtual machine ;) |
I found a solution while searching....
in plugin.py i change the Code:
return(dictionary_path)Code:
return(dictionary_path).replace("\\","/")It worked for windows 8, Windows 10. I don't know if it's working in linux, or older Windows versions :o |
Quote:
I.e., what you've found is a feature not a bug. If removing hyphens doesn't work, there's probably a problem with the encoding of the user dictionary, which needs to be saved as a utf-8 file. Re-save the user dictionary as a utf8 file with Windows Notepad and rerun the plugin. If removing hyphens still doesn't work, attach a short Greek sample epub file with hyphenation issues and the user dictionary that you use. |
Doitsu i test it and with a 2 english words dictionary and a 2 hyphened words epub. And it doesn't worked.
The Dictionary is as UTF-8 without BOM (as Notepad++says) Ok. That's weird... I test the latest version of the plugin with a portable sigil and the hyphens fix works fine :chinscratch: It doesn't work with the installed version of Sigil :blink: To work with the installed version of Sigil you must have the path in json as Code:
"DictFile": "C:/Users/pm/AppData/Local/sigil-ebook/sigil/hunspell_dictionaries/WordDictionary.txt", |
| All times are GMT -4. The time now is 08:29 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.