public IEnumerable <ParagraphParseResult> GetSimpleHierarchicalParagraphResults()
 {
     return(ParagraphResults
            .Union(ChildHierarchyResults
                   .Where(ch => ch.ElementType.IsSimpleHierarchical())
                   .SelectMany(ch => ch.GetSimpleHierarchicalParagraphResults())));
 }
        public HierarchyParseResult GetValuableHierarchyResult()
        {
            if (ParagraphResults.Any() || ChildHierarchyResults.Count > 1 || !ElementTypeHelper.CanBeLinear(ElementType))
            {
                return(this);
            }

            return(ChildHierarchyResults.FirstOrDefault()?.GetValuableHierarchyResult());
        }
 public IEnumerable <ParagraphParseResult> GetAllParagraphParseResults()
 {
     return(ParagraphResults
            .Union(ChildHierarchyResults.SelectMany(h => h.GetAllParagraphParseResults())));
 }