<commit_before>require_relative '../../lib/fidgit'
include Fidgit

Fidgit.default_font_size = 30

media_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'media'))
Gosu::Image.autoload_dirs << File.join(media_dir, 'images')
Gosu::Sample.autoload_dirs << File.join(media_dir, 'sounds')

class ExampleWindow < Fidgit::GuiWindow
  def initialize(options = {})
    default_caption = "Example: #{File.basename($0).chomp(".rb").tr('_', ' ')} #{ENV['FIDGIT_EXAMPLES_TEXT']}"

    options = {
      state: ExampleState,
      caption: default_caption,
    }.merge! options

    super(options)
  end

  def needs_cursor?
    false
  end
end<commit_msg>Press escape to close an example.<commit_after>require_relative '../../lib/fidgit'
include Fidgit

Fidgit.default_font_size = 30

media_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'media'))
Gosu::Image.autoload_dirs << File.join(media_dir, 'images')
Gosu::Sample.autoload_dirs << File.join(media_dir, 'sounds')

class ExampleWindow < Fidgit::GuiWindow
  def initialize(options = {})
    default_caption = "#{File.basename($0).chomp(".rb").tr('_', ' ')} #{ENV['FIDGIT_EXAMPLES_TEXT']}"

    on_input(:escape) { close }

    options = {
      state: ExampleState,
      caption: default_caption,
    }.merge! options

    super(options)
  end

  def needs_cursor?
    false
  end
end
{'fraction_non_alphanumeric': 0.16002949852507375, 'fraction_numerical': 0.004424778761061947, 'mean_word_length': 4.4063745019920315, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 3, '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': '3932852', 'n_tokens_mistral': 490, 'n_tokens_neox': 480, 'n_words': 81}