Exceptions from Replace Method

Advanced Renamer forum
#1 : 21/04-12 01:24
Matthias
Matthias
Posts: 3
Hi Kim, I like ARen very much. But now I have to ask you a question:

I want to replace ue by ü (eg german "fuer" > "für")
BUT NOT every phrase (eg german Feuer shall remain Feuer, not turn to Feür).

Is there any solution? Can I write a list of exceptions manually possibly, or is there any better method?

Thx, frasier





21/04-12 01:24
#2 : 23/04-12 09:03
Kim Jensen
Kim Jensen
Administrator
Posts: 871
Reply to #1:
Hmm that will be tricky. To be able to make a bullet proof rule you will need to set up a consitent rule. My little knowledge about the german language tells me that there can be many exceptions to the german grammer rules. If you know of a concrete rule for when ue should be changed to ü, I can help make a regular expression for using this rule.

Some times it is easier to make a white list. A list of all the words that should be replaced.


23/04-12 09:03
#3 : 18/05-12 18:39
Matthias
Matthias
Posts: 3
Reply to #2:

Hi Kim,

did you mean it like this:

My German Grammar Rules:

There are most probably n o words with an ü after:
a,c,e,i,o,p,q,ß,u,v,x,y.

There a r e words with an ü after:
b,d,f,g,h,j,k,l,m,n,r,s,t,w,z.

There are most probably n o words with an ue after:
b,c,f,h,i,j,k,l,m,n,o,p,u,v,w,x,y.

There a r e words with an ue after:
a (Auerhahn), d (Duell), e (Feuer), g (spanish guerilla or french/english vogue), q (quer), r (french rue), s (Sue = name), z (zuerst).


That means:

aue, eue, que:
remain.

due, gue, sue, zue:
turn into: dü, gü, sü, zü
OR
remain if it is Duell/duel, guerilla/vogue, Sue (name) or zuerst (first).

All other (bue,due,fue,gue,hue,jue,kue,lue,mue,nue,rue,sue,tue,wue,zue):
turn into bü,dü,fü,gü,hü,jü,kü,lü,mü,nü,rü,sü,tü,wü,zü.


xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


There are most probably n o words with an ü before:
a,e,i,j,o,q,u,w,y,z.

There a r e words with an ü before:
b,c,d,f,g,h,k,l,m,n,p,r,s,ß,t,v,x.

There are most probably n o words with an ue before:
a,b,c,d,e,g,h,i,j,k,m,n,o,p,q,s,ß,u,v,w,x,y.

There a r e words with an ue before:
f, l, r, t, z.


That means:

uez:
remains.

uef, uel, uet:
turn into üf, ül, üt (most probably)
OR
remain if it is UEFA (soccer), Duell/duel, Duett/duet.

uer:
There are some german words with uer OR with ür:
Bürde,
Dürer (painter),
Feuer - für,
neuer/teuer/Abenteuer,
Gürtel,
heuer (öst.) - Hürde/Hürden/Hürdenlauf,
Jürgen (name),
Kür/kürzen/kürzer/Kürzung/abkürzen/Abkürzung,
mürbe,
Nürnberg/Nürburg (names),
Puerto,
quer,
Rürup (name),
Tür,
Würde/Würdenträger/würde/würdest/würden/würdet,
zuerst,
may be some more ... Here may help a black / white list?

All other
(ueb,uec,ued,ueg,ueh,uek,uem,uen,uep,uer,ues,ueß,uev,uex):
turn into: üb,üc,üd,üg,üh,ük,üm,ün,üp,ür,üs,üß,üv,üx.


These are my german grammar rules. Can you try and put them into a method? If you succeed, I can do this for ä and ö as well.

Thank you very much so far!

frasier


18/05-12 18:39
#4 : 27/05-12 23:00
Kim Jensen
Kim Jensen
Administrator
Posts: 871
Reply to #3:
I don't think I will implement a dedicated method for this rule. It is very specific for a narrow group of users. This doesn't mean that this is a bad idea and there are many German users of AR and many of these will find this method useful.
The next version of AR with full unicode support is on its way to be released. After this release I am planning to add scripting support to the software. This means that people with small programming skills can extend Advanced Renamer with new custom methods. I think this method might be a good candidate for the first script. I hope for the scripts to be downloadable from the website and that users will collaborate in making the scripts better.


27/05-12 23:00
#5 : 29/05-12 14:50
Matthias
Matthias
Posts: 3
Reply to #4:
I don't really know what scripts are, but AR works fine for me anyway. You are right saying the effort has to be worth it. Thanks a lot.


29/05-12 14:50
#6 : 29/05-12 22:47
Kim Jensen
Kim Jensen
Administrator
Posts: 871
Reply to #5:
A script is a little piece of software that can extend a program, like Advanced Renamer. This script might not be part of the original download package but instead be made available by other users of the software and distributed freely on the Internet.


29/05-12 22:47