Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 10-01-2015, 07:22 PM   #76
martyger
Member
martyger began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Dec 2013
Device: none
Quote:
Originally Posted by CalibUser View Post
The plugin should work now - there was an error in the filename that did not match the XML file in the plugin

I was able to add the plug-in; however I received an "Error Parsing Result XML: Premature end of document" with the following info:

F
atal Python error: Py_Initialize: unable to load the file system codec
ImportError: No module named 'encodings'

I tried this on 5 different files and got the same error message.
martyger is offline   Reply With Quote
Old 10-01-2015, 08:30 PM   #77
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
That appears to be a problem with Python, not the plugin.

Do you have the PYTHONPATH environment variable set to a python2 installation?
eschwartz is offline   Reply With Quote
Advert
Old 10-02-2015, 02:14 AM   #78
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,587
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by eschwartz View Post
That appears to be a problem with Python, not the plugin.
One would think so, but there definitely is a problem with the plugin. I don't get martyger's error message, but the plugin appears to be stuck in an endless loop. The only thing that works is the resize image option.

Last edited by Doitsu; 10-02-2015 at 04:14 AM.
Doitsu is offline   Reply With Quote
Old 10-02-2015, 02:48 AM   #79
gipsy
Connoisseur
gipsy began at the beginning.
 
Posts: 81
Karma: 10
Join Date: Nov 2013
Device: Kobo Aura HD
Works fine for me. You must point to a text file for word list or it stuck in an endless loop
gipsy is offline   Reply With Quote
Old 10-02-2015, 04:41 AM   #80
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,587
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by gipsy View Post
Works fine for me. You must point to a text file for word list or it stuck in an endless loop
I created a WordDictionary.txt dictionary with two words in it in \sigil-ebook\sigil\user_dictionaries and it's still stuck in an endless loop.

Besides, a plugin shouldn't rely on the existence of a file it doesn't create itself.
Doitsu is offline   Reply With Quote
Advert
Old 10-02-2015, 04:49 AM   #81
gipsy
Connoisseur
gipsy began at the beginning.
 
Posts: 81
Karma: 10
Join Date: Nov 2013
Device: Kobo Aura HD
Doitsu create and a words.txt and set it from Use word list from the choices when you run the plugin. It's for the new feature that automatically changes words.
gipsy is offline   Reply With Quote
Old 10-02-2015, 04:57 AM   #82
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,587
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by gipsy View Post
Doitsu create and a words.txt and set it from Use word list from the choices when you run the plugin. It's for the new feature that automatically changes words.
With this file in place the plugin actually works, however, I'm still convinced that a plugin shouldn't rely on the existence of optional files.

If it requires this file, it should create a dummy file when it's first run.
Doitsu is offline   Reply With Quote
Old 10-02-2015, 12:09 PM   #83
CalibUser
Addict
CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.
 
Posts: 201
Karma: 62362
Join Date: Jul 2015
Device: Sony
My plugin did include a check for whether or not the file exists instead of creating a dummy file. However, I found a bug that was linked to the json file that stores user preferences. I resolved this problem and I have posted an update in the first thread of this post.
CalibUser is offline   Reply With Quote
Old 10-05-2015, 02:30 AM   #84
gipsy
Connoisseur
gipsy began at the beginning.
 
Posts: 81
Karma: 10
Join Date: Nov 2013
Device: Kobo Aura HD
@CalibUser
I added the "ακούσε|άκουσε" replacement in word list.
But it changes and the "ακούσει" word that is correct with "άκουσε(return)ι".
How can we change the code to find the whole word? Or the whole word followed by punctuation?

Thanks
gipsy is offline   Reply With Quote
Old 10-05-2015, 06:51 AM   #85
CalibUser
Addict
CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.
 
Posts: 201
Karma: 62362
Join Date: Jul 2015
Device: Sony
I have amended the plugin so it should remove the erroneous return when "ακούσε|άκουσε" is put in word list.
CalibUser is offline   Reply With Quote
Old 10-05-2015, 08:58 AM   #86
gipsy
Connoisseur
gipsy began at the beginning.
 
Posts: 81
Karma: 10
Join Date: Nov 2013
Device: Kobo Aura HD
Quote:
Originally Posted by CalibUser View Post
I have amended the plugin so it should remove the erroneous return when "ακούσε|άκουσε" is put in word list.
Calib how you do that? I found another word and i don't want to bother you with single word

Edit: CalibUser i notice that in some greek words it doesnt find the whole word. Like the one in my last post "ακούσει, ακούσεις" that are correct words it changes them to "άκουσε(space)ι, άκουσε(space)ις" that are mispelled.
I also notice that it doesnt fix all the words. I play with the encoding of the words file to fix this.
In what enconding we must have the words file; it fixes the words when i have it in windows-greek. In utf-8 i have problem with the Ά it changed to '

Last edited by gipsy; 10-05-2015 at 12:39 PM.
gipsy is offline   Reply With Quote
Old 10-05-2015, 01:27 PM   #87
gipsy
Connoisseur
gipsy began at the beginning.
 
Posts: 81
Karma: 10
Join Date: Nov 2013
Device: Kobo Aura HD
I finally get the FixP code to work with!

Code:
def IsFixP(m):
	"""
	This function examines a hyphenated word to see whether the hyphen is required.
	It is called by a regular expression function (re.sub) in FixCommonErrors()
	It returns the original expression if the non-hyphenated word is not in the dictionary,
	otherwise it returns the word without the hyphen
	"""
	FixP="Π"+m.group(2)
	FixP2=m.group(1)+m.group(2)

	if spell(FixP2):
		return(m.group(0))
	elif spell(FixP):
		print("FixP removed from: ", FixP)
		return ('Π'+m.group(2))
	else:
		return(m.group(0))
and
Code:
#Fixes Π in words that are misspelled
		if dictExists == True:
			CorrectText("Π fixes",r"(1\ Ι|ΓΙ|Γΐ|ΙΙ|II|Ι\ Ι|ΓΤ|ΙΊ|Ιί)[ ]?(\w+)(?![^<>]*>)(?!.*<body[^>]*>)", IsFixP)
It bypass the spelling correct words and changes the misspelled.
I think that i have some error in the CorrectText regex.
In the FixP sample that i had in a previously post... It doesn't correct the "Ι Ιήρε" And i have it in the CorrectText as "Ι\ Ι" .

Any thoughts???


EDIT: Found that it doesn't fix if the second part of the word (m.group(2)) is lowercase

Last edited by gipsy; 10-05-2015 at 01:46 PM.
gipsy is offline   Reply With Quote
Old 10-06-2015, 02:28 PM   #88
CalibUser
Addict
CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.
 
Posts: 201
Karma: 62362
Join Date: Jul 2015
Device: Sony
Quote:
Originally Posted by gipsy View Post

Edit: CalibUser i notice that in some greek words it doesnt find the whole word. Like the one in my last post "ακούσει, ακούσεις" that are correct words it changes them to "άκουσε(space)ι, άκουσε(space)ις" that are mispelled.
I also notice that it doesnt fix all the words. I play with the encoding of the words file to fix this.
In what enconding we must have the words file; it fixes the words when i have it in windows-greek. In utf-8 i have problem with the Ά it changed to '
@gipsy: I have investigated the problem and I think the attached file may provide a solution. I have not attached it to the first post in the thread as it is just a test file to see whether this solution works. Please would you see whether this version of the plugin resolves the problem of the extra space and whether it works for other Greek words that have caused problems. If it works then I will update the plugin in the first thread with this solution.

Sigil uses the UTF-8 format so please ensure that your Greek word file is in this format (although this does not seem to matter for English words).
Attached Files
File Type: zip ePubTidyTool_testfile.zip (23.0 KB, 256 views)
CalibUser is offline   Reply With Quote
Old 10-06-2015, 04:17 PM   #89
gipsy
Connoisseur
gipsy began at the beginning.
 
Posts: 81
Karma: 10
Join Date: Nov 2013
Device: Kobo Aura HD
@CalibUser Works fine with the words that I had problems!!!


ps. I have the IncorrectWords.txt saved as UTF-8 at Windows Notepad.
gipsy is offline   Reply With Quote
Old 10-07-2015, 02:41 PM   #90
CalibUser
Addict
CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.
 
Posts: 201
Karma: 62362
Join Date: Jul 2015
Device: Sony
Quote:
Originally Posted by gipsy View Post
@CalibUser Works fine with the words that I had problems!!!
Thanks for testing my update. I am adding another update to the plugin so that apostrophes in the word list will be replaced by a straight or single quote depending on the type of quote that is used in the ePub. When I have managed to get this feature working I will post an update in the first thread.
CalibUser is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tidying Up My Kindle selectortone Calibre 2 07-17-2013 10:35 AM
developping a Plugin for Presentation files abdlink Plugins 4 04-15-2013 11:27 AM
Plugin to fix fb2 files oviksna Plugins 3 01-28-2013 08:53 AM
Tidying Up My Library JayLaFunk Library Management 2 09-20-2011 09:12 AM
Calibre 0.7.50 can't see plugin files mb_webguy Calibre 5 04-29-2011 03:41 AM


All times are GMT -4. The time now is 06:07 PM.


MobileRead.com is a privately owned, operated and funded community.