Sha256: b18290998615fbe5eb98e91e5ff1901f4ddac50a7a5a34bb0aeca5f000e49571

Contents?: true

Size: 725 Bytes

Versions: 1

Compression:

Stored size: 725 Bytes

Contents

require "spec_helper"

describe "n-grams" do
  let(:ngram) { Selector::Simple.new(:function, word_selection: :grams, gram_size: 3) }
  context "#extract_words_from_data" do
    it "should generate a list of words from the data" do
      words = ngram.extract_words_from_data(FactoryGirl.build(:data))
      words.should have(4).things
    end
    it "should remove words with 3 characters or less" do
      words = ngram.extract_words_from_data(FactoryGirl.build(:data_w_short_words))
      words.should have(2).things
    end
    it "should process multiple sections in the data" do
      words = ngram.extract_words_from_data(FactoryGirl.build(:data_w_multiple_sections))
      words.should have(2).things
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
svm_helper-0.2.1 spec/svm_helper/selectors/n_gram_spec.rb