Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
475 lines (382 sloc) 12.8 KB
(in-package #:cffi-wordnet)
;;; This file was automatically generated by SWIG (http://www.swig.org).
;;; Version 1.3.40
;;;
;;; Do not make changes to this file unless you know what you are doing--modify
;;; the SWIG interface file instead.
;;;SWIG wrapper code starts here
(cl:defmacro defanonenum (&body enums)
"Converts anonymous enums to defconstants."
`(cl:progn ,@(cl:loop for value in enums
for index = 0 then (cl:1+ index)
when (cl:listp value) do (cl:setf index (cl:second value)
value (cl:first value))
collect `(alexandria:define-constant ,value ,index))))
(cl:eval-when (:compile-toplevel :load-toplevel)
(cl:unless (cl:fboundp 'swig-lispify)
(cl:defun swig-lispify (name flag cl:&optional (package cl:*package*))
(cl:labels ((helper (lst last rest cl:&aux (c (cl:car lst)))
(cl:cond
((cl:null lst)
rest)
((cl:upper-case-p c)
(helper (cl:cdr lst) 'upper
(cl:case last
((lower digit) (cl:list* c #\- rest))
(cl:t (cl:cons c rest)))))
((cl:lower-case-p c)
(helper (cl:cdr lst) 'lower (cl:cons (cl:char-upcase c) rest)))
((cl:digit-char-p c)
(helper (cl:cdr lst) 'digit
(cl:case last
((upper lower) (cl:list* c #\- rest))
(cl:t (cl:cons c rest)))))
((cl:char-equal c #\_)
(helper (cl:cdr lst) '_ (cl:cons #\- rest)))
(cl:t
(cl:error "Invalid character: ~A" c)))))
(cl:let ((fix (cl:case flag
((constant enumvalue) "+")
(variable "*")
(cl:t ""))))
(cl:intern
(cl:concatenate
'cl:string
fix
(cl:nreverse (helper (cl:concatenate 'cl:list name) cl:nil cl:nil))
fix)
package))))))
;;;SWIG wrapper code ends here
(define-foreign-library libwordnet
(:unix (:or "/usr/lib/libwordnet.so" "/usr/lib/libwordnet-3.0.so" "/usr/local/WordNet-3.0/lib/libWN.3.dylib"))
(t (:default (:or "/usr/lib/libwordnet.so" "/usr/local/WordNet-3.0/lib/libWN.3.dylib"))))
(use-foreign-library libwordnet)
(alexandria:define-constant DICTDIR "/usr/share/wordnet" :test 'equal)
(alexandria:define-constant DEFAULTPATH "/usr/share/wordnet" :test 'equal)
(alexandria:define-constant DATAFILE "/usr/share/wordnet/data.%s" :test 'equal)
(alexandria:define-constant INDEXFILE "/usr/share/wordnet/index.%s" :test 'equal)
(alexandria:define-constant SENSEIDXFILE "/usr/share/wordnet/index.sense" :test 'equal)
(alexandria:define-constant KEYIDXFILE "/usr/share/wordnet/index.key" :test 'equal)
(alexandria:define-constant REVKEYIDXFILE "/usr/share/wordnet/index.key.rev" :test 'equal)
(alexandria:define-constant VRBSENTFILE "/usr/share/wordnet/sents.vrb" :test 'equal)
(alexandria:define-constant VRBIDXFILE "/usr/share/wordnet/sentidx.vrb" :test 'equal)
(alexandria:define-constant CNTLISTFILE "/usr/share/wordnet/cntlist.rev" :test 'equal)
(alexandria:define-constant LINEBUF (cl:* 15 1024))
(alexandria:define-constant SMLINEBUF (cl:* 3 1024))
(alexandria:define-constant WORDBUF 256)
(alexandria:define-constant ALLSENSES 0)
(alexandria:define-constant MAXID 15)
(alexandria:define-constant MAXDEPTH 20)
(alexandria:define-constant MAXSENSE 75)
(alexandria:define-constant MAX_FORMS 5)
(alexandria:define-constant MAXFNUM 44)
(alexandria:define-constant ANTPTR 1)
(alexandria:define-constant HYPERPTR 2)
(alexandria:define-constant HYPOPTR 3)
(alexandria:define-constant ENTAILPTR 4)
(alexandria:define-constant SIMPTR 5)
(alexandria:define-constant ISMEMBERPTR 6)
(alexandria:define-constant ISSTUFFPTR 7)
(alexandria:define-constant ISPARTPTR 8)
(alexandria:define-constant HASMEMBERPTR 9)
(alexandria:define-constant HASSTUFFPTR 10)
(alexandria:define-constant HASPARTPTR 11)
(alexandria:define-constant MERONYM 12)
(alexandria:define-constant HOLONYM 13)
(alexandria:define-constant CAUSETO 14)
(alexandria:define-constant PPLPTR 15)
(alexandria:define-constant SEEALSOPTR 16)
(alexandria:define-constant PERTPTR 17)
(alexandria:define-constant ATTRIBUTE 18)
(alexandria:define-constant VERBGROUP 19)
(alexandria:define-constant DERIVATION 20)
(alexandria:define-constant CLASSIFICATION 21)
(alexandria:define-constant WN-CLASS 22)
(alexandria:define-constant LASTTYPE 22)
(alexandria:define-constant SYNS (cl:+ 22 1))
(alexandria:define-constant FREQ (cl:+ 22 2))
(alexandria:define-constant FRAMES (cl:+ 22 3))
(alexandria:define-constant COORDS (cl:+ 22 4))
(alexandria:define-constant RELATIVES (cl:+ 22 5))
(alexandria:define-constant HMERONYM (cl:+ 22 6))
(alexandria:define-constant HHOLONYM (cl:+ 22 7))
(alexandria:define-constant WNGREP (cl:+ 22 8))
(alexandria:define-constant OVERVIEW (cl:+ 22 9))
(alexandria:define-constant MAXSEARCH (cl:+ 22 9))
(alexandria:define-constant CLASSIF_START (cl:+ 22 9 1))
(alexandria:define-constant CLASSIF_CATEGORY (cl:+ 22 9 1))
(alexandria:define-constant CLASSIF_USAGE (cl:+ 22 9 1 1))
(alexandria:define-constant CLASSIF_REGIONAL (cl:+ 22 9 1 2))
(alexandria:define-constant CLASSIF_END (cl:+ 22 9 1 2))
(alexandria:define-constant CLASS_START (cl:+ 22 9 1 2 1))
(alexandria:define-constant CLASS_CATEGORY (cl:+ 22 9 1 2 1))
(alexandria:define-constant CLASS_USAGE (cl:+ 22 9 1 2 1 1))
(alexandria:define-constant CLASS_REGIONAL (cl:+ 22 9 1 2 1 2))
(alexandria:define-constant CLASS_END (cl:+ 22 9 1 2 1 2))
(alexandria:define-constant INSTANCE (cl:+ 22 9 1 2 1 2 1))
(alexandria:define-constant INSTANCES (cl:+ 22 9 1 2 1 2 2))
(alexandria:define-constant MAXPTR (cl:+ 22 9 1 2 1 2 2))
(alexandria:define-constant NUMPARTS 4)
(alexandria:define-constant NUMFRAMES 35)
(alexandria:define-constant NOUN 1)
(alexandria:define-constant VERB 2)
(alexandria:define-constant ADJ 3)
(alexandria:define-constant ADV 4)
(alexandria:define-constant SATELLITE 5)
(alexandria:define-constant ADJSAT 5)
(alexandria:define-constant ALL_POS 0)
(alexandria:define-constant PADJ 1)
(alexandria:define-constant NPADJ 2)
(alexandria:define-constant IPADJ 3)
(alexandria:define-constant UNKNOWN_MARKER 0)
(alexandria:define-constant ATTRIBUTIVE 2)
(alexandria:define-constant PREDICATIVE 1)
(alexandria:define-constant IMMED_POSTNOMINAL 3)
(cffi:defcvar ("wnrelease" wnrelease)
:string)
(cffi:defcvar ("lexfiles" lexfiles)
:pointer)
(cffi:defcvar ("ptrtyp" ptrtyp)
:pointer)
(cffi:defcvar ("partnames" partnames)
:pointer)
(cffi:defcvar ("partchars" partchars)
:pointer)
(cffi:defcvar ("adjclass" adjclass)
:pointer)
(cffi:defcvar ("frametext" frametext)
:pointer)
(cffi:defcstruct Index
(idxoffset :long)
(wd :string)
(pos :string)
(sense_cnt :int)
(off_cnt :int)
(tagged_cnt :int)
(offset :pointer)
(ptruse_cnt :int)
(ptruse :pointer))
(cffi:defcstruct Synset
(hereiam :long)
(sstype :int)
(fnum :int)
(pos :string)
(wcount :int)
(words :pointer)
(lexid :pointer)
(wnsns :pointer)
(whichword :int)
(ptrcount :int)
(ptrtyp :pointer)
(ptroff :pointer)
(ppos :pointer)
(pto :pointer)
(pfrm :pointer)
(fcount :int)
(frmid :pointer)
(frmto :pointer)
(defn :string)
(key :unsigned-int)
(nextss :pointer)
(nextform :pointer)
(searchtype :int)
(ptrlist :pointer)
(headword :string)
(headsense :short))
(cffi:defcstruct SnsIndex
(sensekey :string)
(word :string)
(loc :long)
(wnsense :int)
(tag_cnt :int)
(nextsi :pointer))
(cffi:defcstruct SearchResults
(SenseCount :pointer)
(OutSenseCount :pointer)
(numforms :int)
(printcnt :int)
(searchbuf :string)
(searchds :pointer))
(cffi:defcvar ("wnresults" wnresults)
(:struct SearchResults))
(cffi:defcvar ("fnflag" fnflag)
:int)
(cffi:defcvar ("dflag" dflag)
:int)
(cffi:defcvar ("saflag" saflag)
:int)
(cffi:defcvar ("fileinfoflag" fileinfoflag)
:int)
(cffi:defcvar ("frflag" frflag)
:int)
(cffi:defcvar ("abortsearch" abortsearch)
:int)
(cffi:defcvar ("offsetflag" offsetflag)
:int)
(cffi:defcvar ("wnsnsflag" wnsnsflag)
:int)
(cffi:defcvar ("OpenDB" OpenDB)
:int)
(cffi:defcvar ("datafps" datafps)
:pointer)
(cffi:defcvar ("indexfps" indexfps)
:pointer)
(cffi:defcvar ("sensefp" sensefp)
:pointer)
(cffi:defcvar ("cntlistfp" cntlistfp)
:pointer)
(cffi:defcvar ("keyindexfp" keyindexfp)
:pointer)
(cffi:defcvar ("revkeyindexfp" revkeyindexfp)
:pointer)
(cffi:defcvar ("vidxfilefp" vidxfilefp)
:pointer)
(cffi:defcvar ("vsentfilefp" vsentfilefp)
:pointer)
(cffi:defcvar ("interface_doevents_func" interface_doevents_func)
:pointer)
(cffi:defcfun ("default_display_message" default_display_message) :int
(arg0 :string))
(cffi:defcvar ("display_message" display_message)
:pointer)
(cffi:defcfun ("findtheinfo" findtheinfo) :string
(arg0 :string)
(arg1 :int)
(arg2 :int)
(arg3 :int))
(cffi:defcfun ("findtheinfo_ds" findtheinfo_ds) :pointer
(arg0 :string)
(arg1 :int)
(arg2 :int)
(arg3 :int))
(cffi:defcfun ("is_defined" is_defined) :unsigned-int
(arg0 :string)
(arg1 :int))
(cffi:defcfun ("in_wn" in_wn) :unsigned-int
(arg0 :string)
(arg1 :int))
(cffi:defcfun ("index_lookup" index_lookup) :pointer
(arg0 :string)
(arg1 :int))
(cffi:defcfun ("getindex" getindex) :pointer
(arg0 :string)
(arg1 :int))
(cffi:defcfun ("parse_index" parse_index) :pointer
(arg0 :long)
(arg1 :int)
(arg2 :string))
(cffi:defcfun ("read_synset" read_synset) :pointer
(arg0 :int)
(arg1 :long)
(arg2 :string))
(cffi:defcfun ("parse_synset" parse_synset) :pointer
(arg0 :pointer)
(arg1 :int)
(arg2 :string))
(cffi:defcfun ("free_syns" free_syns) :void
(arg0 :pointer))
(cffi:defcfun ("free_synset" free_synset) :void
(arg0 :pointer))
(cffi:defcfun ("free_index" free_index) :void
(arg0 :pointer))
(cffi:defcfun ("traceptrs_ds" traceptrs_ds) :pointer
(arg0 :pointer)
(arg1 :int)
(arg2 :int)
(arg3 :int))
(cffi:defcfun ("do_trace" do_trace) :string
(arg0 :pointer)
(arg1 :int)
(arg2 :int)
(arg3 :int))
(cffi:defcfun ("morphinit" morphinit) :int)
(cffi:defcfun ("re_morphinit" re_morphinit) :int)
(cffi:defcfun ("morphstr" morphstr) :string
(arg0 :string)
(arg1 :int))
(cffi:defcfun ("morphword" morphword) :string
(arg0 :string)
(arg1 :int))
(cffi:defcfun ("wninit" wninit) :int)
(cffi:defcfun ("re_wninit" re_wninit) :int)
(cffi:defcfun ("cntwords" cntwords) :int
(arg0 :string)
(arg1 :char))
(cffi:defcfun ("strtolower" strtolower) :string
(arg0 :string))
(cffi:defcfun ("ToLowerCase" ToLowerCase) :string
(arg0 :string))
(cffi:defcfun ("strsubst" strsubst) :string
(arg0 :string)
(arg1 :char)
(arg2 :char))
(cffi:defcfun ("getptrtype" getptrtype) :int
(arg0 :string))
(cffi:defcfun ("getpos" getpos) :int
(arg0 :string))
(cffi:defcfun ("getsstype" getsstype) :int
(arg0 :string))
(cffi:defcfun ("FmtSynset" FmtSynset) :string
(arg0 :pointer)
(arg1 :int))
(cffi:defcfun ("GetWNStr" GetWNStr) :string
(arg0 :string)
(arg1 :int))
(cffi:defcfun ("StrToPos" StrToPos) :int
(arg0 :string))
(cffi:defcfun ("GetSynsetForSense" GetSynsetForSense) :pointer
(arg0 :string))
(cffi:defcfun ("GetDataOffset" GetDataOffset) :long
(arg0 :string))
(cffi:defcfun ("GetPolyCount" GetPolyCount) :int
(arg0 :string))
(cffi:defcfun ("GetWORD" GetWORD) :string
(arg0 :string))
;(cffi:defcfun ("GetPOS" GetPOS) :int
; (arg0 :string))
(cffi:defcfun ("WNSnsToStr" WNSnsToStr) :string
(arg0 :pointer)
(arg1 :int))
(cffi:defcfun ("GetValidIndexPointer" GetValidIndexPointer) :pointer
(arg0 :string)
(arg1 :int))
(cffi:defcfun ("GetWNSense" GetWNSense) :int
(arg0 :string)
(arg1 :string))
(cffi:defcfun ("GetSenseIndex" GetSenseIndex) :pointer
(arg0 :string))
(cffi:defcfun ("GetOffsetForKey" GetOffsetForKey) :string
(arg0 :unsigned-int))
(cffi:defcfun ("GetKeyForOffset" GetKeyForOffset) :unsigned-int
(arg0 :string))
(cffi:defcfun ("SetSearchdir" SetSearchdir) :string)
(cffi:defcfun ("GetTagcnt" GetTagcnt) :int
(arg0 :pointer)
(arg1 :int))
(cffi:defcfun ("strstr_init" strstr_init) :void
(arg0 :string)
(arg1 :string))
(cffi:defcfun ("strstr_getnext" strstr_getnext) :int)
(cffi:defcfun ("bin_search" bin_search) :string
(arg0 :string)
(arg1 :pointer))
(cffi:defcfun ("read_index" read_index) :string
(arg0 :long)
(arg1 :pointer))
(cffi:defcfun ("copyfile" copyfile) :void
(arg0 :pointer)
(arg1 :pointer))
(cffi:defcfun ("replace_line" replace_line) :string
(arg0 :string)
(arg1 :string)
(arg2 :pointer))
(cffi:defcfun ("insert_line" insert_line) :string
(arg0 :string)
(arg1 :string)
(arg2 :pointer))
(cffi:defcvar ("helptext" helptext)
:pointer)
(cffi:defcvar ("license" license)
:string)
(cffi:defcvar ("dblicense" dblicense)
:pointer)