Common uses of phrasebooks are in handling error codes, accessing databases
via SQL queries and written language phrases. Examples are the mime.types
file and the hosts file, both of which use a simple phrasebook design.

Unfortunately Class::Phrasebook is a complete work and not a true class
based framework. If you cant install XML libraries, you cannot use it.
This distribution is a collaboration between Iain Truskett and myself to
create an extendable and class based framework for implementing phrasebooks.

In creating a phrasebook object, a class type is required. This class defines
the nature of the phrasebook or the behaviours associated with it. Currently
there are two classes, Plain and SQL.

The Plain class is the default class, and allows retrieval of phrases via the
fetch() method. The fetch() simply returns the phrase that maps to the given
keyword.

The SQL class allows specific database handling. Phrases are retrieved via the
query() method. The query() method internally retrieves the SQL phrase, then
returns the statement handler object, which the user can then perform a
prepare/execute/fetch/finish sequence on. For more details see
Data::Phrasebook::SQL.

This should allow you some flexibility in what sort of classes
you use while not having you type too much.

For other parameters, see the specific class you wish to instantiate.
The class argument is removed from the arguments list and the new
method of the specified class is called with the remaining arguments.

Data::Phrasebook supports the use of dictionaries. See the specific Loader
module to see how to implement the dictionary within your phrasebook. Using
Data::Phrasebook::Loader::Ini as an example, the dictionary might be laid out
as:

The former is from the default (first) dictionary, and the second is from the
named dictionary (Nonsense). If a phrase is not found in the named dictionary
an attempt is made to find it in the default dictionary. Otherwise undef will
be returned.

Once a dictionary or file is specified, changing either requires reloading. As
this is done at the loader stage, we need to let it know what it needs to
reload. This can be done with the either (or both) of the following:

$q->file(phrases2.ini);
$q->dict(Stuff);

A subsequent fetch() will then reload the file and dictionary, before
retrieving the phrase required. However, a reload only takes place if both the
file and the dictionary passed are not the ones currently loaded.

As of version 0.25, the ability to provide prescendence over multiple
dictionaries for the same phrasebook. Using Data::Phrasebook::Loader::Ini
again as an example, the phrasebook might be laid out as:

Much of the code for the original class framework is from Iains original code.
My code was much simpler and was tied to using just an INI data source. Merging
all the ideas and code together we came up with this distribution.

Unfortunately Iain died in December 2003, so he never got to see or play
with the final working version. I can only thank him for his thoughts and
ideas in getting this distribution into a state worthy of release.