View Single Post
Old 11-17-2017, 12:31 AM   #2535
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,027
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
(multi-reply)

@misydia,

replace_metadata is a very versatile tool for making many kinds of changes.

It relies on regular expressions(regexp or re) and while regexp is usually common knowledge among computer scientists and programmers, is not intuitive to everyone.

The particular cases you mention are fairly simple in theory, but quickly get complicated when you realize that AO3 lets any author enter anything they want. For example, you'll likely want at least:
Code:
[archiveofourown.org]
replace_metadata:
 freeformtags=>^[Aa]lternate[ ]*[Uu]niverse[ :-]+(.*)$=>\1\sAU
 freeformtags=>[ ]+au$=>\sAU
That first regexp means:
^ = beginning of tag
[Aa]lternate = Alternate or alternate
[ ]* = zero or more spaces
[Uu]niverse = Universe or universe
[ :-]+ = one or more spaces, colons and/or dashes
(.*) = zero or more of any characters, grouped for later use
$ = end of tag

And the replacement string means:
\1 = the first paran group from the regexp
\sAU = [space]AU (\s is only in replacement strings, it's FFF specific, not normal regexp.)

Many other users have asked before about trying to normalize AO3 tags. Some have built up substantial personal.ini libraries of replace_metadata settings. But it's never going to be perfect for all stories as long as AO3 allows completely free form tags.

Additional Reading:
FFF Wiki page ReplaceMetadata (and other pages in the wiki)

@DarkMagda,

Check this FAQ, it will probably help.
JimmXinu is online now   Reply With Quote