<commit_before>package timeBench.data;

/**
 * Edge object for handling Edge-related data from a GraphML file in an easy way.
 * 
 * @author <NAME>
 *
 */
public class Edge {
	private String sourceType;
	private String targetType;
	private long lSource;
	private long lTarget;
	private int iSource;
	private int iTarget;
	
	/**
	 * Constructor
	 * @param source
	 * @param target
	 */
	public Edge(String source, String target) {
		this.sourceType = source.substring(0, 1);
    	this.targetType = target.substring(0, 1);
    	this.lSource = Long.parseLong(source.substring(1, 2), 10);
    	this.iSource = Integer.parseInt(source.substring(1, 2));
        this.lTarget = Long.parseLong(target.substring(1, 2), 10);
        this.iTarget = Integer.parseInt(target.substring(1, 2));
	}
	
	/**
	 * Returns the type of the starting point of an edge.
	 * @return
	 */
	public String GetSourceType() {
		if("t".equals(sourceType)) 
			return "element";
		else<commit_msg>IDs are now gathered via split rather than substring (former problem with number greater than 9 fixed).<commit_after>package timeBench.data;

/**
 * Edge object for handling Edge-related data from a GraphML file in an easy way.
 * 
 * @author <NAME>
 *
 */
public class Edge {
	private String sourceType;
	private String targetType;
	private long lSource;
	private long lTarget;
	private int iSource;
	private int iTarget;
	
	/**
	 * Constructor
	 * @param source
	 * @param target
	 */
	public Edge(String source, String target) {
		this.sourceType = source.substring(0, 1);
    	this.targetType = target.substring(0, 1);
    	
    	if("t".equals(sourceType)) {
    		this.lSource = Long.parseLong(source.split("t")[1], 10);
        	this.iSource = Integer.parseInt(source.split("t")[1]);
    	}
    	else {
    		this.lSource = Long.parseLong(source.split(sourceType)[1], 10);
        	this.iSource = Integer.parseInt(source.split(sourceType)[1]);
		}
    	if("t".equals(targetType)) {
    		this.lTarget = Long.parseLong(target.split("t")[1], 10);
        	this.iTarget = Integer.parseInt(target.split("t")[1]);
    	}
    	else {
    		this.lTarget = Long.parseLong(target.split(targetType)[1], 10);
        	this.iTarget = Integer.parseInt(target.split(targetType)[1]);
		}
	}
	
	/**
	 * Returns the type of the starting point of an edge.
	 * @return
	 */
	public String GetSourceType() {
		if("t".equals(sourceType)) 
			return "element";
		else
{'fraction_non_alphanumeric': 0.13297431648715824, 'fraction_numerical': 0.015327257663628831, 'mean_word_length': 3.327956989247312, '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': '1657136', 'n_tokens_mistral': 828, 'n_tokens_neox': 776, 'n_words': 199}