Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: 5 days ago
JSON representation

A Swift implementation of the Double Metaphone algorithm

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
```