<commit_before>require 'spec_helper'

module Bio
  module MAF

    describe KyotoIndex do

      describe ".build" do
        context "mm8_chr7" do
          before(:each) do 
            @p = Parser.new(TestData + 'mm8_chr7_tiny.maf')
            @idx = KyotoIndex.build(@p, '%')
          end
          it "uses the first sequence appearing as the reference sequence" do
            @idx.index_sequences.to_a.should == [["mm8.chr7", 0]]
          end
          it "creates 8 index entries" do
            keys = @idx.db.match_prefix("\xFF\x00")
            keys.size.should == 8
          end
          after(:each) do
            @idx.db.close
          end
        end<commit_msg>Started to specify path handling for KyotoIndex.<commit_after>require 'spec_helper'

module Bio
  module MAF

    describe KyotoIndex do

      describe ".build" do
        it "accepts '%' as a path for an in-memory DB" do
          expect {
            @p = Parser.new(TestData + 'mm8_chr7_tiny.maf')
            @idx = KyotoIndex.build(@p, '%')
            @p.f.close
            @idx.close
          }.not_to raise_error
        end
        it "accepts .kct paths"
        it "rejects other paths"
        context "mm8_chr7" do
          before(:each) do 
            @p = Parser.new(TestData + 'mm8_chr7_tiny.maf')
            @idx = KyotoIndex.build(@p, '%')
          end
          it "uses the first sequence appearing as the reference sequence" do
            @idx.index_sequences.to_a.should == [["mm8.chr7", 0]]
          end
          it "creates 8 index entries" do
            keys = @idx.db.match_prefix("\xFF\x00")
            keys.size.should == 8
          end
          after(:each) do
            @idx.db.close
          end
        end
{'fraction_non_alphanumeric': 0.10293271995399655, 'fraction_numerical': 0.013801035077630822, 'mean_word_length': 1.5892857142857142, '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': '2614321', 'n_tokens_mistral': 542, 'n_tokens_neox': 518, 'n_words': 142}