Skip to content

Instantly share code, notes, and snippets.

View arademaker's full-sized avatar
🎯
Focusing

Alexandre Rademaker arademaker

🎯
Focusing
View GitHub Profile
(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)))))
@arademaker
arademaker / glossas.lisp
Last active January 19, 2016 21:14
glosas and examples
(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
@arademaker
arademaker / erc.el
Created November 26, 2015 10:12
erc config in .emacs
;; 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")))
@arademaker
arademaker / test.lisp
Created November 3, 2015 10:14
reading CPDOC headers in CL
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"
wordsensesense
crosswordsense-01913997-v-1wordsense-02023396-v-2
farsightednesswordsense-14555214-n-2wordsense-14554011-n-4
get_upwordsense-00018405-v-1wordsense-01974062-v-4
liftwordsense-01455184-v-2wordsense-01974062-v-2
raisewordsense-01975587-v-1wordsense-01974062-v-1
makewordsense-01646075-v-1wordsense-01645601-v-3
dowordsense-02561995-v-1wordsense-01645601-v-2
@arademaker
arademaker / output
Last active September 28, 2015 17:24
$ awk '{print $2, $2, $4, "#"}' train.pt | /media/data/src/freeling/src/utilities/train-tagger/bin/change-corpus-dict pt /usr/local/share/freeling/
O O DET # o DA0MS0 0.946534 o PD0MS000 0.0337339 o PP3MSA00 0.0197186 o NCMS000 1.38766e-05
objetivo objetivo NOUN # objetivo AQ0MS0 0.554567 objetivo NCMS000 0.390889 objetivo NP00000 0.0545441
dos dos ADP # de SPS00 1
principais principais ADJ # principal AQ0CP0 0.99061 principais NCMP000 0.00469484 principal NCMP000 0.00469484
hotéis hotéis NOUN # hotel NCMP000 1
da da ADP # de SPS00 1
cidade cidade NOUN # cidade NCFS000 1
é é VERB # ser VMIP3S0 1
que que CONJ # que PR0CN000 0.586684 que CS 0.39617 que PT0CN000 0.0167849 que PE0CN000 0.000361319
$ java -jar /usr/local/HermiT/HermiT.jar --classify test-complet.ttl
Exception in thread "main" org.semanticweb.owlapi.reasoner.InconsistentOntologyException: Inconsistent ontology
at org.semanticweb.HermiT.Reasoner.throwInconsistentOntologyExceptionIfNecessary(Unknown Source)
at org.semanticweb.HermiT.Reasoner.checkPreConditions(Unknown Source)
at org.semanticweb.HermiT.Reasoner.precomputeInferences(Unknown Source)
at org.semanticweb.HermiT.cli.CommandLine$ClassifyAction.run(Unknown Source)
at org.semanticweb.HermiT.cli.CommandLine.main(Unknown Source)
@arademaker
arademaker / commands
Last active August 29, 2015 14:27
playing with stardog and wordnet
stardog-admin server start
stardog-admin db drop wn
stardog-admin db create -n wn wn30.ttl
stardog data add wn test.ttl
stardog-admin icv add -v wn wn30.ttl
stardog icv validate -v -r wn ; the r option is necessary

Portuguese POS tagged corpora

Dados CoNLL-X

Este primeiro arquivo foi obtido do CoNLL-X Shared Task. É o arquivo de teste disponibilizado. A quarta coluna, V4, contém a tag.