<commit_before>require("./styles/main.less");
require('./styles/chartist.scss');

import React               from 'react';
import SearchApp           from './components/SearchApp';
import ActionTypes         from './constants/ActionTypes';
import PayloadSources      from './constants/PayloadSources';
import SearchAppDispatcher from './dispatcher/SearchAppDispatcher';
import TranscriptSearchAPI from './utils/TranscriptSearchAPI';

// really not sure if this belongs here
SearchAppDispatcher.register(payload => {
    // console.log(payload);

    switch (payload.action.type) {
        case ActionTypes.SEARCH_ADD:
            TranscriptSearchAPI.search(payload.action.query, payload.action.interval);
            break;
        case ActionTypes.SEARCH_MULTI:
            TranscriptSearchAPI.searchMultiple(payload.action.queries, payload.action.interval);
            break;
        case ActionTypes.SPEECH_CONTEXT:
            TranscriptSearchAPI.speechContext(payload.action.transcript, payload.action.start, payload.action.end);
            break;
        default:
        // nothing
    }
});

if (typeof ga !== 'undefined') {
    SearchAppDispatcher.register(payload => {
        if (payload.source === PayloadSources.VIEW_ACTION) {
            switch (payload.action.type) {
                case ActionTypes.SEARCH_ADD:
                    ga('send', 'event', payload.source, payload.action.type, payload.action.query);
                    break;
                case ActionTypes.SEARCH_MULTI:
                    ga('send', 'event', payload.source, payload.action.type, payload.action.queries.slice(0).sort().join(','));
                    break;
                case ActionTypes.SPEECH_CONTEXT:
                    ga(
                        'send', 'event', payload.source, payload.action.type,
                        `${payload.action.transcript}.${payload.action.start}-${payload.action.end}`);
                    break;
                case ActionTypes.RESET:
                    ga(
                        'send', 'event', payload.source, payload.action.type, '');
                    break;
                default:
                // nothing
            }
        }
    });
}

React.render(
    <SearchApp />,
    document.getElementById('content')<commit_msg>code style<commit_after>require("./styles/main.less");
require('./styles/chartist.scss');

import React               from 'react';
import SearchApp           from './components/SearchApp';
import ActionTypes         from './constants/ActionTypes';
import PayloadSources      from './constants/PayloadSources';
import SearchAppDispatcher from './dispatcher/SearchAppDispatcher';
import TranscriptSearchAPI from './utils/TranscriptSearchAPI';

// really not sure if this belongs here
SearchAppDispatcher.register(payload => {
    // console.log(payload);

    switch (payload.action.type) {
        case ActionTypes.SEARCH_ADD:
            TranscriptSearchAPI.search(payload.action.query, payload.action.interval);
            break;
        case ActionTypes.SEARCH_MULTI:
            TranscriptSearchAPI.searchMultiple(payload.action.queries, payload.action.interval);
            break;
        case ActionTypes.SPEECH_CONTEXT:
            TranscriptSearchAPI.speechContext(payload.action.transcript, payload.action.start, payload.action.end);
            break;
        default:
        // nothing
    }
});

if (typeof ga !== 'undefined') {
    SearchAppDispatcher.register(payload => {
        if (payload.source === PayloadSources.VIEW_ACTION) {
            switch (payload.action.type) {
                case ActionTypes.SEARCH_ADD:
                    ga('send', 'event', payload.source, payload.action.type, payload.action.query);
                    break;
                case ActionTypes.SEARCH_MULTI:
                    ga('send', 'event', payload.source, payload.action.type,
                        payload.action.queries.slice(0).sort().join(','));
                    break;
                case ActionTypes.SPEECH_CONTEXT:
                    ga(
                        'send', 'event', payload.source, payload.action.type,
                        `${payload.action.transcript}.${payload.action.start}-${payload.action.end}`);
                    break;
                case ActionTypes.RESET:
                    ga(
                        'send', 'event', payload.source, payload.action.type, '');
                    break;
                default:
                // nothing
            }
        }
    });
}

React.render(
    <SearchApp />,
    document.getElementById('content')
{'fraction_non_alphanumeric': 0.11723687077794727, 'fraction_numerical': 0.00043582479843103073, 'mean_word_length': 1.93854033290653, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3486262', 'n_tokens_mistral': 1165, 'n_tokens_neox': 1125, 'n_words': 206}