#1 2008-08-15 12:12

SafetyCar
Senior Member
Registered: 2008-04-28
Posts: 446
Website

A kind of manual dictionary function

I'm not sure if this will be posible but here it goes.

I'll try to be simple

Imagine that I have a text file with names like this

DeviantART
Jennifer Lopez
...

It's any way to compare the the names and for example

Deviant ART > DeviantART
deviant art > DeviantART
deviantart > DeviantART

or

jenniferlopez > Jennifer Lopez
jen n ifer lop e z > Jennifer Lopez

(maybe the key is the a-z characters)


This maybe crazy but... who knows... and I think it would be a nice project to be in the default pascal scripts.

There's no hurry (and maybe neither the posibilty of doing it lol)


If this software has helped you, consider getting your pro version. :)

Offline

#2 2008-08-15 18:12

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

Re: A kind of manual dictionary function

Well, there is a function for string compare, which performs alphabetic comparison on the basis of ASCII (Unicode?) values...

Do you want to implement a different comparison method? What are the rules you suggest for doing so? If you can specify the rules, the script shouldn't be difficult. But leaving it ambiguous makes it difficult to know what exactly you want.

Offline

#3 2008-08-15 21:24

SafetyCar
Senior Member
Registered: 2008-04-28
Posts: 446
Website

Re: A kind of manual dictionary function

Andrew wrote:

Well, there is a function for string compare, which performs alphabetic comparison on the basis of ASCII (Unicode?) values...

Do you want to implement a different comparison method? What are the rules you suggest for doing so? If you can specify the rules, the script shouldn't be difficult. But leaving it ambiguous makes it difficult to know what exactly you want.

I don't undertand very well :S sad

I was thinking that, when adding a file to rename, a pascal would search on the diferent lines of the file text, to see if is any concidence even if ther are spaces or other simbols betwen the leters and if finds it, replace with the new one

About de comparison method I can't say anything sad

Sorry if I'm not expresing properly, my knowledge is limited


If this software has helped you, consider getting your pro version. :)

Offline

#4 2008-08-16 06:10

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

Re: A kind of manual dictionary function

SafetyCar wrote:

Deviant ART > DeviantART
deviant art > DeviantART
deviantart > DeviantART

or

jenniferlopez > Jennifer Lopez
jen n ifer lop e z > Jennifer Lopez

Ok, let's consider the above. When you say Word1 > Word2, what is the exact criteria? Is it only that words shouldn't have spaces in them? That's fine. But now you want some letters capitalised as well, such as only the "D" and the "ART" in "DeviantART". How is the script going to know what is the proper capitalisation for any word? Are you going to specify it for all words? Then you might as well rename manually!

SafetyCar wrote:

I was thinking that, when adding a file to rename, a pascal would search on the diferent lines of the file text, to see if is any concidence even if ther are spaces or other simbols betwen the leters and if finds it, replace with the new one.

If you don't want spaces then that should be possible. But are you sure there won't be any multiple words at all on a single line? If you're sure, then that makes it easier as all we have to do is remove spaces from every line. But looking at your own example above, it seems you don't want a space in "Deviant ART", but you want one in "Jennifer Lopez". How is the script going to know this?

Offline

#5 2008-08-16 08:01

krtek
Senior Member
From: Łódź (Poland)
Registered: 2008-02-21
Posts: 262

Re: A kind of manual dictionary function

I guess I know what SafetyCar need.
He wants the script to check for every given filename if there is something similar in given list (let's name that list "a dictionary"), and if so, to replace old string with the one from dictionary.
Quite a huge task for processor (increasing drammatically with increase of dictionary).
Or even worse, cause I have a feeling that SafetyCar doesn't want checking for whole filename, but for any part of filename, eg.
"1. jennifer l opez - a song" to become "1. Jennifer Lopez - a song"...


Regular Expressions are not as hard to understand as you may think. Check ReNamer's manual or nice Regular Expressions tutorial for more info and start to use full power of applications that use them (like ReNamer, Mp3Tag and so on).

Offline

#6 2008-08-16 14:22

SafetyCar
Senior Member
Registered: 2008-04-28
Posts: 446
Website

Re: A kind of manual dictionary function

That's it big_smile
And this was the part I was afraid of roll

krtek wrote:

Quite a huge task for processor (increasing drammatically with increase of dictionary).

Last edited by SafetyCar (2008-08-16 14:23)


If this software has helped you, consider getting your pro version. :)

Offline

#7 2008-08-17 14:23

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

Re: A kind of manual dictionary function

Well, there are dictionary files available out there, but as Konrad rightly pointed out, it's not a trivial job. You might as well search for some dedicated spell checkers/correction programs rather than try to create a script for this. Why reinvent the wheel unnecessarily, right? smile

Offline

#8 2008-08-17 19:31

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

Re: A kind of manual dictionary function

Yes, this can be done using PascalScript, and it shouldn't need huge processing power requirements like krtek have suggested tongue

The idea would be to process every dictionary entry (like "DeviantART" and "Jennifer Lopez") as a sequence of characters, but only alphabetic letters, ignore symbols and spaces. Then, in every filename try to find the exact same sequence of letters, also ignoring symbols and spaces, and remembering the starting and ending positions of those sequences in the filenames. If you get a match, you simply replace it with the correct entry from the dictionary.

I don't have much free time to write it, but it shouldn't be complicated.

Offline

#9 2008-08-19 17:57

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

Re: A kind of manual dictionary function

Well... I have mixed feelings re. this.

On one hand, a simple search and replace might not consume much processing power (depends if you want to read parts of the dictionary file into RAM first for speed), but it is certainly likely to take a lot of time, esp. if the file to be checked and the dictionary file are both huge (the latter generally will be). Also Denis, I'm pretty sure no dictionary will include words like "DeviantART" and "Jennifer Lopez"! wink Thus if the file to be checked doesn't consist only of proper English (or any other language) words, then it won't work.

Finally, stuff like this, while no doubt possible with PascalScript, doesn't sound to me as if it's all that useful for a renaming program. As I said, there are surely freeware/commercial spell-checkers available that'll do a far better job than what a hurriedly hacked together script can do. A Google search should throw up some names for sure.

Of course, if someone wants to spend time writing such a script, be my guest! tongue PascalScript gives you the power, it's up to you to decide how to use it and for what. (With great power comes great responsibility, after all! lol)

All the best! smile

Offline

#10 2008-08-19 19:43

SafetyCar
Senior Member
Registered: 2008-04-28
Posts: 446
Website

Re: A kind of manual dictionary function

I would try but I don't even know how to start :S


If this software has helped you, consider getting your pro version. :)

Offline

Board footer

Powered by FluxBB