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. The file should be downloaded and unzipped to ~/OEIS/names,
cd ~/OEIS
wget http://oeis.org/names.gz
gunzip names.gz
names is a very large file listing each A-number and the sequence name. The name is a single line description, perhaps a slightly long line.
The names file is sorted by A-number so anum_to_name()
is a text file binary search (currently implemented with Search::Dict).
Terms of use for the names file data can be found at (Creative Commons Attribution Non-Commercial 3.0, at the time of writing).
FUNCTIONS
$name = Math::OEIS::Names->anum_to_name($anum)
-
For a given
$anum
string such as "A000001" return the sequence name as a string, or if not found then returnundef
.The returned
$name
may contain non-ASCII characters. In Perl 5.8 up they're returned as Perl wide chars. In earlier Perl$name
is 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::Names
object to read an OEIS "names" file. The optional key/value parameters arefilename => $filename default ~/OEIS/names fh => $filehandle
The default filename is ~/OEIS/names, or other directory per Math::OEIS->local_directories() . A different filename can be given or an open filehandle. When reading an
fh
thefilename
can be given too and may be used in diagnostics. $name = $obj->anum_to_name($anum)
-
For a given
$anum
string such as "A000001" return the sequence name as a string, or if not found then returnundef
.When running in
perl -T
taint mode the$name
returned is tainted in the usual way for reading from a file. $filename = $obj->filename()
-
Return the names filename from a given
$obj
object. This is thefilename
parameter if given, ordefault_filename()
otherwise. $filename = Math::OEIS::Names->default_filename()
$filename = $obj->default_filename()
-
Return the default filename which is used if no
filename
orfh
option 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, 2015, 2016 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/.