jmdict 1.9.1 → 1.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0821ca8ea8143716c272a4eb71567f17029c312a
4
- data.tar.gz: 45a61791543e6b0e8f2246db0086fdc4d4a4728d
3
+ metadata.gz: a4d1dbc30aaa18d7c6ca15cefea6a228c8af7725
4
+ data.tar.gz: e0b19c59791a449ccafe2035ebc9d22f5ff9939c
5
5
  SHA512:
6
- metadata.gz: 26bbe2713eb64b4880ec342e0432ebfbd68b0366fa8b53686fc51bdeb208f33f9e87c53b8c921eafd654a6dcd7d0f7e39f57b3f932804def992a01b3c9c00256
7
- data.tar.gz: 27b9675ac3b9c1f66a91206ede928a1db7fe0b339171152bd7315e405d58d497f6de06945cfe0a0d3d6ac156097a78c650e56a01b5ad345cc3da66854775ceff
6
+ metadata.gz: eca812b8cc6a3e54f19c049f6c951211b88abd8002f0bf1b2ce95403e898148822f9c1d3db2798f59a5b3954450abaa7625a41db3809009fcb288a776316036f
7
+ data.tar.gz: 81c5ae70fffb026f0da137dd0b708336c1064181216851f22ef328de555c6588ac25e8a5ea14bdd9feda9e613f6b2634ac2cfa8d5eb0d0a8d19f93257bebb7a6
@@ -0,0 +1,24 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ jmdict (1.9.0)
5
+ nokogiri
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ mini_portile2 (2.3.0)
11
+ nokogiri (1.8.2)
12
+ mini_portile2 (~> 2.3.0)
13
+ rake (10.4.2)
14
+
15
+ PLATFORMS
16
+ ruby
17
+
18
+ DEPENDENCIES
19
+ bundler (~> 1.16)
20
+ jmdict!
21
+ rake (~> 10.0)
22
+
23
+ BUNDLED WITH
24
+ 1.16.1
data/README.md CHANGED
@@ -63,7 +63,7 @@ I decided to put a version number that follows the same pattern as the official
63
63
 
64
64
  ## Performance
65
65
 
66
- It's important to advice about the memory and time consumption that all this parsing could take. The file itself and the Nokogiri structures takes about ~2 GB of memory with or without this gem. In matter of time we have a notable increase for converting the Node element into a Hash. Using this gem therefore takes more time than dealing with Nokogiri directly but it's aimed for a one shot use for processing the XML file and brings a more unified form of accessing all the fields.
66
+ In matter of time we have a notable increase for converting the Node element into a Hash. Using this gem therefore takes more time than dealing with Nokogiri directly but it's aimed for a one shot use for processing the XML file and brings a more unified form of accessing all the fields.
67
67
 
68
68
  ## License
69
69
 
@@ -5,12 +5,14 @@ class JMDict
5
5
  @jmdict_file = nil
6
6
 
7
7
  def initialize(filename)
8
- @jmdict_file = File.open(filename) { |f| Nokogiri::XML(f) }
8
+ @jmdict_file = Nokogiri::XML::Reader(File.open(filename))
9
9
  end
10
10
 
11
11
  def each_entry()
12
- @jmdict_file.xpath('JMdict/entry').each do |e|
13
- yield(parse_entry(e))
12
+ @jmdict_file.each do |node|
13
+ next if node.name != 'entry'
14
+ next if node.node_type != Nokogiri::XML::Reader::TYPE_ELEMENT
15
+ yield(parse_entry(Nokogiri::XML(node.outer_xml)))
14
16
  end
15
17
  end
16
18
 
@@ -1,3 +1,3 @@
1
1
  class JMDict
2
- VERSION = "1.9.1"
2
+ VERSION = "1.9.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jmdict
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.1
4
+ version: 1.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ramiro Antonio
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-18 00:00:00.000000000 Z
11
+ date: 2018-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -62,6 +62,7 @@ extra_rdoc_files: []
62
62
  files:
63
63
  - ".gitignore"
64
64
  - Gemfile
65
+ - Gemfile.lock
65
66
  - LICENSE
66
67
  - README.md
67
68
  - Rakefile