I am trying to serialize and deserialize a Trie that I have in memory. I thought it's going to be as simple as:
string jsonString = JsonSerializer.Serialize(giantTrieObj);
JsonSerializer.Deserialize<SuffixTrie>(jsonString);
Seems that is not the case. I just got an empty object {}
upon serialization.
Also, the Trie I am dealing with is massive (5-6GB), so I am looking for an efficient way.
Trie:
public class SuffixTrie
{
public TrieNode root = new TrieNode();
public string endSymbol = "#";
public int Count = 0;
public SuffixTrie(DataTable ruleDt)
{
PopulateSuffixTrieFrom(ruleDt);
}
/// more code