コード例 #1
0
 /// <summary>Initializes a new instance of the <see cref="TextDeconstructionInformation"/> class.</summary>
 public TextDeconstructionInformation(string textSentanceChunk, string subject, SentenceTypes sentenceType, params string[] phrases)
 {
     TextSentanceChunk  = textSentanceChunk;
     Subject            = subject;
     SentenceType       = sentenceType;
     InformativePhrases = phrases;
 }
コード例 #2
0
        private void AddSentence(IList <ISentence> sentences, IList <ISentenceItem> items)
        {
            char.TryParse(items.Last().ToString(), out char sign);
            SentenceTypes type = EnumMapper.GetSentenceType(sign);

            sentences.Add(new Sentence(items, type));
        }
コード例 #3
0
 public Delimeter(string value, bool isSeparatedBySpace,
       DelimeterTypes delimeterType, SentenceTypes sentenceType = SentenceTypes.Indefinite)
 {
     this.CharValue = new Symbol(value);
     this.IsSeparatedBySpace = isSeparatedBySpace;
     this.DelimeterType = delimeterType;
     this.SentenceType = sentenceType;
 }
コード例 #4
0
 /// <summary>Initializes a new instance of the <see cref="TextDeconstructionInformation"/> class.</summary>
 public TextDeconstructionInformation(string textSentanceChunk, string subject, SentenceTypes sentenceType, IReadOnlyDictionary <string, string[]> entities, string[] phrases, double confidenceRating)
 {
     TextSentanceChunk  = textSentanceChunk;
     Subject            = subject;
     SentenceType       = sentenceType;
     InformativePhrases = phrases;
     Entities           = entities;
     ConfidenceRating   = confidenceRating;
 }
コード例 #5
0
 public Sentence(
     List <ISentenceItem> textItemsStore,
     int firstItemPosition, int lastItemPosition, int position, SentenceTypes type)
 {
     TextItemsStore    = textItemsStore;
     FirstItemPosition = firstItemPosition;
     LastItemPosition  = lastItemPosition;
     Position          = position;
     WordCount         = GetWordCount();
     Type = type;
 }
コード例 #6
0
        public void PrintWordsIn(SentenceTypes sentenceType, int wordLength)
        {
            var sentences = Sentences.Where(s => s.Type == sentenceType);

            foreach (var sentence in sentences)
            {
                Console.WriteLine($"В {sentence.Position} предложении находятся следующие слова заданной длины: ");
                var words = sentence
                            .GetWordsBy(wordLength)
                            .Select(w => w.Value.ToLower())
                            .Distinct()
                ;

                foreach (var word in words)
                {
                    Console.Write($"{word}, ");
                }
                Console.WriteLine(Environment.NewLine);
            }
        }
コード例 #7
0
ファイル: Sentence.cs プロジェクト: sasgovor/EPAM_TASK-2
 public Sentence(IList <ISentenceItem> items, SentenceTypes type)
 {
     Items = items;
     Type  = type;
     SetLength();
 }