Common lisp wordnet interface for SQL (specifically MSSQL)
Common Lisp
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
db
documentation
sql-migrations
.gitignore
LICENSE
README
db-connections.lisp
db-defs.lisp
package.lisp
wordnet-examples.asd
wordnet-examples.lisp
wordnet-mssql-to-sqlite.lisp
wordnet.asd
wordnet.lisp

README

CL-Wordnet

This project is released under the GNU Library General Public License (see LICENSE)

Given a MSSQL-based Wordnet setup, we can query information related to Wordnet using clsql

Please note that a lot of the functionality comes from views.  You can create the views by running the scripts within sql-migrations.

Also note, this is pretty dependent on MSSQL for correct operation.
The nice thing about clsql is that we can also use other databases
instead.  There is some basic work for porting the MSSQL wordnet
database into SQLite.  This hasn't been completed yet.

You can get Wordnet-SQLServer here:
http://wordnetsqlserver.googlecode.com/svn/trunk/Database/

 Examples: 

(defpackage :wordnet-examples (:use :cl :wordnet))

(in-package :wordnet-examples)

(defun list-word-defs (word)
  (with-generic-wordnet-mssql-connection (dbms)
    (dolist (obj (query-db :word word :tbl 'worddef :db dbms))
      (format t "Definition: ~a~%" (definition obj)))))

(defun list-word-parse (word)
  (with-generic-wordnet-mssql-connection (dbms)
    (dolist (obj (query-db :word word :tbl 'wordparse :db dbms))
      (format t "parse output: ~a~%" (parse obj)))))

(defun list-word-hypernyms (word)
  (with-generic-wordnet-mssql-connection (dbms)
    (dolist (obj (query-db :word word :tbl 'hypernyms :srcword 'hyponym :order-by 'hypernym :db dbms))
      (format t "Hypernym: ~a~%" (hypernym obj)))))

(defun list-word-hyponyms (word)
  (with-generic-wordnet-mssql-connection (dbms)
    (dolist (obj (query-db :word word :tbl 'hyponyms :srcword 'hypernym :order-by 'hyponym :db dbms))
      (format t "Hyponym: ~a~%" (hyponym obj)))))

(defun list-word-synonyms (word)
  (with-generic-wordnet-mssql-connection (dbms)
    (dolist (obj (query-db :word word :tbl 'synonyms :srcword 'orig_word :db dbms))
      (format t "Synonym: ~a, grammar position: ~a~%" (synonym obj) (grammarpos obj)))))