Cut down on false positive phone numbers by requiring all matched phone numbers to have at least 3 digits (so that emergency services' phone numbers are also matched).
This commit is contained in:
@@ -98,8 +98,9 @@ class PhoneNumbersExtractor:
|
||||
tagContents = tag.text
|
||||
cleanTagContentsList = re.sub(cleanTagsRegex, '', tagContents).split('\n')
|
||||
for cleanTag in cleanTagContentsList:
|
||||
if not phoneNumCharsExclusion.findall(cleanTag):
|
||||
returnResults.append([{'Phone Number': cleanTag.strip(),
|
||||
cleanTag = cleanTag.strip()
|
||||
if not phoneNumCharsExclusion.findall(cleanTag) and len(re.findall(r'\d', cleanTag)) >= 3:
|
||||
returnResults.append([{'Phone Number': cleanTag,
|
||||
'Entity Type': 'Phone Number'},
|
||||
{currentUID: {'Resolution': 'Phone Number Found',
|
||||
'Notes': ''}}])
|
||||
|
||||
Reference in New Issue
Block a user