Page 1 of 1

"Nice position names" only removes leading 1s and 2s

Posted: Sun 10. Jan 2016, 14:30
by Arkintoofle
When using the "nice position names" or "nice position names, nice case" functions in the scene editor, only leading 1s and 2s are removed. Names starting with the digits 3 to 9 require manual removal. It would be nice if any leading numbers were removed, especially since the tooltips indicate that this is intended behavior. The current behavior is very cumbersome.

Edit: It would also be nice if certain abbreviations weren't case adjusted. For example, "DP" should remain as it is, instead of being changed to "dP". Other examples that should be filtered: "A2M", "ATM", "BJ", and so on.

Re: "Nice position names" only removes leading 1s and 2s

Posted: Sun 10. Jan 2016, 14:58
by ok666
Hmm, for correct alphanumeric sorting I assumed all filenames start with double digits ("02" comes before "10", but "10" before "2"). There was a hitch removing single digits, but I can't remember right now. Perhaps Tomcat still knows it.

I also stumbled about the abbreviations and thought about a wordlist. A fixed internal list can't possibly contain all the shortcuts. For instance, there also are CG or RCG...

Since you are the first user talking about the functions, you will be pleased to know that I implemented splitting of camel-cased texts for the next release. "CumToMouth" will be converted to "Cum to mouth". I'm looking at you, Kebaboni... :mussweg2:

Re: "Nice position names" only removes leading 1s and 2s

Posted: Sun 10. Jan 2016, 16:32
by Arkintoofle
ok666 wrote:I also stumbled about the abbreviations and thought about a wordlist. A fixed internal list can't possibly contain all the shortcuts. For instance, there also are CG or RCG...
Alternatively, you could just skip case conversion for whole words that are written entirely in uppercase. The functions don't correctly convert uppercase words right now anyway. If someone has the habit of writing their video file names all in caps, they'll have a problem, but they already do in any case.
ok666 wrote:Hmm, for correct alphanumeric sorting I assumed all filenames start with double digits ("02" comes before "10", but "10" before "2"). There was a hitch removing single digits, but I can't remember right now. Perhaps Tomcat still knows it.
If I was writing this function, I would simply iterate through the filename one character at a time until you hit the first valid letter (ie. not a number, punctuation or special symbols. Only the letters A to Z count). Then I'd strip everything up to the iterator from the string. This would handle all cases, but would also require that no file names actually need to start with a number. A perfectly valid name like "69" might have to be re-added by hand after running the function, but that's a small price to pay for a bit of important automation.

Re: "Nice position names" only removes leading 1s and 2s

Posted: Sun 10. Jan 2016, 17:08
by ok666
Arkintoofle wrote:Alternatively, you could just skip case conversion for whole words that are written entirely in uppercase. The functions don't correctly convert uppercase words right now anyway. If someone has the habit of writing their video file names all in caps, they'll have a problem, but they already do in any case.
Yes, that would work. But I've seen packs where "cg" or "rcg" were lower-case, that's why I thought about a list of "special" words with correct spelling and casing.
Arkintoofle wrote:If I was writing this function, I would simply iterate through the filename one character at a time until you hit the first valid letter (ie. not a number, punctuation or special symbols. Only the letters A to Z count). Then I'd strip everything up to the iterator from the string. This would handle all cases, but would also require that no file names actually need to start with a number. A perfectly valid name like "69" might have to be re-added by hand after running the function, but that's a small price to pay for a bit of important automation.
I've thought a bit about the problematic packs/positions, if I remember correctly, they only contained digits. But, as you said, let's just have a better overall automation. I'm going to change this.

Re: "Nice position names" only removes leading 1s and 2s

Posted: Tue 12. Jan 2016, 14:26
by ok666
Prototype:
wordlist.png