Download the PHP package lion1102/fuzzy without Composer

On this page you can find all versions of the php package lion1102/fuzzy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package fuzzy

Search matched string in 2 specificed key in 2 array

This library requires Fuse.

Install

Usage

Methods

The following methods are available on a Fuzzy\Fuzzy instance:

getCompareString( $arrValidateData, $arrSearchData, arrOptions, $key1, $key2 );

List all matching pattern and scope for all the items between arrays.

Options

keys (type: array)

List of properties that will be searched. This supports nested properties, weighted search, searching in arrays of strings and associative arrays etc:


id (type: string)

The name of the identifier property. If specified, the returned result will be a list of the items' identifiers, otherwise it will be a list of the items.


caseSensitive (type: bool, default: false)

Indicates whether comparisons should be case sensitive.


includeScore (type: bool, default: false)

Whether the score should be included in the result set. A score of 0 indicates a perfect match, while a score of 1 indicates a complete mismatch.


includeMatches (type: bool, default: false)

Whether the matches should be included in the result set. When true, each record in the result set will include the indices of the matched characters: "indices" => [ $start, $end ]. These can consequently be used for highlighting purposes.


shouldSort (type: bool, default: true)

Whether to sort the result list, by score.


getFn (type: function, default: \Fuse\Helpers\deep_value)

The get function to use when fetching an associative array's properties. The default will search nested paths like foo.bar.baz.


sortFn (type: function, default: sort by score)

The function that is used for sorting the result list.


location (type: int, default: 0)

Determines approximately where in the text is the pattern expected to be found.


threshold (type: float, default: 0.6)

At what point does the match algorithm give up. A threshold of 0.0 requires a perfect match (of both letters and location), a threshold of 1.0 would match anything.


distance (type: int, default: 100)

Determines how close the match must be to the fuzzy location (specified by location). An exact letter match which is distance characters away from the fuzzy location would score as a complete mismatch. A distance of 0 requires the match be at the exact location specified, a distance of 1000 would require a perfect match to be within 800 characters of the location to be found using a threshold of 0.8.


maxPatternLength (type: int, default: 32)

The maximum length of the search pattern. The longer the pattern, the more intensive the search operation will be. Whenever the pattern exceeds the maxPatternLength, an error will be thrown. Why is this important? Read this.


verbose (type: bool, default: false)

Will print out steps. Useful for debugging.


tokenize (type: bool, default: false)

When true, the search algorithm will search individual words and the full string, computing the final score as a function of both. Note that when tokenize is true, the threshold, distance, and location are inconsequential for individual tokens.


tokenSeparator (type: string, default: / +/g)

A regular expression string used to separate words of the search pattern when searching. Only applicable when tokenize is true.


matchAllTokens (type: bool, default: false)

When true, the result set will only include records that match all tokens. Will only work if tokenize is also true.


findAllMatches (type: bool, default: false)

When true, the matching function will continue to the end of a search pattern even if a perfect match has already been located in the string.


minMatchCharLength (type: int, default: 1)

When set to include matches, only those whose length exceeds this value will be returned. (For instance, if you want to ignore single character index returns, set to 2)

Weighted Search

In some cases you may want certain keys to be weighted differently for more accurate results. You may provide each key with a custom weight (where 0 < weight <= 1):


All versions of fuzzy with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
loilo/fuse Version ^3.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lion1102/fuzzy contains the following files

Loading the files please wait ....