Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ProhibitedKeyword.cs
1using System.Collections.Generic;
2using System.Threading.Tasks;
3
5{
10 {
16 : base()
17 {
18 this.Keyword = Keyword;
19 }
20
24 public Keyword Keyword { get; }
25
29 public override bool Optional => false;
30
34 public override bool Prohibited => true;
35
39 public override int OrderCategory => -1;
40
44 public override int OrderComplexity => this.Keyword.OrderComplexity;
45
49 public override bool Ignore => this.Keyword.Ignore;
50
52 public override bool Equals(object obj)
53 {
54 return obj is ProhibitedKeyword k && this.Keyword.Equals(k.Keyword);
55 }
56
58 public override string ToString()
59 {
60 return "-" + this.Keyword.ToString();
61 }
62
68 public override Task<IEnumerable<KeyValuePair<string, TokenReferences>>> GetTokenReferences(SearchProcess Process)
69 {
71 }
72
78 public override async Task<bool> Process(SearchProcess Process)
79 {
80 IEnumerable<KeyValuePair<string, TokenReferences>> Records = await this.GetTokenReferences(Process);
81
82 foreach (KeyValuePair<string, TokenReferences> Rec in Records)
83 {
84 TokenReferences References = Rec.Value;
85
86 int j, d = References.ObjectReferences.Length;
87
88 for (j = 0; j < d; j++)
89 {
90 ulong ObjectReference = References.ObjectReferences[j];
91 Process.ReferencesByObject.Remove(ObjectReference);
92 }
93
94 if (Process.ReferencesByObject.Count == 0)
95 return false;
96 }
97
98 return true;
99 }
100
101 }
102}
Abstract base class for keywords.
Definition: Keyword.cs:11
virtual bool Ignore
If keyword should be ignored.
Definition: Keyword.cs:47
virtual int OrderComplexity
Order complexity (within category) of keyword
Definition: Keyword.cs:42
abstract Task< IEnumerable< KeyValuePair< string, TokenReferences > > > GetTokenReferences(SearchProcess Process)
Gets available token references.
override async Task< bool > Process(SearchProcess Process)
Processes the keyword in a search process.
override int OrderComplexity
Order complexity (within category) of keyword
ProhibitedKeyword(Keyword Keyword)
Represents a prohibited keyword.
override bool Ignore
If keyword should be ignored.
override Task< IEnumerable< KeyValuePair< string, TokenReferences > > > GetTokenReferences(SearchProcess Process)
Gets available token references.
Contains information about a search process.
Contains a reference to an indexed object.
Contains a sequence of object references that include the token in its indexed text properties.
ulong[] ObjectReferences
References to objects containing the token.