<commit_before># All countries, ordered by country code.
#
# Definitions are in the format:
#   NDC >> National | NDC >> National | # ...
#
# As soon as a NDC matches, it goes on to the National part. Then breaks off.
# If the NDC does not match, it go on to the next (|, or "or") NDC.
#
# Available matching/splitting methods:
# * none:   Does not have a national destination code, e.g. Denmark, Iceland.
# * one_of: Matches one of the following numbers. Splits if it does.
# * match: Try to match the regex, and if it matches, splits it off.
# * fixed:  Always splits off a fixed length ndc. (Always use last in a | chain)
#
# For the national number part, there are two:
# * split:         Use this number group splitting.
# * matched_split: Give a hash of regex => format array, with a :fallback => format option.
#                   (See Norway how it looks.)
#
# Note: The ones that are commented are defined in their special files.
#
Phony.define do

  # Reserved.
  #
  country '0', fixed(1) >> split(10) # Reserved.

  # USA, Canada, etc.
  #
  country '1', fixed(3) >> split(3,4)

  # Kazakhstan (Republic of) & Russian Federation.
  #
  country '7', fixed(3) >> split(3,2,2)

  # Egypt.
  #
  country '20', one_of('800')    >> split(7) | # Egypt
                one_of('2', '3') >> split(8) | # Cairo/Giza, Alexandria
                fixed(2)         >> split(8)
                # :mobile? => /^10|11|12|14|16|17|18|19*$/, :service? => /^800.*$/

  # South Africa.
  #
  country '27', fixed(2) >> split(3,4)

  # Greece.
  #
  country '30', match(/^(2[3-8]?1|69[0345789]|800)\d+$/) >> split(6) | # Geo/Mobile
                fixed(4)                                 >> split(6)   # 3-digit NDCs

  # country '31' # Netherlands, see special file.

  # Belgium.
  #
  country '32', match(/^(70|800|90\d)\d+$/) >> split(3,3) | # Service
                match(/^(4[789]\d)\d{6}$/)  >> split(6)   | # Mobile
                one_of('2','3','4','9')     >> split(3,5) | # Short NDCs
                fixed(2)                    >> split(3,5)   # 2-digit NDCs
<commit_msg>fix greece mobile support<commit_after># All countries, ordered by country code.
#
# Definitions are in the format:
#   NDC >> National | NDC >> National | # ...
#
# As soon as a NDC matches, it goes on to the National part. Then breaks off.
# If the NDC does not match, it go on to the next (|, or "or") NDC.
#
# Available matching/splitting methods:
# * none:   Does not have a national destination code, e.g. Denmark, Iceland.
# * one_of: Matches one of the following numbers. Splits if it does.
# * match: Try to match the regex, and if it matches, splits it off.
# * fixed:  Always splits off a fixed length ndc. (Always use last in a | chain)
#
# For the national number part, there are two:
# * split:         Use this number group splitting.
# * matched_split: Give a hash of regex => format array, with a :fallback => format option.
#                   (See Norway how it looks.)
#
# Note: The ones that are commented are defined in their special files.
#
Phony.define do

  # Reserved.
  #
  country '0', fixed(1) >> split(10) # Reserved.

  # USA, Canada, etc.
  #
  country '1', fixed(3) >> split(3,4)

  # Kazakhstan (Republic of) & Russian Federation.
  #
  country '7', fixed(3) >> split(3,2,2)

  # Egypt.
  #
  country '20', one_of('800')    >> split(7) | # Egypt
                one_of('2', '3') >> split(8) | # Cairo/Giza, Alexandria
                fixed(2)         >> split(8)
                # :mobile? => /^10|11|12|14|16|17|18|19*$/, :service? => /^800.*$/

  # South Africa.
  #
  country '27', fixed(2) >> split(3,4)

  # Greece.
  #
  country '30', match(/^(2[3-8]?1|69[0345789]|800)\d+$/) >> split(8) | # Geo/Mobile
                fixed(4)                                 >> split(6)   # 3-digit NDCs

  # country '31' # Netherlands, see special file.

  # Belgium.
  #
  country '32', match(/^(70|800|90\d)\d+$/) >> split(3,3) | # Service
                match(/^(4[789]\d)\d{6}$/)  >> split(6)   | # Mobile
                one_of('2','3','4','9')     >> split(3,5) | # Short NDCs
                fixed(2)                    >> split(3,5)   # 2-digit NDCs

{'fraction_non_alphanumeric': 0.16153846153846155, 'fraction_numerical': 0.047596153846153844, 'mean_word_length': 2.3181818181818183, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 71, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4402808', 'n_tokens_mistral': 1530, 'n_tokens_neox': 1387, 'n_words': 449}