View Single Post
Old 04-29-2014, 12:45 AM   #2603
Jade Aislin
Groupie
Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.
 
Posts: 164
Karma: 3100
Join Date: Sep 2011
Device: Kobo Auro H2O, PRS-T1
One of the stories I'm working with is:
http://archiveofourown.org/works/935...apters/1821204

I don't have a problem managing the ones I want to keep (ie. Bilbo Baggins, Gandalf, etc). It's the metadata that I don't want to keep (ie. anyone else who feels like popping in) that I'm having trouble with.

my metadata looks like this:

Spoiler:
Code:
[defaults]
 #Note: The code has been cut down to the necessary code for the above URL.
 #Step one: delete any periods in the category and character name.
add_to_replace_metadata:
 category,characters,ships=>\.=>
 category,characters,ships=>\|=> -\s
 category,characters,ships=>,=>

#clean up fandom names

 category=>( - )?(( )?Fandom|All (Media Types|Series)|(J R R )?Tolkien|[Ww]orks|\(((Bay )?(Jackson )?[Mm]ovies|Cartoon Generation One|TV|Video Game|Manga|AU|2001 2002 2003|2012|1986|Novel)\))=>

 #Book
 category=>^(The )?[Hh]obbit( - )?(: An Unexpected Journey)?=>LOTR.Hobbit


 category=>(^|, )((LOTR|HP|Sherlock Holmes|Twilight|Black Jewels Trilogy)(.)?(.*)?)=>\1Book.\2


#Step four:  Clean up character,ships names 

 characters,ships=>((\()?[Ff]em(ale)?(\))?(( |!))?|\((([Tt]he )?Hobbit|Tolkien|Character|Labyrinth|Mass Effect|BtVS)\)| - Character)=>
 
 #Book

 #LOTR
 characters,ships=>([Bb]ilb[ao](g)?|B[ie]lla|Beryl|Bilbi)( 'briar')?( [Bb])?(aggins)?( reincarnation)?=>Bilbo Baggins&&category=>LOTR

 characters,ships_LIST=>(^|, )(Thranduil|Thorin's Company|Gandalf|Bilbo Baggins)=>\1Book.LOTR.\2&&category=>LOTR


[test1.com]
extratags: FanFiction,Testing
add_to_replace_metadata:

#blanks
 
 characters=>^.*?(|Anime/Manga|Book.LOTR.Bilbo Baggins)$=>\1


The last line of code is supposed to get rid of the extra metadata I don't want. I figured out why the testing (Aragorn <Estel-Strider>) was not working. Unfortunately, this code means I have to give the entire metadata I want to keep (ie. Book.LOTR.Bilbo Baggins, Book.LOTR.Gandalf). I would have to include a lot of names and pairings to get that to work.

I'd rather just look at the beginning of the the metadata to determine whether or not to keep it.

I've tried to replace the last line of code with four different lines:
Code:
 #Let's nothing through
 characters=>^.*?(|Anime/Manga|Book)$=>\1

 #Let's everything through
 characters=>^.*?(|Anime/Manga|Book)=>\1  
 characters=>^.*?((|Anime/Manga|Book)(.*?))$=>\1
 characters=>^.*?((Anime/Manga|Book)(.*?))$=>\1
I've been testing with: all the hobbits,Bilbo. I'm trying to get Bilbo changed to Book.LOTR.Bilbo Baggins and 'all the hobbits' should be erased.

None of the codes I've tried has worked. Basically, I want the code to look for keywords at the beginning of the metadata (Book, Game, Movie, etc.). If the metadata does not start with those keywords, then it should be erased.

Of course, I am assuming that all the code in the defaults section will be done before the code in the website sections. Maybe it would work better if I put that last line of code into the defaults section at the end of the replace_metadata code.
Jade Aislin is offline