Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@microsoft/recognizers-text-sequence

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/recognizers-text-sequence - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

2

dist/types/resources/baseMention.d.ts
export declare namespace BaseMention {
const MentionRegex = "((?<=\\s|^)@([a-zA-Z0-9_]+))";
const MentionRegex = "@([a-zA-Z0-9_]+)(?![.]\\w)\\b";
}
export declare namespace BasePhoneNumbers {
const NumberReplaceToken = "@builtin.phonenumber";
const GeneralPhoneNumberRegex = "(\\b((\\d[\\s]?){7,15}\\d)\\b)";
const BrazilPhoneNumberRegex = "(((\\B\\(\\s?))\\d{2,3}(\\s?\\))|(\\b\\d{2,3}))\\s?\\d{4,5}-?\\d{3,5}\\b";
const UkPhoneNumberRegex = "(((\\b(00)|\\B\\+)\\s?)?\\b\\d{2}\\s?(\\(0\\))?\\d{3,5}[/-]?\\s?(\\d{7,8}|\\d{3}\\s?\\d{3})\\b)";
const GermanyPhoneNumberRegex = "(\\b(\\d{3,4}\\s?[-/]?(\\s?\\d){7,8})\\b)";
const USPhoneNumberRegex = "((((\\B\\+)|\\b)1(\\s|-)?)|\\b)?(\\B\\(|\\b)\\d{3}\\)?\\s?-?\\s?\\d{3}\\s?-?\\s?\\d{4}\\b";
const GeneralPhoneNumberRegex = "(\\b(((\\d[\\s]?){7,15}\\d))(?!-)\\b)|(\\(\\d{5}\\)\\s?\\d{5,6})|\\+\\d{2}\\(\\d\\)\\d{10}";
const BRPhoneNumberRegex = "(((\\B\\(\\s?))\\d{2,3}(\\s?\\))|(\\b\\d{2,3}))\\s?\\d{4,5}-?\\d{3,5}(?!-)\\b";
const UKPhoneNumberRegex = "(((\\b(00)|\\B\\+)\\s?)?(\\b\\d{2}\\s?)?((\\s?\\(0\\)\\s?|\\b|(?<=(\\b^#)\\d{2}))\\d{2,5}|\\(0\\d{3,4}\\))[/-]?\\s?(\\d{5,8}|\\d{3,4}\\s?\\d{3,4})(?!-)\\b)";
const DEPhoneNumberRegex = "((\\+\\d{2}\\s?((\\(0\\))?\\d\\s?)?|\\b)(\\d{2,4}\\s?[-/]?[\\s\\d]{7,10}\\d)(?!-)\\b)";
const USPhoneNumberRegex = "((((\\B\\+)|\\b)1(\\s|-)?)|\\b)?(\\(\\d{3}\\)\\s?|\\b\\d{3}\\s?[-\\.]?\\s?)\\d{3}\\s?[-\\.]?\\s?\\d{4}(x\\d{3,5})?(?!-)\\b";
const CNPhoneNumberRegex = "((\\b00\\s?)?\\+?86\\s?-?\\s?)?(((\\b|(?<=86))\\d{2,5}\\s?-?\\s?|\\(\\d{2,5}\\)\\s?)\\d{4}\\s?-?\\s?\\d{4}(\\s?-?\\s?\\d{4})?|(\\b|(?<=86))\\d{3}\\s?-?\\s?\\d{4}\\s?-?\\s?\\d{4})(?!-)\\b";
const DKPhoneNumberRegex = "((\\(\\s?(\\+\\s?|00)45\\s?\\)\\s?)|(((?<!\\d)\\+\\s?|\\b00)45\\s?)|\\b)(\\s?\\(0\\)\\s?)?((\\d{8})|(\\d{4}\\s?-?\\s?\\d{4,6})|((\\d{2}[\\s-]){3}\\d{2})|(\\d{2}\\s?-?\\s?\\d{3}\\s?-?\\s?\\d{3}))(?!-)\\b";
const ITPhoneNumberRegex = "((\\(\\s?(\\+\\s?|00)39\\s?\\)\\s?)|(((?<!\\d)\\+\\s?|\\b00)39\\s?)|\\b)((0[\\d\\s-]{4,12}\\d)|(3[\\d\\s-]{7,12}\\d))(?!-)\\b";
const NLPhoneNumberRegex = "((((\\(\\s?(\\+\\s?|00)31\\s?\\)\\s?)|(((?<!\\d)\\+\\s?|\\b00)31\\s?))?(((\\b|(?<=31))0?\\d{1,3}\\s?-?|\\(\\s?0?\\d{1,3}\\s?\\)|\\(0\\)\\s?\\d{1,3}\\s?-?)\\s?[\\d\\s]{5,11}\\d))|\\b\\d{10,12})(?!-)\\b";
const SpecialPhoneNumberRegex = "\\b(\\d{3,4}[/-]\\d{1,4}[/-]\\d{3,4})\\b";
const TypicalDeductionRegexList: string[];
const PhoneNumberMaskRegex = "([0-9A-E]{2}(\\s[0-9A-E]{2}){7})";
const CountryCodeRegex = "^(\\(\\s?(\\+\\s?|00)\\d{1,3}\\s?\\)|(\\+\\s?|00)\\d{1,3})";
const AreaCodeIndicatorRegex = "\\(";
const FormatIndicatorRegex = "(\\s|-|/|\\.)+";
const SeparatorCharList: string[];
}
export declare namespace BaseURL {
const URLRegex: string;
const ProtocolRegex = "((https?|ftp):\\/\\/)";
const PortRegex = "(:\\d{1,5})";
const ExtractionRestrictionRegex = "(?<=\\s|[\\'\"\"\\(\\[:]|^)";
const UrlPrefixRegex: string;
const UrlSuffixRegex: string;
const UrlRegex: string;
const IpUrlRegex: string;
const TldList: string[];
}

@@ -6,6 +6,10 @@ export declare class Constants {

static readonly PHONE_NUMBER_REGEX_GENERAL: string;
static readonly PHONE_NUMBER_REGEX_BRAZIL: string;
static readonly PHONE_NUMBER_REGEX_BR: string;
static readonly PHONE_NUMBER_REGEX_UK: string;
static readonly PHONE_NUMBER_REGEX_GERMANY: string;
static readonly PHONE_NUMBER_REGEX_DE: string;
static readonly PHONE_NUMBER_REGEX_US: string;
static readonly PHONE_NUMBER_REGEX_CN: string;
static readonly PHONE_NUMBER_REGEX_DK: string;
static readonly PHONE_NUMBER_REGEX_IT: string;
static readonly PHONE_NUMBER_REGEX_NL: string;
static readonly PHONE_NUMBER_REGEX_SPECIAL: string;

@@ -12,0 +16,0 @@ static readonly MENTION_REGEX: string;

import { BasePhoneNumberExtractor, BaseIpExtractor, BaseMentionExtractor, BaseHashtagExtractor, BaseEmailExtractor, BaseURLExtractor } from "../extractors";
import { ExtractResult } from "@microsoft/recognizers-text";
export declare class PhoneNumberExtractor extends BasePhoneNumberExtractor {
extract(source: string): Array<ExtractResult>;
}

@@ -4,0 +6,0 @@ export declare class IpExtractor extends BaseIpExtractor {

import { BaseSequenceParser, BaseIpParser } from "../parsers";
import { ExtractResult, ParseResult } from "@microsoft/recognizers-text";
export declare class PhoneNumberParser extends BaseSequenceParser {
scoreUpperLimit: number;
scoreLowerLimit: number;
baseScore: number;
countryCodeAward: number;
areaCodeAward: number;
formattedAward: number;
lengthAward: number;
typicalFormatDeductionScore: number;
continueDigitDeductionScore: number;
tailSameDeductionScore: number;
continueFormatIndicatorDeductionScore: number;
maxFormatIndicatorNum: number;
maxLengthAwardNum: number;
tailSameLimit: number;
phoneNumberLengthBase: number;
pureDigitLengthLimit: number;
tailSameDigitRegex: RegExp;
pureDigitRegex: RegExp;
continueDigitRegex: RegExp;
digitRegex: RegExp;
ScorePhoneNumber(phoneNumberText: string): number;
parse(extResult: ExtractResult): ParseResult;
}

@@ -4,0 +27,0 @@ export declare class IpParser extends BaseIpParser {

@@ -11,2 +11,3 @@ import { IModel, ModelResult, IExtractor, IParser } from "@microsoft/recognizers-text";

modelTypeName: string;
parse(query: string): ModelResult[];
}

@@ -13,0 +14,0 @@ export declare class IpAddressModel extends AbstractSequenceModel {

{
"name": "@microsoft/recognizers-text-sequence",
"version": "1.0.1",
"version": "1.1.0",
"description": "recognizers-text-sequence provides robust recognition and resolution of series entities like phone numbers and IP addresses.",

@@ -30,3 +30,3 @@ "author": "Microsoft Corp.",

"scripts": {
"build-resources": "ts-node --project ../resource-generator/ ../resource-generator/ ../recognizers-sequence/resource-definitions.json",
"build-resources": "ts-node --project ../resource-generator/tsconfig.json ../resource-generator/ ../recognizers-sequence/resource-definitions.json",
"clean-build": "rimraf dist && rimraf compiled",

@@ -36,5 +36,5 @@ "prepare": "npm run build-resources && npm run clean-build && tsc && rollup -c"

"dependencies": {
"@microsoft/recognizers-text": "~1.0.1",
"@microsoft/recognizers-text": "~1.1.0",
"grapheme-splitter": "^1.0.2"
}
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc