How to use the @microsoft/recognizers-text-number.ChineseNumberParserConfiguration 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 / chinese / dateTimeConfiguration.ts View on Github external
constructor(dmyDateFormat: boolean) {
        this.dateExtractor = new ChineseDateExtractor(dmyDateFormat);
        this.timeExtractor = new ChineseTimeExtractor();
        this.dateParser = new ChineseDateParser(dmyDateFormat);
        this.timeParser = new ChineseTimeParser();
        this.pmTimeRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.DateTimeSimplePmRegex);
        this.amTimeRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.DateTimeSimpleAmRegex);
        this.specificTimeOfDayRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.TimeOfTodayRegex);
        this.nowRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.NowRegex);
        this.numberParser = AgnosticNumberParserFactory.getParser(AgnosticNumberParserType.Number, new ChineseNumberParserConfiguration());
        this.unitRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.DateUnitRegex);
        this.unitMap = ChineseDateTime.ParserConfigurationUnitMap;
    }
github microsoft / Recognizers-Text / JavaScript / packages / recognizers-date-time / src / dateTime / chinese / dateTimePeriodConfiguration.ts View on Github external
constructor(dmyDateFormat: boolean) {
        let config = new ChineseDateTimePeriodParserConfiguration(dmyDateFormat);
        super(config);
        this.TMORegex = RegExpUtility.getSafeRegExp(ChineseDateTime.DateTimePeriodMORegex);
        this.TMIRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.DateTimePeriodMIRegex);
        this.TAFRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.DateTimePeriodAFRegex);
        this.TEVRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.DateTimePeriodEVRegex);
        this.TNIRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.DateTimePeriodNIRegex);
        this.unitRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.DateTimePeriodUnitRegex);
        this.timeOfDayRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.TimeOfDayRegex);
        this.cardinalExtractor = new ChineseCardinalExtractor();
        this.cardinalParser = AgnosticNumberParserFactory.getParser(AgnosticNumberParserType.Cardinal, new ChineseNumberParserConfiguration());
    }
github microsoft / Recognizers-Text / JavaScript / packages / recognizers-date-time / src / dateTime / chinese / datePeriodConfiguration.ts View on Github external
constructor(dmyDateFormat: boolean) {
        let config = new ChineseDatePeriodParserConfiguration(dmyDateFormat);
        super(config, false);
        this.integerExtractor = new ChineseIntegerExtractor();
        this.numberParser = AgnosticNumberParserFactory.getParser(AgnosticNumberParserType.Integer, new ChineseNumberParserConfiguration());
        this.yearInChineseRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.DatePeriodYearInChineseRegex);
        this.numberCombinedWithUnitRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.NumberCombinedWithUnit);
        this.unitRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.UnitRegex);
        this.yearAndMonthRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.YearAndMonth);
        this.pureNumberYearAndMonthRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.PureNumYearAndMonth);
        this.yearToYearRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.YearToYear);
        this.YearToYearSuffixRequired = RegExpUtility.getSafeRegExp(ChineseDateTime.YearToYearSuffixRequired);
        this.chineseYearRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.DatePeriodYearInChineseRegex);
        this.seasonWithYearRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.SeasonWithYear);
    }
github microsoft / Recognizers-Text / JavaScript / packages / recognizers-date-time / src / dateTime / chinese / dateConfiguration.ts View on Github external
constructor(dmyDateFormat: boolean) {
        this.dateRegex = new ChineseDateExtractorConfiguration(dmyDateFormat).dateRegexList;
        this.monthOfYear = ChineseDateTime.ParserConfigurationMonthOfYear;
        this.dayOfMonth = ChineseDateTime.ParserConfigurationDayOfMonth;
        this.dayOfWeek = ChineseDateTime.ParserConfigurationDayOfWeek;
        this.specialDayRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.SpecialDayRegex);
        this.specialDayWithNumRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.SpecialDayWithNumRegex);
        this.thisRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.DateThisRegex);
        this.nextRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.DateNextRegex);
        this.lastRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.DateLastRegex);
        this.unitRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.DateUnitRegex);
        this.unitMap = ChineseDateTime.ParserConfigurationUnitMap;
        this.weekDayRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.WeekDayRegex);
        this.integerExtractor = new ChineseIntegerExtractor();
        this.numberParser = AgnosticNumberParserFactory.getParser(AgnosticNumberParserType.Number, new ChineseNumberParserConfiguration());

    }
}
github microsoft / Recognizers-Text / JavaScript / packages / recognizers-number-with-unit / src / numberWithUnit / chinese / base.ts View on Github external
constructor(ci: CultureInfo) {
        super(ci);

        this.internalNumberExtractor = new ChineseNumberExtractor(ChineseNumberExtractorMode.Default);
        this.internalNumberParser = AgnosticNumberParserFactory.getParser(AgnosticNumberParserType.Number, new ChineseNumberParserConfiguration());
        this.connectorToken = '';
        this.currencyNameToIsoCodeMap = ChineseNumericWithUnit.CurrencyNameToIsoCodeMap;
        this.currencyFractionCodeList = ChineseNumericWithUnit.FractionalUnitNameToCodeMap;
    }
}
github microsoft / Recognizers-Text / JavaScript / packages / recognizers-date-time / src / dateTime / chinese / datePeriodConfiguration.ts View on Github external
this.simpleCasesRegexes = [
            RegExpUtility.getSafeRegExp(ChineseDateTime.SimpleCasesRegex),
            RegExpUtility.getSafeRegExp(ChineseDateTime.OneWordPeriodRegex),
            RegExpUtility.getSafeRegExp(ChineseDateTime.StrictYearRegex),
            RegExpUtility.getSafeRegExp(ChineseDateTime.YearToYear),
            RegExpUtility.getSafeRegExp(ChineseDateTime.YearToYearSuffixRequired),
            RegExpUtility.getSafeRegExp(ChineseDateTime.YearAndMonth),
            RegExpUtility.getSafeRegExp(ChineseDateTime.PureNumYearAndMonth),
            RegExpUtility.getSafeRegExp(ChineseDateTime.DatePeriodYearInChineseRegex),
            RegExpUtility.getSafeRegExp(ChineseDateTime.WeekOfMonthRegex),
            RegExpUtility.getSafeRegExp(ChineseDateTime.SeasonWithYear),
            RegExpUtility.getSafeRegExp(ChineseDateTime.QuarterRegex),
        ];
        this.datePointExtractor = new ChineseDateExtractor(dmyDateFormat);
        this.integerExtractor = new ChineseIntegerExtractor();
        this.numberParser = new BaseNumberParser(new ChineseNumberParserConfiguration());
        this.illegalYearRegex = RegExpUtility.getSafeRegExp(BaseDateTime.IllegalYearRegex);
        this.tillRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.DatePeriodTillRegex);
        this.followedUnit = RegExpUtility.getSafeRegExp(ChineseDateTime.FollowedUnit);
        this.numberCombinedWithUnit = RegExpUtility.getSafeRegExp(ChineseDateTime.NumberCombinedWithUnit);
        this.pastRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.PastRegex);
        this.futureRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.FutureRegex);
        this.nowRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.NowRegex);
    }
github microsoft / Recognizers-Text / JavaScript / packages / recognizers-date-time / src / dateTime / chinese / holidayConfiguration.ts View on Github external
constructor() {
        let config = new ChineseHolidayParserConfiguration();
        super(config);
        this.lunarHolidayRegex = RegExpUtility.getSafeRegExp(ChineseDateTime.LunarHolidayRegex);
        this.integerExtractor = new ChineseIntegerExtractor();
        this.numberParser = AgnosticNumberParserFactory.getParser(AgnosticNumberParserType.Integer, new ChineseNumberParserConfiguration());
        this.fixedHolidayDictionary = new Map Date>([
            ['元旦', ChineseHolidayParser.NewYear],
            ['元旦节', ChineseHolidayParser.NewYear],
            ['教师节', ChineseHolidayParser.TeacherDay],
            ['青年节', ChineseHolidayParser.YouthDay],
            ['儿童节', ChineseHolidayParser.ChildrenDay],
            ['妇女节', ChineseHolidayParser.FemaleDay],
            ['植树节', ChineseHolidayParser.TreePlantDay],
            ['情人节', ChineseHolidayParser.LoverDay],
            ['平安夜', ChineseHolidayParser.ChristmasEve],
            ['圣诞节', ChineseHolidayParser.ChristmasDay],
            ['新年', ChineseHolidayParser.NewYear],
            ['愚人节', ChineseHolidayParser.FoolDay],
            ['五一', ChineseHolidayParser.LaborDay],
            ['劳动节', ChineseHolidayParser.LaborDay],
            ['万圣节', ChineseHolidayParser.HalloweenDay],

@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