anchor.diff:  
   (defun token-diff (tk1 tk2 &key (fields *token-fields*) (test #'equal) (simple-dep nil))
     (loop for field in fields
  -	for res = (if (and (equal field 'deprel) simple-dep)
  -		      (funcall test
  -			       (simple-deprel (slot-value tk1 field))
  -			       (simple-deprel (slot-value tk2 field)))
  -		      (funcall test
  -			       (slot-value tk1 field)
  -			       (slot-value tk2 field)))
  -	unless res
  -	collect (list field (slot-value tk1 field) (slot-value tk2 field))))
  +     for res = (if (and (equal field 'deprel) simple-dep)
  +		   (funcall test
  +			    (simple-deprel (slot-value tk1 field))
  +			    (simple-deprel (slot-value tk2 field)))
  +		   (funcall test
  +			    (slot-value tk1 field)
  +			    (slot-value tk2 field)))
  +     unless res
  +     collect (list field (slot-value tk1 field) (slot-value tk2 field))))
   
   
   (defun sentence-diff (sent1 sent2 &key (fields *token-fields*)
  -				    (test #'equal) (simple-dep nil) (punct t))
  +                                    (test #'equal) (simple-dep nil) (ignore-punct nil))
  +  "Returns a list of differences in SENT1 and SENT2.
  +
  +   They must have the same size.
  +
  +   If IGNORE-PUNCT, tokens which have 'PUNCT' as upostag
  +   in sent2 are ignored."
  +  
     (assert (equal (sentence-size sent1) (sentence-size sent2)))
  -  (loop for tk1 in (remove-if (lambda (tk)
  -				(and (not punct) (equal "PUNCT" (token-upostag tk))))
  -			      (sentence-tokens sent1))
  -	for tk2 in (remove-if (lambda (tk)
  -				(and (not punct) (equal "PUNCT" (token-upostag tk))))
  -			      (sentence-tokens sent2))
  -	for diff = (token-diff tk1 tk2 :fields fields :test test :simple-dep simple-dep) 
  -	when diff
  -	collect (list (token-id tk1) diff)))
  -
  -
  -(defun attachment-score-by-sentence (list-sent1 list-sent2 &key (fields *token-fields*)
  -							     (punct t) (simple-dep nil))
  +  (let ((complete-diff
  +	 (loop for tk1 in (sentence-tokens sent1)
  +	    for tk2 in (sentence-tokens sent2)
  +	    for diff = (token-diff tk1 tk2 :fields fields :test test :simple-dep simple-dep)
  +	    when diff
  +	    collect (list (token-id tk1) diff))))
  +    (if ignore-punct
  +	(remove-if
  +	 #'(lambda (diff-entry)
  +	     (let ((diff-entry-id (first diff-entry)))
  +	       (equal "PUNCT"
  +		      (token-upostag (find diff-entry-id
  +					   (sentence-tokens sent2)
  +					   :key #'token-id)))))
  +	 complete-diff)
  +	complete-diff)))
  +
  +
  +(defun sentence-average-score (list-sent1 list-sent2
  +                               &key (fields *token-fields*)
  +                                 (ignore-punct t) (simple-dep nil))
  +  "Score by sentence (macro-average).
  +
  +   This is the mean of the percentage of words in each sentence
  +   that are correct with respect to the fields in FIELDS.
  +
  +   We assume that LIST-SENT1 is the classified result
  +   and LIST-SENT2 is the list of golden (correct) sentences.
  +
  +   If IGNORE-PUNCT, tokens which have 'PUNCT' as upostag
  +   in the golden sentences are ignored."
  +  
  +  (let ((list-of-scores
  +         (mapcar
  +          #'(lambda (x y)
  +              (- 1.0
  +                 (/ (length (sentence-diff
  +                             x y
  +                             :fields fields
  +                             :ignore-punct ignore-punct
  +                             :simple-dep simple-dep))
  +                    (sentence-size y))))
  +          list-sent1 list-sent2)))
  +    (/ (apply #'+ list-of-scores)
  +       (float (length list-of-scores)))))
  +
  +
  +(defun word-average-score (list-sent1 list-sent2
  +                           &key (fields *token-fields*)
  +                             (ignore-punct t) (simple-dep nil))
  +  "Score by word (micro-average).
  +
  +   This is the total mean of words in all sentences that
  +   are correct with respect to the fields in FIELDS.
  +
  +   We assume that LIST-SENT1 is the classified result
  +   and LIST-SENT2 is the list of golden (correct) sentences.
  +
  +   If IGNORE-PUNCT, tokens which have 'PUNCT' as upostag
  +   in the golden sentences are ignored."
  +
  +  (let ((total-words (apply #'+ (mapcar #'sentence-size list-sent1)))
  +        (wrong-words (reduce #'+
  +                             (mapcar
  +                              #'(lambda (x y)
  +                                  (sentence-diff
  +                                   x y
  +                                   :fields fields
  +                                   :ignore-punct ignore-punct
  +                                   :simple-dep simple-dep))
  +                              list-sent1
  +                              list-sent2)
  +                             :key #'length
  +                             :initial-value 0)))
  +    (- 1.0 (/ wrong-words total-words))))
  +
  +
  +(defun attachment-score-by-sentence (list-sent1 list-sent2
  +                                     &key (labeled t)
  +                                       (ignore-punct nil) (simple-dep nil))
     "Attachment score by sentence (macro-average).
   
      The attachment score is the percentage of words that have correct
  
positive.code:      list-sent2)
      (if (eq 0
  	    number-of-positives)
  	nil
  	(/ (float true-positives)
  	   number-of-positives))))
  
  (defun projectivity-recall (list-sent1 list-sent2)
    (let ((number-of-projectives
  	 (length (remove-if-not
  		  #'non-projective?
  		  list-sent2)))
  
negative.code: 	     :key #'token-deprel-chosen)))
  	  (wrong-words
  	   (length
  	    (mapcar
  	     #'(lambda (sent1 sent2)
  		 (remove-if-not
  		  #'(lambda (x)
  		      (equal x deprel))
  		  (sentence-diff
  		   sent1 sent2
  		   :fields error-type
  		   :simple-dep simple-dep)
  		  :key
  		  ;; deprel in the predicted (SENT1) sentence
  		  #'(lambda (diff-entry)
  		      (let ((diff-entry-id (first diff-entry)))
  			(token-deprel-chosen
  			 (find diff-entry-id
  			       (sentence-tokens sent1)
  			       :key #'token-id))))))
  	     list-sent1
  	     list-sent2))))
        (if (eq classified-words
  	      0)
  	  (warn "There are no tokens predicted as of deprel ~a." deprel)
  	  (/ (float (- classified-words wrong-words))
  	     classified-words)))))
  
  (defun non-projectivity-accuracy (list-sent1 list-sent2)
    (let ((N (length list-sent1))
  	(correct 0))
      (mapcar
       #'(lambda (x y)
  	 (if (eq (non-projective? x)
  		 (non-projective? y))
  	     (incf correct)))
       list-sent1
       list-sent2)
      (if (eq N 0)
  	(error "LIST-SENT1 is empty!")
  	(/ (float correct)
  	   N))))
  
  (defun non-projectivity-precision (list-sent1 list-sent2)
    (let ((number-of-positives
  	 (length (remove-if-not
  		  #'non-projective?
  