Este primeiro arquivo foi obtido do CoNLL-X Shared Task. É o arquivo
de teste disponibilizado. A quarta coluna, V4
, contém a tag.
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
(defun normalize-agents () | |
(labels ((compare-agents (agent1 agent2) | |
(let ((u1 (nth 0 agent1)) | |
(u2 (nth 0 agent2))) | |
(if (upi= u1 u2) | |
(list u1 u2 0) | |
(list u1 u2 | |
(loop for i in (cdr agent1) | |
for j in (cdr agent2) | |
summing (numeric-upi-equal i j) into total |
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 :drakma) | |
(ql:quickload :st-json) | |
(defun show-google-hits (term key ck) | |
(let* ((query (list (cons "key" key) | |
(cons "cx" ck) | |
(cons "q" term))) | |
(stream (drakma:http-request "https://www.googleapis.com/customsearch/v1" | |
:parameters query |
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
(let ((data (make-array 20 :initial-element nil))) | |
(values(read-sequence data (make-string-input-stream "testing things")) data)) | |
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
# Solucao baseada no pseudo-codigo apresentado em: | |
# http://en.wikipedia.org/wiki/Stable_marriage_problem | |
stable.match <- function(hprefs, mprefs, debug=FALSE){ | |
proposed <- matrix(rep(FALSE,25), ncol = 5, dimnames = list(Homens = 1:5, Mulheres = 1:5)) | |
alloc <- matrix(rep(FALSE,25), ncol = 5, dimnames = list(Homens = 1:5, Mulheres = 1:5)) | |
# os nomes das linhas e colunas irao ser usados para indicar os | |
# indices para selecao de elementos das matrizes proposed e alloc, | |
# por isso precisam ser renomeados. |
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
(defun fib1 (n) | |
(cond | |
((equal n 0) 0) | |
((equal n 1) 1) | |
(t (+ (fib1 (- n 1)) | |
(fib1 (- n 2)))))) | |
(defun fib2 (n) | |
(labels ((calc-fib (n a b) |
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
; first version: procedural | |
(defun nth-1 (n alist) | |
(let ((current alist)) | |
(dotimes (v n current) | |
(if (equal v n) | |
(car current) | |
(setf current (cdr current)))))) | |
; second version: functional |
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
-- testing double without type information | |
double x = x + x | |
-- testing the first example | |
qsort :: Ord a => [a] -> [a] | |
qsort [] = [] | |
qsort (p:xs) = (qsort lesser) ++ [p] ++ (qsort greater) | |
where | |
lesser = filter (< p) xs | |
greater = filter (>= p) xs |
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
<?xml version="1.0" encoding="ISO-8859-1"?> | |
<!ELEMENT EM (#PCDATA) > | |
<!ATTLIST EM | |
ID CDATA #REQUIRED | |
CATEG CDATA #IMPLIED | |
TIPO CDATA #IMPLIED | |
COMENT CDATA #IMPLIED | |
SUBTIPO CDATA #IMPLIED > |
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
;; utilities | |
(defun combinations (&rest lists) | |
(if (car lists) | |
(mapcan (lambda (inner-val) | |
(mapcar (lambda (outer-val) | |
(cons outer-val inner-val)) | |
(car lists))) | |
(apply #'combinations (cdr lists))) | |
(list nil))) |
OlderNewer