<commit_before><commit_msg>Updated the date handling to allow for yyyy, yyyy/mm, yyyy/mm/dd and abt, bef and aft. Also provided more visual feedback when there is a date formatting error. Also modified the queries so that the date in the user data section is used on the diagram for the fist time.<commit_after>package nl.mpi.kinnate.kindata;

import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlValue;

/**
 *  Document   : EntityDate
 *  Created on : Mar 15, 2012, 4:23:27 PM
 *  Author     : <NAME>
 */
public class EntityDate {

    @XmlValue
    private String fullDateString;

    public EntityDate() {
    }

    public EntityDate(String fullDateString) {
        // todo: validate this date format
        this.fullDateString = fullDateString;
    }

    public EntityDate(String yearString, String monthString, String dayString, String qualifierString) throws EntityDateException {
        if (yearString == null) {
            throw new EntityDateException("cannot create date without a year");
        }
        if (dayString != null && monthString == null) {
            throw new EntityDateException("cannot create date with a day but no month");
        }
        if (dayString != null) {
            this.fullDateString = yearString + "/" + monthString + "/" + dayString;
        } else if (monthString != null) {
            this.fullDateString = yearString + "/" + monthString;
        } else {
            this.fullDateString = yearString;
        }
        if (qualifierString != null) {
            boolean foundValidQualifier = false;
            for (String prefixString : new String[]{"ABT", "BEF", "AFT"}) {
                if (qualifierString.startsWith(prefixString)) {
                    foundValidQualifier = true;
                }
            }
            if (!foundValidQualifier) {
                throw new EntityDateException("invalid prefix: " + foundValidQualifier);
            }
            this.fullDateString = this.fullDateString + " " + qualifierString;
        }
    }

    @XmlTransient
    public String getDateString() {
        // todo: validate this date format
        return fullDateString;
    }

    public boolean dateIsValid() {
        // todo: validate the date string
        return false;
    }
}
{'fraction_non_alphanumeric': 0.09007433318758198, 'fraction_numerical': 0.004809794490599038, 'mean_word_length': 2.2968299711815563, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '3313519', 'n_tokens_mistral': 619, 'n_tokens_neox': 596, 'n_words': 187}