How to use the @microsoft/recognizers-text-number.Culture.Spanish 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 / spanish / currency.ts View on Github external
constructor(ci?: CultureInfo) {
        if (!ci) {
            ci = new CultureInfo(Culture.Spanish);
        }

        super(ci);

        this.extractType = Constants.SYS_UNIT_CURRENCY;

        // Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies
        this.suffixList = SpanishNumericWithUnit.CurrencySuffixList;
        this.prefixList = SpanishNumericWithUnit.CurrencyPrefixList;
        this.ambiguousUnitList = SpanishNumericWithUnit.AmbiguousCurrencyUnitList;
    }
}
github microsoft / Recognizers-Text / JavaScript / packages / recognizers-date-time / src / dateTime / dateTimeRecognizer.ts View on Github external
// #region English
        this.registerModel("DateTimeModel", Culture.English, (options) => new DateTimeModel(
            new BaseMergedParser(new EnglishMergedParserConfiguration(new EnglishCommonDateTimeParserConfiguration()), this.Options),
            new BaseMergedExtractor(new EnglishMergedExtractorConfiguration(), this.Options)
        ));
        // #endregion

        // #region EnglishOhters
        this.registerModel("DateTimeModel", Culture.EnglishOthers, (options) => new DateTimeModel(
            new BaseMergedParser(new EnglishMergedParserConfiguration(new EnglishCommonDateTimeParserConfiguration(true)), this.Options),
            new BaseMergedExtractor(new EnglishMergedExtractorConfiguration(true), this.Options)
        ));
        // #endregion

        // #region Spanish
        this.registerModel("DateTimeModel", Culture.Spanish, (options) => new DateTimeModel(
            new BaseMergedParser(new SpanishMergedParserConfiguration(), this.Options),
            new BaseMergedExtractor(new SpanishMergedExtractorConfiguration(), this.Options)
        ));
        // #endregion

        // #region Chinese
        this.registerModel("DateTimeModel", Culture.Chinese, (options) => new DateTimeModel(
            new ChineseFullMergedParser(),
            new ChineseMergedExtractor(this.Options)
        ));
        // #endregion

        // #region French
        this.registerModel("DateTimeModel", Culture.French, (options) => new DateTimeModel(
            new BaseMergedParser(new FrenchMergedParserConfiguration(), this.Options),
            new BaseMergedExtractor(new FrenchMergedExtractorConfiguration(), this.Options)
github microsoft / Recognizers-Text / JavaScript / packages / recognizers-number-with-unit / src / numberWithUnit / numberWithUnitRecognizer.ts View on Github external
this.registerModel("CurrencyModel", Culture.English, (options) => new CurrencyModel(new Map([
            [new BaseMergedUnitExtractor(new EnglishCurrencyExtractorConfiguration()), new BaseMergedUnitParser(new EnglishCurrencyParserConfiguration())]
        ])));
        this.registerModel("TemperatureModel", Culture.English, (options) => new TemperatureModel(new Map([
            [new NumberWithUnitExtractor(new EnglishTemperatureExtractorConfiguration()), new NumberWithUnitParser(new EnglishTemperatureParserConfiguration())]
        ])));
        this.registerModel("DimensionModel", Culture.English, (options) => new DimensionModel(new Map([
            [new NumberWithUnitExtractor(new EnglishDimensionExtractorConfiguration()), new NumberWithUnitParser(new EnglishDimensionParserConfiguration())]
        ])));
        this.registerModel("AgeModel", Culture.English, (options) => new AgeModel(new Map([
            [new NumberWithUnitExtractor(new EnglishAgeExtractorConfiguration()), new NumberWithUnitParser(new EnglishAgeParserConfiguration())]
        ])));
        // #endregion

        // #region Spanish
        this.registerModel("CurrencyModel", Culture.Spanish, (options) => new CurrencyModel(new Map([
            [new NumberWithUnitExtractor(new SpanishCurrencyExtractorConfiguration()), new NumberWithUnitParser(new SpanishCurrencyParserConfiguration())]
        ])));
        this.registerModel("TemperatureModel", Culture.Spanish, (options) => new TemperatureModel(new Map([
            [new NumberWithUnitExtractor(new SpanishTemperatureExtractorConfiguration()), new NumberWithUnitParser(new SpanishTemperatureParserConfiguration())]
        ])));
        this.registerModel("DimensionModel", Culture.Spanish, (options) => new DimensionModel(new Map([
            [new NumberWithUnitExtractor(new SpanishDimensionExtractorConfiguration()), new NumberWithUnitParser(new SpanishDimensionParserConfiguration())]
        ])));
        this.registerModel("AgeModel", Culture.Spanish, (options) => new AgeModel(new Map([
            [new NumberWithUnitExtractor(new SpanishAgeExtractorConfiguration()), new NumberWithUnitParser(new SpanishAgeParserConfiguration())]
        ])));
        // #endregion

        // #region Portuguese
        this.registerModel("CurrencyModel", Culture.Portuguese, (options) => new CurrencyModel(new Map([
            [new NumberWithUnitExtractor(new PortugueseCurrencyExtractorConfiguration()), new NumberWithUnitParser(new PortugueseCurrencyParserConfiguration())]
github microsoft / Recognizers-Text / JavaScript / packages / recognizers-number-with-unit / src / numberWithUnit / numberWithUnitRecognizer.ts View on Github external
this.registerModel("DimensionModel", Culture.English, (options) => new DimensionModel(new Map([
            [new NumberWithUnitExtractor(new EnglishDimensionExtractorConfiguration()), new NumberWithUnitParser(new EnglishDimensionParserConfiguration())]
        ])));
        this.registerModel("AgeModel", Culture.English, (options) => new AgeModel(new Map([
            [new NumberWithUnitExtractor(new EnglishAgeExtractorConfiguration()), new NumberWithUnitParser(new EnglishAgeParserConfiguration())]
        ])));
        // #endregion

        // #region Spanish
        this.registerModel("CurrencyModel", Culture.Spanish, (options) => new CurrencyModel(new Map([
            [new NumberWithUnitExtractor(new SpanishCurrencyExtractorConfiguration()), new NumberWithUnitParser(new SpanishCurrencyParserConfiguration())]
        ])));
        this.registerModel("TemperatureModel", Culture.Spanish, (options) => new TemperatureModel(new Map([
            [new NumberWithUnitExtractor(new SpanishTemperatureExtractorConfiguration()), new NumberWithUnitParser(new SpanishTemperatureParserConfiguration())]
        ])));
        this.registerModel("DimensionModel", Culture.Spanish, (options) => new DimensionModel(new Map([
            [new NumberWithUnitExtractor(new SpanishDimensionExtractorConfiguration()), new NumberWithUnitParser(new SpanishDimensionParserConfiguration())]
        ])));
        this.registerModel("AgeModel", Culture.Spanish, (options) => new AgeModel(new Map([
            [new NumberWithUnitExtractor(new SpanishAgeExtractorConfiguration()), new NumberWithUnitParser(new SpanishAgeParserConfiguration())]
        ])));
        // #endregion

        // #region Portuguese
        this.registerModel("CurrencyModel", Culture.Portuguese, (options) => new CurrencyModel(new Map([
            [new NumberWithUnitExtractor(new PortugueseCurrencyExtractorConfiguration()), new NumberWithUnitParser(new PortugueseCurrencyParserConfiguration())]
        ])));
        this.registerModel("TemperatureModel", Culture.Portuguese, (options) => new TemperatureModel(new Map([
            [new NumberWithUnitExtractor(new PortugueseTemperatureExtractorConfiguration()), new NumberWithUnitParser(new PortugueseTemperatureParserConfiguration())]
        ])));
        this.registerModel("DimensionModel", Culture.Portuguese, (options) => new DimensionModel(new Map([
            [new NumberWithUnitExtractor(new PortugueseDimensionExtractorConfiguration()), new NumberWithUnitParser(new PortugueseDimensionParserConfiguration())]
github microsoft / Recognizers-Text / JavaScript / packages / recognizers-number-with-unit / src / numberWithUnit / spanish / age.ts View on Github external
constructor(ci?: CultureInfo) {
        if (!ci) {
            ci = new CultureInfo(Culture.Spanish);
        }

        super(ci);

        this.BindDictionary(SpanishNumericWithUnit.AgeSuffixList);
    }
}
github microsoft / Recognizers-Text / JavaScript / packages / recognizers-number-with-unit / src / numberWithUnit / spanish / temperature.ts View on Github external
constructor(ci?: CultureInfo) {
        if (!ci) {
            ci = new CultureInfo(Culture.Spanish);
        }

        super(ci);

        this.extractType = Constants.SYS_UNIT_TEMPERATURE;

        this.suffixList = SpanishNumericWithUnit.TemperatureSuffixList;
        this.prefixList = new Map();
        this.ambiguousUnitList = new Array();

        this.ambiguousUnitNumberMultiplierRegex = RegExpUtility.getSafeRegExp(BaseUnits.AmbiguousUnitNumberMultiplierRegex, "gs");
    }
}
github microsoft / Recognizers-Text / JavaScript / packages / recognizers-number-with-unit / src / numberWithUnit / spanish / dimension.ts View on Github external
constructor(ci?: CultureInfo) {
        if (!ci) {
            ci = new CultureInfo(Culture.Spanish);
        }

        super(ci);

        this.extractType = Constants.SYS_UNIT_DIMENSION;

        this.suffixList = dimensionSuffixList;
        this.prefixList = new Map();
        this.ambiguousUnitList = SpanishNumericWithUnit.AmbiguousDimensionUnitList;
    }
}

@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