Method: Words::TokyoWordnetConnection#initialize

Defined in:
lib/wordnet_connectors/tokyo_wordnet_connection.rb

#initialize(data_path, wordnet_path) ⇒ PureWordnetConnection

Constructs a new tokyo ruby connector for use with the words wordnet class.

Parameters:

  • data_path (Pathname)

    Specifies the directory within which constructed datasets can be found (tokyo index, evocations etc…)

  • wordnet_path (Pathname)

    Specifies the directory within which the wordnet dictionary can be found.

Raises:



43
44
45
46
47
48
49
50
51
52
# File 'lib/wordnet_connectors/tokyo_wordnet_connection.rb', line 43

def initialize(data_path, wordnet_path)

    @data_path, @wordnet_path, @connection_type, @connected = data_path + 'wordnet.tct', wordnet_path, :tokyo, false

    # ensure we have the rufus gem loaded, else there is little point in continuing...
    raise BadWordnetConnector, "Coulden't find the rufus-tokyo gem. Please ensure it's installed." unless Gem.available?('rufus-tokyo')

    open!

end