Script to rename from Cyrillic to English

Discuss and share scripts and script files...
ivan
Posts: 577
Joined: 02 Apr 2008 12:52
Contact:

Script to rename from Cyrillic to English

Post by ivan »

Hello,

Thank you in advance to everyone who will help me with this. Little bit of a prologue: I have a bunch (over 200) of video files whose file names are in Russian. I also use Nero (please don't try to discourage me) to burn stuff onto DVDs but unfortunately Nero isn't Unicode so the filenames are all in weird characters. Therefore, I need them renamed from Cyrillic characters into Latin ones. This is a process that's often called transliteration (http://en.wikipedia.org/wiki/Translit). As you can see from the info link there are set associations between Cyrillic characters and Latin ones.

What I'm wondering is if there is a way to create a matrix of associations between Cyrillic characters and Latin characters and apply it to rename the batch of files?

Thanks again! 8)

infimum
Posts: 116
Joined: 30 Dec 2007 21:04

Post by infimum »

Writing in unicode characters (I am assuming you are not using Russian Windows) are poorly supported at the moment. I doubt this is possible. I am happy to be proved wrong, though.

admin
Site Admin
Posts: 60602
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Script to rename from Cyrillic to English

Post by admin »

Interesting task. But there should be specialized software to do this, or?

admin
Site Admin
Posts: 60602
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Post by admin »

infimum wrote:Writing in unicode characters (I am assuming you are not using Russian Windows) are poorly supported at the moment. I doubt this is possible. I am happy to be proved wrong, though.
Actually, the very next version will make some progress here! :)

ivan
Posts: 577
Joined: 02 Apr 2008 12:52
Contact:

Re: Script to rename from Cyrillic to English

Post by ivan »

admin wrote:Interesting task. But there should be specialized software to do this, or?
I am not aware of specialist software that does it. If anyone knows then please let me know. The only way I get by these days is using a webpage that has JavaScript text area which on the fly converts from english characters into russian ones (reverse transliteration so to speak). Then I just copy/paste text where i need it. But for over 200 files? That's a headache I don't want to imagine... :cry:

infimum
Posts: 116
Joined: 30 Dec 2007 21:04

Post by infimum »


ivan
Posts: 577
Joined: 02 Apr 2008 12:52
Contact:

Post by ivan »

infimum wrote:ivan, there you go.
http://www.den4b.com/downloads.php?project=ReNamer
Thanks a lot! Will definitely give this a go! However, I don't think that program allows the editing of rules of what Cyrillic symbols are substituted by what Latin ones. Having a script that would do it would be great because it would offer more flexibility.

infimum
Posts: 116
Joined: 30 Dec 2007 21:04

Post by infimum »

ivan wrote:I don't think that program allows the editing of rules of what Cyrillic symbols are substituted by what Latin ones.
Are you sure you checked "Click here to add a rule" >"Translit"?

ivan
Posts: 577
Joined: 02 Apr 2008 12:52
Contact:

Post by ivan »

infimum wrote:
ivan wrote:I don't think that program allows the editing of rules of what Cyrillic symbols are substituted by what Latin ones.
Are you sure you checked "Click here to add a rule" >"Translit"?
Aah, I noticed that translit rules are stored in TXT files and that way I can edit them. My bad and thanks a bunch. Though it's still a challenge to create a script to do it...*imagines being able to press one button and have it done for you* :P

infimum
Posts: 116
Joined: 30 Dec 2007 21:04

Post by infimum »

ivan wrote:*imagines being able to press one button and have it done for you* :P
AutoHotkey :P

admin
Site Admin
Posts: 60602
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Post by admin »

ivan wrote:Though it's still a challenge to create a script to do it...*imagines being able to press one button and have it done for you* :P
The next version can do it even without a script! :D

I leave it to you to find out how... :wink:

ivan
Posts: 577
Joined: 02 Apr 2008 12:52
Contact:

Post by ivan »

Do you mean the next full stable release or your daily beta ones? In either case...*gets excited and giggles like a little girl* :lol:

admin
Site Admin
Posts: 60602
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Post by admin »

ivan wrote:Do you mean the next full stable release or your daily beta ones? In either case...*gets excited and giggles like a little girl* :lol:
I mean the one that comes up in a few minutes... :)

You can do something in the meantime. Create 2 dummy files named as you intend to map the charsets:
abcdefghijklmnopqrstuvwxyz.txt
... and the same with the cyrillic characters (use Explorer for that... :wink: )

There's only monographemic (1:1) transliteration, hope that's enough for now... other (1:n) will be possible as well, but a bit harder to script.

ivan
Posts: 577
Joined: 02 Apr 2008 12:52
Contact:

Post by ivan »

Good effort. It's a start.

The problem I see is that Russian (my native language) is much more phonetic than English is. What I'm trying to say is that often to create the same sound as you would pronouncing one letter in English you'd need 2 Russian letters and vice versa.

Therefore, the only way I see how this could work is by "brute-forcing" aka storing all possible combinations of 1-3 English letters that result in a Russian letter and reverse-apply the principle in a renaming script. It's a challenge indeed... :?

admin
Site Admin
Posts: 60602
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Post by admin »

ivan wrote:Good effort. It's a start.

The problem I see is that Russian (my native language) is much more phonetic than English is. What I'm trying to say is that often to create the same sound as you would pronouncing one letter in English you'd need 2 Russian letters and vice versa.

Therefore, the only way I see how this could work is by "brute-forcing" aka storing all possible combinations of 1-3 English letters that result in a Russian letter and reverse-apply the principle in a renaming script. It's a challenge indeed... :?
As I said, you also will be able to do 1:n mappings... I just need to add a new rename command to scripting to make it fairly easy: in the meantime you can create your 2 lists like this:
a,b,c,dss,e .... (latin)
X,Xer,sh,ss,... (cyrill)
You see: simply separate with commas...

(BUT; this way won't be ready today -- only tomorrow...)

Post Reply