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.Japanese);
}
super(ci);
this.extractType = Constants.SYS_UNIT_CURRENCY;
// Reference Source: https:// en.wikipedia.org/wiki/List_of_circulating_currencies
this.suffixList = JapaneseNumericWithUnit.CurrencySuffixList;
this.prefixList = JapaneseNumericWithUnit.CurrencyPrefixList;
this.ambiguousUnitList = JapaneseNumericWithUnit.CurrencyAmbiguousValues;;
}
}
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("DimensionModel", Culture.Chinese, (options) => new DimensionModel(new Map([
[new NumberWithUnitExtractor(new ChineseDimensionExtractorConfiguration()), new NumberWithUnitParser(new ChineseDimensionParserConfiguration())],
[new NumberWithUnitExtractor(new EnglishDimensionExtractorConfiguration()), new NumberWithUnitParser(new EnglishDimensionParserConfiguration())]
])));
this.registerModel("AgeModel", Culture.Chinese, (options) => new AgeModel(new Map([
[new NumberWithUnitExtractor(new ChineseAgeExtractorConfiguration()), new NumberWithUnitParser(new ChineseAgeParserConfiguration())],
[new NumberWithUnitExtractor(new EnglishAgeExtractorConfiguration()), new NumberWithUnitParser(new EnglishAgeParserConfiguration())]
])));
// #endregion
// #region Japanese
this.registerModel("CurrencyModel", Culture.Japanese, (options) => new CurrencyModel(new Map([
[new BaseMergedUnitExtractor(new JapaneseCurrencyExtractorConfiguration()), new BaseMergedUnitParser(new JapaneseCurrencyParserConfiguration())],
[new NumberWithUnitExtractor(new EnglishCurrencyExtractorConfiguration()), new NumberWithUnitParser(new EnglishCurrencyParserConfiguration())]
])));
this.registerModel("AgeModel", Culture.Japanese, (options) => new AgeModel(new Map([
[new NumberWithUnitExtractor(new JapaneseAgeExtractorConfiguration()), new NumberWithUnitParser(new JapaneseAgeParserConfiguration())],
[new NumberWithUnitExtractor(new EnglishAgeExtractorConfiguration()), new NumberWithUnitParser(new EnglishAgeParserConfiguration())]
])));
// #endregion
// #region French
this.registerModel("CurrencyModel", Culture.French, (options) => new CurrencyModel(new Map([
[new NumberWithUnitExtractor(new FrenchCurrencyExtractorConfiguration()), new NumberWithUnitParser(new FrenchCurrencyParserConfiguration())]
])));
this.registerModel("TemperatureModel", Culture.French, (options) => new TemperatureModel(new Map([
[new NumberWithUnitExtractor(new FrenchTemperatureExtractorConfiguration()), new NumberWithUnitParser(new FrenchTemperatureParserConfiguration())]
])));
this.registerModel("DimensionModel", Culture.Chinese, (options) => new DimensionModel(new Map([
[new NumberWithUnitExtractor(new ChineseDimensionExtractorConfiguration()), new NumberWithUnitParser(new ChineseDimensionParserConfiguration())],
[new NumberWithUnitExtractor(new EnglishDimensionExtractorConfiguration()), new NumberWithUnitParser(new EnglishDimensionParserConfiguration())]
])));
this.registerModel("AgeModel", Culture.Chinese, (options) => new AgeModel(new Map([
[new NumberWithUnitExtractor(new ChineseAgeExtractorConfiguration()), new NumberWithUnitParser(new ChineseAgeParserConfiguration())],
[new NumberWithUnitExtractor(new EnglishAgeExtractorConfiguration()), new NumberWithUnitParser(new EnglishAgeParserConfiguration())]
])));
// #endregion
// #region Japanese
this.registerModel("CurrencyModel", Culture.Japanese, (options) => new CurrencyModel(new Map([
[new BaseMergedUnitExtractor(new JapaneseCurrencyExtractorConfiguration()), new BaseMergedUnitParser(new JapaneseCurrencyParserConfiguration())],
[new NumberWithUnitExtractor(new EnglishCurrencyExtractorConfiguration()), new NumberWithUnitParser(new EnglishCurrencyParserConfiguration())]
])));
this.registerModel("AgeModel", Culture.Japanese, (options) => new AgeModel(new Map([
[new NumberWithUnitExtractor(new JapaneseAgeExtractorConfiguration()), new NumberWithUnitParser(new JapaneseAgeParserConfiguration())],
[new NumberWithUnitExtractor(new EnglishAgeExtractorConfiguration()), new NumberWithUnitParser(new EnglishAgeParserConfiguration())]
])));
// #endregion
// #region French
this.registerModel("CurrencyModel", Culture.French, (options) => new CurrencyModel(new Map([
[new NumberWithUnitExtractor(new FrenchCurrencyExtractorConfiguration()), new NumberWithUnitParser(new FrenchCurrencyParserConfiguration())]
])));
this.registerModel("TemperatureModel", Culture.French, (options) => new TemperatureModel(new Map([
[new NumberWithUnitExtractor(new FrenchTemperatureExtractorConfiguration()), new NumberWithUnitParser(new FrenchTemperatureParserConfiguration())]
])));
this.registerModel("DimensionModel", Culture.French, (options) => new DimensionModel(new Map([
[new NumberWithUnitExtractor(new FrenchDimensionExtractorConfiguration()), new NumberWithUnitParser(new FrenchDimensionParserConfiguration())]
])));
this.registerModel("AgeModel", Culture.French, (options) => new AgeModel(new Map([
constructor(ci?: CultureInfo) {
if (!ci) {
ci = new CultureInfo(Culture.Japanese);
}
super(ci);
this.BindDictionary(JapaneseNumericWithUnit.AgeSuffixList);
}
}