A high-performance Rust workspace containing both a command-line tool and library for inverse lexicographic (suffix) sorting.
This workspace contains two crates:
A high-performance library for inverse lexicographic sorting that provides:
- Core sorting algorithms
- Flexible configuration options
- Parallel processing capabilities
- Both high-level and low-level APIs
Location: core/
A command-line interface that uses the suffixsort library to provide:
- File and stdin input handling
- Multiple sorting options and output formatting
- High-performance processing of large files
Location: cli/
- Rust toolchain (latest stable version recommended)
- Cargo (comes with Rust)
# Build both crates
cargo build
# Build in release mode (optimized)
cargo build --release# Install the ssort tool globally
cargo install --path cli
# Basic usage
ssort input.txt
# With various options
ssort -air file1.txt file2.txt
# Read from stdin
cat large_file.txt | ssort -iAdd to your Cargo.toml:
[dependencies]
suffixsort = ">=0.1"Example usage:
use suffixsort::SortConfig;
let config = SortConfig {
ignore_case: true,
reverse: false,
..Default::default()
};
let lines = vec!["Banana".to_string(), "apple".to_string(), "Cherry".to_string()];
let (sorted, _) = config.process_lines(lines);
for item in sorted {
println!("{}", item.original);
}This workspace is optimized for processing large datasets:
- Parallel processing using Rayon
- Efficient memory management
- Zero-cost abstractions
- Streaming input/output support
Dual-licensed under:
- MIT License (see LICENSE-MIT)
- Apache License 2.0 (see LICENSE-APACHE)
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Run tests with
cargo test - Submit a pull request
For more detailed information about each crate, see their individual README files.