public static void AddLabel(this ITagged tagged, string label, int verbosity = 1, ITagged start = null) { tagged.AddTag(new ProcessTag(label, String.IsNullOrEmpty(label) ? 1000 : verbosity, (start == null) ? (IProcessRange)tagged.ProcessData : new ProcessRange(start.ProcessData, tagged.ProcessData))); }
public static string Generate(params object[] elements) { string doc = ""; foreach (object obj in elements) { ITagged myTaggedObject = obj as ITagged; INested myNestedObject = obj as INested; if (myNestedObject is null || myTaggedObject is null) // obj is of raw information type (or non nested decorator). no further recursion possible -> add & continue { doc += obj; continue; } doc += $"\n{myTaggedObject.TagId}" + Generate(myNestedObject.Elements) + $"\n{myTaggedObject.TagId[..1]}/{myTaggedObject.TagId[1..]}";// Recursive function call for nested elements
public static bool IsTaggedAny(this ITagged tagged, IEnumerable <Tag> tags) { return(tagged.Tags.Intersect(tags).Any()); }
public bool Matches(ITagged tagged) => tagged.Tags.Contains(_tag);
public static TTagged Labeled <TTagged>(this TTagged taggedProcess, string label, int verbosity = 0, ITagged start = null) where TTagged : ITagged { taggedProcess.AddLabel(label, verbosity, start); return(taggedProcess); }
public static void AddTag(this ITagged tagged, IProcessTag tag) { tagged.ProcessData.Add(tag); }
public bool Matches(ITagged tagged) { return(_filters.All(f => f.Matches(tagged))); }
public bool Matches(ITagged tagged) { return(!_inner.Matches(tagged)); }
public TaggedWithScore(ITagged entity, float score) { Entity = entity; Score = score; }
public static bool ContainsTags(this ITagged taggedEntity, params int[] tags) => ContainsTags(taggedEntity, (IEnumerable <int>)tags);
public static bool DoesNotContainsTags(this ITagged taggedEntity, IEnumerable <int> tags) { return(!tags.Any(x => taggedEntity.Tags.Contains(x))); }
public static bool ContainsTags(this ITagged taggedEntity, IEnumerable <int> tags) { return(tags.All(x => taggedEntity.Tags.Contains(x))); }
public bool Matches(ITagged tagged) { return(tagged.Tags.Any(tag => tag.StartsWith(_search))); }
public IEnumerable <ITagged <T> > GetChildren(ITagged <T> item) { //Cast to Container and enumerate... }
public static bool IsTaggedAll(this ITagged tagged, IEnumerable <Tag> tags) { throw new System.Exception("NOT IMPL"); }
public static bool IsTagged(this ITagged tagged, Tag tag) { return(tagged.Tags.Contains(tag)); }
public bool Matches(ITagged tagged) => true;