// ------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// ------------------------------------------------------------------------------

package com.microsoft.recognizers.text.sequence.resources;

import java.util.Arrays;
import java.util.List;

public class BasePhoneNumbers {

    public static final String NumberReplaceToken = "@builtin.phonenumber";

    public static final String WordBoundariesRegex = "\\b";

    public static final String NonWordBoundariesRegex = "\\B";

    public static final String EndWordBoundariesRegex = "\\b";

    public static final String PreCheckPhoneNumberRegex = "(\\d{1,4}.){2,4}\\s?\\d{2,3}";

    public static String GeneralPhoneNumberRegex(String WordBoundariesRegex, String EndWordBoundariesRegex) {
        return "({WordBoundariesRegex}(((\\d[\\s]?){4,12}))(-?[\\d\\s?]{3}\\d)(?!-){EndWordBoundariesRegex})|(\\(\\d{5}\\)\\s?\\d{5,6})|\\+\\d{2}\\(\\d\\)\\d{10}"
            .replace("{WordBoundariesRegex}", WordBoundariesRegex)
            .replace("{EndWordBoundariesRegex}", EndWordBoundariesRegex);
    }

    public static String BRPhoneNumberRegex(String WordBoundariesRegex, String NonWordBoundariesRegex, String EndWordBoundariesRegex) {
        return "((\\(\\s?(\\+\\s?|00)55\\s?\\)\\s?)|(((?<!\\d)\\+\\s?|{WordBoundariesRegex}00)55\\s?)|{WordBoundariesRegex})?((({NonWordBoundariesRegex}\\(\\s?))\\d{2,3}(\\s?\\))|({WordBoundariesRegex}\\d{2,3}))\\s?\\d{4,5}-?\\d{3,5}(?!-){EndWordBoundariesRegex}"
            .replace("{WordBoundariesRegex}", WordBoundariesRegex)
            .replace("{NonWordBoundariesRegex}", NonWordBoundariesRegex)
            .replace("{EndWordBoundariesRegex}", EndWordBoundariesRegex);
    }

    public static String UKPhoneNumberRegex(String WordBoundariesRegex, String NonWordBoundariesRegex, String EndWordBoundariesRegex) {
        return "((({WordBoundariesRegex}(00)|{NonWordBoundariesRegex}\\+)\\s?)?({WordBoundariesRegex}\\d{2}\\s?)?((\\s?\\(0\\)[-\\s]?|{WordBoundariesRegex}|(?<=(\\b^#)\\d{2}))\\d{2,5}|\\(0\\d{3,4}\\))[/-]?\\s?(\\d{5,8}|\\d{3,4}[-\\s]?\\d{3,4})(?!-){EndWordBoundariesRegex})"
            .replace("{WordBoundariesRegex}", WordBoundariesRegex)
            .replace("{NonWordBoundariesRegex}", NonWordBoundariesRegex)
            .replace("{EndWordBoundariesRegex}", EndWordBoundariesRegex);
    }

    public static String DEPhoneNumberRegex(String WordBoundariesRegex, String EndWordBoundariesRegex) {
        return "((\\+\\d{2}\\s?((\\(0\\))?\\d\\s?)?|{WordBoundariesRegex})(\\d{2,4}\\s?[-/]?[\\s\\d]{7,10}\\d)(?!-){EndWordBoundariesRegex})"
            .replace("{WordBoundariesRegex}", WordBoundariesRegex)
            .replace("{EndWordBoundariesRegex}", EndWordBoundariesRegex);
    }

    public static String USPhoneNumberRegex(String WordBoundariesRegex, String NonWordBoundariesRegex, String EndWordBoundariesRegex) {
        return "((((({NonWordBoundariesRegex}\\+)|{WordBoundariesRegex})1(\\s|-)?)|{WordBoundariesRegex})?(\\d{3}\\)[-\\s]?|\\(\\d{3}\\)[-\\.\\s]?|{WordBoundariesRegex}\\d{3}\\s?[-\\.]?\\s?)|{WordBoundariesRegex})[2-9]\\d{2}\\s?[-\\.]?\\s?\\d{4}(\\s?(x|X|ext)\\s?\\d{3,5})?(?!(-\\s?\\d)){EndWordBoundariesRegex}"
            .replace("{WordBoundariesRegex}", WordBoundariesRegex)
            .replace("{NonWordBoundariesRegex}", NonWordBoundariesRegex)
            .replace("{EndWordBoundariesRegex}", EndWordBoundariesRegex);
    }

    public static String CNPhoneNumberRegex(String WordBoundariesRegex, String EndWordBoundariesRegex) {
        return "(({WordBoundariesRegex}00\\s?)?\\+?(86|82|81)\\s?-?\\s?)?((({WordBoundariesRegex}|(?<=(86|82|81)))\\d{2,5}\\s?-?\\s?|\\(\\d{2,5}\\)\\s?)\\d{4}\\s?-?\\s?\\d{4}(\\s?-?\\s?\\d{4})?|(\\b|(?<=(86|82|81)))\\d{3}\\s?-?\\s?\\d{4}\\s?-?\\s?\\d{4})(?!-){EndWordBoundariesRegex}"
            .replace("{WordBoundariesRegex}", WordBoundariesRegex)
            .replace("{EndWordBoundariesRegex}", EndWordBoundariesRegex);
    }

    public static String DKPhoneNumberRegex(String WordBoundariesRegex, String EndWordBoundariesRegex) {
        return "((\\(\\s?(\\+\\s?|00)45\\s?\\)\\s?)|(((?<!\\d)\\+\\s?|\\b00)45\\s?)|{WordBoundariesRegex})(\\s?\\(0\\)\\s?)?((\\d{8})|(\\d{4}\\s?-?\\s?\\d{4,6})|((\\d{2}[\\s-]){3}\\d{2})|(\\d{2}\\s?-?\\s?\\d{3}\\s?-?\\s?\\d{3}))(?!-){EndWordBoundariesRegex}"
            .replace("{WordBoundariesRegex}", WordBoundariesRegex)
            .replace("{EndWordBoundariesRegex}", EndWordBoundariesRegex);
    }

    public static String ITPhoneNumberRegex(String WordBoundariesRegex, String EndWordBoundariesRegex) {
        return "((\\(\\s?(\\+\\s?|00)39\\s?\\)\\s?)|(((?<!\\d)\\+\\s?|\\b00)39\\s?)|{WordBoundariesRegex})((0[\\d-]{4,12}\\d)|(3[\\d-]{7,12}\\d)|(0[\\d\\s]{4,12}\\d)|(3[\\d\\s]{7,12}\\d))(?!-){EndWordBoundariesRegex}"
            .replace("{WordBoundariesRegex}", WordBoundariesRegex)
            .replace("{EndWordBoundariesRegex}", EndWordBoundariesRegex);
    }

    public static String NLPhoneNumberRegex(String WordBoundariesRegex, String EndWordBoundariesRegex) {
        return "((((\\(\\s?(\\+\\s?|00)31\\s?\\)\\s?)|(((?<!\\d)\\+\\s?|{WordBoundariesRegex}00)31\\s?))?((({WordBoundariesRegex}|(?<=31))0?\\d{1,3}|\\(\\s?0?\\d{1,3}\\s?\\)|\\(0\\)[-\\s]?\\d{1,3})((-?[\\d]{5,11})|(\\s[\\d\\s]{5,11}))\\d))|\\b\\d{10,12})(?!-){EndWordBoundariesRegex}"
            .replace("{WordBoundariesRegex}", WordBoundariesRegex)
            .replace("{EndWordBoundariesRegex}", EndWordBoundariesRegex);
    }

    public static String SpecialPhoneNumberRegex(String WordBoundariesRegex, String EndWordBoundariesRegex) {
        return "({WordBoundariesRegex}(\\d{3,4}[/-]\\d{1,4}[/-]\\d{3,4}){EndWordBoundariesRegex})"
            .replace("{WordBoundariesRegex}", WordBoundariesRegex)
            .replace("{EndWordBoundariesRegex}", EndWordBoundariesRegex);
    }

    public static final String NoAreaCodeUSPhoneNumberRegex = "(?<!(-|-\\s|\\d|\\)|\\)\\s|\\.))[2-9]\\d{2}\\s?[-\\.]\\s?\\d{4}(?!(-\\s?\\d))\\b";

    public static final String InternationDialingPrefixRegex = "0(0|11)$";

    public static final List<String> TypicalDeductionRegexList = Arrays.asList("^\\d{5}-\\d{4}$", "\\)\\.", "^0(0|11)(-)");

    public static final String PhoneNumberMaskRegex = "([0-9a-e]{2}(\\s[0-9a-e]{2}){7})";

    public static final String CountryCodeRegex = "^(\\(\\s?(\\+\\s?|00)\\d{1,3}\\s?\\)|(\\+\\s?|00)\\d{1,3})";

    public static final String AreaCodeIndicatorRegex = "\\(";

    public static final String FormatIndicatorRegex = "(\\s|-|/|\\.)+";

    public static final List<Character> ColonMarkers = Arrays.asList(':');

    public static final String ColonPrefixCheckRegex = "(([a-z])\\s*$)";

    public static final List<Character> SpecialBoundaryMarkers = Arrays.asList('-', ' ');

    public static final List<Character> BoundaryMarkers = Arrays.asList('-', '.', '/', '+', '#', '*');

    public static final List<Character> ForbiddenPrefixMarkers = Arrays.asList(',', ':', '%');

    public static final List<Character> ForbiddenSuffixMarkers = Arrays.asList('/', '+', '#', '*', ':', '%');

    public static final String SSNFilterRegex = "^\\d{3}-\\d{2}-\\d{4}$";
}
