Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure email addresses are 100% valid #1

Open
9b opened this issue Nov 23, 2019 · 1 comment
Open

Ensure email addresses are 100% valid #1

9b opened this issue Nov 23, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@9b
Copy link
Owner

9b commented Nov 23, 2019

def extract_emails(results: str, domain: str, fuzzy: bool) -> List[str]:

There are times when matches are found in which extra data has been tacked onto the end of the match. In these cases, a valid email is made invalid due to the trailing data. It would be ideal to trim anything past the core domain match.

Potential ways to solve this

  • Get the substring index of the domain + length of domain in order to then ask for that, plus the pre-pending email match
  • Leverage a TLD list in order to match the TLD, dropping anything else.
@9b 9b added enhancement New feature or request help wanted Extra attention is needed labels Nov 23, 2019
@9b 9b changed the title Add a means to drop anything past match Ensure email addresses are 100% valid Nov 23, 2019
@9b
Copy link
Owner Author

9b commented Nov 23, 2019

This will only impact fuzzy matching. A proper solution has been identified, though it needs to be checked for performance as it may slow down the program.

    A proper implementation here will pull in a TLD library in order to
    isolate the "core" of the domain from the TLD. The core itself should
    be what is used as the "seed" for the fuzzy search. If matched, then
    we know a fuzzy hit (kword) is there. We apply the substring method
    after to ensure that we preserve a valid email. This approach counters
    the trailing junk behind a valid email.

@9b 9b self-assigned this Nov 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant