NAME
WE::DB::Glossary - glossary data database.
SYNOPSIS
my $u = WE::DB::Glossary->new(undef, $glossary_db_file, %args);
$u->add_entry(Keyword => ..., Description => ...);
$glossary_obj = $u->get_entry($keyword);
DESCRIPTION
Database for administration of glossary entries. You can add, delete, modify and retrieve glossary entries.
WE::GlossaryObj
The glossary entries are WE::GlossaryObj
objects with the following members:
- Keyword
-
The keyword for this entry. The keyword is also used as the key in the database hash.
- Description
-
The descriptive text for this keyword. The value is opaque and may be language-dependent (e.g. by using WE::Util::LangString), HTML or plain text or whatever.
METHODS
The following methods are defined for WE::DB::Glossary
:
- add_entry(Keyword => ..., Description => ..., -force => 1)
-
Add a glossary object with Keyword and Description. If
-force
is set to true, then existing entries will get overwritten, otherwise an exception will be raised. - add_entry($glossaryobj, -force => 1)
-
Like the other add_entry() method, but use a pre-build
WE::GlossaryObj
object instead. - delete_entry($keyword)
-
Delete the named entry.
- get_entry($keyword)
-
Get a
WE::GlossaryObj
object for the specified $keyword or undef. - get_descr($keyword)
-
Retrieve the description element for the specified $keyword or undef.
- search($regex)
-
Return a list of
WE::GlossaryObj
s which keywords match the given regular expression. NYI. - all_keywords_regex([$filter])
-
Create a regular expression with all keywords used in the database. The $filter is optional and should be a code reference accepting the keyword as first parameter and return a boolean value for acceptance.
AUTHORS
Slaven Rezic - slaven@rezic.de