How to use the @microsoft/recognizers-text-suite.recognizePhoneNumber function in @microsoft/recognizers-text-suite

To help you get started, we’ve selected a few @microsoft/recognizers-text-suite examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / Recognizers-Text / JavaScript / samples / simple-console / index.js View on Github external
// Dimension recognizer - This function will find any dimension presented
        // E.g "The six-mile trip to my airport hotel that had taken 20 minutes earlier in the day took more than three hours." will return "6 Mile"
        ...Recognizers.recognizeDimension(input, culture),

        // Temperature recognizer - This function will find any temperature presented
        // E.g "Set the temperature to 30 degrees celsius" will return "30 C"
        ...Recognizers.recognizeTemperature(input, culture),
        
        // DateTime recognizer - This function will find any Date even if its write in colloquial language -
        // E.g "I'll go back 8pm today" will return "2017-10-04 20:00:00"
        ...Recognizers.recognizeDateTime(input, culture),
        
        // Add PhoneNumber recognizer - This recognizer will find any phone number presented
        // E.g "My phone number is ( 19 ) 38294427."
        ...Recognizers.recognizePhoneNumber(input, culture),

        // Add IP recognizer - This recognizer will find any Ipv4/Ipv6 presented
        // E.g "My Ip is 8.8.8.8"
        ...Recognizers.recognizeIpAddress(input, culture),

        // URL recognizer -This recognizer will find all the urls
        // E.g "bing.com"
        ...Recognizers.recognizeURL(input, culture),

        // GUID recognizer - This recognizer will find all the GUID presented
        // E.g "My GUID number is {123e4567-e89b-12d3-a456-426655440000}"
        ...Recognizers.recognizeGUID(input, culture),

        // Boolean recognizer - This function will find yes/no like responses, including emoji -
        // E.g "yup, I need that" will return "True"
        ...Recognizers.recognizeBoolean(input, culture)