<commit_before># Namespace and main entry point for the Mustermann library.
#
# Under normal circumstances the only external API entry point you should be using is {Mustermann.new}.
module Mustermann
  # @param [String] string The string representation of the new pattern
  # @param [Hash] options The options hash
  # @return [Mustermann::Pattern] pattern corresponding to string.
  # @see file:README.md#Types_and_Options "Types and Options" in the README
  def self.new(string, type: :sinatra, **options)
    options.any? ? self[type].new(string, **options) : self[type].new(string)
  end

  # Maps a type to its factory.
  #
  # @example
  #   Mustermann[:sinatra] # => Mustermann::Sinatra
  #
  # @param [Symbol] key a pattern type identifier
  # @return [Class, #new] pattern factory
  def self.[](key)
    constant, library = register.fetch(key) { raise ArgumentError, "unsupported type %p" % key }
    require library if library<commit_msg>document exceptions raise by Mustermann.new and Mustermann[]<commit_after># Namespace and main entry point for the Mustermann library.
#
# Under normal circumstances the only external API entry point you should be using is {Mustermann.new}.
module Mustermann
  # @param [String] string The string representation of the new pattern
  # @param [Hash] options The options hash
  # @return [Mustermann::Pattern] pattern corresponding to string.
  # @raise (see [])
  # @raise (see Mustermann::Pattern.new)
  # @see file:README.md#Types_and_Options "Types and Options" in the README
  def self.new(string, type: :sinatra, **options)
    options.any? ? self[type].new(string, **options) : self[type].new(string)
  end

  # Maps a type to its factory.
  #
  # @example
  #   Mustermann[:sinatra] # => Mustermann::Sinatra
  #
  # @param [Symbol] key a pattern type identifier
  # @raise [ArgumentError] if the type is not supported
  # @return [Class, #new] pattern factory
  def self.[](key)
    constant, library = register.fetch(key) { raise ArgumentError, "unsupported type %p" % key }
    require library if library
{'fraction_non_alphanumeric': 0.10776699029126213, 'fraction_numerical': 0.0, 'mean_word_length': 4.311855670103093, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '6566254', 'n_tokens_mistral': 617, 'n_tokens_neox': 593, 'n_words': 224}