Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
TokenizationProcess.cs
1using System;
4
6{
11 {
16 {
17 this.TokenCounts = new Dictionary<string, ChunkedList<uint>>();
18 }
19
23 public Dictionary<string, ChunkedList<uint>> TokenCounts { get; }
24
28 public uint DocumentIndexOffset { get; set; }
29
35 {
36 int c = this.TokenCounts.Count;
37 if (c == 0)
38 return Array.Empty<TokenCount>();
39
40 int i = 0;
41 TokenCount[] Counts = new TokenCount[c];
42
43 foreach (KeyValuePair<string, ChunkedList<uint>> P in this.TokenCounts)
44 Counts[i++] = new TokenCount(P.Key, P.Value.ToArray());
45
46 return Counts;
47 }
48 }
49}
Represents a token and a corresponding occurrence count.
Definition: TokenCount.cs:12
Contains information about a tokenization process.
uint DocumentIndexOffset
Document Index Offset. Used to identify sequences of tokens in a document.
Dictionary< string, ChunkedList< uint > > TokenCounts
Accumulated token counts.
TokenizationProcess()
Contains information about a tokenization process.
TokenCount[] ToArray()
Generates an array of token counts.
A chunked list is a linked list of chunks of objects of type T .
Definition: ChunkedList.cs:54