How to use the @microsoft/recognizers-text-number.EnglishNumberParserConfiguration function in @microsoft/recognizers-text-number

To help you get started, we’ve selected a few @microsoft/recognizers-text-number 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 / packages / recognizers-number-with-unit / src / numberWithUnit / english / base.ts View on Github external
constructor(ci: CultureInfo) {
        super(ci);

        this.internalNumberExtractor = new EnglishNumberExtractor(NumberMode.Default);
        this.internalNumberParser = AgnosticNumberParserFactory.getParser(AgnosticNumberParserType.Number, new EnglishNumberParserConfiguration());
        this.connectorToken = '';
        this.currencyNameToIsoCodeMap = EnglishNumericWithUnit.CurrencyNameToIsoCodeMap;
        this.currencyFractionCodeList = EnglishNumericWithUnit.FractionalUnitNameToCodeMap;
    }
}
github microsoft / Recognizers-Text / JavaScript / packages / recognizers-date-time / src / dateTime / english / baseConfiguration.ts View on Github external
constructor(dmyDateFormat: boolean = false) {
        super();
        this.utilityConfiguration = new EnglishDateTimeUtilityConfiguration();
        this.unitMap = EnglishDateTime.UnitMap;
        this.unitValueMap = EnglishDateTime.UnitValueMap;
        this.seasonMap = EnglishDateTime.SeasonMap;
        this.cardinalMap = EnglishDateTime.CardinalMap;
        this.dayOfWeek = EnglishDateTime.DayOfWeek;
        this.monthOfYear = EnglishDateTime.MonthOfYear;
        this.numbers = EnglishDateTime.Numbers;
        this.doubleNumbers = EnglishDateTime.DoubleNumbers;
        this.cardinalExtractor = new EnglishCardinalExtractor();
        this.integerExtractor = new EnglishIntegerExtractor();
        this.ordinalExtractor = new EnglishOrdinalExtractor();
        this.dayOfMonth = new Map([...BaseDateTime.DayOfMonthDictionary, ...EnglishDateTime.DayOfMonth]);
        this.numberParser = new BaseNumberParser(new EnglishNumberParserConfiguration());
        this.dateExtractor = new BaseDateExtractor(new EnglishDateExtractorConfiguration(dmyDateFormat));
        this.timeExtractor = new BaseTimeExtractor(new EnglishTimeExtractorConfiguration());
        this.dateTimeExtractor = new BaseDateTimeExtractor(new EnglishDateTimeExtractorConfiguration(dmyDateFormat));
        this.durationExtractor = new BaseDurationExtractor(new EnglishDurationExtractorConfiguration());
        this.datePeriodExtractor = new BaseDatePeriodExtractor(new EnglishDatePeriodExtractorConfiguration(dmyDateFormat));
        this.timePeriodExtractor = new BaseTimePeriodExtractor(new EnglishTimePeriodExtractorConfiguration());
        this.dateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new EnglishDateTimePeriodExtractorConfiguration(dmyDateFormat));
        this.durationParser = new BaseDurationParser(new EnglishDurationParserConfiguration(this));
        this.dateParser = new BaseDateParser(new EnglishDateParserConfiguration(this, dmyDateFormat));
        this.timeParser = new EnglishTimeParser(new EnglishTimeParserConfiguration(this));
        this.dateTimeParser = new BaseDateTimeParser(new EnglishDateTimeParserConfiguration(this));
        this.datePeriodParser = new BaseDatePeriodParser(new EnglishDatePeriodParserConfiguration(this));
        this.timePeriodParser = new BaseTimePeriodParser(new EnglishTimePeriodParserConfiguration(this));
        this.dateTimePeriodParser = new BaseDateTimePeriodParser(new EnglishDateTimePeriodParserConfiguration(this));
    }
}
github microsoft / Recognizers-Text / JavaScript / packages / recognizers-date-time / src / dateTime / english / datePeriodConfiguration.ts View on Github external
];
        this.illegalYearRegex = RegExpUtility.getSafeRegExp(BaseDateTime.IllegalYearRegex);
        this.YearRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.YearRegex);
        this.tillRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.TillRegex);
        this.followedUnit = RegExpUtility.getSafeRegExp(EnglishDateTime.FollowedDateUnit);
        this.numberCombinedWithUnit = RegExpUtility.getSafeRegExp(EnglishDateTime.NumberCombinedWithDateUnit);
        this.pastRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.PreviousPrefixRegex);
        this.futureRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.NextPrefixRegex);
        this.weekOfRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.WeekOfRegex);
        this.monthOfRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.MonthOfRegex);
        this.dateUnitRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.DateUnitRegex);
        this.inConnectorRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.InConnectorRegex);
        this.rangeUnitRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.RangeUnitRegex);
        this.datePointExtractor = new BaseDateExtractor(new EnglishDateExtractorConfiguration(dmyDateFormat));
        this.integerExtractor = new EnglishIntegerExtractor();
        this.numberParser = new BaseNumberParser(new EnglishNumberParserConfiguration());
        this.durationExtractor = new BaseDurationExtractor(new EnglishDurationExtractorConfiguration());
        this.rangeConnectorRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.RangeConnectorRegex);
        this.nowRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.NowRegex);
    }
github microsoft / Recognizers-Text / JavaScript / packages / recognizers-date-time / src / dateTime / english / dateConfiguration.ts View on Github external
RegExpUtility.getSafeRegExp(EnglishDateTime.WeekDayOfMonthRegex),
            RegExpUtility.getSafeRegExp(EnglishDateTime.SpecialDate),
            RegExpUtility.getSafeRegExp(EnglishDateTime.RelativeWeekDayRegex),
        ];
        this.monthEnd = RegExpUtility.getSafeRegExp(EnglishDateTime.MonthEnd);
        this.ofMonth = RegExpUtility.getSafeRegExp(EnglishDateTime.OfMonth);
        this.dateUnitRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.DateUnitRegex);
        this.forTheRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.ForTheRegex);
        this.weekDayAndDayOfMonthRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.WeekDayAndDayOfMonthRegex);
        this.relativeMonthRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.RelativeMonthRegex);
        this.strictRelativeRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.StrictRelativeRegex);
        this.weekDayRegex = RegExpUtility.getSafeRegExp(EnglishDateTime.WeekDayRegex);
        this.dayOfWeek = EnglishDateTime.DayOfWeek;
        this.ordinalExtractor = new EnglishOrdinalExtractor();
        this.integerExtractor = new EnglishIntegerExtractor();
        this.numberParser = new BaseNumberParser(new EnglishNumberParserConfiguration());
        this.durationExtractor = new BaseDurationExtractor(new EnglishDurationExtractorConfiguration());
        this.utilityConfiguration = new EnglishDateTimeUtilityConfiguration();
    }
}

@microsoft/recognizers-text-number

recognizers-text-number provides robust recognition and resolution of numbers expressed in multiple languages.

MIT
Latest version published 1 year ago

Package Health Score

81 / 100
Full package analysis