package com.knecon.fforesight.service.layoutparser.processor.services.classification;

import java.util.regex.Pattern;

public class ClassificationPatterns {

    public static final Pattern HEADLINE_WITH_2_IDENTIFER_PATTERN = Pattern.compile("^([1-9]\\d?\\.){1,3}\\d{1,2}\\.?\\s(?:14C)?\\s*[a-z][0-9a-z \\[\\]]{2,50}", Pattern.CASE_INSENSITIVE);

    public static final Pattern HEADLINE_WITH_SINGLE_IDENTIFER_PATTERN = Pattern.compile("^([0-9]\\.)\\s[a-z][0-9a-z \\[\\]]{2,50}", Pattern.CASE_INSENSITIVE);

    public static final Pattern AT_LEAST_3_CHARS_PATTERN = Pattern.compile("\\p{L}{3,}", Pattern.CASE_INSENSITIVE);

    public static final Pattern HEADLINE_PATTERN_WITH_SLASHES = Pattern.compile("^(\\d{1,1}\\.){1,3}\\d{1,2}\\.?\\s[a-z]{1,2}\\/[a-z]{1,2}.*");

    public static final Pattern AMOUNT_PATTERN = Pattern.compile(
            "^\\s*\\d+(?:\\.\\d+)?\\s*(?:ml|ul|μl|l|ug|μg|g|kg|mg|cm|cm2|cm3|mm|mm2|mm3|km|km2|m|m2|m3|lb|oz|ppm|dpm|days|weeks|months|%|f|ppb)\\b",
            Pattern.CASE_INSENSITIVE);



    public static final Pattern TABLE_OR_FIGURE_HEADLINE_PATTERN = Pattern.compile(
            "^\\s*(?:table|continued\\s+table|appendix|figure)\\s+(?:[xvi]+|[a-z0-9]{1,3}(?:\\.[0-9]{1,3})*(?:-[0-9]{1,3})?)\\b",
            Pattern.CASE_INSENSITIVE);

    public static final Pattern TABLE_MID_SENTENCE_PATTERN = Pattern.compile(
            "(?:table|continued\\s+table|appendix|figure)\\s+(?:[xvi]+|[a-z0-9]{1,3}(?:\\.[0-9]{1,3})*(?:-[0-9]{1,3})?)\\b",
            Pattern.CASE_INSENSITIVE);

    public static final Pattern ALPHANUMERIC = Pattern.compile("[a-zA-Z0-9]");

    public static final Pattern NUMERIC = Pattern.compile("[0-9]+");

}
