Пример #1
0
        private void PrepareAndApplyZipfLaw(ZipfProcess _zp, string selectedFileContent)
        {
            #region sıklık araştırmasına hazırlık
            selectedFileContent = Regex.Replace(selectedFileContent, @"\t|\n|\r", " ");
            selectedFileContent = new string((from c in selectedFileContent where char.IsWhiteSpace(c) || char.IsLetterOrDigit(c) select c).ToArray());
            string[] outputContent = selectedFileContent.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
            #endregion
            _zp.WordCount = outputContent.Length;
            #region Zipf kanunun kontrol edilmesi

            if (_zp.FilePath.Contains("Book") == false)
            {
                _zp.FindWordsForFile(outputContent);
                _zp.FindStempForWords();
                _zp.InitWordsOfFile();
                _zp.CalculateWfrequency();
            }
            else
            {
                //burayı kodlayacağım

                _zp.FindWordsForFileEn(outputContent);
                _zp.InitWordsOfFileen();
                _zp.CalculateWfrequency();
            }

            // _zp.ReOrderWordListByConstant();
            #endregion
        }