11-04-2012, 02:26 AM | #991 |
Enthusiast
Posts: 48
Karma: 1056
Join Date: Jul 2012
Location: Central Canada
Device: Sony PRS-T1, RIM Playbook & Z10, Samsung Note, MacOSX
|
Trying to understand the syntax JimmXinu, apologies for my lack of certainty. I have read the Calibre faq section on regular expressions, but part of the question has to do with how FFDL parses.
characters=>(.+)=>Character.Transformers.\1&&categ ory=>Transformers says: look in class: characters=>find (any text string of any length in an individual tag)=>output to the Character column the tag contents from the brackets prepended with the string “Transformers.” if the string was from the category Transformers. Is that correct? Basically, I’m not sure whether “Character” is the destination, the class, or what. So if I want to have FFDL take a character who appears in two related fandoms, like Willow R. in either Buffy: The Vampire Slayer and Angel, and convert it to ch Jossverse: Willow Rosenberg in general tags and Jossverse.B:tVS.Willow Rosenberg or Jossverse.Angel.Willow Rosenberg as appropriate (I split Buffy, Angel, in the hierarchical column but combine it in general tags) in the character column I would do: Spoiler:
? I suspect not, but I’m not sure how to do it. And granted that even if it worked, it would break in the crossover case mentioned by Jade Aislin above. There are embedded questions about at what points FFDL looks at the data downloaded vs. subsequently altered entries. What I currently do (written prior to the introduction of 5 part lines, and only works for characters with unique names per fandom) is (excerpt): Spoiler:
Notes to Jade Aislin (or others doing specific substitutions): Spoiler:
Last edited by seabream; 11-04-2012 at 02:28 AM. Reason: I cut more from the excerpt than I should have, so I added a bit back. |
11-04-2012, 11:34 AM | #992 | ||
Plugin Developer
Posts: 6,439
Karma: 4276871
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Quote:
replace_metadata changes the content of metadata, it doesn't specify it's 'destination'. Adding 'Character.Transformers.' has something to do with hierarchical tags. I don't use them and cannot speak to that. Frankly, you guys are getting into a level of complexity that is beyond what I want to think about. I'll help explain the mechanism, but you're going to have to figure out the details for yourselves. Quote:
Yes, huge numbers of replace_metadata lines and complex patterns will slow down FFDL. I did not anticipate anyone would go to the lengths you guys are (when do you have time to read? ). I can help speed it up some, possibly a lot, with some simple internal optimizations. I will investigate. |
||
Advert | |
|
11-04-2012, 11:36 AM | #993 |
Plugin Developer
Posts: 6,439
Karma: 4276871
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Let's see if a brief review on how replace_metadata works will help.
replace_metadata lines can take one of three different forms. The first and simplest is: pattern=>replacement All metadata items that matches regexp 'pattern' will be replaced using the standard Python regexp library like so: "value = re.sub(pattern,replacement,value)" So, for example, if you are offended by the word Furbie and never want to see it anywhere in your metadata, you do: Code:
Furbie=>F*rbie The only difference is that you are limiting which metadata items the line will apply do by including one or more 'metakeys'. Metakey is one of the metadata items defined by FFDL (category, genre, rating, etc) or added by extra_valid_entries. So, for example, if you what Humor converted to Comedy in genre and category: Code:
genre,category=>Humor=>Comedy metakey[,metakey]=>pattern=>replacement&&conditionalkey=>condregex p This essentially says, "For metadata items 'metakey', if metadata item 'conditionalkey' matches 'conditionalkey', replace 'pattern' with 'replacement'. Now there are three conditions that must be true before the replacement is done. 1) It must be a metadata item 'metakey', 2) the value must match 'pattern' and 3) the value of metadata item 'conditionalkey' must match 'condregexp'. Code:
characters=>Sam W\.=>Sam Witwicky&&category=>Transformers characters=>Sam W\.=>Sam Winchester&&category=>Supernatural Another tip: If you want to be able to test your patterns without hitting your favorite stories again and again, you can use the fake test site and the extracharacters, extracategories, etc parameters. test1.com URLs will generate stories, but not go out to the network. URL: http://test1.com?sid=12345 Code:
[test1.com] extracharacters:Reginald Smythe-Smythe,Mokona,Harry P. replace_metadata: characters=>Harry P\.=>Harry Potter |
11-04-2012, 01:30 PM | #994 | |
Plugin Developer
Posts: 6,439
Karma: 4276871
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Quote:
UPDATE(Nov5): attachment removed--there's a newer test version with this change farther down the thread. That version will also be removed after the next release. Last edited by JimmXinu; 11-05-2012 at 12:26 PM. Reason: Remove obsolete beta versions |
|
11-04-2012, 10:42 PM | #995 |
Connoisseur
Posts: 89
Karma: 706
Join Date: Nov 2012
Device: Kobo Touch
|
|
Advert | |
|
11-04-2012, 11:37 PM | #996 | |
Plugin Developer
Posts: 6,439
Karma: 4276871
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Quote:
One does not, but that's because the author put the story text into the author's note instead of the chapter body. ponyfictionarchive.net doesn't have any convenient wrapping tag to grab the author notes with the chapter text, so they haven't been included. If you can show more than the one story with this mistake, I'll look into ways to include the author notes, too. UPDATE(Nov5): attachment removed--there's a newer test version with this change farther down the thread. That version will also be removed after the next release. Last edited by JimmXinu; 11-05-2012 at 12:26 PM. Reason: Remove obsolete beta versions |
|
11-05-2012, 12:10 PM | #997 |
Zealot
Posts: 105
Karma: 10
Join Date: Nov 2012
Location: Germany
Device: Kobo Libra 2
|
Hi!
I'm not sure if this is the right place to ask, but I've encountered a problem with downloading fanfiction from potionsandsnitches... The error-message says: Nothing to download - Title: Unknown - Author: Unknown - URL: http://www.potionsandsnitches.net/fa...y.php?sid=2662 - Comment: time data '16 09 2011' does not match format '%m %d %Y' I tried various stories and it doesn't seem to be a problem with stories, that were only recently startet (e. g. http://www.potionsandsnitches.net/fa...y.php?sid=2872 published 02 Nov 12 works) Not working: http://www.potionsandsnitches.net/fa...y.php?sid=1958 http://www.potionsandsnitches.net/fa...y.php?sid=1772 http://www.potionsandsnitches.net/fa...y.php?sid=2590 http://www.potionsandsnitches.net/fa...y.php?sid=2663 http://www.potionsandsnitches.net/fa...y.php?sid=2477 http://www.potionsandsnitches.net/fa...y.php?sid=2525 http://www.potionsandsnitches.net/fa...y.php?sid=2652 http://www.potionsandsnitches.net/fa...y.php?sid=2571 Is there a possible solution or workaround for this? Thank you! |
11-05-2012, 12:24 PM | #998 |
Plugin Developer
Posts: 6,439
Karma: 4276871
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
It looks like potionsandsnitches.net has changed how they write dates.
Try the attached version, it works for me. (This version also contains the ponyfictionarchive.net fix and replace_metadata optimizations.) Last edited by JimmXinu; 11-08-2012 at 01:37 PM. Reason: Remove obsolete beta versions |
11-05-2012, 03:52 PM | #999 |
Zealot
Posts: 105
Karma: 10
Join Date: Nov 2012
Location: Germany
Device: Kobo Libra 2
|
Hey, it works again.
Thanks for the help! |
11-05-2012, 08:36 PM | #1000 | ||||
Groupie
Posts: 164
Karma: 3100
Join Date: Sep 2011
Device: Kobo Auro H2O, PRS-T1
|
Quote:
Quote:
Quote:
Quote:
I'm also having problems with the text program I use to edit my personal.ini as that program is converting some of the special characters (like the 'u' in Yūgi) to basic characters. Do you use a text program to work on your personal.ini or do you only edit it in the plugin window? If you use another program, what do you use? |
||||
11-05-2012, 08:50 PM | #1001 | |
Plugin Developer
Posts: 6,439
Karma: 4276871
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Quote:
|
|
11-05-2012, 09:04 PM | #1002 |
Zealot
Posts: 139
Karma: 21754
Join Date: Mar 2011
Device: Kindle 3, Icarus Illumina XL, Boyue T62
|
Could be worse, it could be vi =) Emacs is tolerable, however, depending on the operating system, I would recommend Notepad++ or Gedit.
|
11-05-2012, 09:37 PM | #1003 |
Groupie
Posts: 164
Karma: 3100
Join Date: Sep 2011
Device: Kobo Auro H2O, PRS-T1
|
I've been using Notepad++. It takes the 'é', but it's been converting the 'ū' to 'u'. Unfortunately, that means that the plugin will not recognize a character with that letter. I'll check Gedit though.
|
11-05-2012, 09:42 PM | #1004 |
Plugin Developer
Posts: 6,439
Karma: 4276871
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
My wife uses vi. We've agreed to disagree. :-)
Re: Notepad++, I haven't used it lately, but I expect that you somehow have to tell it you're editing a UTF8 file and then the other characters will work. |
11-07-2012, 11:01 PM | #1005 |
Plugin Developer
Posts: 6,439
Karma: 4276871
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Version 1.6.18 - 07 Nov 2012
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] Find Duplicates | kiwidude | Plugins | 1103 | 06-10-2024 05:20 PM |
[GUI Plugin] Count Pages | kiwidude | Plugins | 1750 | 04-07-2024 01:20 AM |
[GUI Plugin] Open With | kiwidude | Plugins | 403 | 04-01-2024 08:39 AM |
[GUI Plugin] Resize Cover | kiwidude | Plugins | 95 | 03-16-2024 11:55 PM |
[GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 12:27 PM |