<commit_before>api.repl = {}

api.doc.repl.open = {"api.repl.open() -> textgrid", "Opens a REPL that has full access to Hydra's API"}
function api.repl.open()
  local win = api.textgrid.open()
  win:livelong()

  local fg = "00FF00"
  local bg = "222222"

  win:settitle("Hydra REPL")

  local stdout = ""
  local stdin = ""

  local function printstr(x, y, str)
    local size = win:getsize()
    local w = size.w
    local h = size.h

    for i = 1, #str do
      if x == w + 1 then
        x = 1
        y = y + 1
      end

      if y == h + 1 then break end<commit_msg>Fixes bug caused by REPL documentation.<commit_after>api.repl = {}

api.doc.repl = {__doc = "Read-Eval-Print-Loop"}

api.doc.repl.open = {"api.repl.open() -> textgrid", "Opens a (primitive) REPL that has full access to Hydra's API"}
function api.repl.open()
  local win = api.textgrid.open()
  win:livelong()

  local fg = "00FF00"
  local bg = "222222"

  win:settitle("Hydra REPL")

  local stdout = ""
  local stdin = ""

  local function printstr(x, y, str)
    local size = win:getsize()
    local w = size.w
    local h = size.h

    for i = 1, #str do
      if x == w + 1 then
        x = 1
        y = y + 1
      end

      if y == h + 1 then break end
{'fraction_non_alphanumeric': 0.13765182186234817, 'fraction_numerical': 0.024291497975708502, 'mean_word_length': 2.3315363881401616, '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': '4959620', 'n_tokens_mistral': 498, 'n_tokens_neox': 457, 'n_words': 146}