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 +4 -4
- data/lib/google-local-results-ai-parser.rb +6 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2d3d26973c143811af3354af94b83eaf429542cb41dc8e869ee51e933e6f2d7
|
4
|
+
data.tar.gz: e33c4fe018e422245516cd200f57d4a9e2077a9874b5ba01a3107ce8c2a533d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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[
|
359
|
-
results[price_duplicate[
|
360
|
-
results[price_duplicate[
|
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[
|
363
|
+
label_order[price_duplicate[0]] = "reviews"
|
364
364
|
|
365
365
|
# Rearranging duplicates
|
366
|
-
|
367
|
-
duplicates[duplicates.index(price_duplicate)].delete(
|
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)
|