rickysarraf / foxreplace

Automatically exported from code.google.com/p/foxreplace
0 stars 0 forks source link

Keep case #82

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I was thinking of two things that I'd like to request.

First: (This might be a little tough)

While setting the substitutions, I have to write the different case styles 
manually for each word, Example:

To replace 'johnny brown' with 'jack garner' while keeping the proper case 
style we'd have to insert the following with "match case" selected:

johnny brown (lower case)    -> jack garner
JOHNNY BROWN (ALL CAPS)      -> JACK GARNER
Johnny Brown (Title Case)    -> Jack Garner
Johnny brown (Sentence case) -> Jack garner

You already have the "match case" checkbox which helps match the substitution 
to the proper casing... but then we have to put in the substitutions manually 
as many times as the number of cases in order to keep the proper casing (as 
shown above).

Can you add another "keep case" checkbox so that we only have to write the term 
(in any case form) and the program automatically converts it to the source 
case? Example:

johnny brown (input) -> search found: Johnny brown -> Sentence case detected -> 
converted 'jack garner' to 'Jack garner' (Sentence case) -> replaced

Ah! Please note: You might have to make it radio button instead of checkbox, 
since match case and keep case would work against each other. Or something like 
that. These two can't be active together.

(Also: You might want to check out "Métamorphose file -n- folder renamer", 
they have a similar system implemented that allows them to rename whole file 
names as well as specific portions of the names using basic search and reg-ex 
search with user specified case types. Maybe they might help you out, or the 
experience with their renamer could inspire you in some way. 
http://en.wikipedia.org/wiki/Metamorphose_%28renamer%29)

If you can manage this then FoxReplace would  get a big level up in terms of 
replacement.

Second: (This one should be easier)

Can you make it so that the "filters" in the Fox replace options can be 
separately "enabled" or "disabled"?

That way if we want we could disable filters we don't want to be active but at 
the same time don't want to delete as well (it takes a lot of time to re-input 
the filters y'know).

Finally. Thanks for the awesome program. I really use it a lot and it really 
helps me manage a lot of tedious stuff.

Original issue reported on code.google.com by jedi200...@gmail.com on 21 Aug 2012 at 11:27

GoogleCodeExporter commented 9 years ago
Hi, thank you for your suggestions. The second one is already suggested in 
issue 33 as I understand it, so I changed the title to reflect the first 
request only. As you say, it seams hard at first glance, but I will look at how 
Métamorphose does it.

Original comment by marc.r...@gmail.com on 21 Aug 2012 at 3:04

GoogleCodeExporter commented 9 years ago
A note of importance. Metamorphose has two versions:

The stable version 1.

And the beta stage under development version 2.

Version 1 has the change case feature for sure as far as I know, I haven't used 
the beta v2.

Original comment by jedi200...@gmail.com on 22 Aug 2012 at 6:29

GoogleCodeExporter commented 9 years ago
As for the second. To be more precise:

I meant enable/disable feature (checkbox?) for the filter "groups" that are 
showed in the options window. Not after opening a group and clicking on the 
substitutions tab.

Though enable/disable for both would be even better.

Original comment by jedi200...@gmail.com on 22 Aug 2012 at 6:36

GoogleCodeExporter commented 9 years ago
V2 has "change case" too, but I don't see "keep case", i.e. detection of 
current case and applying it to the output.

And for the second one, that's what I understood ;)

Original comment by marc.r...@gmail.com on 22 Aug 2012 at 10:59

GoogleCodeExporter commented 9 years ago
Yes that is true. It doesn't have the system of "detecting" the case but it 
does have the system of "changing" the case. You can use that to change the 
substitution term's case. All you have to do is detect the type of case. 
Perhaps by using regex or something. Sorry but the detecting thing is a little 
troublesome for me too. Or... wait a minute... THAT'S IT. EUREKA!!!!

I have an idea. Look... in order to replace the term in the current system I 
have to write the rules a multiple number of times with minor variations as 
shown above, right? So how about using the "change" function on the SEARCH term 
as well as the REPLACE term and searching and replacing via that method?

For example:

The user places a rule for searching for 'johnny brown' and replacing with 
'jack garner' and checks the 'keep case'.

The system converts both terms to each case seaperately and goes through the 
whole page searching for thevterm with the matching case and replaces them with 
the converted replacement term.

ie:
search term = johnny brown
replacement term = jack garner
'keep case' selected

Convert both to lower case, just to be sure, and run search and replace:
johnny brown (match case) -> jack garner

Convert both to ALL CAPS, and run search and replace:
JOHNNY BROWN (match case) -> JACK GARNER

Convert both to Title Case, and run search and replace:
Johnny Brown (match case) -> Jack Garner

Convert both to Sentence case, and run search and replace:
Johnny brown (match case) -> Jack garner

In essence, the system does the work of allocating temporary search and replace 
rules, derived from the user input search and replace rule. A bit tedious but 
it's simple, no? Or you could figure out some way to detect via regex, but that 
would be harder.

Original comment by jedi200...@gmail.com on 23 Aug 2012 at 4:34

GoogleCodeExporter commented 9 years ago
Although irregular terms like JOhnnY BRowN would be a problem.

Original comment by jedi200...@gmail.com on 23 Aug 2012 at 4:37

GoogleCodeExporter commented 9 years ago
Maybe those could be ignored or replaced, if it matches with the default search 
and replace values. An infotip note saying 'keep case' will only change [these, 
these and these] cases.

Original comment by jedi200...@gmail.com on 23 Aug 2012 at 5:30

GoogleCodeExporter commented 9 years ago
Good idea :) Thank you!

Original comment by marc.r...@gmail.com on 24 Aug 2012 at 3:19

GoogleCodeExporter commented 9 years ago
You're welcome. Though my method is an extremely simple one. Perhaps later you 
could improve it in some way.

Original comment by jedi200...@gmail.com on 24 Aug 2012 at 3:22

GoogleCodeExporter commented 9 years ago
So what's the progress on this?

Original comment by jedi200...@gmail.com on 6 Dec 2012 at 5:12

GoogleCodeExporter commented 9 years ago
And when's the next official upgrade planned to occur?

Original comment by jedi200...@gmail.com on 6 Dec 2012 at 5:14

GoogleCodeExporter commented 9 years ago
Still haven't started on this one, but I would like to release a new version 
this month.

Original comment by marc.r...@gmail.com on 6 Dec 2012 at 1:20

GoogleCodeExporter commented 9 years ago
I'm looking forward to it.

Original comment by jedi200...@gmail.com on 23 Dec 2012 at 4:50

GoogleCodeExporter commented 9 years ago
To convert to lowercase or uppercase you can use the code explained in the link 
below:
http://www.hscripts.com/tutorials/javascript/string-case-converting.php

For Title Case you can use this:
http://stackoverflow.com/questions/196972/convert-string-to-title-case-with-java
script

For Sentence case:
http://www.javascriptsource.com/forms/sentence-case.html

Please please implement this. I really need it.

Original comment by jedi200...@gmail.com on 13 Mar 2013 at 6:43

GoogleCodeExporter commented 9 years ago
Thank you for the links, I will implement it when I can.

Original comment by marc.r...@gmail.com on 14 Mar 2013 at 3:56

GoogleCodeExporter commented 9 years ago
Has this been fixed yet? I can't seem to find this feature in the latest 
release v0.16.1... and it's been exactly 2 years since the last comment here.

Is it fixed in the beta (if there is one)? If so, where can I find it?

Original comment by dammy...@gmail.com on 14 Mar 2015 at 8:04

GoogleCodeExporter commented 9 years ago
It's not implemented yet, sorry. There have been issues with higher priority.

Original comment by marc.r...@gmail.com on 14 Mar 2015 at 2:59