<commit_before>// Adapted from https://github.com/miracle2k/python-glob2

use "regex"

primitive Glob
  """Filename matching and globbing with shell patterns.

  `fnmatch(file_name, pattern)` matches according to the local convention.
  `fnmatchcase(file_name, pattern)` always takes case in account.  The functions
  operate by translating the pattern into a regular expression.

  The function translate(PATTERN) returns a regular expression corresponding to PATTERN.

  """

  fun fnmatch(name: String, pattern: String): Bool =>
    """
    Tests whether `name` matches `pattern`.

    Patterns are Unix shell style:
        *       | matches everything
        ?       | matches any single character
        [seq]   | matches any character in seq
        [!seq]  | matches any char not in seq

    An initial period in `name` is not special.

    Both `name` and `pattern` are first case-normalized if the operating system
    requires it.  If you don't want this, use `fnmatchcase`.
    """
    fnmatchcase(Path.normcase(name), Path.normcase(pattern))<commit_msg>improve comments<commit_after>// Adapted from https://github.com/miracle2k/python-glob2

use "regex"

primitive Glob
  """Filename matching and globbing with shell patterns.

  `fnmatch(file_name, pattern)` matches according to the local convention.
  `fnmatchcase(file_name, pattern)` always takes case in account.  The functions
  operate by translating the pattern into a regular expression.

  The function translate(PATTERN) returns a regular expression corresponding to PATTERN.

  """

  fun fnmatch(name: String, pattern: String): Bool =>
    """
    Tests whether `name` matches `pattern`.

    Patterns are Unix shell style:
        *       | matches files
        **      | matches files across directories
        ?       | matches any single character
        [seq]   | matches any character in seq
        [!seq]  | matches any char not in seq

    An initial period in `name` is not special.

    Both `name` and `pattern` are first case-normalized if the operating system
    requires it.  If you don't want this, use `fnmatchcase`.
    """
    fnmatchcase(Path.normcase(name), Path.normcase(pattern))
{'fraction_non_alphanumeric': 0.08466819221967964, 'fraction_numerical': 0.0018306636155606408, 'mean_word_length': 3.2119460500963393, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '2726004', 'n_tokens_mistral': 608, 'n_tokens_neox': 578, 'n_words': 236}