Compare two classifier output
@param doc1
@param doc2
@return
439348
public boolean compare(List<CoreLabel> doc1, List<CoreLabel> doc2) {
		int i1 = 0, i2 = 0; //
		String last1 = "O", last2 = "O";

		boolean cm_set;
	
		for (int i = 0; i < doc1.size(); i++) {
			CoreLabel c1 = doc1.get(i);
			CoreLabel c2 = doc2.get(i);
			
			String a1 = c1.getString(AnswerAnnotation.class);
			String a2 = c2.getString(AnswerAnnotation.class);
			
			if (a1 == null || a2 == null) return false;
		}
		// TODO
			
		return true;
	}
22727
public static int typeCompareTo(Writable one, Writable other) {
        PrimitiveObject noOne = hadoop2Primitive(one);
        PrimitiveObject noOther = hadoop2Primitive(other);
        if (noOne.getType() != noOther.getType()) {
            return -1;
        }

        return 0;
    }
1050405
public double[][] classify(Document[] documents) throws Exception {
		double[][] predictions = new double[documents.length][lexicon
				.getLabelNum()];
		for (int d = 0; d < documents.length; d++) {
			Document doc = documents[d];
			predictions[d] = classify(doc);
		}
		return predictions;
	}
388841
def __doc_cmp(self, other):
        
        if other is None:
            return -1
        if self.is_new and other.is_new:
            return 0
        if self.__docid < other.__docid:
            return -1
        elif self.__docid == other.__docid:
            return 0
        else:
            return 1
500563
public static boolean compareQNameLists(List<QName> list1, List<QName> list2) {
        if (list1 == list2)
            return true;
        if (list1 == null || list2 == null)
            return false;
        if (list1.size() != list2.size())
            return false;

        for (int i = 0; i < list1.size(); i++) {
            if (!compareQNames(list1.get(i), list2.get(i)))
                return false;
        }

        return true;
    }
9057
protected void compareNode(Node control, Node test,
                               DifferenceListener listener, ElementQualifier elementQualifier) 
        throws DifferenceFoundException {
        boolean comparable = compareNodeBasics(control, test, listener);
        boolean isDocumentNode = false;

        if (comparable) {
            switch (control.getNodeType()) {
            case Node.ELEMENT_NODE:
                compareElement((Element)control, (Element)test, listener);
                break;
            case Node.CDATA_SECTION_NODE:
            case Node.TEXT_NODE:
                compareText((CharacterData) control,
                            (CharacterData) test, listener);
                break;
            case Node.COMMENT_NODE:
                compareComment((Comment)control, (Comment)test, listener);
                break;
            case Node.DOCUMENT_TYPE_NODE:
                compareDocumentType((DocumentType)control,
                                    (DocumentType)test, listener);
                break;
            case Node.PROCESSING_INSTRUCTION_NODE:
                compareProcessingInstruction((ProcessingInstruction)control,
                                             (ProcessingInstruction)test, listener);
                break;
            case Node.DOCUMENT_NODE:
                isDocumentNode = true;
                compareDocument((Document)control, (Document) test, 
                                listener, elementQualifier);
                break;
            default:
                listener.skippedComparison(control, test);
            }
        } 

        compareHasChildNodes(control, test, listener);
        if (isDocumentNode) {
            Element controlElement = ((Document)control).getDocumentElement();
            Element testElement = ((Document)test).getDocumentElement();
            if (controlElement!=null && testElement!=null) {
                compareNode(controlElement, testElement, listener, elementQualifier);
            }
        } else {
            controlTracker.indent();
            testTracker.indent();
            compareNodeChildren(control, test, listener, elementQualifier);
            controlTracker.outdent();
            testTracker.outdent();
        }
    }
832141
public void classifyAndWriteAnswersKBest(String testFile, int k,
                                       DocumentReaderAndWriter<IN> readerAndWriter)
    throws IOException
  {
    ObjectBank<List<IN>> documents =
      makeObjectBankFromFile(testFile, readerAndWriter);
    PrintWriter pw = IOUtils.encodedOutputStreamPrintWriter(System.out, "", true);
    classifyAndWriteAnswersKBest(documents, k, pw, readerAndWriter);
  }
743184
def compare(self, statement_a, statement_b):
        
        # Make both strings lowercase
        document_a = self.nlp(statement_a.text.lower())
        document_b = self.nlp(statement_b.text.lower())

        statement_a_lemmas = set([
            token.lemma_ for token in document_a if not token.is_stop
        ])
        statement_b_lemmas = set([
            token.lemma_ for token in document_b if not token.is_stop
        ])

        # Calculate Jaccard similarity
        numerator = len(statement_a_lemmas.intersection(statement_b_lemmas))
        denominator = float(len(statement_a_lemmas.union(statement_b_lemmas)))
        ratio = numerator / denominator

        return ratio
792506
def compare_basis_files(file_path_1, file_path_2, file_type_1=None, file_type_2=None, uncontract_general=False):
    ''''''

    bs1 = read_formatted_basis(file_path_1, file_type_1)
    bs2 = read_formatted_basis(file_path_2, file_type_2)
    return basis_comparison_report(bs1, bs2, uncontract_general)
710265
private boolean extendedIdentifierEquals(String eid1, String eid2) {
		try {
			return DomHelpers.compare(DomHelpers.toDocument(eid1, null),
					DomHelpers.toDocument(eid2, null));
		} catch (MarshalException e) {
			return false;
		}
	}
826442
@Override
	public List<IN> classify(List<IN> tokens) {
		if (baseClassifiers.isEmpty()) {
			return tokens;
		}
		List<List<IN>> baseOutputs = new ArrayList<List<IN>>();

		// the first base model works in place, modifying the original tokens
		List<IN> output = baseClassifiers.get(0).classifySentence(tokens);
		// classify(List<IN>) is supposed to work in place, so add AnswerAnnotation to tokens!
		for (int i = 0, sz = output.size(); i < sz; i++) {
			tokens.get(i).set(AnswerAnnotation.class, output.get(i).get(AnswerAnnotation.class));
		}
		baseOutputs.add(tokens);

		for (int i = 1, sz = baseClassifiers.size(); i < sz; i ++) {
			//List<CoreLabel> copy = deepCopy(tokens);
			// no need for deep copy: classifySentence creates a copy of the input anyway
			// List<CoreLabel> copy = tokens;
			output = baseClassifiers.get(i).classifySentence(tokens);
			baseOutputs.add(output);
		}
		assert(baseOutputs.size() == baseClassifiers.size());
		List<IN> finalAnswer = mergeDocuments(baseOutputs);

		return finalAnswer;
	}
1208100
private ComparisonState
        compareDocTypes(DocumentType control,
                        XPathContext controlContext,
                        DocumentType test,
                        XPathContext testContext) {
        return compare(new Comparison(ComparisonType.DOCTYPE_NAME,
                                      control, getXPath(controlContext),
                                      control.getName(), getParentXPath(controlContext),
                                      test, getXPath(testContext),
                                      test.getName(), getParentXPath(testContext)))
            .andThen(new Comparison(ComparisonType.DOCTYPE_PUBLIC_ID,
                                    control, getXPath(controlContext),
                                    control.getPublicId(), getParentXPath(controlContext),
                                    test, getXPath(testContext),
                                    test.getPublicId(), getParentXPath(testContext)))
            .andThen(new Comparison(ComparisonType.DOCTYPE_SYSTEM_ID,
                                    control, null, control.getSystemId(), null,
                                    test, null, test.getSystemId(), null));
    }
1258553
public static int compareTo(byte[] b1, int s1, int l1, byte[] b2, int s2,
      int l2) {
    return LexicographicalComparerHolder.BEST_COMPARER.compareTo(
        b1, s1, l1, b2, s2, l2);
  }
693350
public static int compareToIgnoreCaseCarefulEquals(String S1, String S2) {
		int diff=S1.compareToIgnoreCase(S2);
		if(diff==0) diff=S1.compareTo(S2);
		return diff;
	}
399216
public int compare(Attribute a, Attribute b) {
        int result = a.getId().toString().compareTo(b.getId().toString());

        if (result == 0) {
            result = a.getType().toString().compareTo(b.getType().toString());
        } else {
            return result;
        }

        if (result == 0) {
            result = a.getValue().encode().compareTo(b.getValue().encode());
        } else {
            return result;
        }

        if (result == 0
                && (a.getIssueInstant() != null || b.getIssueInstant() != null)) {
            if (a.getIssueInstant() == null && b.getIssueInstant() == null) {
                result = 0;
            } else if (a.getIssueInstant() != null
                    && b.getIssueInstant() == null) {
                result = 1;
            } else if (a.getIssueInstant() == null
                    && b.getIssueInstant() != null) {
                result = -1;
            } else {
                result =
                        a.getIssueInstant().encode().compareTo(b
                                .getIssueInstant().encode());
            }
        }

        return result;
    }
43484
public static <T> boolean compareLists(List<T> list1, List<T> list2) {
        if (list1 == list2)
            return true;
        if (list1 == null || list2 == null)
            return false;
        if (list1.size() != list2.size())
            return false;

        for (int i = 0; i < list1.size(); i++) {
            if (!list1.get(i).equals(list2.get(i))) {
                return false;
            }
        }
        return true;
    }
950088
public static boolean areElementEquals(Element element1, Element element2) {
		for (Mask mask1 : element1.getMask()) {
			if (!areBooleanEquals(element1.isNegated(), element2.isNegated())) {
				// Negated.
				return false;
			}
			for (Mask mask2 : element2.getMask()) {
				if (!areStringEquals(mask1.getLexemeMask(), mask2.getLexemeMask())) {
					// LexemeMask.
					return false;
				} else if (!areStringEquals(mask1.getPrimitiveMask(), mask2.getPrimitiveMask())) {
					// PrimitiveMask.
					return false;
				} else if (!areTagMaskEquals(mask1.getTagMask(), mask2.getTagMask())) {
					// TagMask.
					return false;
				}
			}
		}
		return true;
	}