Module: WordNet::DefaultDB

Defined in:
lib/wordnet/defaultdb.rb

Overview

This gem is a container for the default database files required for the 'wordnet' gem. It's mostly just a wrapper around the Sqlite database from SQLUNet:

http://sqlunet.sourceforge.net/

Constant Summary collapse

VERSION =

Library version constant

'2.0.1'
REVISION =

Version-control revision constant

%q$Revision$
DATA_DIR =

The data directory which contains the database file

if ENV['WORDNET_DEFAULTDB_DATADIR']
	Pathname( ENV['WORDNET_DEFAULTDB_DATADIR'] )
elsif Gem.loaded_specs['wordnet-defaultdb'] &&
	  File.directory?( Gem.loaded_specs['wordnet-defaultdb'].datadir )
	Pathname( Gem.loaded_specs['wordnet-defaultdb'].datadir )
else
	Pathname( __FILE__ ).dirname.parent.parent + 'data/wordnet-defaultdb'
end
DATABASE_FILENAME =

The name of the bundled Sqlite database

'wordnet31.sqlite'

Class Method Summary collapse

Class Method Details

.uriObject

Return the Sequel URI for the database



36
37
38
39
40
# File 'lib/wordnet/defaultdb.rb', line 36

def self::uri
	dbfile = WordNet::DefaultDB::DATA_DIR + DATABASE_FILENAME
	return nil unless dbfile.exist?
	return "sqlite:%s" % [ dbfile ]
end