<commit_before>'use strict';
//TODO: Consider implementing ES6 maps instead so I can use arrays of keywords as keywords
//////  That way, a check can be done for all of the keywords in the key array, and if they
/////   all match (.every) the sentence, then the value (dialogue config) will be used.
////    NOTE: use map.entries to iterate over the entries in a for of loop...
const Dialogue = require('../../src/dialogue').Dialogue;
const expect = require('chai').expect;

describe.only('Basic keyword parsing', () => {

  const mockConfig = {
    'thieves guild': {
      keywords: ['thieves', 'thief', 'stealing', 'guild'],
      priority: Dialogue.Priority.LOW,
      prereqs: {
        introduced: true
      },
      dialogue: 'I need you to infiltrate the thieves guild for me, and find their roster.'
    },
    'murder': {
      keywords: ['murder', 'killings', 'assassin', 'assassination'],
      priority: Dialogue.Priority.HIGH,
      prereqs: {
        introduced: true
      },
      dialogue: 'The thieves have become assassins? We cannot have two assassin\'s guilds...'
    },
    'here': {
      keywords: ['here'],
      priority: Dialogue.Priority.LOWEST,
      prereqs: {
        introduced: true
      },
      dialogue: [
        'This is my favorite place.',
        'It is so great here.'
      ]
    },
    'quest': {
      keywords: ['quest', 'mission'],
      priority: Dialogue.Priority.HIGH,
      prereqs: {
        introduced: true
      }
    }
  };

  describe('tokenization', () => {
    it('should be able to break a string into words', () => {
      expect(Dialogue.tokenizeSentence('hello world!')).to.eql(['hello', 'world']);<commit_msg>Decided to use a map for the dialogue parser thing<commit_after>'use strict';
//TODO: Consider implementing ES6 maps instead so I can use arrays of keywords as keys
//////  Map predicates to dialogue config. If the predicate is true,
/////   add to an array of possible dialogue branches. Then sort by priority...
////    NOTE: use map.entries to iterate over the entries in a for of loop...
///     or map.forEach((key, value) => // do stuff)
const Dialogue = require('../../src/dialogue').Dialogue;
const expect = require('chai').expect;

describe.only('Basic keyword parsing', () => {
  const mockConfig = {
    'thieves guild': {
      priority: Dialogue.Priority.LOW,
      keywords: {
        every: 'guild',
        some:  ['thief', 'thieves', 'what']
      }
      dialogue: 'I need you to infiltrate the thieves guild for me, and find their roster.'
    },
    'murder': {
      priority: Dialogue.Priority.HIGH,
      keywords: {
        every: 'guild',
        some: ['murder', 'killing', 'killings', 'dead']
        find: ['assassin']
      }
      dialogue: 'The thieves have become assassins? We cannot have two assassin\'s guilds...'
    },
    'here': {
      priority: Dialogue.Priority.LOWEST,
      keywords: {
        some: ['here', 'this place', 'where']
      }
      dialogue: [
        'This is my favorite place.',
        'It is so great here.'
      ]
    },
    'quest': {
      priority: Dialogue.Priority.HIGH,
    }
  };



  describe('tokenization', () => {
    it('should be able to break a string into words', () => {
      expect(Dialogue.tokenizeSentence('hello world!')).to.eql(['hello', 'world']);
{'fraction_non_alphanumeric': 0.14497130776200542, 'fraction_numerical': 0.0006040471156750226, 'mean_word_length': 2.5047619047619047, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '209023', 'n_tokens_mistral': 990, 'n_tokens_neox': 959, 'n_words': 329}