[Added a page telling about the program flux@modeemi.fi**20090924194728] { addfile ./index.html hunk ./index.html 1 + + +
+So should it be called AGABFRT instead? AGABaFiReT? + +
Author: Erkki Seppälä <flux@modeemi.fi>, aka flux (on IRCNet, FreeNode). + +
Ganame is a small toy that turned out to have some slight + real-world usage potential also. The use case is this: you want to + rename a bunch of files with some pattern, but you don't know how + to express this pattern; perhaps you haven't yet mastered the Perl + regular expressions and the s//-operator, or a certain detail of + them has slipped your mind. Here Ganame comes into rescue: you + provide it a set of examples and it tries to figure out the + pattern in them. + +
Mind you, the pattern cannot be particularly complex, atleast + not at the moment. Basically spaces can be converted to + underscores and vice versa, the same with uppercase and lowercase, + and changes in case and a fixed set of separators can be + detected. + +
levenstein.ml originates from + Berke Durak's O'Caml software page and it is + apparently under Public Domain, although the page isn't quite + exact about it. + +
genepool.mli and + genepool.ml originate from + Alex + Rubinsteyn's GenePool which is licensed under LGPL v3. It is also + slightly modified to allow custom comparison of fitness. + +
To build it, you will + need O'Caml compiler + and ExtLib + (in Ubuntu apt-get install ocaml-nox libextlib-ocaml-dev). After that + you may run: + +
% ocamlbuild ganame.native+ +
You may install the binary with: + +
% sudo install ganame.native /usr/local/bin/ganame+ +
Or perhaps you want to install it to ~/bin instead. + +
% ganame IMG_1234.JPG=img_1234.JPG -- *.JPG+ +
In this instance and by luck in my test, this produced the following plan: + +
Until(Separator,MapCopy(Lowercase)),Until(Separator,Copy),Until(ChangeCase,Copy),Until(ChangeCase,Copy) + +
After running it (it will finish in at most 10 seconds), it + will first list the renames it would perform and then + interactively ask, if you wish to commit. If you just want to see + what kind of plan it would produce, you may omit the -- and the + file names. + + + }