<commit_before>const nlp = require('compromise');
const model = require('../../database-postgres/models/index.js');
const apiHandler = require('../apihandler');
const parseTools = require('./parseTools');

const response = (str = "is there fog today?", loc = '{"lat":"37.7837039","lon":"-122.4091297"}') => {

  let place = parseTools.findPlace(str); //place will be an empty string if no place

  return model.words.getWordsApiMatch()
    .then((data) => {
    	//find an api match
      return parseTools.findMatch(str, data);
    })
    .then((api) => {
    	//call api
      return apiHandler(api, loc, place, str);
    });

};

module.exports = response;<commit_msg>Update engine.js<commit_after>const nlp = require('compromise');
const model = require('../../database-postgres/models/index.js');
const apiHandler = require('../apihandler');
const parseTools = require('./parseTools');

const response = (str = "is there fog today?", loc = {"lat":"37.7837039","lon":"-122.4091297"}) => {

  let place = parseTools.findPlace(str); //place will be an empty string if no place

  return model.words.getWordsApiMatch()
    .then((data) => {
    	//find an api match
      return parseTools.findMatch(str, data);
    })
    .then((api) => {
    	//call api
      return apiHandler(api, loc, place, str);
    });

};

module.exports = response;
{'fraction_non_alphanumeric': 0.18093819806403574, 'fraction_numerical': 0.028294862248696945, 'mean_word_length': 3.4949832775919734, 'pattern_counts': {'":': 4, '<': 3, '<?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': '3180099', 'n_tokens_mistral': 443, 'n_tokens_neox': 412, 'n_words': 106}