Casing Exceptions


#1

In mp3tag is there a way to table exceptions to the "Mixed Case" routine? I have another program that has a plain-text exception file that can be applied to words a mixed-case routine might mess up such as:

a
ABBA
an
and
are
as
at
but
by
de
for
in
mp3
McGee
nor
of
OK
on
or
the
to
TV
USA
USSR
while
with

... but it is weak when dealing with mp3 tags, so I use it for other filetypes and casing only. Title casing in English is probably more complicated than in German where all nouns are capitalized anyway. Title casing in English is like our spelling--many rules and exceptions to rules. Here's a sample from a Canadian website:

Writer's Block - Writing Tips - Capitalization in Titles


#2

Rijkstra,

you can add all these exceptions as replace actions in an extra action group and run this action group after the actual case conversion.

~ Florian


#3

That's quite a job when there are a lot of patterns involved. Is there any way to import all the actions needed or must they be all done by hand?


#4

P.S. I wrote an Access query to create an MTA file that looks like this:

MTA

"[#0]
T=2
F=_ALL
1=(Ep)
2=(EP)
3=1
"
"[#1]
T=2
F=_ALL
1=(Lp)
2=(LP)
3=1
"
"[#2]
T=2
F=_ALL
1=2Pac
2=2PAC
3=1
"
"[#3]
T=2
F=_ALL
1=A
2=a
3=1
"

That's as close as Access gets without writing a VBA module, so I need to clean up the unwanted quotes in MS Word. Is there a way to change the case of a RegEx replacement string? There's a need for that to force uppercasing at the beginning of a line.


#5

You can use someting like $caps("$0") at Replace matches with.

~ Florian


#6

Does that mean I need to escape the parens in the first two lines of my sample? Which other characters need to be escaped and what is the reason for it?


#7

Yes, that's because it's a regular expression and non-literal charcters have to be masked out.


#8

Actually, no in the case of my generated files which are simple replaces by whole word. I successfully created the file with 60 words and growing. I decided to do the RegEx replacements by hand as they are very few and quite unique.

In the process I discovered a bug. The action dialog will pick up a .TXT file and display it blank at the end of the list. I moved the .TXT file out of the \actions\ directory and the problem went away.


#9
QUOTE (Rijkstra @ Feb 21 2004, 11:45 PM)

Actually, no in the case of my generated files which are simple replaces by whole word. I successfully created the file with 60 words and growing. I decided to do the RegEx replacements by hand as they are very few and quite unique.


If you don't use a regular expression in the Replace matches with you don't need to mask anything.

I'll restict the displayed files to the .mta extension to the next release. Thanks for reporting.

~ Florian