The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Moot::Waste::Lexicon - libmoot : WASTE tokenizer : simple word-list lexicon

SYNOPSIS

 use Moot::Waste;

 ##=====================================================================
 ## Moot::Waste::Lexicon

 $lexer = Moot::Waste::Lexer->new();   ##-- parent lexer object
 $lex = $lexer->abbrevs();             ##-- embedded lexicon
 $lex = $lexer->stopwords();           ##-- embedded lexicon
 $lex = $lexer->conjunctions();        ##-- embedded lexicon

 ##---------------------------------------------------------------------
 ## Basic Access

 $lex->clear();			##-- delete all entries
 $lex->insert($str);			##-- insert a string
 $n    = $lex->size();			##-- get number of entries
 $bool = $lex->lookup($str);		##-- check for membership

 ##---------------------------------------------------------------------
 ## I/O

 $lex->load($reader);			##-- load from Moot::TokenReader object
 $lex->load($filename);		##-- load from named file (1 word/line)
 $lex->load($fh);			##-- load from filehandle (1 word/line)

 ##---------------------------------------------------------------------
 ## Batch Import/Export

 $lex   = $lex->from_array(\@words);	##-- load from perl array
 $words = $lex->to_array($isutf8=0);	##-- dump to perl array

DESCRIPTION

The Moot::Waste::Lexicon module provides an object-oriented interface to the simple word-list lexica used by the WASTE tokenization system. It can ONLY be accessed by means of an embedding Moot::Waste::Lexer.

SEE ALSO

Moot(3perl), Moot::Waste(3perl), Moot::Waste::Lexer(3perl), waste(1), perl(1).

AUTHOR

Bryan Jurish <moocow@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2013 by Bryan Jurish

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.