View Single Post
Old 09-29-2017, 10:32 AM   #2477
kstar
Member
kstar began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jun 2015
Device: Kobo
Bubble Sorting

Bubble sorting....?

Is this conceptually possible within Fanficfare for ships/relationships tag?

My objective is uniformity of the ship tagging order either by Alphabetically or by Preference.

Name 1/Name 2/Name 3/Name 4/Name 5

Input:
Severus Snape/Voldemort/Draco Malfoy/Harry Potter
Harry Potter/Severus Snape/Voldemort/Draco Malfoy
Harry Potter/Severus Snape/Draco Malfoy/Voldemort
Severus Snape/Draco Malfoy/Voldemort/Harry Potter
Severus Snape/Voldemort/Draco Malfoy/Harry Potter

Preference Method: Using reg code I swap placement order. Name 1 is listed last in the personal.ini file since the program reads top-down. This allows for personal preference.

This method is WORKS but requires a lot of "ship swap"coding.
Code:
##__FIRST Normalization

 Harry Potter \- J\. K\. Rowling=>Harry Potter
 Harry P\.=>Harry Potter&&category=>Harry Potter
 Hermione G\.=>Hermione Granger&&category=>Harry Potter

 Tom R\. Jr\.=>Voldemort
 Tom Riddle Jr\.=>Voldemort 
 Tom Riddle \| Voldemort=>Voldemort
 Tom Riddle=>Voldemort

 Draco M\.=>Draco Malfoy
 Lucius M\.=>Lucius Malfoy
 Severus S\.=>Severus Snape

##__Ship Priority (last in list take priority) Bubble Sort?

 (.*)\/Lucius Malfoy=>Lucius Malfoy/\1
 (.*)\/Draco Malfoy=>Draco Malfoy/\1
 (.*)\/Hermione Granger=>Hermione Granger/\1
 (.*)\/Luna Lovegood=>Luna Lovegood/\1
 (.*)\/Severus Snape=>Severus Snape/\1
 (.*)\/Voldemort=>Voldemort/\1 
 (.*)\/Harry Potter=>Harry Potter/\1

 (.*)\/Loki=>Loki/\1
 (.*)\/Tony Stark=>Tony Stark/\1

 (.*)\/John Sheppard=>John Sheppard/\1
 (.*)\/Jack O\'Neill=>Jack O'Neill/\1
Preference Output:
Harry Potter/Voldemort/Severus Snape/Draco Malfoy
Harry Potter/Voldemort/Severus Snape
Harry Potter/Voldemort
John Sheppard/Rodney McKay
John Sheppard/Harry Potter


Alphabetical Method : I got far as reading the string when I ran into problems... when I realize I would have to loop to read each letter and my regex knowledge is novice level. So I opted for Preference Method for now.

Alphabetical Output:
Draco Malfoy/Harry Potter/Severus Snape/Voldemort
Harry Potter/Severus Snape/Sirus Black
Harry Potter/Voldemort
John Sheppard/Rodney McKay

Code:
([a-zA-Z0-9 .\-&]*)/{0,1}([a-zA-Z0-9 .\-&]*)/{0,1}([a-zA-Z0-9 .\-&]*)/{0,1}([a-zA-Z0-9 .\-&]*)/{0,1}
Side Note: Removing any "friendships" denoted with ampersand...
My coding didn't work.
Code:
 
exclude_metadata_pre:
 ships=~(*.)\&(.*)


May have forgotton to say this before but thank you for Fanficfare. Love the program. Kudos!

Last edited by kstar; 09-29-2017 at 12:45 PM.
kstar is offline   Reply With Quote