/// <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;
 }
Exemplo n.º 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));
        }
 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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);
            }
        }
Exemplo n.º 7
0
 public Sentence(IList <ISentenceItem> items, SentenceTypes type)
 {
     Items = items;
     Type  = type;
     SetLength();
 }