View Single Post
Old 05-09-2013, 03:30 PM   #1373
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: 163
Karma: 3100
Join Date: Sep 2011
Device: Kobo Auro H2O, PRS-T1
I've almost got my personal ini set for Hobbit stories on AO3 when I ran into an output I didn't expect.

There are certain tags that I want at the end of a ship in parenthesis. However, I only want one per tag.

So instead of: Book/Comics.LOTR.Bilbo Baggins/Kli (Friendship) (Family)

I want to break it down to:
Book/Comics.LOTR.Bilbo Baggins/Kli (Friendship)

and

Book/Comics.LOTR.Bilbo Baggins/Kli (Family)

I added code # 5 to seperate the tags out.

Spoiler:
Code:
 ##This only shows relevant code and key words have been edited to reduce space.

#1 convert & and 'and' to (Friendship) tag
 ships=> (&|and) (.*?)$=>/\2 (Friendship)
 ships=>&(.*?)$=>/\1 (Friendship) 
 ships=> (&|and) =>/
 ships=>&amp=>/
 
 #2 use key words to insert parenthesis tag
 ships=>(- brothers| - Family)=>\1 (Family)
 ships=>(Brotherly )(.*?)$=>\2 (Family)
 ships=>(- friendship|-Friendship)=>\1 (Friendship)
 ships=>(Platonic )(.*?)$=>\2 (Friendship)

 #3 Erase keywords
 ships=>(- brothers| - Family|Brotherly |- friendship|-Friendship|Platonic )=>
 
 #4 Make sure the parenthesis tag is at the end
 ships=>(\(Family\)|\(Friendship\))( )?(.*?)$=>\3 \1

 #5 Separate 2 parenthesis tags into different tags
 ships=>(.*?) \((.*?)\) \((.*?)\)=>\1 (\2), \1 (\3)

 #6 Sort Hierarchically.  Done after junk tags have been erased.
 ships=>(^Bilbo/)=>Book/Comics.LOTR.\1


However, when I did this, code # 6 only applied to the first one. So, I got:

Book/Comics.LOTR.Bilbo Baggins/Kli (Friendship)

and

Bilbo Baggins/Kli (Family)

The same thing happened if the two parenthesis were the same (like (Friendship) (Friendship)). I don't understand why the second tag is not going through the final step. Unless it doesn't seperate the commas into tags until the personal ini is finished. If so, is there a way I can fix this?

A couple urls that have this problem are:
http://archiveofourown.org/works/659182
http://archiveofourown.org/works/639...apters/1160141
Jade Aislin is offline