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