<commit_before>package com.urlcrawler;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class LineParserImpl implements LineParser {

    private Pattern regPattern;
    private List<URL> links = new ArrayList<URL>();

    public List<URL> extractUrl(String line) {
        Matcher m = regPattern.matcher(line);
        while (m.find()) {
            try {
                System.out.println("Converting string to URL: " + m.group(1));
                URL url = new URL(m.group(1));
                links.add(url);
            } catch (MalformedURLException e) {
            }
        }
        return links;
    }

    public void setRegularExpression(String regex) {
        this.regPattern = Pattern.compile(regex);
    }

}
<commit_msg>Clean links list for each new cycle.<commit_after>package com.urlcrawler;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class LineParserImpl implements LineParser {

    private Pattern regPattern;
    private List<URL> links = new ArrayList<URL>();

    public List<URL> extractUrl(String line) {
        links.clear();
        Matcher m = regPattern.matcher(line);
        while (m.find()) {
            try {
                System.out.println("Converting string to URL: " + m.group(1));
                URL url = new URL(m.group(1));
                links.add(url);
            } catch (MalformedURLException e) {
            }
        }
        return links;
    }

    public void setRegularExpression(String regex) {
        this.regPattern = Pattern.compile(regex);
    }

}

{'fraction_non_alphanumeric': 0.10746102449888642, 'fraction_numerical': 0.0022271714922048997, 'mean_word_length': 2.4163498098859315, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '5310311', 'n_tokens_mistral': 523, 'n_tokens_neox': 504, 'n_words': 123}