<commit_before>'use babel';

import path from 'path';
import fs from 'fs-plus';
import File from 'pathwatcher';
import React from 'react';
import Immutable from 'immutable';
import {CompositeDisposable} from 'atom';
import {$, ScrollView} from 'atom-space-pen-views';
import NotebookCell from './notebook-cell';

export default class NotebookEditorView extends React.Component {

  constructor(props) {
    super(props);
    this.store = props.store;
    this.subscriptions = new CompositeDisposable();
    //TODO: remove these development handles
    global.editorView = this;
  }

  componentDidMount() {
    this.subscriptions.add(this.store.addStateChangeListener(this._onChange));
  }

  componentDidUpdate(prevProps, prevState) {

  }

  componentWillUnmount() {
    this.subscriptions.dispose();
  }

  render() {
    // console.log('notebookeditorview render called');
    if (this.state.data.get('cells') === null
    || this.state.data.get('cells') === undefined) {
      return <h1>Not Initialized</h1>;
    } else {
      let language = this.state.data.getIn(['metadata', 'kernelspec', 'language']);
      // console.log('Language:', language);
      let notebookCells = this.state.data.get('cells').map((cell) => {
        cell = cell.set('language', language);
        return (
          <NotebookCell
            data={cell}
            key={cell.getIn(['metadata', 'id'])}
            language={language}<commit_msg>Fix text-editor grammar<commit_after>'use babel';

import path from 'path';
import fs from 'fs-plus';
import File from 'pathwatcher';
import React from 'react';
import Immutable from 'immutable';
import {CompositeDisposable} from 'atom';
import {$, ScrollView} from 'atom-space-pen-views';
import NotebookCell from './notebook-cell';

export default class NotebookEditorView extends React.Component {

  constructor(props) {
    super(props);
    this.store = props.store;
    this.subscriptions = new CompositeDisposable();
    //TODO: remove these development handles
    global.editorView = this;
  }

  componentDidMount() {
    this.subscriptions.add(this.store.addStateChangeListener(this._onChange));
  }

  componentDidUpdate(prevProps, prevState) {

  }

  componentWillUnmount() {
    this.subscriptions.dispose();
  }

  render() {
    // console.log('notebookeditorview render called');
    if (this.state.data.get('cells') === null
    || this.state.data.get('cells') === undefined) {
      return <h1>Not Initialized</h1>;
    } else {
      let language = this.state.data.getIn(['metadata', 'language_info', 'name']);
      // console.log('Language:', language);
      let notebookCells = this.state.data.get('cells').map((cell) => {
        cell = cell.set('language', language);
        return (
          <NotebookCell
            data={cell}
            key={cell.getIn(['metadata', 'id'])}
            language={language}
{'fraction_non_alphanumeric': 0.14653672119735467, 'fraction_numerical': 0.0013922728854855553, 'mean_word_length': 3.490625, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '7630276', 'n_tokens_mistral': 860, 'n_tokens_neox': 835, 'n_words': 185}