Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(ci?: CultureInfo) {
if (!ci) {
ci = new CultureInfo(Culture.Portuguese);
}
super(ci);
this.extractType = Constants.SYS_UNIT_CURRENCY;
// Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies
this.suffixList = PortugueseNumericWithUnit.CurrencySuffixList;
this.prefixList = PortugueseNumericWithUnit.CurrencyPrefixList;
this.ambiguousUnitList = PortugueseNumericWithUnit.AmbiguousCurrencyUnitList;
}
}
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())]
])));
this.registerModel("AgeModel", Culture.Portuguese, (options) => new AgeModel(new Map([
[new NumberWithUnitExtractor(new PortugueseAgeExtractorConfiguration()), new NumberWithUnitParser(new PortugueseAgeParserConfiguration())]
])));
// #endregion
// #region Chinese
this.registerModel("CurrencyModel", Culture.Chinese, (options) => new CurrencyModel(new Map([
[new BaseMergedUnitExtractor(new ChineseCurrencyExtractorConfiguration()), new BaseMergedUnitParser(new ChineseCurrencyParserConfiguration())],
[new NumberWithUnitExtractor(new EnglishCurrencyExtractorConfiguration()), new NumberWithUnitParser(new EnglishCurrencyParserConfiguration())]
])));
this.registerModel("TemperatureModel", Culture.Chinese, (options) => new TemperatureModel(new Map([
[new NumberWithUnitExtractor(new ChineseTemperatureExtractorConfiguration()), new NumberWithUnitParser(new ChineseTemperatureParserConfiguration())],
[new NumberWithUnitExtractor(new EnglishTemperatureExtractorConfiguration()), new NumberWithUnitParser(new EnglishTemperatureParserConfiguration())]
])));
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())]
])));
this.registerModel("AgeModel", Culture.Portuguese, (options) => new AgeModel(new Map([
[new NumberWithUnitExtractor(new PortugueseAgeExtractorConfiguration()), new NumberWithUnitParser(new PortugueseAgeParserConfiguration())]
])));
// #endregion
// #region Chinese
this.registerModel("CurrencyModel", Culture.Chinese, (options) => new CurrencyModel(new Map([
[new BaseMergedUnitExtractor(new ChineseCurrencyExtractorConfiguration()), new BaseMergedUnitParser(new ChineseCurrencyParserConfiguration())],
constructor(ci?: CultureInfo) {
if (!ci) {
ci = new CultureInfo(Culture.Portuguese);
}
super(ci);
this.extractType = Constants.SYS_UNIT_DIMENSION;
this.suffixList = dimensionSuffixList;
this.prefixList = new Map();
this.ambiguousUnitList = PortugueseNumericWithUnit.AmbiguousDimensionUnitList;
}
}
constructor(ci?: CultureInfo) {
if (!ci) {
ci = new CultureInfo(Culture.Portuguese);
}
super(ci);
this.BindDictionary(PortugueseNumericWithUnit.TemperatureSuffixList);
}
}
constructor(ci?: CultureInfo) {
if (!ci) {
ci = new CultureInfo(Culture.Portuguese);
}
super(ci);
this.extractType = Constants.SYS_UNIT_AGE;
this.suffixList = PortugueseNumericWithUnit.AgeSuffixList;
this.prefixList = new Map();
this.ambiguousUnitList = PortugueseNumericWithUnit.AmbiguousAgeUnitList;
}
}