gov.nih.nlm.nls.nlp.textfeatures
Class CandidateListbyScoreComparator

java.lang.Object
  extended by gov.nih.nlm.nls.nlp.textfeatures.CandidateListbyScoreComparator
All Implemented Interfaces:
java.util.Comparator

 class CandidateListbyScoreComparator
extends java.lang.Object
implements java.util.Comparator


Constructor Summary
CandidateListbyScoreComparator()
           
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Method compare This compare routine returns values to form a descending sorted ordering based on the final score of the candidate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

CandidateListbyScoreComparator

CandidateListbyScoreComparator()
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Method compare This compare routine returns values to form a descending sorted ordering based on the final score of the candidate. We also want to sort alpha ascending within same scores. This was from a email from Lan: In MetaMap, the order of both candidates and mappings is determined by Prolog's sort/2 predicate. Candidates are ordered by sorting them, i.e., by sorting terms of the form ev(NegValue, CUI, MetaTerm, MetaConcept, MetaWords, SemTypes, MatchMap, InvolvesHead, IsOvermatch). Thus, within a given score (NegValue), candidates are sorted by CUI.

Specified by:
compare in interface java.util.Comparator
Parameters:
o1 -
o2 -
Returns:
int


The use and distribution of this material is subject to the terms and conditions included in the file SPECIALIST_NLP_TOOLS_TERMS_AND_CONDITIONS.TXT, located in the root directory of the distribution.