Skip to content

Commit

Permalink
Ensure 95% names from core model are accepted by parser
Browse files Browse the repository at this point in the history
  • Loading branch information
inukshuk committed May 30, 2018
1 parent cd9c908 commit 93b7058
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions spec/anystyle/normalizer/names_spec.rb
Expand Up @@ -135,5 +135,22 @@ def n(author, **opts)
expect(n('J Doe ...')).to eq([doe, others])
end
end

describe "Parsed Core Data" do
before :all do
@data = resource('parser/core.xml')
.map { |item| item.values_at(*Normalizer::Names.keys) }
.flatten
.uniq
.reject { |name| name.nil? || name[:other] }
end

let(:lit) { @data.select { |name| !name[:literal].nil? } }
let(:nam) { @data.select { |name| name[:literal].nil? } }

it "accepts more than 95% of names" do
expect(nam.length.to_f / @data.length).to be > 0.95
end
end
end
end

0 comments on commit 93b7058

Please sign in to comment.