01-07-2014, 03:35 PM | #451 | |
Ex-Helpdesk Junkie
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)
|
Quote:
Negation is easy, just add "not" before the term. You can chain together search terms by holding down Ctrl while selecting multiple tag browser fields. Double clicking will negate the field and use the button "alter tag browser" to switch "search type when selecting multiple items" between "match all" and "match any". |
|
01-07-2014, 06:38 PM | #452 | |
Wizard
Posts: 1,065
Karma: 858115
Join Date: Jan 2011
Device: Kobo Clara, Kindle Paperwhite 10
|
Quote:
I bet I spend less time not downloading tags, but reading comments then designating my own tags in my own custom columns, than you do, or than I would if I downloaded tags and had to assess and transform the downloaded tags into something workable. |
|
01-08-2014, 01:16 AM | #453 | |
Groupie
Posts: 180
Karma: 299
Join Date: Jul 2010
Location: Brampton ON
Device: Kobo, Kindle3
|
Quote:
|
|
01-08-2014, 01:37 AM | #454 | |
Groupie
Posts: 180
Karma: 299
Join Date: Jul 2010
Location: Brampton ON
Device: Kobo, Kindle3
|
Quote:
Two issues arise of course, the negation doesn't catch Mystery/Thrillers, of course. Using the tag browser to ctrl click on every Mystery variant is certainly doable, if daunting. Secondly, the negation I was talking about was in the regex/program area. So, strictly speaking, I was incorrect in attributing it strictly to my python ignorance. It's as much regex as Python. I use regex at it's most basic levels because my own programming relies on a masking language that is somewhere south of Regex and not exactly a full-blow implementation. When, or if, you find away to break apart the tags and use smart matching so that I can construct my own set of logical statements to compare fragments, so that Mystery==Mystery/Thrillers==mysteries by comparing for myster, then I think I can carry the ball the rest of the way. It'll probably be slower'n molasses, but I'll adapt it. An AI solution won't be perfect. But neither is my eyesight OR my memory these days. |
|
01-08-2014, 01:55 AM | #455 | |
Wizard
Posts: 1,065
Karma: 858115
Join Date: Jan 2011
Device: Kobo Clara, Kindle Paperwhite 10
|
Quote:
|
|
01-08-2014, 02:17 AM | #456 | |
Ex-Helpdesk Junkie
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)
|
Quote:
Searches don't use regex, though you can "search" using a custom column, where if certain fields match certain regexes, the value is set to "Yes" or something. I bet we could work something out. Negation in regex is quite simple, as far as it goes. You can match "Mystery" but not "Mystery/Thrillers" with the regex "Mystery(?!/Thrillers)". By creating a capture group of form (?regex) you will match only when that string is there, but not include the string in the result; perhaps more useful is (?!regex) where the ! negates it. Last edited by eschwartz; 01-08-2014 at 02:26 AM. Reason: I opened my mouth and was wrong. :o |
|
01-08-2014, 02:19 AM | #457 |
creator of calibre
Posts: 44,020
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You most definitely can use regexes in searches. http://manual.calibre-ebook.com/gui....arch-interface
|
01-08-2014, 02:21 AM | #458 | ||
Ex-Helpdesk Junkie
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)
|
Quote:
Should check these things first before I blab, eh? So you can search Quote:
Last edited by eschwartz; 01-08-2014 at 02:25 AM. |
||
01-09-2014, 01:09 PM | #459 | |
Groupie
Posts: 180
Karma: 299
Join Date: Jul 2010
Location: Brampton ON
Device: Kobo, Kindle3
|
Quote:
Do you have any control over the in-place ads that accompany random entries here in Mobileread? The ad accompanying ESchwartz's entry below is probably different each time for each user, but I got the toe fungus ad and it was extremely off-putting. I don't block ads, but this one has me considering doing just that. The accompany picture was ... well, it might be accurate but I didn't need to see it just before lunch. If you CAN contribute some editorial guidance, it would be appreciated. I don't begrudge sites making money to provide me with important extras in life, but ... |
|
01-09-2014, 01:22 PM | #460 | |
Groupie
Posts: 180
Karma: 299
Join Date: Jul 2010
Location: Brampton ON
Device: Kobo, Kindle3
|
Quote:
Well, it appears that my fears were totally unfounded. Changing search terms from a multiplicity of Mystery variants in the form of tags:"=Mystery" proved unnecessary. tags:"Mystery" got Mystery and it also got Mystery & Detective as you expected. That knowledge changes my interpretation of what I CAN do to a very large degree. Furthermore, getting the in-line negation code fragment now allows me to do IF THEN's to my programming heart's delight. It will let me write smarter searches that leave fewer incoming books as uncategorized. Thank you. You doggedness in getting it right is much appreciated. |
|
01-09-2014, 01:55 PM | #461 | |
Groupie
Posts: 180
Karma: 299
Join Date: Jul 2010
Location: Brampton ON
Device: Kobo, Kindle3
|
Quote:
tags:"~Mystery(?!/Thrillers)" I get the parentheses. That's a group. I get the exclamation mark as being negation and /Thrillers as the term I expressly asked for. The question mark I THINK is what turns the parentheses into a group. But the tilde? I tried my search with and without the tilde and got the same result set in what appears to be close to instantaneous time. My 03B Mysteries Not Thrillers search now becomes: ((tags:"Mystery" or tags:"Detectives" or tags:"Crime") and not (tags:"Thriller")) The design decision to add a separate NOT clause for thiller was to avoid having to add a negation regex to each of the three search terms in the OR clause. The speed was very fast, much faster than the old saved search that included the equals sign. Now, if I could only write a search that would change the created column #tagsgm... i.e. something like #tagsgm:=="BioSports"(?(tags:"Biography") and (tags:"Sports")) which I could follow with #tagsgm:=="Bio"(?(tags:"Biography") and not (tags:"Sports")) Throw those (and others) into a program for the created column and I'm on auto cruise control. |
|
01-09-2014, 03:04 PM | #462 |
Ex-Helpdesk Junkie
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)
|
The tilde is supposed to activate regex mode.
And searching for "Mystery" would take a much longer time, as it has to search through every metadata field, but when you add the tags: qualifier, it narrows that down tremendously. Having it EXACTLY equal Mystery versus CONTAIN mystery is a minor difference, so feel free to use = only when you feel like it, just so long as you avoid using a search that wants to search the entire database. |
01-09-2014, 04:07 PM | #463 | |
Grand Sorcerer
Posts: 11,790
Karma: 7029971
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
What exactly do you want to do? Is #tagsgsm a composite custom column like tags? Are you saying that you want it to contain the word "BioSports" if tags contains the tag Sports and the tag Biography? Our something else? BTW: (?!xyz) Is not really a group. Instead it tests that whatever text is next does not equal xyz. The interesting thing about this test is that it does not consume the characters negatively matched, so that the test foo(?!bar)\w* will match fooAlphanumeric except if the alphanumeric part starts with bar. |
|
01-10-2014, 02:32 AM | #464 | |
Groupie
Posts: 180
Karma: 299
Join Date: Jul 2010
Location: Brampton ON
Device: Kobo, Kindle3
|
Quote:
I did do the experiments outlined in the previous post. I used tags:"Mystery" and got back a rather instantaneous search. Even combined with other AND clauses, it was likety split quick. Added the NOT clause for Thriller. STILL likety split quick. All of which were accomplished without needing to resort to regex. Now, NOW that I know the tilde is needed for initiating a regex search, you have save me considerable angst down the road when I start using negation regex code within some more complex. Appreciate the further definition. GM |
|
01-10-2014, 02:59 AM | #465 | |
Groupie
Posts: 180
Karma: 299
Join Date: Jul 2010
Location: Brampton ON
Device: Kobo, Kindle3
|
Quote:
Okay, since YOU ASKED .... I'm faced with this situation. I add a rather large number of books. I then select the newly added ones and change the new books to have an Uncat value in the my #gmtags column. It's not a complex column, just one that allows for my small tag sub-set, Mysteries, Thrillers, SF, NF, Sports, Biographies, Sports Biographies, Bridge, Writing and Young Adult. Then, I ctrl-D and download the metadata from the internet. I then run a series of saved searches that looks for #gmtags=Uncat added to a series of search terms in a bracketed OR clause for the tags field. One that covers, for the most part, each of the gmtags categories. After it finds the uncategorized books that fit, I select all and go into group edit. I check off delete all gmtags and then add that particular gmtag. Click OK and the books all disappear. I then move on to the next saved search. Repeat rinse cycle. In all, it takes about five minutes. Long for a half-dozen books, really quick for a thousand new uncategorized books. However, my searches are NOT perfect. I'd say I get somewhere around 80 percent recategorized. I put SOME effort into manually scanning and correcting the rest, but I'm old, lazy and less interested in perfection than I used to be. ESchwartz has been quite active of late and has started producing code that I find ... interesting. Especially recent threads that have moved towards changing another column through a program rather than a quick one-line regex code (which I got from you, heh heh heh). I need a program (or I think I do) because the end result has to be smarter than what I have currently. The BETTER solution will involve LOTS of nesting when all is said and done. There is the old issue of which one term to use in gmtags when more than one of the 'mother' terms is found. While I have bent on the issue of Sports Biographies, I'm a stubborn old coot on the rest. I have imperiously commanded that Mystery/Thrillers are Thrillers, not Mysteries. At least they are in my small pocket universe. That's why I was anxiously looking forward to ESchwartz's development of the request he had gotten from ACGauthor. So I could poach. I am not a good man. That's WHAT I am doing. I would like to shorten the steps down to one really smart super search (that would change the other column), because wrapping it up IN a created column definition might slow things down during normal use of the library I have created in Calibre. I'm sure there are bigger libraries out there. But given the inclusion of academic papers and my own writings and acquired books, mine is sizable. So there it is, wrapped up in a bunch of peanut shells. What have you got? Happy New Year, by the way. GM |
|
Tags |
custom column, tag, tags |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
custom column i need a little help | shinken | Calibre | 3 | 09-15-2010 03:41 AM |
Using Custom Metadata in Save Template | EJvdH | Calibre | 1 | 07-02-2010 06:06 AM |
Accessories Decalgirl Kindle 2 custom skin template | srmalloy | Amazon Kindle | 6 | 04-09-2010 09:55 PM |
Donations for Custom Recipes | ddavtian | Calibre | 5 | 01-23-2010 04:54 PM |
Help understanding custom recipes | andersent | Calibre | 0 | 12-17-2009 02:37 PM |