Exemplo n.º 1
0
        public SettingFilter(SettingList settingList)
        {
            this.settingList      = settingList;
            this.settingMatcher   = new SettingMatcher(this.settingList);
            this.numberNormalizer = new NumberNormalizer();

            // Supporting setting files are stored as embeddded resources
            Assembly resourceAssembly = typeof(SettingFilter).Assembly;

            var amountNormalizerFile = resourceAssembly
                                       .GetManifestResourceNames()
                                       .Where(x => x.Contains("amount_percentage.tsv"))
                                       .First();

            var typeNormalizerFile = resourceAssembly
                                     .GetManifestResourceNames()
                                     .Where(x => x.Contains("amount_type.tsv"))
                                     .First();

            var unitNormalizerFile = resourceAssembly
                                     .GetManifestResourceNames()
                                     .Where(x => x.Contains("amount_unit.tsv"))
                                     .First();

            this.amountNormalizer = new EntityNormalizer(resourceAssembly, amountNormalizerFile);
            this.typeNormalizer   = new EntityNormalizer(resourceAssembly, typeNormalizerFile);
            this.unitNormalizer   = new EntityNormalizer(resourceAssembly, unitNormalizerFile);
        }
Exemplo n.º 2
0
 public SettingFilter(SettingList settingList)
 {
     this.settingList      = settingList;
     this.settingMatcher   = new SettingMatcher(this.settingList);
     this.numberNormalizer = new NumberNormalizer();
     this.amountNormalizer = new EntityNormalizer("Dialogs/VehicleSettings/Resources/normalization/amount_percentage.tsv");
     this.typeNormalizer   = new EntityNormalizer("Dialogs/VehicleSettings/Resources/normalization/amount_type.tsv");
     this.unitNormalizer   = new EntityNormalizer("Dialogs/VehicleSettings/Resources/normalization/amount_unit.tsv");
 }
Exemplo n.º 3
0
        public SettingFilter(SettingList settingList)
        {
            this.settingList      = settingList;
            this.settingMatcher   = new SettingMatcher(this.settingList);
            this.numberNormalizer = new NumberNormalizer();

            var resDir = Path.Combine(
                Path.GetDirectoryName(typeof(SettingFilter).Assembly.Location),
                "Dialogs\\VehicleSettings\\Resources\\normalization\\");

            this.amountNormalizer = new EntityNormalizer(resDir + "amount_percentage.tsv");
            this.typeNormalizer   = new EntityNormalizer(resDir + "amount_type.tsv");
            this.unitNormalizer   = new EntityNormalizer(resDir + "amount_unit.tsv");
        }