예제 #1
0
        public static IMorphoModel Create(MorphoModelConfig config)
        {
            config.ThrowIfNull("config");

            switch (config.TreeDictionaryType)
            {
            case MorphoModelConfig.TreeDictionaryTypeEnum.Classic:
            case MorphoModelConfig.TreeDictionaryTypeEnum.FastMemPlenty:
            {
                var model = new MorphoModel(config);

                //GC.Collect( GC.MaxGeneration, GCCollectionMode.Forced );

                return(model);
            }

            case MorphoModelConfig.TreeDictionaryTypeEnum.Native:
            {
                var model = new MorphoModelNative(config);

                //GC.Collect( GC.MaxGeneration, GCCollectionMode.Forced );

                return(model);
            }

            default:
                throw (new ArgumentException(config.TreeDictionaryType.ToString()));
            }
        }
예제 #2
0
 private static void CheckConfig(MorphoModelConfig config)
 {
     config.ThrowIfNull("config");
     config.MorphoTypesFilenames.ThrowIfNullOrWhiteSpaceAnyElement("config.MorphoTypesFilenames");
     config.ProperNamesFilenames.ThrowIfNullOrWhiteSpaceAnyElement("config.ProperNamesFilenames");
     config.CommonFilenames.ThrowIfNullOrWhiteSpaceAnyElement("config.CommonFilenames");
 }