예제 #1
0
        /// <summary>
        /// Генерирование моделей
        /// </summary>
        void GenerateModels()
        {
            ProbabilityDictionary[] pD = new ProbabilityDictionary[_paths.Length];
            tmds = new TextModelData[pD.Length];

            for (int i = 0; i < _paths.Length; i++)
            {
                tmds[i]     = new TextModelData();
                tmds[i].pds = (new ProbabilityDictionary(File.ReadAllText(_paths[i]))).pDictionary;
            }
        }
예제 #2
0
        //Загрузка
        public static TextModel Load(string path)
        {
            string[] paths = Directory.GetFiles(path, "*.model");


            TextModelData[] tmds2 = new TextModelData[paths.Length];

            for (int i = 0; i < paths.Length; i++)
            {
                tmds2[i] = new TextModelData();
                tmds2[i].LoadData(paths[i]);
            }

            return(new TextModel(tmds2, paths));
        }