20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/chem_scanner/cdxml.rb', line 20
def read(file, is_path = true)
fs = is_path ? File.open(file) : file
@cdxml = Nokogiri::XML(fs)
return false if @cdxml.internal_subset.system_id != CDXML_DOCTYPE
read_global
@cdxml.xpath("//page").each do |page|
@reader = page
read_objects
end
rebuild_objects_map
@scheme = Interpreter::Scheme.new(self)
@scheme.interpret
@molecules = @scheme.molecules
@reactions = @scheme.reactions
true
end
|