Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure suffix array module #50

Merged
merged 4 commits into from
Jan 31, 2025
Merged

Conversation

ajalab
Copy link
Owner

@ajalab ajalab commented Jan 31, 2025

In #48, I proposed moving sais module to suffix_array.

It's not obvious for readers that the module and function name sais computes a suffix array. Maybe it should be something like suffix_array instead.
#48

However, suffix_array module already exists and consists of the following elements.

  • trait for search index (HasPosition)
  • methods and structs for sampled suffix arrays (sample, SuffixOrderSampledArray)

It's not so nice to colocate SA-IS related methods in suffix_array with these elements. Therefore, this PR moves the existing suffix_array module elements to different locations beforehand.

  • the trait for search index (HasPosition) will be moved to iter module, where other traits for search index (FMIndexBackend, HeapSize) exist. We may also want to consider restructuring the iter module, but this can be done in another work.
  • methods and structs for sampled suffix arrays (sample, SuffixOrderSampledArray) will be moved to a new module suffix_array::sample. This is not exposed to crate users.

After that, we can move sais module to suffix_array::sais.

HasPosition is a property (trait) of a search index, so it might be more
intuitive to move this to iter module, where other traits for indexes
are located.
@ajalab ajalab requested a review from faassen January 31, 2025 00:58
@faassen
Copy link
Collaborator

faassen commented Jan 31, 2025

So if I understand it correctly this doesn't yet contain any changes to sais itself. I spent a moment looking for suffix_array::sais but I take it you plan to move that later. Looks good!

@ajalab
Copy link
Owner Author

ajalab commented Jan 31, 2025

Right! Let me create another PR to move sais module to suffix_array.

@ajalab ajalab merged commit 735005a into master Jan 31, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants