https://github.com/ZebulonRouseFrantzich/DoubleMetaphoneSwift
A Swift implementation of the Double Metaphone algorithm
https://github.com/ZebulonRouseFrantzich/DoubleMetaphoneSwift
cocoapods double-metaphone doublemetaphone postgresql spm swift-3 swift-package-manager swift3
Last synced: 8 months ago
JSON representation
A Swift implementation of the Double Metaphone algorithm
- Host: GitHub
- URL: https://github.com/ZebulonRouseFrantzich/DoubleMetaphoneSwift
- Owner: ZebulonRouseFrantzich
- License: mit
- Created: 2017-03-11T19:29:16.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-02-03T14:18:52.000Z (over 5 years ago)
- Last Synced: 2025-02-02T15:51:23.457Z (over 1 year ago)
- Topics: cocoapods, double-metaphone, doublemetaphone, postgresql, spm, swift-3, swift-package-manager, swift3
- Language: C
- Homepage:
- Size: 122 KB
- Stars: 9
- Watchers: 2
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DoubleMetaphoneSwift
This is an implementation of the Double Metaphone algorithm in Swift. The algorithm was originally coded by Lawrence Philips.
### Setting up with [CocoaPods](http://cocoapods.org/?q=DoubleMetaphoneSwift)
```ruby
source 'https://github.com/CocoaPods/Specs.git'
pod 'DoubleMetaphoneSwift', '~> 0.0.1'
```
## Usage
Import DoubleMetaphoneSwift at the top of the Swift file.
```swift
import DoubleMetaphoneSwift
```
The returned Double Metaphone calculation returns the primary and secondary calculations as a tuple.
```swift
guard let (primary, secondary) = DoubleMetaphoneSwift.calculate(input: "Hello World!") else {
print("Failed to calculate...")
return
}
print("Primary: \(primary)") // Primary: HLRL
print("Secondary: \(secondary)") // Secondary: HLRL
```