NAME
Math::OEIS::Names - read the OEIS names file
SYNOPSIS
my $name = Math::OEIS::Names->anum_to_name('A123456');
DESCRIPTION
This is an interface to the OEIS names file
~/OEIS/names
downloaded and gunzipped from
The names file lists each A-number and its name. The name is a single line description, perhaps a slightly long line.
The names file is sorted by A-number so the anum_to_name() lookup is a text file binary search (currently implemented with Search::Dict).
FUNCTIONS
$name = Math::OEIS::Names->anum_to_name($anum)-
For a given
$anumstring such as "A000001" return the sequence name as a string, or if not found then returnundef.The returned
$namemay contain non-ASCII characters. In Perl 5.8 and higher they're returned as Perl wide chars. In earlier Perl$nameis the native encoding of the names file (which is UTF-8). Math::OEIS::Names->close()-
Close the names file, if not already closed.
Oopery
$obj = Math::OEIS::Names->new (key => value, ...)-
Create and return a new
Math::OEIS::Namesobject to read an OEIS "names" file. The optional key/value parameters arefilename => $filename default ~/OEIS/names fh => $filehandleThe default filename is ~/OEIS/names, or other directory per Math::OEIS->local_directories() . A different filename can be given or an open filehandle. When a file handle is given the
filenamemay be used for diagnostics and so can be helpfully given too. $name = $obj->anum_to_name($anum)-
For a given
$anumstring such as "A000001" return the sequence name as a string, or if not found then returnundef. $filename = $obj->filename()-
Return the names filename from a given
$objobject. This is thefilenameparameter if given, ordefault_filename()otherwise. $filename = Math::OEIS::Names->default_filename()$filename = $obj->default_filename()-
Return the default filename which is used if no
filenameorfhoption is given.default_filename()can be called either as a class method or object method. $obj->close()-
Close the file handle, if not already closed.
SEE ALSO
Math::OEIS, Math::OEIS::Stripped
OEIS files page http://oeis.org/allfiles.html
HOME PAGE
http://user42.tuxfamily.org/math-oeis/index.html
LICENSE
Copyright 2010, 2011, 2012, 2013, 2014 Kevin Ryde
Math-OEIS 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 3, or (at your option) any later version.
Math-OEIS 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 Math-OEIS. If not, see http://www.gnu.org/licenses/.