anchor.diff:  	     :key #'token-deprel-chosen)))
   	  (wrong-words
   	   (length
  -	    (remove-if-not
  -	     #'(lambda (x)
  -		 (equal x deprel))
  -	     (mappend
  -	      #'identity
  -	      (mapcar
  -	       #'(lambda (sent1 sent2)
  -		   (disagreeing-words
  -		    sent1 sent2
  -		    :head-error head-error
  -		    :label-error label-error))
  -	       list-sent1
  -	       list-sent2))
  -	     :key #'(lambda (disag-pair)
  -		      (token-deprel-chosen
  -		       (first disag-pair)))))))
  +	    (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)
  -	  nil
  +	  (warn "There are no tokens predicted as of deprel ~a." deprel)
   	  (/ (float (- classified-words wrong-words))
   	     classified-words)))))
   
  -(defun projectivity-accuracy (list-sent1 list-sent2)
  +(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)))
  +	 (if (eq (non-projective? x)
  +		 (non-projective? y))
  +	     (incf correct)))
        list-sent1
        list-sent2)
       (if (eq N 0)
  -	nil
  +	(error "LIST-SENT1 is empty!")
   	(/ (float correct)
   	   N))))
   
  -(defun projectivity-precision (list-sent1 list-sent2)
  +(defun non-projectivity-precision (list-sent1 list-sent2)
     (let ((number-of-positives
   	 (length (remove-if-not
   		  #'non-projective?
  
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: 
  (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))))
  
  
  (defun sentence-diff (sent1 sent2 &key (fields *token-fields*)
                                      (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)))
    (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
  