<commit_before>package com.obidea.semantika.cli2.runtime;

import java.util.HashMap;
import java.util.Map;

import com.obidea.semantika.cli2.command.Command;
import com.obidea.semantika.cli2.command.CommandFactory;
import com.obidea.semantika.cli2.command.SelectCommand;
import com.obidea.semantika.cli2.command.SetPrefixCommand;
import com.obidea.semantika.cli2.command.ShowPrefixesCommand;
import com.obidea.semantika.knowledgebase.IPrefixManager;
import com.obidea.semantika.queryanswer.IQueryEngine;

public class ConsoleSession
{
   private IQueryEngine mQueryEngine;
   private Map<String, String> mPrefixMapper;

   public ConsoleSession(IQueryEngine engine, IPrefixManager prefixManager)
   {
      mQueryEngine = engine;
      mPrefixMapper = new HashMap<String, String>(prefixManager.getPrefixMapper());
   }

   public Object execute(String command) throws Exception
   {
      Command cmd = CommandFactory.create(command);
      if (cmd instanceof SelectCommand) {
         return mQueryEngine.evaluate(cmd.arguments().get("value"));
      }
      else if (cmd instanceof SetPrefixCommand) {<commit_msg>Fix wrong argument key.<commit_after>package com.obidea.semantika.cli2.runtime;

import java.util.HashMap;
import java.util.Map;

import com.obidea.semantika.cli2.command.Command;
import com.obidea.semantika.cli2.command.CommandFactory;
import com.obidea.semantika.cli2.command.SelectCommand;
import com.obidea.semantika.cli2.command.SetPrefixCommand;
import com.obidea.semantika.cli2.command.ShowPrefixesCommand;
import com.obidea.semantika.knowledgebase.IPrefixManager;
import com.obidea.semantika.queryanswer.IQueryEngine;

public class ConsoleSession
{
   private IQueryEngine mQueryEngine;
   private Map<String, String> mPrefixMapper;

   public ConsoleSession(IQueryEngine engine, IPrefixManager prefixManager)
   {
      mQueryEngine = engine;
      mPrefixMapper = new HashMap<String, String>(prefixManager.getPrefixMapper());
   }

   public Object execute(String command) throws Exception
   {
      Command cmd = CommandFactory.create(command);
      if (cmd instanceof SelectCommand) {
         return mQueryEngine.evaluate(cmd.arguments().get("string"));
      }
      else if (cmd instanceof SetPrefixCommand) {
{'fraction_non_alphanumeric': 0.09326193663543061, 'fraction_numerical': 0.00535475234270415, 'mean_word_length': 4.915567282321899, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5626005', 'n_tokens_mistral': 660, 'n_tokens_neox': 657, 'n_words': 125}