View Single Post
Old 10-18-2015, 05:32 AM   #6
moldy
Enthusiast
moldy began at the beginning.
 
Posts: 43
Karma: 10
Join Date: Oct 2015
Device: Kindle
Hi All and thanks for the helpful replies.

The saved search solution sort of works but is not ideal.

Searching for say 'color' finds color, colorful, coloring etc. which is quite useful. But search and replace 'odor, gives me odour - fine but also deodourant - wrong.
Search and replace 'mom' this gives me mum fine but also mument - wrong.

Trying to use regex to manipulate the search I searched for [Oo]dor[^\w].
This worked but then what about odorless - another search to save and name.

Trying to speed things up I exported the saved searches and opened the file in an old copy of DreamWeaver I have. I could see the search sections so I set up a template to add a search:

{
"case_sensitive": true,
"dot_all": true,
"find": "([Ww])ord([^\w])",
"mode": "regex",
"name": "",
"replace": "\\1ord\\2"
},

I added some words and saved the file but when I tried to import it I got this:

calibre, version 2.41.0
ERROR: Unhandled exception: <b>ValueError</b>:No JSON object could be decoded

calibre 2.41 [64bit] isfrozen: True is64bit: True
Windows-8-6.2.9200 Windows ('64bit', 'WindowsPE')
('Windows', '8', '6.2.9200')
Python 2.7.9
Windows: ('8', '6.2.9200', '', 'Multiprocessor Free')
Successfully initialized third party plugins: Kindle Collections && Diaps Editing Toolbag && Manage Series && Count Pages
Traceback (most recent call last):
File "site-packages\calibre\gui2\tweak_book\search.py", line 1090, in import_searches
File "json\__init__.py", line 338, in loads
File "json\decoder.py", line 366, in decode
File "json\decoder.py", line 384, in raw_decode
ValueError: No JSON object could be decoded

Well thats where I'm up to in my project. As much as I would like to; I don't have the capability to write a plug in.

Any input would be welcomed and much appreciated. Thanks - moldy
moldy is offline   Reply With Quote