Added a KAF fixture file

This is an output document from one of the components of the
OpeNER (http://www.opener-project.eu/) project.
This commit is contained in:
Yorick Peterse 2015-08-18 22:32:57 +02:00
parent be7bc8f423
commit 4346cc6ec3
4 changed files with 14 additions and 15 deletions

1
.gitignore vendored
View File

@ -12,6 +12,7 @@ lib/oga/css/parser.rb
lib/liboga.*
benchmark/fixtures/big.xml
benchmark/fixtures/kaf.xml
profile/samples/xml/*.txt
profile/samples/xml/*/*.txt

View File

@ -5,29 +5,27 @@ require 'benchmark/ips'
require_relative '../lib/oga'
##
# Returns a File instance pointing to the sample XML file.
#
# @return [File]
#
def big_xml_file
return File.open(File.expand_path('../fixtures/big.xml', __FILE__), 'r')
File.open(File.expand_path('../fixtures/big.xml', __FILE__), 'r')
end
# @return [File]
def big_kaf_file
File.open(File.expand_path('../fixtures/kaf.xml', __FILE__), 'r')
end
##
# Reads a big XML file and returns it as a String.
#
# @return [String]
#
def read_big_xml
return big_xml_file.read
big_xml_file.read
end
# @return [String]
def read_big_kaf
big_kaf_file.read
end
##
# Reads a normal sized HTML fixture.
#
# @return [String]
#
def read_html
return File.read(File.expand_path('../fixtures/with_entities.html', __FILE__))
end

Binary file not shown.

View File

@ -3,4 +3,4 @@ rule '.xml' => '.xml.gz' do |task|
end
desc 'Generates large XML fixtures'
task :fixtures => ['benchmark/fixtures/big.xml']
task :fixtures => ['benchmark/fixtures/big.xml', 'benchmark/fixtures/kaf.xml']