<commit_before>package com.darwinsys.todo.model;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Import {
	
	public static Pattern re = Pattern.compile(
			"(x)?( \\d{4}\\-\\d{2}\\-\\d{2})?" + // Completion flag, completion date+
			" ?" +
			"(\\([A-Z]\\))?( \\d{4}-\\d{2}-\\d{2}) ?" +		// PRIORITY, CreationDate
			".*((\\+\\w+)|(@\\w+))*.*",			// name, optional +Project, @Context in either order anywhere
					
			Pattern.COMMENTS);
			

	public static List<Task> importTasks(List<String> input) {
		List<Task> list = new ArrayList<Task>();
		for (String s : input) {
			list.add(importTask(s));
		}
		return list;
	}
	
	public static Task importTask(String str) {
		Matcher m = re.matcher(str);
		Task t = new Task();
		if (m.matches()) {
			t.setName(str);
			return t;
		} else {
			throw new IllegalArgumentException("Task failed to parse: " + str);
		}
	}
}<commit_msg>Match a bit better. Dump matches to stdout for debugging<commit_after>package com.darwinsys.todo.model;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Import {
	
	public static Pattern re = Pattern.compile(
			"(x)?( \\d{4}\\-\\d{2}\\-\\d{2})?" + // Completion flag, completion date+
			" ?" +
			"(\\([A-Z]\\))?( \\d{4}-\\d{2}-\\d{2})?" +		// PRIORITY, CreationDate
			" ?" +
			"(.*(\\+\\w+)|(@\\w+)*.*)",			// name, optional +Project, @Context in either order anywhere
					
			Pattern.COMMENTS);
			

	public static List<Task> importTasks(List<String> input) {
		List<Task> list = new ArrayList<Task>();
		for (String s : input) {
			list.add(importTask(s));
		}
		return list;
	}
	
	public static Task importTask(String str) {
		Matcher m = re.matcher(str);
		Task t = new Task();
		if (m.matches()) {
			for (int i = 0; i < m.groupCount(); i++) {
				System.out.println(i + " " + m.group(i));
			}
			t.setName(str);
			return t;
		} else {
			throw new IllegalArgumentException("Task failed to parse: " + str);
		}
	}
}
{'fraction_non_alphanumeric': 0.2000966650555824, 'fraction_numerical': 0.006283228612856452, 'mean_word_length': 3.0194174757281553, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 11, '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': '119018', 'n_tokens_mistral': 847, 'n_tokens_neox': 738, 'n_words': 176}