#1 2009-02-08 11:09

narayan
Senior Member
Registered: 2009-02-08
Posts: 470

Provide a case-conversion rule

Certain words are always used with a pre-defined case.

For example,
1. Some words are instantly recognizable in ALLCAPS. (e.g. XML, C++, FM, UN, USA, NASA)
2. Proper names begin with a capitalized name (e.g. Russia, Java, Eclipse, Sun, Microsoft)

ReNamer could have a feature where such words are defined, and their preferred case is also defined. ReNamer should have an option to find and replace such words with proper case.

Normally, the rule would be applicable only if these are whole words, not where the string is part of another word (for example, the word "sundry" has "Sun" in it, but cannot be capitalized). But then the final judgment should be left to the user.

Last edited by narayan (2009-02-08 11:16)

Offline

#2 2009-02-08 15:22

prologician
Member
Registered: 2009-01-30
Posts: 84

Re: Provide a case-conversion rule

How is this fundamentally different from using a Case rule? It seems like what you're describing falls into this a lot. (At least, if you are dealing with proper titles, you want most words capitalized, with a few either all-lowercase or all-capitals. But those special cases can be handled manually.)

And if you're asking for to ONLY capitalize special words, that feels a lot like a dictionary-based thing. Perhaps take a look at this thread to give ideas as to how it might be done.

Offline

#3 2009-02-08 15:37

eR@SeR
Senior Member
From: Земун, Србија
Registered: 2008-01-23
Posts: 353

Re: Provide a case-conversion rule

narayan wrote:

ReNamer could have a feature where such words are defined, and their preferred case is also defined. ReNamer should have an option to find and replace such words with proper case.

First of all did you notice "Force Case for fragments:" in Case rule to do your actions?
If you want to be defined/included in ReNamer itself then I don't know whether will be accepted since someone don't want to use pre-defined cases and like prologician said it could be dictionary-based detection. Author (Denis) gave you "Force Case for fragments:" option to type those that YOU need. For that you have Preset option to run your own rules and use them everytime you need. I have these ones "CD DVD DJ MC BMW DMX TV" pre-defined.

narayan wrote:

Normally, the rule would be applicable only if these are whole words...

I discovered that and posted it here but I think that I emphasized wrong so I'll try to give more clear examples:

Added: Capitalize every word (skip extension), Force case fragments "DJ" "TV"

Modjo - Chillin'.mp3 ---> MoDJo - Chillin'.mp3
Formis & Kleins - Dzlesma Par Laimi (Latvia).mp3 ---> Formis & Kleins - Dzlesma Par Laimi (LaTVia).mp3
L. Agutin & A. Varum - Vse V Tvoih Rukah.mp3 ---> L. Agutin & A. Varum - Vse V TVoih Rukah.mp3

This is really important since I have too many Serbian words having DJ & TV in them: Rodjendan, Dodji, Andjeo, Odjednom... & Tvog, Tvoj, Stvar, Cetvrta, Neverstvo...
I hope that Denis will change this behaviour roll


TRUTH, FREEDOM, JUSTICE and FATHERLAND are the highest morale values which human is born, lives and dies for!

Offline

#4 2009-02-08 16:09

narayan
Senior Member
Registered: 2009-02-08
Posts: 470

Re: Provide a case-conversion rule

Yes, it actually IS a dictionary-type "find and replace" rule. It applies to specific words.

The algorithm is like this:

Basic requirement:
There are two lists-
List-1: All words to be turned ALLCAPS
List-2: All words to capitalize only first letter.

Then each time the rule works like this:
ReNamer scans the selected files.
* If they have a whole word from List-1, it changes its case to ALLCAPS.
* If they have  a whole word from List-2, it changes its case to small first, and then capitalizes only the first letter.

******
How to manage the lists:

Although each user can make his own list, this list can be collaboratively created by users at this forum. (I can start off with a list.)

********
Your link shows a possibility, but I am not clear what exactly to do. What is the required syntax of the command, and how to apply it? I need a template (pattern) for this, which can be repeated for all the words.

I imagine the trick is to make a text file and then tell ReNamer to use it. If so, what is the required structure of that file, including header and structure of each replacement record? And then how to tell ReNamer to use it?

The User Manual is not detailed enough for this task.  I also do not want to study PascalScript for this. Can someone provide the framework?

Thanks!

Last edited by narayan (2009-02-08 16:22)

Offline

#5 2009-02-08 16:31

narayan
Senior Member
Registered: 2009-02-08
Posts: 470

Re: Provide a case-conversion rule

eR@SeR
Fragment won't be useful in this context... We need to change the case of specific WHOLE words; not parts of it. Otherwise ReNamer will go on changing the cases mindlessly. Besides, the list would be fairly large (may be 100 words for average user). We do not aim to cover every conceivable word- Just the most common words. So, depending on the user's field of work, he will have a different list.

Offline

#6 2009-02-08 17:30

Andrew
Senior Member
Registered: 2008-05-22
Posts: 542

Re: Provide a case-conversion rule

Try looking at this thread to see if the PascalScript Denis has already written helps you... I think it should work in this case (no pun intended! wink) as well.

http://www.den4b.com/forum/viewtopic.php?id=507

Offline

#7 2009-02-08 17:47

eR@SeR
Senior Member
From: Земун, Србија
Registered: 2008-01-23
Posts: 353

Re: Provide a case-conversion rule

narayan wrote:

Fragment won't be useful in this context... We need to change the case of specific WHOLE words; not parts of it. Otherwise ReNamer will go on changing the cases mindlessly. Besides, the list would be fairly large (may be 100 words for average user).

Yes you right and that's what I'm talking about. That will be possible if only Denis change the behaviour for examples that I posted and will be valid for yours too.
Mine examples are, let me say, "abbreviated" one, but your and any other can be feasible too, since it will be interpreted as WHOLE words. I hope that you understood me?
BUT now I know that mine suggestion will not be good solution since it wouldn't be practic to add into "Force Case for fragments:" +100 words.
So you confirmed that is dictionary-based detection and I agree with that wink
Andrew's solution might help if not, then someone have to create a Pasal script to solve your issue because I don't know sad


TRUTH, FREEDOM, JUSTICE and FATHERLAND are the highest morale values which human is born, lives and dies for!

Offline

#8 2009-02-08 18:15

narayan
Senior Member
Registered: 2009-02-08
Posts: 470

Re: Provide a case-conversion rule

Well, the word "dictionary-based" may have different meanings for different people. For example, many abbreviations are not included in most dictionaries. So what would  happen if the desired word is NOT included in a dictionary? Would it be processed in ReNamer?

Secondly, where do we get the dictionary from? I have a vague idea that Aspell has some plug-in dictionaries in all major languages of the world. But I would not know in what format those words are; or how to fit them in ReNamer. Further, the original Aspell dictionary may NOT be case-sensitive. So whether they can be used for this purpose???

********
In the other thread, you were trying to apply Fregment rule. Someone else was trying to use the Translit rule. I think both methods won't work for this purpose.

BTW this request is quite different from the spell-check. While a spell-check would replace the mis-spelled word, I want to retain the original word, but only change its case.

But I have a feeling that Denis may be able to implement both these ideas in one stroke using the Aspell plugin, by applying slightly different logic for each rule.

Last edited by narayan (2009-02-09 18:21)

Offline

#9 2009-02-10 00:26

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,375

Re: Provide a case-conversion rule

ReNamer Beta from 9 Feb 2009:
* Fragments in the Case rule are replaced as Whole Words only.

But if you have 100+ words dictinary, you might be better off using that script.

Offline

#10 2009-02-10 01:58

narayan
Senior Member
Registered: 2009-02-08
Posts: 470

Re: Provide a case-conversion rule

But if you have 100+ words dictinary, you might be better off using that script.

I'll take your word for it. You are the boss!

But the million-dollar question is, HOW??

BTW this request is quite different from the spell-check. While a spell-check would replace the mis-spelled word, I want to retain the original word, but only change its case.

So I guess the original script (from the other thread) will not work for me directly.

To be frank I cannot modify the original script on my own. I will definitely need some help here.

Can someone provide the following?
(a) the file's header
(b) the commands needed, and
(c) just one sample of the case-conversion?

I can then carry on and add my own words (or maybe use Aspell dictionary directly or with some modifications).

After that text file is ready, the next problem for me is how to integrate that file with ReNamer. I will need some clarity in that too. For example, how to name that file, where to keep it, and how to call it inside the ReNamer (or would ReNamer automatically sense it when we start it the next time and add it to the rules?)

Thanks in advance!

Last edited by narayan (2009-02-10 02:03)

Offline

Board footer

Powered by FluxBB