How to use the @microsoft/recognizers-text-number.BaseNumberParser 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-date-time / src / dateTime / spanish / datePeriodConfiguration.ts View on Github external
this.pastRegex = RegExpUtility.getSafeRegExp(SpanishDateTime.PastRegex);
        this.futureRegex = RegExpUtility.getSafeRegExp(SpanishDateTime.FutureRegex);
        this.weekOfRegex = RegExpUtility.getSafeRegExp(SpanishDateTime.WeekOfRegex);
        this.monthOfRegex = RegExpUtility.getSafeRegExp(SpanishDateTime.MonthOfRegex);
        this.dateUnitRegex = RegExpUtility.getSafeRegExp(SpanishDateTime.DateUnitRegex);
        this.inConnectorRegex = RegExpUtility.getSafeRegExp(SpanishDateTime.InConnectorRegex);
        this.rangeUnitRegex = RegExpUtility.getSafeRegExp(SpanishDateTime.RangeUnitRegex);

        this.fromRegex = RegExpUtility.getSafeRegExp(SpanishDateTime.FromRegex);
        this.RangeConnectorRegex = RegExpUtility.getSafeRegExp(SpanishDateTime.RangeConnectorRegex);
        this.betweenRegex = RegExpUtility.getSafeRegExp(SpanishDateTime.BetweenRegex);
        this.nowRegex = RegExpUtility.getSafeRegExp(SpanishDateTime.NowRegex);

        this.datePointExtractor = new BaseDateExtractor(new SpanishDateExtractorConfiguration(dmyDateFormat));
        this.integerExtractor = new SpanishIntegerExtractor();
        this.numberParser = new BaseNumberParser(new SpanishNumberParserConfiguration());
        this.durationExtractor = new BaseDurationExtractor(new SpanishDurationExtractorConfiguration());
    }
github microsoft / Recognizers-Text / JavaScript / packages / recognizers-date-time / src / dateTime / french / datePeriodConfiguration.ts View on Github external
this.futureRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.NextSuffixRegex);
        this.weekOfRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.WeekOfRegex);
        this.monthOfRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.MonthOfRegex);
        this.dateUnitRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.DateUnitRegex);
        this.inConnectorRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.InConnectorRegex);
        this.rangeUnitRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.RangeUnitRegex);
        this.weekDayOfMonthRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.WeekDayOfMonthRegex);

        this.fromRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.FromRegex);
        this.connectorAndRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.ConnectorAndRegex);
        this.beforeRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.BeforeRegex2);
        this.nowRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.NowRegex);

        this.datePointExtractor = new BaseDateExtractor(new FrenchDateExtractorConfiguration(dmyDateFormat));
        this.integerExtractor = new FrenchIntegerExtractor();
        this.numberParser = new BaseNumberParser(new FrenchNumberParserConfiguration());
        this.durationExtractor = new BaseDurationExtractor(new FrenchDurationExtractorConfiguration());
    }
github microsoft / Recognizers-Text / JavaScript / packages / recognizers-date-time / src / dateTime / french / baseConfiguration.ts View on Github external
this.utilityConfiguration = new FrenchDateTimeUtilityConfiguration();

        this.unitMap = FrenchDateTime.UnitMap;
        this.unitValueMap = FrenchDateTime.UnitValueMap;
        this.seasonMap = FrenchDateTime.SeasonMap;
        this.cardinalMap = FrenchDateTime.CardinalMap;
        this.dayOfWeek = FrenchDateTime.DayOfWeek;
        this.monthOfYear = FrenchDateTime.MonthOfYear;
        this.numbers = FrenchDateTime.Numbers;
        this.doubleNumbers = FrenchDateTime.DoubleNumbers;

        this.cardinalExtractor = new FrenchCardinalExtractor();
        this.integerExtractor = new FrenchIntegerExtractor();
        this.ordinalExtractor = new FrenchOrdinalExtractor();

        this.numberParser = new BaseNumberParser(new FrenchNumberParserConfiguration());
        this.dateExtractor = new BaseDateExtractor(new FrenchDateExtractorConfiguration(dmyDateFormat));
        this.timeExtractor = new BaseTimeExtractor(new FrenchTimeExtractorConfiguration());
        this.dateTimeExtractor = new BaseDateTimeExtractor(new FrenchDateTimeExtractorConfiguration(dmyDateFormat));
        this.durationExtractor = new BaseDurationExtractor(new FrenchDurationExtractorConfiguration());
        this.datePeriodExtractor = new BaseDatePeriodExtractor(new FrenchDatePeriodExtractorConfiguration(dmyDateFormat));
        this.timePeriodExtractor = new BaseTimePeriodExtractor(new FrenchTimePeriodExtractorConfiguration());
        this.dateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new FrenchDateTimePeriodExtractorConfiguration(dmyDateFormat));
        this.durationParser = new BaseDurationParser(new FrenchDurationParserConfiguration(this));
        this.dateParser = new BaseDateParser(new FrenchDateParserConfiguration(this, dmyDateFormat));
        this.timeParser = new BaseTimeParser(new FrenchTimeParserConfiguration(this));
        this.dateTimeParser = new BaseDateTimeParser(new FrenchDateTimeParserConfiguration(this));
        this.datePeriodParser = new BaseDatePeriodParser(new FrenchDatePeriodParserConfiguration(this));
        this.timePeriodParser = new BaseTimePeriodParser(new FrenchTimePeriodParserConfiguration(this));
        this.dateTimePeriodParser = new BaseDateTimePeriodParser(new FrenchDateTimePeriodParserConfiguration(this));
        this.dayOfMonth = new Map([...BaseDateTime.DayOfMonthDictionary, ...FrenchDateTime.DayOfMonth]);
    }
github microsoft / Recognizers-Text / JavaScript / packages / recognizers-date-time / src / dateTime / spanish / baseConfiguration.ts View on Github external
this.utilityConfiguration = new SpanishDateTimeUtilityConfiguration();

        this.unitMap = SpanishDateTime.UnitMap;
        this.unitValueMap = SpanishDateTime.UnitValueMap;
        this.seasonMap = SpanishDateTime.SeasonMap;
        this.cardinalMap = SpanishDateTime.CardinalMap;
        this.dayOfWeek = SpanishDateTime.DayOfWeek;
        this.monthOfYear = SpanishDateTime.MonthOfYear;
        this.numbers = SpanishDateTime.Numbers;
        this.doubleNumbers = SpanishDateTime.DoubleNumbers;

        this.cardinalExtractor = new SpanishCardinalExtractor();
        this.integerExtractor = new SpanishIntegerExtractor();
        this.ordinalExtractor = new SpanishOrdinalExtractor();

        this.numberParser = new BaseNumberParser(new SpanishNumberParserConfiguration());
        this.dateExtractor = new BaseDateExtractor(new SpanishDateExtractorConfiguration(dmyDateFormat));
        this.timeExtractor = new BaseTimeExtractor(new SpanishTimeExtractorConfiguration());
        this.dateTimeExtractor = new BaseDateTimeExtractor(new SpanishDateTimeExtractorConfiguration(dmyDateFormat));
        this.durationExtractor = new BaseDurationExtractor(new SpanishDurationExtractorConfiguration());
        this.datePeriodExtractor = new BaseDatePeriodExtractor(new SpanishDatePeriodExtractorConfiguration(dmyDateFormat));
        this.timePeriodExtractor = new BaseTimePeriodExtractor(new SpanishTimePeriodExtractorConfiguration());
        this.dateTimePeriodExtractor = new BaseDateTimePeriodExtractor(new SpanishDateTimePeriodExtractorConfiguration(dmyDateFormat));
        this.durationParser = new BaseDurationParser(new SpanishDurationParserConfiguration(this));
        this.dateParser = new BaseDateParser(new SpanishDateParserConfiguration(this, dmyDateFormat));
        this.timeParser = new BaseTimeParser(new SpanishTimeParserConfiguration(this));
        this.dateTimeParser = new BaseDateTimeParser(new SpanishDateTimeParserConfiguration(this));
        this.datePeriodParser = new BaseDatePeriodParser(new SpanishDatePeriodParserConfiguration(this));
        this.timePeriodParser = new BaseTimePeriodParser(new SpanishTimePeriodParserConfiguration(this));
        this.dateTimePeriodParser = new BaseDateTimePeriodParser(new SpanishDateTimePeriodParserConfiguration(this));
    }
}
github microsoft / Recognizers-Text / JavaScript / packages / recognizers-date-time / src / dateTime / french / dateConfiguration.ts View on Github external
RegExpUtility.getSafeRegExp(FrenchDateTime.WeekDayOfMonthRegex, "gis"),
            RegExpUtility.getSafeRegExp(FrenchDateTime.SpecialDate, "gis")
        ];

        this.monthEnd = RegExpUtility.getSafeRegExp(FrenchDateTime.MonthEnd, "gis");
        this.ofMonth = RegExpUtility.getSafeRegExp(FrenchDateTime.OfMonth, "gis");
        this.dateUnitRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.DateUnitRegex, "gis");
        this.forTheRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.ForTheRegex, "gis");
        this.weekDayAndDayOfMonthRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.WeekDayAndDayOfMonthRegex, "gis");
        this.relativeMonthRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.RelativeMonthRegex, "gis");
        this.strictRelativeRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.StrictRelativeRegex, "gis");
        this.weekDayRegex = RegExpUtility.getSafeRegExp(FrenchDateTime.WeekDayRegex, "gis");
        this.dayOfWeek = FrenchDateTime.DayOfWeek;
        this.ordinalExtractor = new FrenchOrdinalExtractor();
        this.integerExtractor = new FrenchIntegerExtractor();
        this.numberParser = new BaseNumberParser(new FrenchNumberParserConfiguration());
        this.durationExtractor = new BaseDurationExtractor(new FrenchDurationExtractorConfiguration());
        this.utilityConfiguration = new FrenchDateTimeUtilityConfiguration();
        this.nonDateUnitRegex = RegExpUtility.getSafeRegExp("(?heure|heures|hrs|secondes|seconde|secs|sec|minutes|minute|mins)\b", "gis");
    }
}
github microsoft / Recognizers-Text / JavaScript / packages / recognizers-date-time / src / dateTime / spanish / dateConfiguration.ts View on Github external
RegExpUtility.getSafeRegExp(SpanishDateTime.WeekDayOfMonthRegex, "gis"),
            RegExpUtility.getSafeRegExp(SpanishDateTime.SpecialDateRegex, "gis")
        ];

        this.monthEnd = RegExpUtility.getSafeRegExp(SpanishDateTime.MonthEndRegex, "gis");
        this.ofMonth = RegExpUtility.getSafeRegExp(SpanishDateTime.OfMonthRegex, "gis");
        this.dateUnitRegex = RegExpUtility.getSafeRegExp(SpanishDateTime.DateUnitRegex, "gis");
        this.forTheRegex = RegExpUtility.getSafeRegExp(SpanishDateTime.ForTheRegex, "gis");
        this.weekDayAndDayOfMonthRegex = RegExpUtility.getSafeRegExp(SpanishDateTime.WeekDayAndDayOfMonthRegex, "gis");
        this.relativeMonthRegex = RegExpUtility.getSafeRegExp(SpanishDateTime.RelativeMonthRegex, "gis");
        this.strictRelativeRegex = RegExpUtility.getSafeRegExp(SpanishDateTime.StrictRelativeRegex, "gis");
        this.weekDayRegex = RegExpUtility.getSafeRegExp(SpanishDateTime.WeekDayRegex, "gis");
        this.dayOfWeek = SpanishDateTime.DayOfWeek;
        this.ordinalExtractor = new SpanishOrdinalExtractor();
        this.integerExtractor = new SpanishIntegerExtractor();
        this.numberParser = new BaseNumberParser(new SpanishNumberParserConfiguration());
        this.durationExtractor = new BaseDurationExtractor(new SpanishDurationExtractorConfiguration());
        this.utilityConfiguration = new SpanishDateTimeUtilityConfiguration();
    }
}

@microsoft/recognizers-text-number

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

MIT
Latest version published 10 months ago

Package Health Score

79 / 100
Full package analysis