<commit_before>'use strict';

import { compromise, taxonomy, relations, sentiment } from './processors'
import { composeAsync } from '../helpers'

export default (state) => {
  const time = new Date();
  const factory = composeAsync(compromise, taxonomy, relations, sentiment);

  return new Promise( (resolve, reject) => {
    state.sentence = state.sentence.toLowerCase();
    state.nlp = {};

    factory(state)
      .then( state => {
        state.nlp.ms = (new Date() - time);
        resolve(state)
      })
      .catch( error => reject(error) )
  });
};<commit_msg>Don't need create a new promise, just use async/await and return the state.<commit_after>'use strict';

import { compromise, taxonomy, relations, sentiment } from './processors'
import { composeAsync } from '../helpers'

export default async (state) => {
  const time = new Date();
  const factory = composeAsync(compromise, taxonomy, relations, sentiment);

  state.sentence = state.sentence.toLowerCase();
  state.nlp = {};
  await factory(state);
  state.nlp.ms = (new Date() - time);

  return state;
};
{'fraction_non_alphanumeric': 0.1461609620721554, 'fraction_numerical': 0.0, 'mean_word_length': 3.623931623931624, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '6301843', 'n_tokens_mistral': 318, 'n_tokens_neox': 314, 'n_words': 95}