Issue #3 new

#3 SQLite3::SQLException: no such table: synsets

Viz Tay
created an issue

I am newbie on ruby which just complete install "wordnet-defaultdb" gem and execute in irb

here is the code

DL is deprecated, please use Fiddle
irb(main):001:0> require 'wordnet'
=> true
irb(main):002:0> w=WordNet::Lexicon.new
=> #<WordNet::Lexicon:0x2a15278 sqlite:C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/w
ordnet-defaultdb-1.0.1/data/wordnet-defaultdb/wordnet30.sqlite>
irb(main):003:0> w[:shoe]
[2013-12-08 00:49:12.278144 3504/main] error {} -- SQLite3::SQLException: no suc
h table: synsets: SELECT * FROM `synsets` WHERE (`synsets`.`synsetid` IN (SELECT
 `senses`.`synsetid` FROM `senses` WHERE ((`senses`.`wordid` IN (SELECT `words`.
`wordid` FROM `words` WHERE ((`lemma` = 'shoe') AND (`words`.`wordid` IS NOT NUL
L)))) AND (`senses`.`synsetid` IS NOT NULL)))) LIMIT 1 OFFSET 0
Sequel::DatabaseError: SQLite3::SQLException: no such table: synsets
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.8-x64-mingw32/l
ib/sqlite3/database.rb:91:in `initialize'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.8-x64-mingw32/l
ib/sqlite3/database.rb:91:in `new'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.8-x64-mingw32/l
ib/sqlite3/database.rb:91:in `prepare'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sqlite3-1.3.8-x64-mingw32/l
ib/sqlite3/database.rb:263:in `query'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sequel-3.48.0/lib/sequel/ad
apters/sqlite.rb:179:in `block (2 levels) in _execute'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sequel-3.48.0/lib/sequel/da
tabase/logging.rb:37:in `log_yield'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sequel-3.48.0/lib/sequel/ad
apters/sqlite.rb:179:in `block in _execute'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sequel-3.48.0/lib/sequel/da
tabase/connecting.rb:235:in `block in synchronize'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sequel-3.48.0/lib/sequel/co
nnection_pool/threaded.rb:104:in `hold'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sequel-3.48.0/lib/sequel/da
tabase/connecting.rb:235:in `synchronize'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sequel-3.48.0/lib/sequel/ad
apters/sqlite.rb:172:in `_execute'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sequel-3.48.0/lib/sequel/ad
apters/sqlite.rb:122:in `execute'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sequel-3.48.0/lib/sequel/da
taset/actions.rb:860:in `execute'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sequel-3.48.0/lib/sequel/ad
apters/sqlite.rb:350:in `fetch_rows'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sequel-3.48.0/lib/sequel/da
taset/actions.rb:154:in `each'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sequel-3.48.0/lib/sequel/da
taset/actions.rb:57:in `all'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/wordnet-1.0.0/lib/wordnet/l
exicon.rb:324:in `lookup_synsets'
        from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/wordnet-1.0.0/lib/wordnet/l
exicon.rb:255:in `[]'
        from (irb):3
        from C:/Ruby200-x64/bin/irb:12:in `<main>'irb(main):004:0>
}}}

Comments (3)

  1. Michael Granger repo owner

    Well, that's no good.

    The Lexicon is clearly pointing at the database included with the defaultdb gem, so I don't know why it can't see the synsets table.

    Can you do me a favor and run the following in an IRB session?

    require 'wordnet'
    w = WordNet::Lexicon.new
    w.db.tables
    

    That should output a list of tables like:

    [:adjpositions,
     :adjpositiontypes,
     :casedwords,
     :lexdomains,
     :lexlinks,
     :linktypes,
     :morphmaps,
     :morphs,
     :postypes,
     :samples,
     :semlinks,
     :senses,
     :synsets,
     :vframemaps,
     :vframes,
     :vframesentencemaps,
     :vframesentences,
     :words]
    

    I'm assuming it won't in your case, but I want to ensure it's actually a data problem, and not a code problem.

    If that is indeed empty, can you look at the database file (C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/wordnet-defaultdb-1.0.1/data/wordnet-defaultdb/wordnet30.sqlite) and ensure that it's around 60M in size?

    That'll tell us whether it was the download that was the problem, or if there's something else going on. I've never run the library on a Windows machine, so I might have screwed something up with regard to the path to the default database or something.

    I'll also try testing it on my Windows box to see if I can spot any trouble.

    Thanks for reporting this!

  2. Viz Tay reporter

    Hi Michael Granger

    Thanks for the feedback. I try it and as what you expect, it is empty.

    irb(main):001:0> require 'wordnet' 
    => true
    irb(main):002:0> w=WordNet::Lexicon.new 
    => #<WordNet::Lexicon:0x36a008 sqlite:C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/ 1.9.1/gems/wordnet-defaultdb-1.0.1/data/wordnet-defaultdb/wordnet30.sqlite>
    irb(main):003:0> w.db.tables
    => [] 
    irb(main):004:0> 
    

    I did check the directory and it show 63mb sqlite file exist in the path. I just not really sure why the it can't be detected.

    Any suggestion on this?

    Thanks

  3. Log in to comment