google-local-results-ai-parser 0.1.9 → 0.2.1
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 +12 -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: 32115a821e2e34cb64ab9e0b28e7c5be3a5b0de03006617c429e094bddd3e38d
|
4
|
+
data.tar.gz: c298704a904a2867528bf4ff9827bf50fdbde288fcffd5d8076447d1817e400e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0782715755059bf87928160366f3bb6168f1b12fab37f9e66cee5cf46a22406d2a05d6fd19e7e17f3f0f0c8925a5cfcdead320f009ed4b58b7f7aff8829ef896'
|
7
|
+
data.tar.gz: c0b8d099c542dcc5e64219594db5f2fa3f9f634835e0f6c2b18818b067d341bee8666045afc9f4c2da889ee86637949d7572f3bd03493395f47d1f5e2de1d023
|
@@ -63,7 +63,7 @@ module GoogleLocalResultsAiParser
|
|
63
63
|
|
64
64
|
if final_results[label]
|
65
65
|
# Combine the text for same elements
|
66
|
-
final_results[label] = unsplit_text[/#{final_results[label]}
|
66
|
+
final_results[label] = unsplit_text[/#{final_results[label]}[.|\n]+#{value}/]
|
67
67
|
else
|
68
68
|
# Directly assign values
|
69
69
|
final_results[label] = value
|
@@ -453,7 +453,17 @@ module GoogleLocalResultsAiParser
|
|
453
453
|
# On-site services, Online appointments
|
454
454
|
# Fixes `On-site services`, `Online appointments`
|
455
455
|
def service_options_as_description_or_type_confusion(results, label_order, duplicates)
|
456
|
-
known_errors = [
|
456
|
+
known_errors = [
|
457
|
+
"On-site services",
|
458
|
+
"On-site services not available",
|
459
|
+
"Onsite services",
|
460
|
+
"Onsite services not available",
|
461
|
+
"Online appointments",
|
462
|
+
"Online appointments not available",
|
463
|
+
"Online estimates",
|
464
|
+
"Online estimates not available",
|
465
|
+
"Takeaway"
|
466
|
+
]
|
457
467
|
caught_results_indices = results.map.with_index {|result, index| index if known_errors.include?(result[:input])}.compact
|
458
468
|
return results, label_order, duplicates if caught_results_indices == []
|
459
469
|
|