Page 1 of 2
Script to rename from Cyrillic to English
Posted: 09 Apr 2008 10:30
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!

Posted: 09 Apr 2008 10:52
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.
Re: Script to rename from Cyrillic to English
Posted: 09 Apr 2008 11:18
by admin
Interesting task. But there should be specialized software to do this, or?
Posted: 09 Apr 2008 11:18
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!

Re: Script to rename from Cyrillic to English
Posted: 09 Apr 2008 11:23
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...

Posted: 09 Apr 2008 11:38
by infimum
Posted: 09 Apr 2008 11:46
by ivan
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.
Posted: 09 Apr 2008 11:48
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"?
Posted: 09 Apr 2008 11:55
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*

Posted: 09 Apr 2008 12:03
by infimum
ivan wrote:*imagines being able to press one button and have it done for you*

AutoHotkey

Posted: 09 Apr 2008 13:10
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*

The next version can do it even without a script!
I leave it to you to find out how...

Posted: 09 Apr 2008 13:15
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*

Posted: 09 Apr 2008 14:15
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*

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...

)
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.
Posted: 09 Apr 2008 14:51
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...

Posted: 09 Apr 2008 14:55
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...)