https://github.com/fwcd/swift-algorithms-on-sequences
String search algorithms for Swift
https://github.com/fwcd/swift-algorithms-on-sequences
Last synced: 2 months ago
JSON representation
String search algorithms for Swift
- Host: GitHub
- URL: https://github.com/fwcd/swift-algorithms-on-sequences
- Owner: fwcd
- License: mit
- Created: 2022-06-07T02:00:55.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-07-02T23:20:50.000Z (almost 2 years ago)
- Last Synced: 2026-02-15T16:40:08.625Z (3 months ago)
- Language: Swift
- Size: 219 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Algorithms on Sequences for Swift
[](https://github.com/fwcd/swift-algorithms-on-sequences/actions/workflows/build.yml)
An implementation of various string search algorithms for Swift.
## Overview
- Exact Pattern Matching Problem (EPMP)
- [x] Naive algorithm (quadratic time)
- [x] Z-Box algorithm (linear time)
- [x] Boyer-Moore algorithm
- [x] Knuth-Morris-Pratt algorithm
- [x] Ukkonen's algorithm
- Exact Set Matching Problem (ESMP)
- [x] Naive algorithm
- [ ] Aho-Corasick algorithm
## Getting Started
- To build the package, make sure to have Swift 5.9 or newer installed and run `swift build`.
- To run the test suite, invoke `swift test`.
- To run the benchmarks, invoke `Scripts/run-benchmarks` and then `Scripts/plot-benchmarks` to plot them (make sure to have Python 3.9 or newer, `matplotlib`, `numpy` and `scipy` installed)