<commit_before>var Immutable = require('immutable');
const initialState = new Immutable.Map();

module.exports = function(state = initialState, action) {
  if (action.type === 'SET_MEASURES' && action.measures) {
    return Immutable.fromJS(action.measures);
  }
  if (action.type === 'CREATE_MEASURE') {
    return state.set(action.measureId, Immutable.Map({
      list: new Immutable.List()
      }));
    }

  if (action.type === 'SET_KIND') {
    if (action.kind !== 'numeric') {
      state = state.setIn([action.measureId, 'unit'], null);
    }
    if (action.kind === 'qualitative') {
      state = state.setIn([action.measureId, 'list'], null);
    }
    if (action.kind === 'list') {
      state = state.setIn([action.measureId, 'scale'], null);<commit_msg>Add default for Measure choice<commit_after>var Immutable = require('immutable');
const initialState = new Immutable.Map();

module.exports = function(state = initialState, action) {
  if (action.type === 'SET_MEASURES' && action.measures) {
    return Immutable.fromJS(action.measures);
  }
  if (action.type === 'CREATE_MEASURE') {
    return state.set(action.measureId, Immutable.Map({
      list: new Immutable.List()
      }));
    }

  if (action.type === 'SET_KIND') {
    if (action.kind !== 'numeric') {
      state = state.setIn([action.measureId, 'unit'], null);
    }
    if (action.kind === 'qualitative') {
      state = state.setIn([action.measureId, 'list'], null);
    }
    if (action.kind === 'list') {
      state = state.setIn([action.measureId, 'list'], Immutable.List())
      state = state.setIn([action.measureId, 'scale'], null);
{'fraction_non_alphanumeric': 0.17890191239975323, 'fraction_numerical': 0.0, 'mean_word_length': 3.5690140845070424, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7201769', 'n_tokens_mistral': 526, 'n_tokens_neox': 520, 'n_words': 107}