<commit_before>/**
 * Alexa Reply
 *
 * See message-renderer to see the msg structure that
 * Reply expects.
 *
 * TODO: validate that no more text is appeneded after
 * has yielded.
 *
 * Copyright (c) 2016 Rain Agency.
 * Licensed under the MIT license.
 */

'use strict';

var _ = require('lodash')
    , S = require("string")
    , _ = require('lodash')
  ;

var SSML = "SSML";

function Reply(msg) {
  this.msg = {
    statements: [],
    reprompt: '',
    card: null,
    yield: false,
    hasAnAsk: false
  };
  this.append(msg);
}

Reply.prototype.append = function (msg) {
  if (!msg) return this;
  var statement = msg.ask || msg.tell || msg.say;
  if (statement) this.msg.statements.push(statement);
  this.msg.reprompt = msg.reprompt || this.msg.reprompt;<commit_msg>Added directive field to reply class<commit_after>/**
 * Alexa Reply
 *
 * See message-renderer to see the msg structure that
 * Reply expects.
 *
 * TODO: validate that no more text is appeneded after
 * has yielded.
 *
 * Copyright (c) 2016 Rain Agency.
 * Licensed under the MIT license.
 */

'use strict';

var _ = require('lodash')
    , S = require("string")
    , _ = require('lodash')
  ;

var SSML = "SSML";

function Reply(msg) {
  this.msg = {
    statements: [],
    reprompt: '',
    card: null,
    yield: false,
    hasAnAsk: false,
    directives: {}
  };
  this.append(msg);
}

Reply.prototype.append = function (msg) {
  if (!msg) return this;
  var statement = msg.ask || msg.tell || msg.say;
  if (statement) this.msg.statements.push(statement);
  this.msg.reprompt = msg.reprompt || this.msg.reprompt;
{'fraction_non_alphanumeric': 0.14366021236727045, 'fraction_numerical': 0.004996876951905059, 'mean_word_length': 3.1076923076923078, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2038144', 'n_tokens_mistral': 564, 'n_tokens_neox': 535, 'n_words': 153}