JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q35000F

Watson utility framework

Package Exports

  • watsonhelper

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (watsonhelper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Watson-Helper

Extract phone numbers and emails from arbitrary text.

Features:

  • Extract multiple phone number formats across different countries
  • Extract multiple email number formats across multiple domains
  • Extract numbers with / without international prefixes (e.g 0061 and +61)
  • Extract emails that starts with variable formats(email.xx.xxx, em.ail.xxx)
  • Unit tested
  • Examples enclosed

Background

For a recent customer exploring coversation api in watson; extraction of phone numbers and email was a key usecase. Now identifying email and phone number is not a NLP usecase but more of a expression usecase. Hence I have writtent this library to help customers get the not so NLP data usually expressed in conversations or personal blogs

Examples

Basic example

Extraction one or more phone numbers, email or custom data from a user supplied text.

var watsonhelper = require('watsonhelper');
var phonelist = helper.phoneextractor("I am moving to hyderabad and my mobile number is  +919538099898, You can also call me at 08042227967");

var email = helper.phoneextractor("I am moving to US and my email id is  shunandi@gmail.com, You can also email me at shubhradeepnandi@gmail.com");

var ticketno = helper.extractor("<Extracting What>", "<TEXT>", "<REGEX>");

### Limitations
This software cannot capture every single combination imaginable. Especially number-to-letter substitution is difficult to detect e.g:
- O4!4.Ol2;341 (= 0414 012 341)

In my experience very few users write their phone number this way. From a programming point of view it would be possible to cover for edge cases like above, but I have chosen not to.

### Issues, bug reports
shunandi@gmail.com

### License
MIT