Method: Words::PureWordnetConnection#open!
- Defined in:
- lib/wordnet_connectors/pure_wordnet_connection.rb
#open! ⇒ Object
Causes the connection specified within the wordnet object to be reopened if currently closed.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/wordnet_connectors/pure_wordnet_connection.rb', line 64 def open! raise BadWordnetDataset, "Failed to locate the wordnet database. Please ensure it is installed and that if it resides at a custom path that path is given as an argument when constructing the Words object." if @wordnet_path.nil? @connected = true # try and open evocations too evocation_path = @data_path + 'evocations.dmp' File.open(evocation_path, 'r') do |file| @evocations = Marshal.load file.read end if evocation_path.exist? return nil end |