vi3k6i5 / flashtext

Extract Keywords from sentence or Replace keywords in sentences.
MIT License
5.58k stars 598 forks source link

added phone number regex example to docs #122

Open gracerosemary opened 3 years ago

remiadon commented 3 years ago

@gracerosemary I think your example can be done via fuzzy matching If I take your example

phone_dictionary = {
    '(123)456-7890': ['123-456-7890', '123-4567890', '123456-7890', '(123)4567890'],
    }

calling add_keyword("'(123)456-7890") and setting very low costs for "(", ")", and "-" would do the trick I think

But this would require passing individual costs for additions/deletions