Lingua::LangId::Object - language guesser: generic objects


(Back to Top)


NAME

Lingua::LangId::Object - language guesser: generic objects

(Back to Top)


SYNOPSIS

 ##========================================================================
 ## PRELIMINARIES
 
 use Lingua::LangId::Object;
 
 ##========================================================================
 ## Constructors etc.
 
 $obj = $CLASS_OR_OBJ->new(%opts);
 @noShadowKeys = $obj->noShadowKeys();
 $obj2 = $obj->shadow(%opts);
 $obj2 = $obj->clone();
 
 ##========================================================================
 ## Methods: I/O
 
 $bool = $obj->saveBinFile($filename_or_fh);
 $str = $obj->saveBinString();
 $bool = $CLASS_OR_OBJECT->loadBinFile($filename_or_fh);
 $str = $CLASS_OR_OBJECT->loadBinString($str);
 $bool = $obj->saveTextFile($filename_or_fh);
 $str = $obj->saveTextString();
 $bool = $CLASS_OR_OBJECT->loadTextFile($filename_or_fh);
 $str = $CLASS_OR_OBJECT->loadTextString($str);

(Back to Top)


DESCRIPTION

Constructors etc.

new
 $obj = $CLASS_OR_OBJ->new(%opts);

Returns new object as hash-ref.

noShadowKeys
 @noShadowKeys = $obj->noShadowKeys();

Returns list of keys not to be passed to $CLASS->new() on shadow(). Default just returns empty list

shadow
 $obj2 = $obj->shadow(%opts);

Returns new object identical to $obj, overriding %opts.

clone
 $obj2 = $obj->clone();

Object cloning utility using Storable::dclone.

Methods: I/O

saveBinFile
 $bool = $obj->saveBinFile($filename_or_fh);

Save object to a binary file or handle using Storable module.

saveBinString
 $str = $obj->saveBinString();

Save object to a binary string.

loadBinFile
 $bool = $CLASS_OR_OBJECT->loadBinFile($filename_or_fh);

Load object from a binary file or handle.

loadBinString
 $str = $CLASS_OR_OBJECT->loadBinString($str);

Load object form a binary string.

saveTextFile
 $bool = $obj->saveTextFile($filename_or_fh);

Save object to a text file or handle. Not supported by all subclasses.

Dummy method, override to make available for a new subclass.

saveTextString
 $str = $obj->saveTextString();

Save object to a text string. Not supported by all subclasses.

loadTextFile
 $bool = $CLASS_OR_OBJECT->loadTextFile($filename_or_fh);

Load object from a text file or handle. Not supported by all subclasses.

Dummy method, override to make available for a new subclass.

loadTextString
 $str = $CLASS_OR_OBJECT->loadTextString($str);

Load object from text string.

(Back to Top)


SEE ALSO

Lingua::LangId(3pm)

(Back to Top)


AUTHOR

Bryan Jurish <jurish@uni-potsdam.de>

(Back to Top)


COPYRIGHT AND LICENSE

Copyright (C) 2009 by Bryan Jurish

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

(Back to Top)

 Lingua::LangId::Object - language guesser: generic objects