generated from amosproj/amos202Xss0Y-projname
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #193 from amosproj/dev
sprint-09-release
- Loading branch information
Showing
19 changed files
with
1,431 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!-- | ||
SPDX-License-Identifier: MIT | ||
SPDX-FileCopyrightText: 2023 Lucca Baumgärtner <lucca.baumgaertner@fau.de> | ||
--> | ||
|
||
# Google Search Strategy | ||
|
||
## Introduction | ||
|
||
In order to gather more information about a lead, we query the Google Places API. The API has | ||
multiple endpoints, enabling different search method. To have the best chances at correctly identifying a lead | ||
we try to combine the search methods and derive the most probable result. | ||
|
||
### Available Lead Information | ||
|
||
| First Name | Last Name | Phone Number | Email | | ||
| ---------- | --------- | ------------- | ---------------------------- | | ||
| Max | Muster | +491721234567 | max-muster@mybusiness.com | | ||
| Melanie | Muster | +491322133321 | melanies-flowershop@gmail.nl | | ||
| ... | ... | ... | ... | | ||
|
||
### Available Search Methods | ||
|
||
1. Fulltext Search | ||
2. Phone Number Search | ||
|
||
## Search Strategy | ||
|
||
1. Phone Number Search 2) If there's a valid phone number, look it up | ||
2. Email Based Search 3) If there's a custom domain, look it up 4) Else: Unless it contains the full name, look up the E-Mail account (everything before the `@` sing) | ||
3. If Email-based Search returned any results, use those | ||
4. Else: Return Phone-based search results | ||
5. Else: Return nothing | ||
|
||
 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions
2
Documentation/Media/google_places_strategy.drawio.png.license
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SPDX-License-Identifier: MIT | ||
SPDX-FileCopyrightText: 2023 Lucca Baumgärtner <lucca.baumgaertner@fau.de> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# SPDX-License-Identifier: MIT | ||
# SPDX-FileCopyrightText: 2023 Berkay Bozkurt <resitberkaybozkurt@gmail.com> | ||
|
||
from .console_utils import get_int_input, get_multiple_choice, get_yes_no_input | ||
from .demos import bdc_demo, db_demo, evp_demo, pipeline_demo, preprocessing_demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# SPDX-License-Identifier: MIT | ||
# SPDX-FileCopyrightText: 2023 Berkay Bozkurt <resitberkaybozkurt@gmail.com> | ||
|
||
|
||
# Utility Functions | ||
def get_yes_no_input(prompt: str) -> bool: | ||
""" | ||
Prompts the user with a given prompt and returns True if the user enters 'yes' or 'y', | ||
and False if the user enters 'no' or 'n'. The input is case-insensitive. | ||
Args: | ||
prompt (str): The prompt to display to the user. | ||
Returns: | ||
bool: True if the user enters 'yes' or 'y', False if the user enters 'no' or 'n'. | ||
""" | ||
while True: | ||
user_input = input(prompt).strip().lower() | ||
if user_input in ["y", "yes"]: | ||
return True | ||
elif user_input in ["n", "no"]: | ||
return False | ||
else: | ||
print("Invalid input. Please enter (yes/no) or (y/N).") | ||
|
||
|
||
def get_int_input(prompt: str, input_range: range = None) -> int: | ||
""" | ||
Prompts the user for an integer input and validates it. | ||
Args: | ||
prompt (str): The prompt message to display to the user. | ||
input_range (range, optional): The range of valid input values. Defaults to None. | ||
Returns: | ||
int: The validated integer input. | ||
Raises: | ||
ValueError: If the input is not a valid integer. | ||
""" | ||
while True: | ||
try: | ||
input_int = int(input(prompt)) | ||
if input_range is not None and input_int not in input_range: | ||
print("Invalid input. Please enter a valid integer.") | ||
continue | ||
else: | ||
return input_int | ||
except ValueError: | ||
print("Invalid input. Please enter a valid integer.") | ||
|
||
|
||
def get_multiple_choice(prompt: str, choices: list) -> str: | ||
""" | ||
Prompts the user with a message and a list of choices, and returns the selected choice. | ||
Args: | ||
prompt (str): The message to display to the user. | ||
choices (list): The list of choices to display to the user. | ||
Returns: | ||
str: The selected choice. | ||
Raises: | ||
ValueError: If the user enters an invalid input. | ||
""" | ||
while True: | ||
try: | ||
prompt += "".join( | ||
f"({index}) : {choice} \n" for index, choice in enumerate(choices) | ||
) | ||
ind = get_int_input(prompt, range(len(choices) + 1)) | ||
return choices[ind] | ||
except ValueError: | ||
print("Invalid input. Please enter a valid integer.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.