Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
RolesTokenizer.cs
1using System;
2using System.Collections.Generic;
3using System.Reflection;
4using System.Threading.Tasks;
8
10{
15 {
20 {
21 }
22
28 public Grade Supports(Type Type)
29 {
30 if (typeInfo.IsAssignableFrom(Type))
31 return Grade.Ok;
32 else
33 return Grade.NotAtAll;
34 }
35
36 private static readonly TypeInfo typeInfo = typeof(IEnumerable<Role>).GetTypeInfo();
37
43 public async Task Tokenize(object Value, TokenizationProcess Process)
44 {
45 if (Value is IEnumerable<Role> Roles)
46 await Tokenize(Roles, null, Process);
47 }
48
55 public static async Task Tokenize(IEnumerable<Role> Roles,
57 {
58 if (!(Roles is null))
59 {
60 foreach (Role Role in Roles)
61 {
62 await RoleTokenizer.Tokenize(Role, Contract, Process);
63 Process.DocumentIndexOffset++; // Make sure sequences of keywords don't cross element boundaries.
64 }
65 }
66 }
67 }
68}
Contains information about a tokenization process.
uint DocumentIndexOffset
Document Index Offset. Used to identify sequences of tokens in a document.
Interface for full-text-search tokenizers
Definition: ITokenizer.cs:12
Grade
Grade enumeration
Definition: Grade.cs:7