2

I am working on a voice bot at the moment. I am having difficulty in extracting pan card number (hazwr2312g). Customer can give it in many different ways. for example they can say my pan id is (hazwr2312g).

I have created a regex based on pan rules, which is working fine /[a-z]{3}[abcfghljpte][a-z][0-9]{4}[a-z]/i and extract pan number.

However, when the customer is giving pan number via voice then "g" is often replaced by "ji" (hazwr2312 ji) in the end of sentence.

various utterances:

1) my pan number is hazwr2312 ji 2) hazwr2312 ji is my pan number 3) it is hazwr2312 ji 4) hmm ahem my id is hazwr2312 ji

so-forth

how can I tackle this? Please guide me

Regards Meet

Meet
  • 243
  • 2
  • 13
  • You need to know the rules about pan card. how these pan card numbers patterns are. if you know these rules than you can search. without them it's not possible – Code Maniac Feb 11 '19 at 05:34
  • The PAN structure is as follows: AAAPL1234C: The five (5) first characters are letters, followed by four (4) numerals, and the last (10th) character is a letter – Meet Feb 11 '19 at 05:44

1 Answers1

2

you can try by using regex or you also opt split, indexOf etc, if you having particular type of keyword that coming all the time or common.

Avinash Singh
  • 4,970
  • 8
  • 20
  • 35