View Single Post
Old 09-22-2018, 02:58 PM   #2934
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
Quote:
Originally Posted by rishidiams View Post
Another question: is there a way to force the title column to use title case? For some reason, some AO3 authors think they're e.e. cummings.
Not in the existing code. Nor do I see a way to add such code that is both reasonably correct and only reasonably difficult.

Well, I suppose there is a way, but it is also a bit less than 'reasonably correct', only works for English and similar languages and is ugly to boot:

Code:
add_to_replace_metadata:
 title,author=>((^| )+)a=>\1A
 title,author=>((^| )+)b=>\1B
 title,author=>((^| )+)c=>\1C
 title,author=>((^| )+)d=>\1D
 title,author=>((^| )+)e=>\1E
 title,author=>((^| )+)f=>\1F
 title,author=>((^| )+)g=>\1G
 title,author=>((^| )+)h=>\1H
 title,author=>((^| )+)i=>\1I
 title,author=>((^| )+)j=>\1J
 title,author=>((^| )+)k=>\1K
 title,author=>((^| )+)l=>\1L
 title,author=>((^| )+)m=>\1M
 title,author=>((^| )+)n=>\1N
 title,author=>((^| )+)o=>\1O
 title,author=>((^| )+)p=>\1P
 title,author=>((^| )+)q=>\1Q
 title,author=>((^| )+)r=>\1R
 title,author=>((^| )+)s=>\1S
 title,author=>((^| )+)t=>\1T
 title,author=>((^| )+)u=>\1U
 title,author=>((^| )+)v=>\1V
 title,author=>((^| )+)w=>\1W
 title,author=>((^| )+)x=>\1X
 title,author=>((^| )+)y=>\1Y
 title,author=>((^| )+)z=>\1Z
Note that articles and other short words ('of', 'a', 'an', etc) that technically shouldn't be capitalized still are using this. And only the first 'E' of 'e.e.' would be capitalized, etc, etc.

Some of those issues could be addressed with even more or more complex patterns. Those are left as an exercise for the reader.

Or fix them individually when you find one that offends you. That's what I do; example:

Code:
[https://archiveofourown.org/works/999999]
add_to_replace_metadata:
 title=>.*=>Title as I think it Should Be
JimmXinu is offline   Reply With Quote