microsoft / Recognizers-Text

Microsoft.Recognizers.Text provides recognition and resolution of numbers, units, date/time, etc. in multiple languages (ZH, EN, FR, ES, PT, DE, IT, TR, HI, NL. Partial support for JA, KO, AR, SV). Packages available at: https://www.nuget.org/profiles/Recognizers.Text, https://www.npmjs.com/~recognizers.text
MIT License
1.68k stars 431 forks source link

Exception thrown in BasePhoneNumberExtractor #3138

Open HayderMarzouk opened 1 year ago

HayderMarzouk commented 1 year ago

Describe the bug When trying to match some phone numbers a "Object reference not set to an instance of an object" exception is thrown.

To Reproduce Here an example with this value: (5) 555-3932

var extractor = new BasePhoneNumberExtractor(new PhoneNumberConfiguration(SequenceOptions.None));
extractor.extract("(5) 555-3932")

Expected behavior No exception is thrown;

Sample input/output

Platform (please complete the following information):

HayderMarzouk commented 1 year ago

Update : After debugging, the issue is in the following line: Line 196 : if (this.config.ForbiddenPrefixMarkers.Contains(ch))

ForbiddenPrefixMarkers is null