Ifrit

.2.0.2

Swfit library for fuzzy search. No dependencies lib.
ukushu/Ifrit

What's New

v.2.0.2

2024-06-20T00:29:58Z
  • Documentation improvements
  • Ability to set QoS for fuse syncSearch
  • Improved sync search speed a little bit
  • Fixed crash caused of binary operation arithmetic overflow

Ifrit

https://github.com/ukushu/Ifrit.git
git@github.com:ukushu/Ifrit.git

πŸ‡ΊπŸ‡¦πŸ‡ΊπŸ‡¦πŸ‡ΊπŸ‡¦ UKRAINE NEEDS YOUR SUPPORT! πŸ‡ΊπŸ‡¦πŸ‡ΊπŸ‡¦πŸ‡ΊπŸ‡¦

What is Ifrit?

Ifrit is fuzzy search library written in pure swift.

What is fuzzy Search?

A fuzzy search algorithm is designed to find approximate matches for a given search query.

Let's say you have a list of products, and a user is looking for a "Czy Swetr,". Exact match will return nothing, but the fuzzy search will find "Cozy Sweater.".

If you need exact match - you need to use standard function .filter { } instead of this library.

Demo of Fuzzy Search:

Ifrit demo

Advanteges / Disadvantages of Ifrit

Advanteges:
+ Super lightweight
+ No dependencies
+ OS supported: MacOS(>=v10_15), iOS(>=v13), visionOS, watchOS, twOS, Linux
+ Asynchronous search ( async/await + callbacks both )
+ Text highlight support (AttributedString)
+ Covered with automated tests
+ MIT Licensed
+ Ability to link Ifrit as Static and Dynamic package - you are able to choose what is better in your case

Disadvantages:
- Wasn't tested in production
- Swift 5.9 and higher, older version of Swift does not supported.

This repository is based on archived repository Fuse-Swift by KRisk: https://github.com/krisk/fuse-swift

Swift Package Index information: https://swiftpackageindex.com/ukushu/Ifrit

Difference: Ifrit VS Fuze-Swift?

+ Fuze-Swift support Pods and Packages :)
- Ifrit supports only Packages :(

- Fuze-Swift is dead :(
+ Ifrit is a Fuse-Swift reborn from hell and ALIVE as ever :)

- Fuze-Swift supports async functins with callbacks, but does not support async/await
+ Ifrit supports callbacks and async/await both:)

- Fuze-Swift have async/multithreading issues. Crashes is possible :(
+ Ifrit is a Fuze-Swift with fixed multithreading issues - no crashes :)

- Fuze-Swift async functions returns incorrect results (wrong indexes) :((((
+ Ifrit's async functins returns correct indexes and covered with tests :)

- Fuze-Swift written for xcode 11 and have a lot of warnings at now :(
+ Ifrit code is updated to swift's latest standards and there are no build warnings :)

+ Ifrit - extended coverage with automated tests in general :)
+ Ifrit have additional search system using Levenstain distance algorythm :)
+ Ifrit have ability to search by several templates
+ Ifrit have a little bit changed syntax to be more flexible.
+ Ifrit's sync search faster than Fuse's on 2% (standard settings) using M1 processor. Async search have tha same speed (standard settings).

Documentation / Instructions / Example Project

Ifrit repository have no example project. Use instructions below:

How to use Ifrit's Fuse

How to use Ifrit's Levenstain

How to display search results in UI

Installation

  1. XCode -> Menu Line -> Add Package Dependencies -> https://github.com/ukushu/Ifrit.git

  2. import Ifrit to your source files.

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sun Nov 10 2024 01:42:53 GMT-1000 (Hawaii-Aleutian Standard Time)