<commit_before>require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')

require 'stringio'

describe "projection" do
  it "should work" do
    stream = StringIO.new('{"name": "keith", "age": 27}')
    projector = Yajl::Projector.new(stream)
    projection = projector.project({"name" => nil})
    expect(projection['name']).to eql("keith")
  end
end<commit_msg>Add failing spec for filtering<commit_after>require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')

require 'stringio'

describe "projection" do
  it "should work" do
    stream = StringIO.new('{"name": "keith", "age": 27}')
    projector = Yajl::Projector.new(stream)
    projection = projector.project({"name" => nil})
    expect(projection['name']).to eql("keith")
  end

  it "should filter" do
    stream = StringIO.new('{"name": "keith", "age": 27}')
    projector = Yajl::Projector.new(stream)
    projection = projector.project({"name" => nil})
    expect(projection['age']).to eql(nil)
  end
end
{'fraction_non_alphanumeric': 0.17835671342685372, 'fraction_numerical': 0.006012024048096192, 'mean_word_length': 4.6440677966101696, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 6, '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': '1529096', 'n_tokens_mistral': 351, 'n_tokens_neox': 340, 'n_words': 72}