Esempio n. 1
0
 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)));
 }
Esempio n. 2
0
        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
Esempio n. 3
0
 public static bool IsTaggedAny(this ITagged tagged, IEnumerable <Tag> tags)
 {
     return(tagged.Tags.Intersect(tags).Any());
 }
Esempio n. 4
0
 public bool Matches(ITagged tagged) => tagged.Tags.Contains(_tag);
Esempio n. 5
0
 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);
 }
Esempio n. 6
0
 public static void AddTag(this ITagged tagged, IProcessTag tag)
 {
     tagged.ProcessData.Add(tag);
 }
Esempio n. 7
0
 public bool Matches(ITagged tagged)
 {
     return(_filters.All(f => f.Matches(tagged)));
 }
Esempio n. 8
0
 public bool Matches(ITagged tagged)
 {
     return(!_inner.Matches(tagged));
 }
Esempio n. 9
0
 public TaggedWithScore(ITagged entity, float score)
 {
     Entity = entity;
     Score  = score;
 }
Esempio n. 10
0
 public static bool ContainsTags(this ITagged taggedEntity, params int[] tags)
 => ContainsTags(taggedEntity, (IEnumerable <int>)tags);
Esempio n. 11
0
 public static bool DoesNotContainsTags(this ITagged taggedEntity, IEnumerable <int> tags)
 {
     return(!tags.Any(x => taggedEntity.Tags.Contains(x)));
 }
Esempio n. 12
0
 public static bool ContainsTags(this ITagged taggedEntity, IEnumerable <int> tags)
 {
     return(tags.All(x => taggedEntity.Tags.Contains(x)));
 }
Esempio n. 13
0
 public bool Matches(ITagged tagged)
 {
     return(tagged.Tags.Any(tag => tag.StartsWith(_search)));
 }
Esempio n. 14
0
 public IEnumerable <ITagged <T> > GetChildren(ITagged <T> item)
 {
     //Cast to Container and enumerate...
 }
Esempio n. 15
0
 public static bool IsTaggedAll(this ITagged tagged, IEnumerable <Tag> tags)
 {
     throw new System.Exception("NOT IMPL");
 }
Esempio n. 16
0
 public static bool IsTagged(this ITagged tagged, Tag tag)
 {
     return(tagged.Tags.Contains(tag));
 }
Esempio n. 17
0
 public bool Matches(ITagged tagged) => true;