google-local-results-ai-parser 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b078ffd7df8466aa1859da5120725c18b9425ddb331a16a54c913811af0d3b8
4
- data.tar.gz: 637c78ed81d02642834e083b1bbcbab1962a09afd218e490e02ffc9ae0232013
3
+ metadata.gz: a2d3d26973c143811af3354af94b83eaf429542cb41dc8e869ee51e933e6f2d7
4
+ data.tar.gz: e33c4fe018e422245516cd200f57d4a9e2077a9874b5ba01a3107ce8c2a533d7
5
5
  SHA512:
6
- metadata.gz: 216e1a13a42b32294a5196f26bd34a05f05cf53cfbf4b50f05b2f7ba93f1f8349a1eff7becd6900f6d96e2c18af910af96be8c92b6a5e467262d672aff4e97d5
7
- data.tar.gz: 3dc359ac52dd5e3475bdb4817135f17cc98621a1a59d21078c13090d3e16d6bf10b37520c627fbc0e203f3c6fa51257bb3ae682e65e8b146b5eb8bc1ed187a13
6
+ metadata.gz: 9aeaebb296e9940cc2a07f50cff70955c6f4ea40093c21cbe44529e19d329406812fd12fbf25243b65fdc178c752dbe38ffe89c9574b8e5323cea8e4247d13c5
7
+ data.tar.gz: 8dd7b93a1683d5fbed86f97a17f6e655769ce2f7b81a2af798519b222a64e526a2b3a153ef1d0863c6c280f8f6388a54cb04f928a813c12c9ae91c1e59312024
@@ -355,16 +355,16 @@ module GoogleLocalResultsAiParser
355
355
  # Zero out the `price`, and put it to last position
356
356
  reviews_hash = results[price_duplicate[-1]][:result][0].find {|hash| hash["label"] == "reviews" }
357
357
  reviews_index = results[price_duplicate[-1]][:result][0].index(reviews_hash)
358
- results[price_duplicate[-1]][:result][0][0] = {"label" => "reviews", "score" => 1.0}
359
- results[price_duplicate[-1]][:result][0].delete_at(reviews_index)
360
- results[price_duplicate[-1]][:result][0] << {"label" => "price", "score" => 0.0}
358
+ results[price_duplicate[0]][:result][0][0] = {"label" => "reviews", "score" => 1.0}
359
+ results[price_duplicate[0]][:result][0].delete_at(reviews_index)
360
+ results[price_duplicate[0]][:result][0] << {"label" => "price", "score" => 0.0}
361
361
 
362
362
  # Rearranging `label_order`
363
- label_order[price_duplicate[-1]] = "reviews"
363
+ label_order[price_duplicate[0]] = "reviews"
364
364
 
365
365
  # Rearranging duplicates
366
- last_item = duplicates[duplicates.index(price_duplicate)][-1]
367
- duplicates[duplicates.index(price_duplicate)].delete(last_item)
366
+ first_item = duplicates[duplicates.index(price_duplicate)][0]
367
+ duplicates[duplicates.index(price_duplicate)].delete(first_item)
368
368
 
369
369
  if (duplicate_arr = duplicates[duplicates.index(price_duplicate)]) && duplicate_arr.size == 1
370
370
  duplicates.delete(duplicate_arr)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-local-results-ai-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emirhan Akdeniz