<commit_before>/**
 * This is a simple replacement for draft-js ContentBlock,
 * CharacterList or any related methods are not implented here
 */
const stubContentBlock = block => Object.assign({}, block, {
  get: name => block[name],
  getText: () => block.text,
  getType: () => block.type,
  getKey: () => block.key,
  getLength: () => block.text.length,
  getDepth: () => block.depth,
  getData: () => block.data,
});

export default stubContentBlock;<commit_msg>ContentBlockStub is now a class<commit_after>/**
 * This is a simple replacement for draft-js ContentBlock,
 * CharacterList or any related methods are not implented here
 */

class ContentBlockStub {
  constructor(block) {
    Object.assign(this, block);
  }
  get(name) {
    return this[name];
  }
  getText() {
    return this.text;
  }
  getType() {
    return this.type;
  }
  getKey() {
    return this.key;
  }
  getLength() {
    return this.text.length;
  }
  getDepth() {
    return this.depth;
  }
  getData() {
    return this.data;
  }
}

const stubContentBlock = block => new ContentBlockStub(block);

export default stubContentBlock;
{'fraction_non_alphanumeric': 0.1336322869955157, 'fraction_numerical': 0.0, 'mean_word_length': 3.4819277108433737, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '2623927', 'n_tokens_mistral': 355, 'n_tokens_neox': 354, 'n_words': 96}