<commit_before>package ch.tkuhn.hashuri.rdf;

import java.util.Comparator;

import org.openrdf.model.BNode;
import org.openrdf.model.Literal;
import org.openrdf.model.Resource;
import org.openrdf.model.Statement;
import org.openrdf.model.URI;
import org.openrdf.model.Value;
import org.openrdf.model.impl.ContextStatementImpl;
import org.openrdf.model.impl.LiteralImpl;
import org.openrdf.model.impl.StatementImpl;
import org.openrdf.model.impl.URIImpl;

public class SerStatementComparator implements Comparator<String> {

	public SerStatementComparator() {
	}

	@Override
	public int compare(String s1, String s2) {
		String[] parts1 = s1.split("\\t");
		String[] parts2 = s2.split("\\t");
		int c;
		c = parts1[0].compareTo(parts2[0]);
		if (c != 0) return c;
		c = parts1[1].compareTo(parts2[1]);
		if (c != 0) return c;
		c = parts1[2].compareTo(parts2[2]);
		if (c != 0) return c;
		c = parts1[3].compareTo(parts2[3]);<commit_msg>Fix bug in sorting with external files<commit_after>package ch.tkuhn.hashuri.rdf;

import java.util.Comparator;

import org.openrdf.model.BNode;
import org.openrdf.model.Literal;
import org.openrdf.model.Resource;
import org.openrdf.model.Statement;
import org.openrdf.model.URI;
import org.openrdf.model.Value;
import org.openrdf.model.impl.ContextStatementImpl;
import org.openrdf.model.impl.LiteralImpl;
import org.openrdf.model.impl.StatementImpl;
import org.openrdf.model.impl.URIImpl;

public class SerStatementComparator implements Comparator<String> {

	public SerStatementComparator() {
	}

	@Override
	public int compare(String s1, String s2) {
		String[] parts1 = s1.split("\\t");
		String[] parts2 = s2.split("\\t");
		int c;
		c = parts1[0].compareTo(parts2[0]);
		if (c != 0) return c;
		c = parts1[1].compareTo(parts2[1]);
		if (c != 0) return c;
		c = parts1[2].compareTo(parts2[2]);
		if (c != 0) return c;
		boolean objuri1 = !parts1[3].isEmpty();
		boolean objuri2 = !parts2[3].isEmpty();
		if (objuri1 && !objuri2) return -1;
		if (!objuri1 && objuri2) return 1;
		c = parts1[3].compareTo(parts2[3]);
{'fraction_non_alphanumeric': 0.1502918287937743, 'fraction_numerical': 0.030155642023346304, 'mean_word_length': 4.77808988764045, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4822720', 'n_tokens_mistral': 795, 'n_tokens_neox': 766, 'n_words': 159}