NAME
Chatbot::Alpha::Sort - Alphabetic sorting for Chatbot::Alpha documents.
SYNOPSIS
use Chatbot::Alpha::Sort;
# Create a new sorter.
my $sort = new Chatbot::Alpha::Sort();
# Sort your files.
$sort->start (
dir => './before',
out => './after',
ext => 'cba',
);
DESCRIPTION
Chatbot::Alpha::Sort can take your numerous unsorted Alpha documents, and create nicely formatted documents from A.cba to Z.cba with triggers sorted alphabetically within each document.
METHODS
new (ARGUMENTS)
Creates a new Chatbot::Alpha::Sort object. You should only need one object, since each sort request creates its own Chatbot::Alpha, unless you intend to run multiple sorts at the same time.
Returns a Chatbot::Alpha::Sort instance.
version
Returns the version number of the module.
start (ARGUMENTS)
Starts the sorting process. ARGUMENTS is a hash that you must pass in to tell the module how to do things. The arguments are as follows:
dir => DIRECTORY
The directory at which your original Alpha documents
can be found. Defaults to CWD.
out => DIRECTORY
Another directory for which your newly formatted Alpha
documents will be written to. Defaults to CWD.
ext => EXTENSION
The file extension of your Alpha documents. Defaults
to cba
files => SORT_TYPE
The sorting method for which your new files will be sorted.
See below for the sort types.
SORT TYPES (FILES)
alpha Sorts the files alphabetically. Will create files "A.cba" through "Z.cba", as well as "star.cba" and "other.cba", and a "topics.cba" to keep all topics together. Triggers within each file are sorted alphabetically.
intact Keeps your original filename structure intact; only sorts triggers alphabetically within each file (topics go to the top of the file's contents).
single Takes ALL your Alpha documents and merges them into one single file. Will write the finished file to "sorted.cba" in the OUT directory. Topics are written first.
CHANGES
Version 0.2
- Added sorting with "keep filenames intact" as well as "single filename"
Version 0.1
- Initial release.
SEE ALSO
KNOWN BUGS
No bugs have been discovered at this time.
AUTHOR
Cerone J. Kirsle, cjkirsle "@" aichaos.com
COPYRIGHT AND LICENSE
Chatbot::Alpha - A simple chatterbot brain.
Copyright (C) 2005 Cerone J. Kirsle
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA