<commit_before>'use strict'

const {equal} = require('assert')
const FuzzySearchStrategy = require('../../src/SearchStrategies/FuzzySearchStrategy')

test('FuzzySearchStrategy', () => {
  test('does not match words that don\'t contain the search criteria', () => {
    equal(FuzzySearchStrategy.matches('fuzzy', 'fzyyy'), false)
    equal(FuzzySearchStrategy.matches('react', 'angular'), false)

    equal(FuzzySearchStrategy.matches('what the heck', 'wth?'), false)
  })

  test('matches words containing the search criteria', () => {
    equal(FuzzySearchStrategy.matches('fuzzy', 'fzy'), true)
    equal(FuzzySearchStrategy.matches('react', 'rct'), true)

    equal(FuzzySearchStrategy.matches('what the heck', 'wth'), true)
  })

  test('is case insensitive', () => {
    equal(FuzzySearchStrategy.matches('Different Cases', 'dc', true))
    equal(FuzzySearchStrategy.matches('UPPERCASE', 'upprcs', true))
    equal(FuzzySearchStrategy.matches('lowercase', 'lc', true))
    equal(FuzzySearchStrategy.matches('DiFfErENt cASeS', 'dc', true))
  })
})
<commit_msg>Fixed search strategies<commit_after>'use strict'

const {equal} = require('assert')
const FuzzySearchStrategy = require('../../src/SearchStrategies/FuzzySearchStrategy')

test('FuzzySearchStrategy', () => {
  test('does not match words that don\'t contain the search criteria', () => {
    equal(FuzzySearchStrategy.matches('fuzzy', 'fzyyy'), false)
    equal(FuzzySearchStrategy.matches('react', 'angular'), false)

    equal(FuzzySearchStrategy.matches('what the heck', 'wth?'), false)
  })

  test('matches words containing the search criteria', () => {
    equal(FuzzySearchStrategy.matches('fuzzy', 'fzy'), true)
    equal(FuzzySearchStrategy.matches('react', 'rct'), true)

    equal(FuzzySearchStrategy.matches('what the heck', 'wth'), true)
  })

  test('is case insensitive', () => {
    equal(FuzzySearchStrategy.matches('Different Cases', 'dc'), true)
    equal(FuzzySearchStrategy.matches('UPPERCASE', 'upprcs'), true)
    equal(FuzzySearchStrategy.matches('lowercase', 'lc'), true)
    equal(FuzzySearchStrategy.matches('DiFfErENt cASeS', 'dc'), true)
  })
})

{'fraction_non_alphanumeric': 0.17025257249766138, 'fraction_numerical': 0.0, 'mean_word_length': 5.663551401869159, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '5101729', 'n_tokens_mistral': 693, 'n_tokens_neox': 646, 'n_words': 130}