Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
HumanReadableTextsTokenizer.cs
1using System;
2using System.Collections.Generic;
3using System.Reflection;
4using System.Threading.Tasks;
9
11{
16 {
21 {
22 }
23
29 public Grade Supports(Type Type)
30 {
31 if (typeInfo.IsAssignableFrom(Type))
32 return Grade.Ok;
33 else
34 return Grade.NotAtAll;
35 }
36
37 private static readonly TypeInfo typeInfo = typeof(IEnumerable<HumanReadableText>).GetTypeInfo();
38
44 public async Task Tokenize(object Value, TokenizationProcess Process)
45 {
46 if (Value is IEnumerable<HumanReadableText> HumanReadableTexts)
47 await Tokenize(HumanReadableTexts, null, Process);
48 }
49
56 public static async Task Tokenize(IEnumerable<HumanReadableText> HumanReadableTexts,
58 {
59 if (!(HumanReadableTexts is null))
60 {
61 foreach (HumanReadableText HumanReadableText in HumanReadableTexts)
62 {
64 Process.DocumentIndexOffset++; // Make sure sequences of keywords don't cross element boundaries.
65 }
66 }
67 }
68 }
69}
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