* account for diacritical marks when normalizing filenames
This commit is contained in:
parent
baf01fad74
commit
67fe97c345
|
@ -132,4 +132,4 @@ String.metaClass.transliterate = { transformIdentifier -> com.ibm.icu.text.Trans
|
|||
* e.g. "Österreich" -> "Osterreich"
|
||||
* "カタカナ" -> "katakana"
|
||||
*/
|
||||
String.metaClass.ascii = { delegate.transliterate("Any-Latin;Latin-ASCII").replaceAll("[^\\p{ASCII}]", "?") }
|
||||
String.metaClass.ascii = { delegate.transliterate("Any-Latin;Latin-ASCII;[:Diacritic:]remove").replaceAll("[^\\p{ASCII}]", "?") }
|
||||
|
|
|
@ -120,7 +120,7 @@
|
|||
<code>E:/Complete/<span class="block start">{</span><span class="variable">n</span><span class="block end">}</span> (<span class="block start">{</span><span class="variable">y</span><span class="block end">}</span>)<span class="block start">{</span><span class="string">'/Season '</span>+<span class="variable">s</span><span class="block end">}</span>/<span class="block start">{</span><span class="variable">s</span>+<span class="string">'x'</span><span class="block end">}</span><span class="block start">{</span><span class="variable">e</span>.<span class="method">pad</span>(<span class="numeral">2</span>)<span class="block end">}</span> - <span class="block start">{</span><span class="variable">t</span><span class="block end">}</span></code>Rename and <strong>move</strong> files. The directory structure is completely up to you.
|
||||
</p>
|
||||
<p>
|
||||
<code><span class="block start">{</span><span class="variable">n</span>.<span class="method">replaceTrailingBrackets</span>()<span class="block end">}</span> - <span class="block start">{</span><span class="variable">s</span>+<span class="string">'x'</span><span class="block end">}</span><span class="block start">{</span><span class="variable">e</span>.<span class="method">pad</span>(<span class="numeral">2</span>)<span class="block end">}</span> - <span class="block start">{</span><span class="variable">t</span>.<span class="method">replaceAll</span>(<span class="regex">/[!?.]+$/</span>).<span class="method">replaceAll</span>(<span class="regex">/[`´]/</span>, <span class="string">"'"</span>).<span class="method">lowerTrail</span>().<span class="method">replacePart</span>(<span class="string">', Part $1'</span>)<span class="block end">}</span></code>My personal favorite. Pretty much 1x01, but with lots of cleanup operations.
|
||||
<code><span class="block start">{</span><span class="variable">n</span>.<span class="method">replaceTrailingBrackets</span>()<span class="block end">}</span> - <span class="block start">{</span><span class="variable">s</span>+<span class="string">'x'</span><span class="block end">}</span><span class="block start">{</span><span class="variable">e</span>.<span class="method">pad</span>(<span class="numeral">2</span>)<span class="block end">}</span> - <span class="block start">{</span><span class="variable">t</span>.<span class="method">replaceAll</span>(<span class="regex">/[!?.]+$/</span>).<span class="method">replaceAll</span>(<span class="regex">/[`´‘’ʻ]/</span>, <span class="string">"'"</span>)<br/>.<span class="method">lowerTrail</span>().<span class="method">replacePart</span>(<span class="string">', Part $1'</span>)<span class="block end">}</span></code>My personal favorite. Pretty much 1x01, normalizing accents, and lots of other cleanup operations.
|
||||
</p>
|
||||
|
||||
<h2 class="reference" id="bindings">
|
||||
|
|
Loading…
Reference in New Issue