<commit_before><commit_msg>tests changes to dateparser<commit_after>package org.rapidsms.java.test;

import org.rapidsms.java.core.model.SimpleFieldType;
import org.rapidsms.java.core.parser.IParseResult;

import junit.framework.TestCase;

public class DateParserTest extends TestCase {

	SimpleFieldType sft1;
	protected void setUp() throws Exception {
		super.setUp();
		
		SimpleFieldType sft = new SimpleFieldType(1, "date224", "((\\d{2,2}\\.{1,1}){2,2}\\d{4,4}|(\\d{2,2}\\/{1,1}){2,2}\\d{4,4}|(\\d{2,2}\\-{1,1}){2,2}\\d{4,4}|\\d{4,4}(\\.\\d{2,2}){2,2}|\\d{4,4}(\\/\\d{2,2}){2,2}|\\d{4,4}(\\/\\d{2,2}){2,2}|\\d{4,4}(\\-\\d{2,2}){2,2})$",
//		SimpleFieldType sft = new SimpleFieldType(1, "date224", "((\\d{2,2}\\.{1,1}){2,2}\\d{4,4})|((\\d{2,2}\\/{1,1}){2,2}\\d{4,4})|((\\d{2,2}\\-{1,1}){2,2}\\d{4,4})|(\\d{4,4}(\\.\\d{2,2}){2,2})|(\\d{4,4}(\\/\\d{2,2}){2,2})|(\\d{4,4}(\\-\\d{2,2}){2,2})",
//		SimpleFieldType sft = new SimpleFieldType(1, "date224", "((\\d{2,2}\\.{1,1}){2,2}\\d{4,4})|((\\d{2,2}\\/{1,1}){2,2}\\d{4,4})|((\\d{2,2}\\-{1,1}){2,2}\\d{4,4})|(\\d{4,4}(\\.\\d{2,2}){2,2})|(\\d{4,4}(\\/\\d{2,2}){2,2})|(\\d{4,4}(\\-\\d{2,2}){2,2})$",
//				SimpleFieldType sft = new SimpleFieldType(1, "date224", "((\\d{2,2}\\.{1,1}){2,2}\\d{4,4})|((\\d{2,2}\\/{1,1}){2,2}\\d{4,4})|((\\d{2,2}\\-{1,1}){2,2}\\d{4,4})|(\\d{4,4}(\\.\\d{2,2}){2,2})|(\\d{4,4}(\\/\\d{2,2}){2,2})|(\\d{4,4}(\\-\\d{2,2}){2,2})\\.*",
//		SimpleFieldType sft = new SimpleFieldType(1, "date224", "^(\\d{4,4}(\\.\\d{2,2}){2,2})|(\\d{4,4}(\\/\\d{2,2}){2,2})|(\\d{4,4}(\\-\\d{2,2}){2,2})(\\s|$)",
				"date224_test");
//		sft.setDataType("date224");
//		sft.setRegex("^(\\d{4,4}(\\.\\d{2,2}){2,2})|(\\d{4,4}(\\/\\d{2,2}){2,2})|(\\d{4,4}(\\-\\d{2,2}){2,2})(\\s|$)");
		sft1 = sft;
		
	}
	
	public void test1_422(){
		
		IParseResult result = sft1.Parse("2013.22.21");
		assertNotNull(result);
		assertEquals("2013.22.21", result.getParsedToken());

		result = sft1.Parse("2013/22/21");
		assertNotNull(result);
		assertEquals("2013/22/21", result.getParsedToken());

		result = sft1.Parse("2013-22-21");
		assertNotNull(result);
		assertEquals("2013-22-21", result.getParsedToken());
	}

	public void test1_224(){
		
		IParseResult result = sft1.Parse("22.21.2013");
		assertNotNull(result);
		assertEquals("22.21.2013", result.getParsedToken());
		
		result = sft1.Parse("22/21/2013");
		assertNotNull(result);
		assertEquals("22/21/2013", result.getParsedToken());
		
		result = sft1.Parse("22-21-2013");
		assertNotNull(result);
		assertEquals("22-21-2013", result.getParsedToken());
	}

	public void test2(){
		
		IParseResult result = sft1.Parse("523.22.21kjsdsflkjdsf");
		assertNotNull(result);
		assertEquals("2013.22.21", result.getParsedToken());
	}
	
	public void test3(){
		
		IParseResult result = sft1.Parse("22.21.3023.kjsdsflkjdsf");
		assertNotNull(result);
		assertEquals("22.21.3023", result.getParsedToken());
	}

}
{'fraction_non_alphanumeric': 0.3451724137931034, 'fraction_numerical': 0.13206896551724137, 'mean_word_length': 4.180357142857143, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4827052', 'n_tokens_mistral': 1566, 'n_tokens_neox': 1400, 'n_words': 115}