<commit_before>import each from 'lodash.foreach';

const actionRegex = /^(\w+)\s*/;
const solveRegex = /^solve\s+([:\w\d\s\.\!\-_]+)/;
const newRegex = /([\w]+=\[[:\w\d\s\.\!\-_]+\])/g;

export default (actionString) => {
  var action = actionRegex.exec(actionString.trim())[1];

  switch (action) {
    case 'solve':
      return {
        action,
        answer: solveRegex.exec(actionString.trim())[1]
      };

    case 'new':
      let ret = {
        action
      };

      let params = actionString.trim().match(newRegex);
<commit_msg>fixed issue with no action error<commit_after>import each from 'lodash.foreach';

const actionRegex = /^(\w*)\s*/;
const solveRegex = /^solve\s+([:\w\d\s\.\!\-_]+)/;
const newRegex = /([\w]+=\[[:\w\d\s\.\!\-_]+\])/g;

export default (actionString) => {
  var action = actionRegex.exec(actionString.trim())[1];

  switch (action) {
    case 'solve':
      return {
        action,
        answer: solveRegex.exec(actionString.trim())[1]
      };

    case 'new':
      let ret = {
        action
      };

      let params = actionString.trim().match(newRegex);

{'fraction_non_alphanumeric': 0.21214868540344514, 'fraction_numerical': 0.003626473254759746, 'mean_word_length': 2.515923566878981, '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': '3998680', 'n_tokens_mistral': 400, 'n_tokens_neox': 389, 'n_words': 75}