Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
protected InitializeConfiguration() {
// #region English
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())]
protected InitializeConfiguration() {
// #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)
constructor(ci?: CultureInfo) {
if (!ci) {
ci = new CultureInfo(Culture.English);
}
super(ci);
this.extractType = Constants.SYS_UNIT_CURRENCY;
// Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies
this.suffixList = EnglishNumericWithUnit.CurrencySuffixList;
this.prefixList = EnglishNumericWithUnit.CurrencyPrefixList;
this.ambiguousUnitList = EnglishNumericWithUnit.AmbiguousCurrencyUnitList;
}
}
protected InitializeConfiguration() {
// #region English
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())]
constructor(ci?: CultureInfo) {
if (!ci) {
ci = new CultureInfo(Culture.English);
}
super(ci);
this.extractType = Constants.SYS_UNIT_DIMENSION;
this.suffixList = dimensionSuffixList;
this.prefixList = new Map();
this.ambiguousUnitList = EnglishNumericWithUnit.AmbiguousDimensionUnitList;
}
}
constructor(ci?: CultureInfo) {
if (!ci) {
ci = new CultureInfo(Culture.English);
}
super(ci);
this.extractType = Constants.SYS_UNIT_AGE;
this.suffixList = EnglishNumericWithUnit.AgeSuffixList;
this.prefixList = new Map();
this.ambiguousUnitList = new Array();
}
}
constructor(ci?: CultureInfo) {
if (!ci) {
ci = new CultureInfo(Culture.English);
}
super(ci);
this.BindDictionary(EnglishNumericWithUnit.TemperatureSuffixList);
}
}