Raised This Month: $300 Target: $400
 75% 

[batch] Compress Russian strings (transliteration)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine
Old 02-18-2020 , 04:09   [batch] Compress Russian strings (transliteration)
Reply With Quote #1

Purpose:
Decrease number of bytes of the Russian string by replacing Russian letters by English analogue.

Usefull, e.g. in nicknames or some rare translation phrases cases where buffer size is limited like menus/panels.

Some tip: RU letter is 2 byte, EN - 1 byte.
Script:
Spoiler


Using:
1. Save your string in file "newnames.ini"

2. Unpack:
- ren_script_ANSI.cmd
or
- ren_script_UTF8.cmd

from archive (depending on what txt file codepage you have UTF8 or ANSI)*
- Windows by default create text files in ANSI.
- .phrases.txt is UTF8.

3. Place ren_script_*.cmd next to your text file.

4. Run it (double click).
Attached Files
File Type: zip ren_script.zip (925 Bytes, 30 views)
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D1 fun (Bloody Witch)
[My plugins] [My tools] [GitHub] [Articles]
Dragokas is offline
spumer
Senior Member
Join Date: Aug 2011
Old 02-22-2020 , 07:45   Re: [batch] Compress Russian strings (transliteration)
Reply With Quote #2

Hmm. If you have limited buffer size you just can cut nickname, no?
__________________
spumer is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine
Old 02-22-2020 , 08:36   Re: [batch] Compress Russian strings (transliteration)
Reply With Quote #3

Like, cut original nick "Nice Assistant" to "Nice Ass" ? DD
No. It depends.
Where you want to preserve original word completely without any cutting, it is a case.

There are lot of use cases. Upcoming examples:
- translation in panel: https://forums.alliedmods.net/showpo...5&postcount=22
- Name changer for bad names: https://github.com/Exle/Auto-Name-Changer
(I'm often fill new names for replacement that exceed the limit. Since I usually create > 20 options it is a lot of text to replace it manually)
- or even if you want to create nickname for yourself that contains russian letters that exceed maximum string size allowed in total.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D1 fun (Bloody Witch)
[My plugins] [My tools] [GitHub] [Articles]
Dragokas is offline
spumer
Senior Member
Join Date: Aug 2011
Old 02-23-2020 , 13:31   Re: [batch] Compress Russian strings (transliteration)
Reply With Quote #4

Quote:
Originally Posted by Dragokas View Post
Like, cut original nick "Nice Assistant" to "Nice Ass" ? DD
No. It depends.
Where you want to preserve original word completely without any cutting, it is a case.

There are lot of use cases. Upcoming examples:
- translation in panel: https://forums.alliedmods.net/showpo...5&postcount=22
- Name changer for bad names: https://github.com/Exle/Auto-Name-Changer
(I'm often fill new names for replacement that exceed the limit. Since I usually create > 20 options it is a lot of text to replace it manually)
- or even if you want to create nickname for yourself that contains russian letters that exceed maximum string size allowed in total.
Yes, cause you can't compress this nickname cause it have only english symbols.

I mean i actually don't see big problem in cutting, cause in 80% of cases buffer size is big enough.
I knew only one case where i needed smart cutting - vscripting. Buf size for vscript menus is 128 bytes.
For that cases i just wrote algorithm which cut long names and replace ending with dots (...)
__________________
spumer is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine
Old 02-23-2020 , 13:58   Re: [batch] Compress Russian strings (transliteration)
Reply With Quote #5

Quote:
Yes, cause you can't compress this nickname cause it have only english symbols.
lol, that's because if I would write for you Russian example, you can't understand it, or you are speaking Russian?
But if you insist:

here is a name for auto-name-changer:
Code:
setinfo name "Ведьмак Колокольчикус"
it is 41 byte.

Maximum allowed is 31 byte + NULL.

I don't imagine how to cut this nickname without loss of its meaning other than apply transliteration.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D1 fun (Bloody Witch)
[My plugins] [My tools] [GitHub] [Articles]
Dragokas is offline
spumer
Senior Member
Join Date: Aug 2011
Old 02-27-2020 , 13:33   Re: [batch] Compress Russian strings (transliteration)
Reply With Quote #6

It's good try to solve Players problem.
But are you sure it's problem really exists?
In all menus you enough see name part to determine player and apply any action (vote/etc.).

Where did you see the need to show the full name anyway?
And this does not negate the fact that you can specify an even longer name, in the general case, the problem is not completely solved.

Yes, i understand russian. And i have some russian game servers for L4D2.
__________________

Last edited by spumer; 02-27-2020 at 13:34.
spumer is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine
Old 02-27-2020 , 14:09   Re: [batch] Compress Russian strings (transliteration)
Reply With Quote #7

I don't understand what are you trying to explain me.

It is always good to show full name instead of cutted. Ask anybody.
E.g. if my name Stanislav will be auto-cutted to Stanisla, I will not be happy at all.

Quote:
Originally Posted by spumer View Post
Where did you see the need to show the full name anyway?
I already told you and gave 2 examples.

Also ++

Here: https://www.dropbox.com/s/l0twg83fhi...names.png?dl=0
And here: https://www.dropbox.com/s/rgjoizx8rf...ames2.png?dl=0

About second: when my server has 16 players, sometimes it is a case for limit of panel buffer.
You can use the same replacement technique in plugin to show full names without need to cut anything.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D1 fun (Bloody Witch)
[My plugins] [My tools] [GitHub] [Articles]

Last edited by Dragokas; 02-29-2020 at 11:28.
Dragokas is offline
spumer
Senior Member
Join Date: Aug 2011
Old 02-29-2020 , 11:20   Re: [batch] Compress Russian strings (transliteration)
Reply With Quote #8

I don't try explain or teach. I try to understand. Sorry if i disappointed you.

I just have another point of view and now i got what i wanted - "It is always good to show full name instead of cutted.". It's ok and good job for that case.
__________________
spumer is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:21.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode