Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tyiu/swift-trie
A Swift package that provides a Trie data structure that allow efficient searches of values that map from prefixed keys or non-prefixed key substrings.
https://github.com/tyiu/swift-trie
Last synced: about 1 hour ago
JSON representation
A Swift package that provides a Trie data structure that allow efficient searches of values that map from prefixed keys or non-prefixed key substrings.
- Host: GitHub
- URL: https://github.com/tyiu/swift-trie
- Owner: tyiu
- License: mit
- Created: 2024-06-09T18:44:05.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-06-17T00:05:54.000Z (5 months ago)
- Last Synced: 2024-10-12T20:30:57.899Z (about 1 month ago)
- Language: Swift
- Homepage: https://tyiu.github.io/swift-trie/documentation/swifttrie/
- Size: 10.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Unit Tests](https://github.com/tyiu/swift-trie/actions/workflows/unit.yml/badge.svg)](https://github.com/tyiu/swift-trie/actions/workflows/unit.yml) [![SwiftLint](https://github.com/tyiu/swift-trie/actions/workflows/swiftlint.yml/badge.svg)](https://github.com/tyiu/swift-trie/actions/workflows/swiftlint.yml) [![Docs](https://github.com/tyiu/swift-trie/actions/workflows/docs.yml/badge.svg)](https://github.com/tyiu/swift-trie/actions/workflows/docs.yml)
# SwiftTrie
A Swift package that provides a [Trie](https://en.wikipedia.org/wiki/Trie) data structure that allow efficient searches of values that map from prefixed keys or non-prefixed key substrings.
## Minimum Requirements
- Swift 5.8
## Installation
SwiftTrie can be integrated as an Xcode project target or a Swift package target.
### Xcode Project Target
1. Go to `File` -> `Add Package Dependencies`.
2. Type https://github.com/tyiu/swift-trie.git into the search field.
3. Select `swift-trie` from the search results.
4. Select `Up to Next Major Version` starting from the latest release as the dependency rule.
5. Ensure your project is selected next to `Add to Project`.
6. Click `Add Package`.
7. On the package product dialog, add `SwiftTrie` to your target and click `Add Package`.### Swift Package Target
In your `Package.swift` file:
1. Add the SwiftTrie package dependency to https://github.com/tyiu/swift-trie.git
2. Add `SwiftTrie` as a dependency on the targets that need to use the SDK.```swift
let package = Package(
// ...
dependencies: [
// ...
.package(url: "https://github.com/tyiu/swift-trie.git", .upToNextMajor(from: "0.1.0"))
],
targets: [
.target(
// ...
dependencies: ["SwiftTrie"]
),
.testTarget(
// ...
dependencies: ["SwiftTrie"]
)
]
)
```## Usage
See [TrieTests.swift](Tests/SwiftTrieTests/TrieTests.swift) for an example of how to use SwiftTrie.