Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old Yesterday, 11:25 PM   #136
DaltonST
Deviser
DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!
 
DaltonST's Avatar
 
Posts: 1,252
Karma: 100496
Join Date: Aug 2013
Location: Texas
Device: 8" Win10 Tablet w/Calibre64
Prefixes

A prefix can be anything of any length.

An example of what can be done with the new Tag Prefix Suffix Rules Table in the Scrub Tags tool of Job Spy (that I intend to supersede entirely the 'prefix' values in Library Code's options once the new JS functionality is released):

Example: Add a prefix of "Fiction" to any tag that does not already start with "Fiction" but has "Romance" or "Suspense" or "Science" or "Mystery" in it, or otherwise matches the rule's regular expression matching requirement.

I use tags with implicit hierarchical formatting like "Factual:History-War-WWII-Africa-North Africa-Libya" and "Fiction:Science-Space Opera" and "Fiction:Romance-Paranormal-Vampires".

I develop my plug-ins for myself as their first user, and I would never want any Tag that had "--"'s in the middle arbitrarily split into 2 or 3 pieces as has been suggested. Such splitting should be rule-based on an individual user basis. I might add that capability to Job Spy too.



DaltonST
DaltonST is offline   Reply With Quote
Old Today, 12:01 AM   #137
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 15,235
Karma: 24732438
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo: Touch, Glo, Aura H2O, Glo HD, Aura ONE, Clara HD
Quote:
Originally Posted by DaltonST View Post
A prefix can be anything of any length.

An example of what can be done with the new Tag Prefix Suffix Rules Table in the Scrub Tags tool of Job Spy (that I intend to supersede entirely the 'prefix' values in Library Code's options once the new JS functionality is released):

Example: Add a prefix of "Fiction" to any tag that does not already start with "Fiction" but has "Romance" or "Suspense" or "Science" or "Mystery" in it, or otherwise matches the rule's regular expression matching requirement.

I use tags with implicit hierarchical formatting like "Factual:History-War-WWII-Africa-North Africa-Libya" and "Fiction:Science-Space Opera" and "Fiction:Romance-Paranormal-Vampires".
OK, so it is adding something that one of your other plugins might find useful.
Quote:
I develop my plug-ins for myself as their first user, and I would never want any Tag that had "--"'s in the middle arbitrarily split into 2 or 3 pieces as has been suggested. Such splitting should be rule-based on an individual user basis. I might add that capability to Job Spy too.
Yes, and as you so capably demonstrated, adding an extra option to the configuration dialog to enable a split like this would be simple. The amount of time you took to add that prefix would be roughly the same time as to add an option to do what @knobunc wanted. And of course, where to do the split,or even if it makes sense at all, is dependent on the tag type. The FAST tags are clearly using "--" in a way that represents a hierarchy. The examples you use above appear to use just "-" (before you added the prefix). I don't know about any of the other tags that Library Code as I haven't looked at them closely.

Adding splitting like this to JobSpy is fine, but it does mean the user has to install and configure that plugin. And they have to run two separate steps each time they update metadata.

But, it is good that you finally understand what was being asked.
davidfor is offline   Reply With Quote
Old Today, 08:48 AM   #138
DaltonST
Deviser
DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!
 
DaltonST's Avatar
 
Posts: 1,252
Karma: 100496
Join Date: Aug 2013
Location: Texas
Device: 8" Win10 Tablet w/Calibre64
Use Job Spy "Scrub Tags" Tool to Modify LCEAD/FAST Tags

Library Codes users who wish to modify either the LCEAD Tags or the FAST Tags should see this post: https://www.mobileread.com/forums/sh...5&postcount=23


For example, if you want to replace any "--" with a "." for #fast tags, use the Tag String Replacement Rules table to do so.




DaltonST
DaltonST is offline   Reply With Quote
Old Today, 12:00 PM   #139
knobunc
Junior Member
knobunc began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Sep 2018
Device: Paperwhite 3
Thanks! I'll give that a try.

Do you have any thoughts about making it possible to skip results from WorldCat that are not Dewey codes? e.g. "FIC" or "B" often come back. Unfortunately, they are not consistently used so I usually get back a DDC, but about 30% of the books have something else.

I added a (probably horrible) bit of code to classify_web_service_api.py to skip things that don't match a regex. And that works nicely for now while I'm updating my collection to include the FAST codes.

But I wasn't sure if it was something you were interested in adding to your plugin.

Code:
               #~ ---------------------------
                ddc = recommendations.getElementsByTagName('ddc')[0]
                #~ ---------------------------
                if ddc:
                    for mostPopular in ddc.getElementsByTagName('mostPopular'):
                        holdings = mostPopular.attributes["holdings"].value
                        nsfa = mostPopular.attributes["nsfa"].value
                        sfa = mostPopular.attributes["sfa"].value
                        if DEBUG: print('DDC mostPopular: class=' + sfa + ' normalized=' + nsfa + ' holdings=' + holdings)
                        # Allow cutter codes after matches, but we want numbers, not text strings (e.g. FIC, B, etc.)
                        if re.match(r"^\d+(\.$\d+)?(\s.+)?", sfa) is not None:
                            ddc_return = sfa
                            break
                    del ddc
                    del holdings
knobunc is offline   Reply With Quote
Old Today, 02:34 PM   #140
DaltonST
Deviser
DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!DaltonST rocks like Gibraltar!
 
DaltonST's Avatar
 
Posts: 1,252
Karma: 100496
Join Date: Aug 2013
Location: Texas
Device: 8" Win10 Tablet w/Calibre64
Job Spy plugin's Scrub Tags functionality

Use the Job Spy plugin's Scrub Tags functionality to add new tags, delete undesired tags, change existing tags, create a 3d new tag if 2 certain tags exist, or a 4th if 3 exist, capitalize sub-strings within tags, and so forth.

The above can easily delete any tags for any specific custom column, like #fast, based on any matching regular expression you wish to specify.




DaltonST
DaltonST is offline   Reply With Quote
Reply

Tags
ddc, dewey decimal, lcc, library of congress, oclc

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Consolidate All Library Metadata (CALM) DaltonST Plugins 191 10-04-2018 10:30 AM
[GUI Plugin] KindleUnpack - The Plugin DiapDealer Plugins 412 04-24-2018 06:07 PM
[GUI Plugin] SmartEject JimmXinu Plugins 35 03-13-2018 11:52 AM
[GUI Plugin] Astro-ph iatheia Plugins 14 07-25-2015 11:41 PM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 10:02 PM.


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