BitapSearch 0.2.3

BitapSearch 0.2.3

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release May 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Kirollos Risk.



BitapSearch

What is BitapSearch?

BitapSearch provides a simple way to do fuzzy searching.

Demo

Usage

let bitap = BitapSearch()
let result = bitap.search("od mn war", in: "Old Man's War")

print(result?.score)  // 0.44444444444444442
print(result?.ranges) // [CountableRange(0..<0), CountableRange(2..<6), CountableRange(9..<12)]
let bitap = BitapSearch()

let books = ["The Silmarillion", "The Lock Artist", "The Lost Symbol"]

// Improve performance by creating the pattern once
let pattern = bitap.createPattern(from: "Te silm")

books.forEach {
    let result = bitap.search(pattern, in: $0)
    print(result?.score)
    print(result?.ranges)
}

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

BitapSearch is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "BitapSearch"

Author

Kirollos Risk, [email protected]

License

BitapSearch is available under the MIT license. See the LICENSE file for more info.