![]() |
#1 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 110
Karma: 38500
Join Date: Sep 2016
Location: San Jose, CA
Device: Kindle moving to Kobo or Boox
|
building a genre custom column from tags
I'm trying to use the tags that get automatically imported to build my #genre column based on other columns (tags). It's slow going, but with over 8000 books and over a couple of dozen new ones added each week, worth it to figure out. But I'm stuck on a couple of things. First is a regex question at the bottom. Second, is there a known/better way for setting up a #genre column already? There was a plugin (DeriveGenre) that's no longer up.
So my custom column is set up like this right now: Code:
program: build_genre = list_re_group(field('tag'), ', ', '', '(.*)romance(.*)', '', 'Love & Romance ', ''); build_genre = list_re_group(build_genre, ', ', '', '(.*)fantasy(.*)', '', 'Fantasy ', ''); build_genre = list_re_group(build_genre, ', ', '', '(.*)crime(.*)|(.*)mystery(.*)', '', 'Crime & Mystery ', '') I tried in build_genre = list_re_group(build_genre, ', ', '', '(.*)investigat(.*)', '', 'Crime & Mystery ', '') but it doesn't like that. When I switched it to build_genre = list_re_group(build_genre, ', ', '', '(.*)privat(.*)', '', 'Crime & Mystery ', '') it did take it. I tried '^(.*)investigat(.*)' and a couple of other things but still not getting it. Thank you in advanced! |
![]() |
![]() |
![]() |
#2 |
Deviser
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
|
The Derive Genres plugin was redesigned and then incorporated into the CALM and Q&S plugins. CALM is easier if DG is all you want.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 110
Karma: 38500
Join Date: Sep 2016
Location: San Jose, CA
Device: Kindle moving to Kobo or Boox
|
@ Dalton, I appreciate the work put in on CALM and I tried it a couple of times, but the documentation and forum help was too confusing/scattered for me and I'm not sure it would ultimately give me my desired result. Thank you though.
@all, for now, I'd like to get the specific regex working for copying/replacing words in a list like 'private investigator', 'private investigators', 'Private Investigator (+1)'. General goal: Basically my books come from multiple sources but mainly amazon. Genre metadata is not being filled even though I think I activated it for Goodreads (separate thing for more exploring). The publishers and sellers just dump everything into the 'tags' field anyway. I have 2 custom columns for the task. One column is a tag-browser set of preferred genre cagegories's that I can also edit manually (#genre). and the other a composite column I'm trying to map commonly-used tags to (#genre_from_tags). My #genre column is a 'text, as tags' format and #genre_from_tags is built from other columns using the template langauge (GPL). |
![]() |
![]() |
![]() |
#4 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 110
Karma: 38500
Join Date: Sep 2016
Location: San Jose, CA
Device: Kindle moving to Kobo or Boox
|
Resolved - For other noobs looking for some help:
My problem was caused by the ending parenthetical expression in a tag. The expression (^.*)((investig)(.+$) seems to work to deal with variations that include an expression with a partial word and a parenthetical expression at the end, like '(+1)' or '(anything)'. This following expression (^.*)((investig)(.+$)|(^.*)(detect)(.+$)) maps multiple partials to a genre: list_re_group(build_genre, ', ', '', '(^.*)((investig)(.+$)|(^.*)(detect)(.+$))', '', 'Crime & Mystery ', ''); Last edited by meghane_e; 03-09-2019 at 09:49 PM. Reason: missing word |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Custom Genre Hierarchical Column to tags | jjquin | Library Management | 5 | 03-02-2018 12:25 AM |
How can I boolean OR several tags into one custom column? | bmix | Library Management | 3 | 01-09-2015 03:57 AM |
Custom column listing the tags and language | dpierron | Library Management | 4 | 10-19-2012 07:24 AM |
Download tags to a custom column | atjnjk | Library Management | 8 | 01-18-2012 08:02 AM |
Help with template for custom column from tags | africalass | Library Management | 2 | 07-16-2011 11:47 AM |