1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-17 14:55:09 -05:00

handle contractions (e.g. should not capitalize to Don'T but Don't)

This commit is contained in:
Reinhard Pointner 2012-06-29 09:03:23 +00:00
parent 8b887055aa
commit f8b0eaea95

View File

@ -61,7 +61,7 @@ String.metaClass.space = { replacement -> replaceAll(/[:?._]/, " ").trim().repla
* *
* e.g. "The Day a new Demon was born" -> "The Day A New Demon Was Born" * e.g. "The Day a new Demon was born" -> "The Day A New Demon Was Born"
*/ */
String.metaClass.upperInitial = { replaceAll(/\b[a-z]/, { it.toUpperCase() }) } String.metaClass.upperInitial = { replaceAll(/(?<=[&()+.,-;<=>?\[\]_{|}~ ]|^)[a-z]/, { it.toUpperCase() }) }
/** /**