private static async Task GenerateSuffixTreeAsync(string catalogModelPath, string suffixTreePath) { if (File.Exists(suffixTreePath)) { return; } Console.WriteLine($"Generating {Path.GetFileName(suffixTreePath)}..."); var catalog = await ApiCatalogModel.LoadAsync(catalogModelPath); var builder = new SuffixTreeBuilder(); foreach (var api in catalog.GetAllApis()) { if (api.Kind.IsAccessor()) { continue; } builder.Add(api.ToString(), api.Id); } await using var stream = File.Create(suffixTreePath); builder.WriteSuffixTree(stream); }
public void SuffixTreeBuilder_CreateRootSuffixGroupTest1() { SuffixTreeBuilder.BuildSuffixGroup("$").Assert("$"); SuffixTreeBuilder.BuildSuffixGroup("X$").Assert("X$"); }
public void SuffixTreeBuilder_CreateRootSuffixGroupTest2() { SuffixGroup group = SuffixTreeBuilder.BuildSuffixGroup("sample$"); group.Assert("e$", "le$", "ple$", "mple$", "ample$", "sample$"); }
public SequencedTrack SequenceTrack(Track track) { SuffixTreeBuilder builder = new SuffixTreeBuilder(track); builder.Build(); return null; }