コード例 #1
0
ファイル: Stylo.cs プロジェクト: lindsoe/AuthorIdentification
        public static List <TextSummary> SummarizeBooks(List <TextInfo> books, int decimals = 3)
        {
            var res = new List <TextSummary>();

            foreach (var book in books)
            {
                var preProcessedText =
                    Stylo.PreProcessText(Path.Combine(@"..\..\Tekster\", book.Filename), Encoding.UTF8, true);
                var s = new Stylo.TextSummary(book, preProcessedText, decimals);
                res.Add(s);
            }
            return(res);
        }
コード例 #2
0
        public ImportDataModel(TextInfo info, string text, int numberOfDecimals = 2)
        {
            if (text.Length > 0)
            {
                var content = new Stylo.TextSummary(info, text);
                Guiraud          = content.Guiraud;
                MedianWordLength = content.Words.Median;
                HapaxLegomena    = content.HapaxLegomena;

                TotalWords     = content.WordsCount;
                StopWords      = content.StopWordsCount;
                LongWords      = content.LongWordsCount;
                DifferentWords = content.DifferentWordsCount;
                SmogIndex      = content.Smog;
                Text           = text;
            }
        }
コード例 #3
0
ファイル: Stylo.cs プロジェクト: lindsoe/AuthorIdentification
        public static List <TextSummary> SummarizeSentenceClusters(TextInfo info, int ClusterSize, int decimals = 3)
        {
            var summary = new List <TextSummary>();

            var preProcessedText =
                Stylo.PreProcessText(Path.Combine(@"..\..\Tekster\", info.Filename), Encoding.UTF8, true);
            var clusters = Stylo.getSentenceClusters(preProcessedText, ClusterSize, false);
            int counter  = 1;

            foreach (var cluster in clusters)
            {
                var s = new Stylo.TextSummary(info, cluster, decimals);
                //          s.Words.Cluster = counter;
                counter++;
                summary.Add(s);
            }
            return(summary);
        }