<commit_before># coding: utf-8

#Extensions to the \String class required by the fOOrth language system.
class String
  #Convert this String to a form suitable for embedding in a source string.
  #<br>Returns
  #* An embeddable form of this string as a string.
  def foorth_embed
    temp = (self.gsub(/"/)  {|_v| "\\\""}).gsub(/\\/) {|_v| "\\\\"}
    "\"#{temp}\""
  end

  #Convert this string to a single character string.
  def to_foorth_c
    self[0]
  end

  #Convert this string to a numeric. Return a number or nil on fail.
  def to_foorth_n
    if /\di$/ =~ self      #Check for a trailing '<digit>i'.
      #Check for the internal '+' or '-'sign.
      if /(?<=\d)[+-]/ =~ self<commit_msg>Fixed a bug in String foorth_embed.<commit_after># coding: utf-8

#Extensions to the \String class required by the fOOrth language system.
class String
  #Convert this String to a form suitable for embedding in a source string.
  #<br>Returns
  #* An embeddable form of this string as a string.
  def foorth_embed
    self.inspect
  end

  #Convert this string to a single character string.
  def to_foorth_c
    self[0]
  end

  #Convert this string to a numeric. Return a number or nil on fail.
  def to_foorth_n
    if /\di$/ =~ self      #Check for a trailing '<digit>i'.
      #Check for the internal '+' or '-'sign.
      if /(?<=\d)[+-]/ =~ self
{'fraction_non_alphanumeric': 0.12065136935603257, 'fraction_numerical': 0.0029607698001480384, 'mean_word_length': 2.787114845938375, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '7568260', 'n_tokens_mistral': 456, 'n_tokens_neox': 444, 'n_words': 183}