This file contains 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
-- Excerpt From: Graham Hutton. “Programming in Haskell.” | |
import Data.Char | |
positions :: Eq a => a -> [a] -> [Int] | |
positions x xs = [i | (x',i) <- zip xs [0..], x == x'] | |
lowers :: String -> Int | |
lowers xs = length [x | x <- xs, x >= 'a' && x <= 'z'] |
This file contains 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
ar@leme udp % awk '$3 ~ /^(irmã|irmão|pai|mãe|tio|tia|bisavô|bisavó|primo|prima|avô|avó|sobrinho|sobrinha|cunhado|cunhada|parente)$/ {print $2,$3}' *.conllu | sort | uniq -c | sort -nr | |
1622 pai pai | |
1283 irmão irmão | |
336 tio tio | |
336 irmãos irmão | |
315 Sobrinho sobrinho | |
277 avô avô | |
272 primo primo | |
256 mãe mãe | |
188 sobrinho sobrinho |
This file contains 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
ar@leme workspace % echo $SIGMA_CP | |
/Users/ar/workspace/sigmakee/build/classes:/Users/ar/workspace/sigmakee/build/lib/*:/Users/ar/workspace/sigmakee/lib/* | |
ar@leme workspace % java -Xmx7g -classpath $SIGMA_CP com.articulate.sigma.InferenceTestSuite -t SP01.kif.tq | |
Info in KBmanager.initializeOnce() | |
Info in KBmanager.initializeOnce(): initializing with /Users/ar/.sigmakee/KBs | |
KBmanager.readConfiguration() | |
KBmanager.serializedExists(): true | |
KBmanager.serializedOld(config): | |
KBmanager.serializedOld(config): save date: Thu May 28 01:48:33 BRT 2020 |
This file contains 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
open set | |
variable {U : Type} | |
example (A B : set U) : A ∈ powerset (A ∪ B) := | |
assume x, | |
assume : x ∈ A, | |
show x ∈ A ∪ B, from or.inl ‹x ∈ A› |
This file contains 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 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 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 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 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 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) |