This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ql:quickload '(:yason :wilbur :alexandria) :silent t) | |
| (wilbur:add-namespace "du" "http://br.ibm.com/document-understanding/") | |
| (defun get-relations (sent) | |
| (let ((rels (wilbur:all-values sent '!du:hasRelation))) | |
| (mapcar (lambda (rel) | |
| (alexandria:plist-hash-table | |
| (list "origin" (wilbur:value rel '(:seq !du:origin)) | |
| "subject" (wilbur:value rel '(:seq !du:subject)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import jsonlines | |
| import rdflib | |
| from rdflib.namespace import RDFS, SKOS, RDF | |
| from rdflib import Namespace | |
| import json | |
| ont = sys.argv[1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ql:quickload :cxml) | |
| (ql:quickload :cxml-stp) | |
| (defparameter *document* (cxml:parse #P"raw/2010-official-1.xml" | |
| (stp:make-builder))) | |
| (let (res) | |
| (xpath:do-node-set (node (xpath:evaluate "//statement" *document*) res) | |
| (push (xpath-protocol:node-text node) res))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ql:quickload :snark) | |
| (initialize) | |
| (use-resolution t) | |
| (defun var-complemente (var) | |
| (if (equal var '?x) | |
| '?y | |
| '?x)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (setenv "LANG" "en_US.UTF-8") | |
| (setenv "LC_ALL" "en_US.UTF-8") | |
| (prefer-coding-system 'utf-8) | |
| (set-language-environment "UTF-8") | |
| ;; slime setup | |
| (use-package slime | |
| :init | |
| (load (expand-file-name "~/quicklisp/slime-helper.el")) | |
| :config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| RACER-USER> (signature :atomic-concepts (A C a1 a2) | |
| :roles (h)) | |
| ; No value | |
| RACER-USER> (equivalent a1 (and (some h A) (all h C))) | |
| A1 | |
| RACER-USER> (equivalent a2 (some h C)) | |
| A2 | |
| RACER-USER> (concept-subsumes? a1 a2) | |
| NIL | |
| RACER-USER> (concept-subsumes? a2 a1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defmacro with-open-files (args &rest body) | |
| (let ((res `(progn ,@body))) | |
| (reduce (lambda (acc e) `(with-open-file (,@e) ,acc)) args | |
| :initial-value res))) | |
| (defmacro with-open-files-1 (args &rest body) | |
| (let ((res `(progn ,@body))) | |
| (dolist (a (reverse args) res) | |
| (setf res `(with-open-file (,@a) | |
| ,res))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun group-by (alist n &optional res) | |
| (if (null alist) | |
| (reverse res) | |
| (group-by (subseq alist n) n (cons (subseq alist 0 n) res)))) | |
| (defun split-gloss (gloss) | |
| (let* ((re "[ ]*;[ ]*\"[^\"]+\"") | |
| (pos (cl-ppcre:all-matches re gloss)) | |
| (bw '(#\; #\" #\Space))) | |
| (if pos |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; ERC | |
| (erc-autojoin-mode t) | |
| (setq erc-save-buffer-on-part nil | |
| erc-save-queries-on-quit nil | |
| erc-log-write-after-send t | |
| erc-log-write-after-insert t | |
| erc-echo-notices-in-minibuffer-flag t | |
| erc-log-channels-directory "~/.erc/logs/" | |
| erc-autojoin-channels-alist '(("freenode.net" "#lisp") | |
| ("wnpt.brlcloud.com" "#brl"))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CL-USER> (pushnew "/opt/local/lib/" cffi:*foreign-library-directories* :test #'equal) | |
| ("/opt/local/lib/" (CFFI::EXPLODE-PATH-ENVIRONMENT-VARIABLE "LD_LIBRARY_PATH") | |
| (CFFI::EXPLODE-PATH-ENVIRONMENT-VARIABLE "DYLD_LIBRARY_PATH") (UIOP/OS:GETCWD) | |
| (CFFI::DARWIN-FALLBACK-LIBRARY-PATH)) | |
| CL-USER> (ql:quickload :cl-yaml) | |
| To load "cl-yaml": | |
| Load 1 ASDF system: | |
| cl-yaml | |
| ; Loading "cl-yaml" |