Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
PlainKeyword.cs
2using System.Threading.Tasks;
4
6{
10 public class PlainKeyword : Keyword
11 {
16 public PlainKeyword(string Keyword)
17 {
18 this.Keyword = Keyword;
19 this.Ignore = string.IsNullOrEmpty(Keyword) ||
20 FullTextSearchModule.IsStopWord(Keyword);
21 }
22
26 public string Keyword { get; }
27
31 public override bool Ignore { get; }
32
36 public override int OrderComplexity => this.Keyword.Length;
37
39 public override bool Equals(object obj)
40 {
41 return obj is PlainKeyword k && this.Keyword == k.Keyword;
42 }
43
45 public override string ToString()
46 {
47 return this.Keyword;
48 }
49
55 public override async Task<IEnumerable<KeyValuePair<string, TokenReferences>>> GetTokenReferences(SearchProcess Process)
56 {
58 KeyValuePair<string, object>[] Records = await Process.Index.GetEntriesAsync(this.Keyword, this.Keyword + "!");
59
60 foreach (KeyValuePair<string, object> Rec in Records)
61 {
62 if (Rec.Value is TokenReferences References)
63 Result.Add(new KeyValuePair<string, TokenReferences>(this.Keyword, References));
64 }
65
66 return Result;
67 }
68 }
69}
Full-text search module, controlling the life-cycle of the full-text-search engine.
Abstract base class for keywords.
Definition: Keyword.cs:11
virtual async Task< bool > Process(SearchProcess Process)
Processes the keyword in a search process.
Definition: Keyword.cs:67
PlainKeyword(string Keyword)
Represents a plain text keyword.
Definition: PlainKeyword.cs:16
override bool Ignore
If keyword should be ignored.
Definition: PlainKeyword.cs:31
override async Task< IEnumerable< KeyValuePair< string, TokenReferences > > > GetTokenReferences(SearchProcess Process)
Gets available token references.
Definition: PlainKeyword.cs:55
override int OrderComplexity
Order complexity (within category) of keyword
Definition: PlainKeyword.cs:36
Contains information about a search process.
Contains a sequence of object references that include the token in its indexed text properties.
A chunked list is a linked list of chunks of objects of type T .
Definition: ChunkedList.cs:54