google-local-results-ai-parser 0.2.3 → 0.2.4
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 +4 -4
- data/lib/google-local-results-ai-parser.rb +2 -2
- 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: 9f8076de3793dabc268bc5705443e28202655e26c5a1503498767e1b8a62ff16
|
4
|
+
data.tar.gz: 7e3cf96add3d90d2e6174f9acda7f6cd8357f2f06792d46fc308aa80cc7fa93f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91c997a71f5765a0d43cc1c4418cecc1a83b00eb3b418f4aed6802a1c5fa78391b337384433147cf5c7eb8af5455ad07289f8440c31e58585493978d4673394a
|
7
|
+
data.tar.gz: b0d1a462cba2a8097c0bc54ec0142e78b5d7daffe5c5ed4c663ddb7522c35391ee4ba9587f803a711f2e0fbe7395ab7d353254eda6ecab6212bbeed64c563b4d
|
@@ -2,7 +2,6 @@ require 'nokolexbor'
|
|
2
2
|
require 'http'
|
3
3
|
require 'parallel'
|
4
4
|
require 'json'
|
5
|
-
require 'pry'
|
6
5
|
|
7
6
|
module GoogleLocalResultsAiParser
|
8
7
|
DEFAULT_SERVER = 'https://api-inference.huggingface.co/models/serpapi/bert-base-local-results'.freeze
|
@@ -476,7 +475,8 @@ module GoogleLocalResultsAiParser
|
|
476
475
|
end
|
477
476
|
end
|
478
477
|
|
479
|
-
|
478
|
+
already_a_service_option = caught_results_indices.all? {|index| results[index][:result][0][0]["label"] == "service options"}
|
479
|
+
return results, label_order, duplicates if already_a_service_option
|
480
480
|
# Zero out the `type` or `description`, and put it to last position
|
481
481
|
caught_results_indices.each do |caught_index|
|
482
482
|
service_options_hash = results[caught_index][:result][0].find {|hash| hash["label"] == "service options" }
|