public PercentageExtractor(NumberOptions options = NumberOptions.None) : base( NumberExtractor.GetInstance(options: options)) { Options = options; Regexes = InitRegexes(); }
internal static TypeName NumberType(NumberOptions options) { var name = ""; if (options.Unlimited) { name = "BigInt"; } else if (options.Imaginary) { name = "Complex"; } else { if (options.Unsigned) { name += "U"; } name += options.Floating ? "Float" : "Int"; name += options.Bits; } return(new SimpleTypeName(name)); }
} = Constants.SYS_NUM; // "Number"; public NumberExtractor(NumberMode mode = NumberMode.Default, NumberOptions options = NumberOptions.None) { var builder = ImmutableDictionary.CreateBuilder <Regex, string>(); //Add Cardinal CardinalExtractor cardExtract = null; switch (mode) { case NumberMode.PureNumber: cardExtract = CardinalExtractor.GetInstance(NumbersDefinitions.PlaceHolderPureNumber); break; case NumberMode.Currency: builder.Add(new Regex(NumbersDefinitions.CurrencyRegex, RegexOptions.Singleline), "IntegerNum"); break; case NumberMode.Default: break; } if (cardExtract == null) { cardExtract = CardinalExtractor.GetInstance(); } builder.AddRange(cardExtract.Regexes); //Add Fraction var fracExtract = new FractionExtractor(); builder.AddRange(fracExtract.Regexes); this.Regexes = builder.ToImmutable(); }
} = Constants.SYS_NUM; // "Number"; public NumberExtractor(NumberMode mode = NumberMode.Default, NumberOptions options = NumberOptions.None) { var builder = ImmutableDictionary.CreateBuilder <Regex, TypeTag>(); //Add Cardinal CardinalExtractor cardExtract = null; switch (mode) { case NumberMode.PureNumber: cardExtract = CardinalExtractor.GetInstance(NumbersDefinitions.PlaceHolderPureNumber); break; case NumberMode.Currency: builder.Add(new Regex(NumbersDefinitions.CurrencyRegex, RegexOptions.Singleline), RegexTagGenerator.GenerateRegexTag(Constants.FRACTION_PREFIX, Constants.NUMBER_SUFFIX)); break; case NumberMode.Default: break; } if (cardExtract == null) { cardExtract = CardinalExtractor.GetInstance(); } builder.AddRange(cardExtract.Regexes); //Add Fraction var fracExtract = new FractionExtractor(); builder.AddRange(fracExtract.Regexes); this.Regexes = builder.ToImmutable(); }
private OrdinalExtractor(NumberOptions options) : base(options) { RelativeReferenceRegex = RegexCache.Get(NumbersDefinitions.RelativeOrdinalRegex, RegexFlags); var regexes = new Dictionary <Regex, TypeTag> { { RegexCache.Get(NumbersDefinitions.OrdinalSuffixRegex, RegexFlags), RegexTagGenerator.GenerateRegexTag(Constants.ORDINAL_PREFIX, Constants.NUMBER_SUFFIX) }, { RegexCache.Get(NumbersDefinitions.OrdinalNumericRegex, RegexFlags), RegexTagGenerator.GenerateRegexTag(Constants.ORDINAL_PREFIX, Constants.NUMBER_SUFFIX) }, { RegexCache.Get(NumbersDefinitions.OrdinalTurkishRegex, RegexFlags), RegexTagGenerator.GenerateRegexTag(Constants.ORDINAL_PREFIX, Constants.TURKISH) }, { RegexCache.Get(NumbersDefinitions.RoundNumberOrdinalRegex, RegexFlags), RegexTagGenerator.GenerateRegexTag(Constants.ORDINAL_PREFIX, Constants.TURKISH) }, }; Regexes = regexes.ToImmutableDictionary(); }
public BaseNumberRangeExtractor(BaseNumberExtractor numberExtractor, BaseNumberExtractor ordinalExtractor, BaseNumberParser numberParser, NumberOptions options = NumberOptions.None) { this.numberExtractor = numberExtractor; this.ordinalExtractor = ordinalExtractor; this.numberParser = numberParser; Options = options; }
private OrdinalExtractor(NumberOptions options) : base(options) { AmbiguousFractionConnectorsRegex = new Regex(NumbersDefinitions.AmbiguousFractionConnectorsRegex, RegexFlags); RelativeReferenceRegex = new Regex(NumbersDefinitions.RelativeOrdinalRegex, RegexFlags); var regexes = new Dictionary <Regex, TypeTag> { { new Regex(NumbersDefinitions.OrdinalSuffixRegex, RegexFlags), RegexTagGenerator.GenerateRegexTag(Constants.ORDINAL_PREFIX, Constants.NUMBER_SUFFIX) }, { new Regex(NumbersDefinitions.OrdinalNumericRegex, RegexFlags), RegexTagGenerator.GenerateRegexTag(Constants.ORDINAL_PREFIX, Constants.NUMBER_SUFFIX) }, { new Regex(NumbersDefinitions.OrdinalEnglishRegex, RegexFlags), RegexTagGenerator.GenerateRegexTag(Constants.ORDINAL_PREFIX, Constants.ENGLISH) }, { new Regex(NumbersDefinitions.OrdinalRoundNumberRegex, RegexFlags), RegexTagGenerator.GenerateRegexTag(Constants.ORDINAL_PREFIX, Constants.ENGLISH) }, }; Regexes = regexes.ToImmutableDictionary(); }
public BaseNumberOptionsConfiguration(string culture, NumberOptions options = NumberOptions.None, NumberMode mode = NumberMode.Default, string placeholder = BaseNumbers.PlaceHolderDefault) { Culture = culture; Options = options; Mode = mode; Placeholder = placeholder; }
private void AddItem(GenericMenu menu, string name, NumberOptions type) { if (menu != null) { menu.AddItem(new GUIContent() { text = name }, selected.Equals(type), OnMenuSelected, type); } }
public NumberAttribute(string number) : base(1, 1) { if (number == "0") this.number = NumberOptions.Zero; else if (number == "1") this.number = NumberOptions.One; else if (number == "2") this.number = NumberOptions.Many; else throw new ArgumentException("No known number " + number); }
public static OrdinalExtractor GetInstance(NumberOptions options = NumberOptions.None) { var cacheKey = options.ToString(); if (!Instances.ContainsKey(cacheKey)) { var instance = new OrdinalExtractor(options); Instances.TryAdd(cacheKey, instance); } return(Instances[cacheKey]); }
private void CreateNumberField(NumberOptions selected) { try { switch (selected) { case NumberOptions.CONSTANT: NumberGenerator.Number = EditorGUILayout.FloatField("", NumberGenerator.Number, GUILayout.ExpandWidth(true)); EditorUtility.SetDirty(target); break; case NumberOptions.CONSTANT_BETWEEN_TWO_NUMBER: NumberGenerator.Number = GetRandomNumber(); EditorUtility.SetDirty(target); break; } }catch (Exception e) { Debug.LogWarning(e); } }
private OrdinalExtractor(NumberOptions options) : base(options) { AmbiguousFractionConnectorsRegex = RegexCache.Get(NumbersDefinitions.AmbiguousFractionConnectorsRegex, RegexFlags); RelativeReferenceRegex = RegexCache.Get(NumbersDefinitions.RelativeOrdinalRegex, RegexFlags); var regexes = new Dictionary <Regex, TypeTag> { { RegexCache.Get(NumbersDefinitions.RelativeOrdinalRegex, RegexFlags), RegexTagGenerator.GenerateRegexTag(Constants.ORDINAL_PREFIX, Constants.HINDI) }, { RegexCache.Get(NumbersDefinitions.HinglishOrdinalRegex, RegexFlags), RegexTagGenerator.GenerateRegexTag(Constants.ORDINAL_PREFIX, Constants.HINDI) }, { RegexCache.Get(NumbersDefinitions.CompoundHindiOrdinalRegex, RegexFlags), RegexTagGenerator.GenerateRegexTag(Constants.ORDINAL_PREFIX, Constants.HINDI) }, { RegexCache.Get(NumbersDefinitions.CompoundNumberOrdinals, RegexFlags), RegexTagGenerator.GenerateRegexTag(Constants.ORDINAL_PREFIX, Constants.HINDI) }, { RegexCache.Get(NumbersDefinitions.CompoundEnglishOrdinalRegex, RegexFlags), RegexTagGenerator.GenerateRegexTag(Constants.ORDINAL_PREFIX, Constants.HINDI) }, { RegexCache.Get(NumbersDefinitions.OrdinalSuffixRegex, RegexFlags), RegexTagGenerator.GenerateRegexTag(Constants.ORDINAL_PREFIX, Constants.NUMBER_SUFFIX) }, }; Regexes = regexes.ToImmutableDictionary(); }
protected CachedNumberExtractor(NumberOptions options = NumberOptions.None) : base(options) { }
public NumberRangeExtractor(NumberOptions options = NumberOptions.None) : base( NumberExtractor.GetInstance(), OrdinalExtractor.GetInstance(), new BaseNumberParser(new EnglishNumberParserConfiguration()), options) { var regexes = new Dictionary <Regex, string>() { { // between...and... new Regex(NumbersDefinitions.TwoNumberRangeRegex1, RegexFlags), NumberRangeConstants.TWONUMBETWEEN }, { // more than ... less than ... new Regex(NumbersDefinitions.TwoNumberRangeRegex2, RegexFlags), NumberRangeConstants.TWONUM }, { // less than ... more than ... new Regex(NumbersDefinitions.TwoNumberRangeRegex3, RegexFlags), NumberRangeConstants.TWONUM }, { // from ... to/~/- ... new Regex(NumbersDefinitions.TwoNumberRangeRegex4, RegexFlags), NumberRangeConstants.TWONUMTILL }, { // more/greater/higher than ... new Regex(NumbersDefinitions.OneNumberRangeMoreRegex1, RegexFlags), NumberRangeConstants.MORE }, { // 30 and/or greater/higher new Regex(NumbersDefinitions.OneNumberRangeMoreRegex2, RegexFlags), NumberRangeConstants.MORE }, { // less/smaller/lower than ... new Regex(NumbersDefinitions.OneNumberRangeLessRegex1, RegexFlags), NumberRangeConstants.LESS }, { // 30 and/or less/smaller/lower new Regex(NumbersDefinitions.OneNumberRangeLessRegex2, RegexFlags), NumberRangeConstants.LESS }, { // equal to ... new Regex(NumbersDefinitions.OneNumberRangeEqualRegex, RegexFlags), NumberRangeConstants.EQUAL }, { // equal to 30 or more than, larger than 30 or equal to ... new Regex(NumbersDefinitions.OneNumberRangeMoreSeparateRegex, RegexFlags), NumberRangeConstants.MORE }, { // equal to 30 or less, smaller than 30 or equal ... new Regex(NumbersDefinitions.OneNumberRangeLessSeparateRegex, RegexFlags), NumberRangeConstants.LESS }, }; Regexes = regexes.ToImmutableDictionary(); AmbiguousFractionConnectorsRegex = new Regex(NumbersDefinitions.AmbiguousFractionConnectorsRegex, RegexFlags); }
public NumberLiteralEx(string name, NumberOptions options, Type astNodeType) : base(name, options, astNodeType) { }
public NumberLiteralEx(string name, NumberOptions options) : base(name, options) { }
protected BaseNumberExtractor(NumberOptions options = NumberOptions.None) { Options = options; }
public NumberLiteral(string name, NumberOptions options) : base(name) { Options = options; base.SetFlag(TermFlags.IsLiteral); }
private NumberRecognizer(NumberOptions options) { RegisterModel(Culture.English, options.ToString(), new Dictionary <Type, IModel> { [typeof(NumberModel)] = new NumberModel( AgnosticNumberParserFactory.GetParser(AgnosticNumberParserType.Number, new EnglishNumberParserConfiguration()), English.NumberExtractor.GetInstance(NumberMode.PureNumber)), [typeof(OrdinalModel)] = new OrdinalModel( AgnosticNumberParserFactory.GetParser(AgnosticNumberParserType.Ordinal, new EnglishNumberParserConfiguration()), English.OrdinalExtractor.GetInstance()), [typeof(PercentModel)] = new PercentModel( AgnosticNumberParserFactory.GetParser(AgnosticNumberParserType.Percentage, new EnglishNumberParserConfiguration()), new English.PercentageExtractor()) }); RegisterModel(Culture.Chinese, options.ToString(), new Dictionary <Type, IModel> { [typeof(NumberModel)] = new NumberModel( AgnosticNumberParserFactory.GetParser(AgnosticNumberParserType.Number, new ChineseNumberParserConfiguration()), new Chinese.NumberExtractor()), [typeof(OrdinalModel)] = new OrdinalModel( AgnosticNumberParserFactory.GetParser(AgnosticNumberParserType.Ordinal, new ChineseNumberParserConfiguration()), new Chinese.OrdinalExtractor()), [typeof(PercentModel)] = new PercentModel( AgnosticNumberParserFactory.GetParser(AgnosticNumberParserType.Percentage, new ChineseNumberParserConfiguration()), new Chinese.PercentageExtractor()) }); RegisterModel(Culture.Spanish, options.ToString(), new Dictionary <Type, IModel> { [typeof(NumberModel)] = new NumberModel( AgnosticNumberParserFactory.GetParser(AgnosticNumberParserType.Number, new SpanishNumberParserConfiguration()), new Spanish.NumberExtractor(NumberMode.PureNumber)), [typeof(OrdinalModel)] = new OrdinalModel( AgnosticNumberParserFactory.GetParser(AgnosticNumberParserType.Ordinal, new SpanishNumberParserConfiguration()), new Spanish.OrdinalExtractor()), [typeof(PercentModel)] = new PercentModel( AgnosticNumberParserFactory.GetParser(AgnosticNumberParserType.Percentage, new SpanishNumberParserConfiguration()), new Spanish.PercentageExtractor()) }); RegisterModel(Culture.Portuguese, options.ToString(), new Dictionary <Type, IModel> { [typeof(NumberModel)] = new NumberModel( AgnosticNumberParserFactory.GetParser(AgnosticNumberParserType.Number, new PortugueseNumberParserConfiguration()), new Portuguese.NumberExtractor(NumberMode.PureNumber)), [typeof(OrdinalModel)] = new OrdinalModel( AgnosticNumberParserFactory.GetParser(AgnosticNumberParserType.Ordinal, new PortugueseNumberParserConfiguration()), new Portuguese.OrdinalExtractor()), [typeof(PercentModel)] = new PercentModel( AgnosticNumberParserFactory.GetParser(AgnosticNumberParserType.Percentage, new PortugueseNumberParserConfiguration()), new Portuguese.PercentageExtractor()) }); RegisterModel(Culture.French, options.ToString(), new Dictionary <Type, IModel> { [typeof(NumberModel)] = new NumberModel( AgnosticNumberParserFactory.GetParser(AgnosticNumberParserType.Number, new FrenchNumberParserConfiguration()), new French.NumberExtractor(NumberMode.PureNumber)), [typeof(OrdinalModel)] = new OrdinalModel( AgnosticNumberParserFactory.GetParser(AgnosticNumberParserType.Ordinal, new FrenchNumberParserConfiguration()), new French.OrdinalExtractor()), [typeof(PercentModel)] = new PercentModel( AgnosticNumberParserFactory.GetParser(AgnosticNumberParserType.Percentage, new FrenchNumberParserConfiguration()), new French.PercentageExtractor()) }); RegisterModel(Culture.German, options.ToString(), new Dictionary <Type, IModel> { [typeof(NumberModel)] = new NumberModel( AgnosticNumberParserFactory.GetParser(AgnosticNumberParserType.Number, new GermanNumberParserConfiguration()), German.NumberExtractor.GetInstance(NumberMode.PureNumber)), [typeof(OrdinalModel)] = new OrdinalModel( AgnosticNumberParserFactory.GetParser(AgnosticNumberParserType.Ordinal, new GermanNumberParserConfiguration()), German.OrdinalExtractor.GetInstance()), [typeof(PercentModel)] = new PercentModel( AgnosticNumberParserFactory.GetParser(AgnosticNumberParserType.Percentage, new GermanNumberParserConfiguration()), new German.PercentageExtractor()) }); }
public NumberAttribute(NumberOptions number) : base(1, 1) { this.number = number; }
public NumberLiteral(string name, NumberOptions options, Type astNodeType) : this(name, options) { base.AstConfig.NodeType = astNodeType; }
public static BnfiTermConversionTL CreateNumberLiteral(NumberOptions options) { return new NumberLiteral(name: "numberliteral", options: options).IntroNumberLiteral(); }
void IFastSerializable.Deserialize(SerializationReader reader) { base.Deserialize(reader); number = (NumberOptions) reader.ReadObject(); }
public static BnfiTermConversionTL CreateNumberLiteral(string name, NumberOptions options) { return new NumberLiteral(name: name, options: options).IntroNumberLiteral(); }
public BaseNumberExtractor(NumberOptions options = NumberOptions.None) { Options = options; }
public DutchNumberParserConfiguration(NumberOptions options) : this() { this.Options = options; }
public bool IsSet(NumberOptions option) { return((Options & option) != 0); }
public ItalianNumberParserConfiguration(NumberOptions options) : this() { this.Options = options; }
public NumberLiteral(string name, NumberOptions options, AstNodeCreator astNodeCreator) : this(name, options) { base.AstConfig.NodeCreator = astNodeCreator; }
public void AddPrefix(string prefix, NumberOptions options) { PrefixFlags.Add(prefix, (short)options); Prefixes.Add(prefix); }
public NumberLiteralEx(string name, NumberOptions options, AstNodeCreator astNodeCreator) : base(name, options, astNodeCreator) { }
public NumberRangeExtractor(NumberOptions options = NumberOptions.None) : base(new NumberExtractor(), new OrdinalExtractor(), new BaseCJKNumberParser(new ChineseNumberParserConfiguration()), options: options) { var regexes = new Dictionary <Regex, string>() { { // 在...和...之间 new Regex(NumbersDefinitions.TwoNumberRangeRegex1, RegexOptions.Singleline), NumberRangeConstants.TWONUMBETWEEN }, { // 大于...小于... new Regex(NumbersDefinitions.TwoNumberRangeRegex2, RegexOptions.Singleline), NumberRangeConstants.TWONUM }, { // 小于...大于... new Regex(NumbersDefinitions.TwoNumberRangeRegex3, RegexOptions.Singleline), NumberRangeConstants.TWONUM }, { // ...到/至..., 20~30 new Regex(NumbersDefinitions.TwoNumberRangeRegex4, RegexOptions.Singleline), NumberRangeConstants.TWONUMTILL }, { // 大于/多于/高于... new Regex(NumbersDefinitions.OneNumberRangeMoreRegex1, RegexOptions.Singleline), NumberRangeConstants.MORE }, { // 比...大/高/多 new Regex(NumbersDefinitions.OneNumberRangeMoreRegex2, RegexOptions.Singleline), NumberRangeConstants.MORE }, { // ...多/以上/之上 new Regex(NumbersDefinitions.OneNumberRangeMoreRegex3, RegexOptions.Singleline), NumberRangeConstants.MORE }, { // 小于/少于/低于... new Regex(NumbersDefinitions.OneNumberRangeLessRegex1, RegexOptions.Singleline), NumberRangeConstants.LESS }, { // 比...小/低/少 new Regex(NumbersDefinitions.OneNumberRangeLessRegex2, RegexOptions.Singleline), NumberRangeConstants.LESS }, { // .../以下/之下 new Regex(NumbersDefinitions.OneNumberRangeLessRegex3, RegexOptions.Singleline), NumberRangeConstants.LESS }, { // 等于... new Regex(NumbersDefinitions.OneNumberRangeEqualRegex, RegexOptions.Singleline), NumberRangeConstants.EQUAL }, }; Regexes = regexes.ToImmutableDictionary(); AmbiguousFractionConnectorsRegex = new Regex(NumbersDefinitions.AmbiguousFractionConnectorsRegex, RegexOptions.Singleline); }
public NumberRangeExtractor(NumberOptions options = NumberOptions.None) : base(NumberExtractor.GetInstance(), OrdinalExtractor.GetInstance(), new BaseNumberParser(new SpanishNumberParserConfiguration()), options) { var regexes = new Dictionary <Regex, string>() { { // entre ...y ... new Regex(NumbersDefinitions.TwoNumberRangeRegex1, RegexOptions.Singleline), NumberRangeConstants.TWONUMBETWEEN }, { // más que ... monos que ... new Regex(NumbersDefinitions.TwoNumberRangeRegex2, RegexOptions.Singleline), NumberRangeConstants.TWONUM }, { // monos que ... más que ... new Regex(NumbersDefinitions.TwoNumberRangeRegex3, RegexOptions.Singleline), NumberRangeConstants.TWONUM }, { // de ... a ... new Regex(NumbersDefinitions.TwoNumberRangeRegex4, RegexOptions.Singleline), NumberRangeConstants.TWONUMTILL }, { // más/mayor que ... new Regex(NumbersDefinitions.OneNumberRangeMoreRegex1, RegexOptions.Singleline), NumberRangeConstants.MORE }, { // 30 and/or greater/higher new Regex(NumbersDefinitions.OneNumberRangeMoreRegex2, RegexOptions.Singleline), NumberRangeConstants.MORE }, { // less/smaller/lower than ... new Regex(NumbersDefinitions.OneNumberRangeLessRegex1, RegexOptions.Singleline), NumberRangeConstants.LESS }, { // 30 y/o mas/más/mayor/mayores new Regex(NumbersDefinitions.OneNumberRangeLessRegex2, RegexOptions.Singleline), NumberRangeConstants.LESS }, { // igual a ... new Regex(NumbersDefinitions.OneNumberRangeEqualRegex, RegexOptions.Singleline), NumberRangeConstants.EQUAL }, { // igual a 30 o más, más que 30 o igual ... new Regex(NumbersDefinitions.OneNumberRangeMoreSeparateRegex, RegexOptions.Singleline), NumberRangeConstants.MORE }, { // igual a 30 o menos, menos que 30 o igual ... new Regex(NumbersDefinitions.OneNumberRangeLessSeparateRegex, RegexOptions.Singleline), NumberRangeConstants.LESS }, }; Regexes = regexes.ToImmutableDictionary(); AmbiguousFractionConnectorsRegex = new Regex(NumbersDefinitions.AmbiguousFractionConnectorsRegex, RegexOptions.Singleline); }
public NumberRangeExtractor(NumberOptions options = NumberOptions.None) : base(new NumberExtractor(), new OrdinalExtractor(), new BaseCJKNumberParser(new JapaneseNumberParserConfiguration()), options: options) { var regexes = new Dictionary <Regex, string> { { // ...と...の間 new Regex(NumbersDefinitions.TwoNumberRangeRegex1, RegexOptions.IgnoreCase | RegexOptions.Singleline), NumberRangeConstants.TWONUMBETWEEN }, { // より大きい...より小さい... new Regex(NumbersDefinitions.TwoNumberRangeRegex2, RegexOptions.IgnoreCase | RegexOptions.Singleline), NumberRangeConstants.TWONUM }, { // より小さい...より大きい... new Regex(NumbersDefinitions.TwoNumberRangeRegex3, RegexOptions.IgnoreCase | RegexOptions.Singleline), NumberRangeConstants.TWONUM }, { // ...と/から..., 20~30 new Regex(NumbersDefinitions.TwoNumberRangeRegex4, RegexOptions.IgnoreCase | RegexOptions.Singleline), NumberRangeConstants.TWONUMTILL }, { // 大なり|大きい|高い|大きく... new Regex(NumbersDefinitions.OneNumberRangeMoreRegex1, RegexOptions.IgnoreCase | RegexOptions.Singleline), NumberRangeConstants.MORE }, { // ...より大なり|大きい|高い|大きく new Regex(NumbersDefinitions.OneNumberRangeMoreRegex2, RegexOptions.IgnoreCase | RegexOptions.Singleline), NumberRangeConstants.MORE }, { // ...以上 new Regex(NumbersDefinitions.OneNumberRangeMoreRegex3, RegexOptions.IgnoreCase | RegexOptions.Singleline), NumberRangeConstants.MORE }, { // 小なり|小さい|低い... new Regex(NumbersDefinitions.OneNumberRangeLessRegex1, RegexOptions.IgnoreCase | RegexOptions.Singleline), NumberRangeConstants.LESS }, { // ...より小なり|小さい|低い new Regex(NumbersDefinitions.OneNumberRangeLessRegex2, RegexOptions.IgnoreCase | RegexOptions.Singleline), NumberRangeConstants.LESS }, { // ...以下 new Regex(NumbersDefinitions.OneNumberRangeLessRegex3, RegexOptions.IgnoreCase | RegexOptions.Singleline), NumberRangeConstants.LESS }, { // イコール... | ...等しい| new Regex(NumbersDefinitions.OneNumberRangeEqualRegex, RegexOptions.IgnoreCase | RegexOptions.Singleline), NumberRangeConstants.EQUAL } }; Regexes = regexes.ToImmutableDictionary(); AmbiguousFractionConnectorsRegex = new Regex(NumbersDefinitions.AmbiguousFractionConnectorsRegex, RegexOptions.IgnoreCase | RegexOptions.Singleline); }