Download the PHP package dd/php-library-ddtextcompare without Composer

On this page you can find all versions of the php package dd/php-library-ddtextcompare. 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 php-library-ddtextcompare

ddTextCompare

A simple tool allowing to compare two strings. The library works only with UTF-8 strings for now.

What this library is

ddTextCompare can be used in situations when it is not possible to make the native string comparison in PHP. The library relies on chars number and their position, therefore, it's suitable for a comparison of strings containing typos or having different word order but the same words.

What this library isn't

ddTextCompare has nothing to do with morphological or any other analysis you would expect from an intelligent search engine. The main purpose for the library is to stay simple.

How it works

By default ddTextCompare performs a simple analysis. Each string being compared is represented as two n-dimensional vectors, where n is the number of unique chars used in both strings. The firs vector v1 shows what chars are in its string and their total number. The other vector v2 shows where those unique chars are. When those two vectors are found for each string, cosine similarity will be found for the vector pairs. Once calculated, cos(v1,1v1,2) and cos(v2,1v2,2) are multiplied by their wights respectively and the result is modified to make it belong to a range between 0 and 1.

Installation

Composer

Just add the package to your composer.json.

Manually

Though it's convenient to use Composer, it is also possible to place the library wherever you want and include all the classes inside the “src” folder manually.

Basic usage

Here are some examples.

Comparing strings with typos

Adjusting weights

By default, the weights for all criteria are equal, but it can be changed. When a wight is changed the another weight will be adjusted automatically to make their sum equal to 1.

Extending

A custom comparator class can be created by implementing the DDTextCompare\Comparator interface.

Changelog

Version 0.9 (2015-11-07)


All versions of php-library-ddtextcompare with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
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 dd/php-library-ddtextcompare contains the following files

Loading the files please wait ....