2017 © Pedro Peláez
 

library php-lcs

An implementation of the 'longest common subsequence' algorithm for PHP.

image

ezzatron/php-lcs

An implementation of the 'longest common subsequence' algorithm for PHP.

  • Monday, February 17, 2014
  • by ezzatron
  • Repository
  • 2 Watchers
  • 13 Stars
  • 175 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

PHP-LCS

An implementation of the 'longest common subsequence' algorithm for PHP., (*1)

The most recent stable version is 2.0.0 Current build status image Current coverage status image, (*2)

Installation and documentation

What is PHP-LCS?

PHP-LCS is a PHP implementation of an algorithm to solve the 'longest common subsequence' problem., (*3)

From Wikipedia - longest common subsequence problem:, (*4)

The longest common subsequence (LCS) problem is to find the longest subsequence common to all sequences in a set of sequences (often just two). Note that subsequence is different from a substring, see substring vs. subsequence. It is a classic computer science problem, the basis of file comparison programs such as diff, and has applications in bioinformatics., (*5)

Usage

use Eloquent\Lcs\LcsSolver;

$solver = new LcsSolver;

$sequenceA = array('B', 'A', 'N', 'A', 'N', 'A');
$sequenceB = array('A', 'T', 'A', 'N', 'A');

// calculates the LCS to be array('A', 'A', 'N', 'A')
$lcs = $solver->longestCommonSubsequence($sequenceA, $sequenceB);

Elements in sequences can be anything. By default, sequence members are compared using the === operator. To customize this comparison, simply construct the solver with a custom comparator, like so:, (*6)

use Eloquent\Lcs\LcsSolver;

$solver = new LcsSolver(
    function ($left, $right) {
        // return true if $left and $right are equal
    }
);

The Versions

17/02 2014

dev-develop

dev-develop https://github.com/eloquent/php-lcs

An implementation of the 'longest common subsequence' algorithm for PHP.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

common sequence algorithm diff longest subsequence

17/02 2014

dev-master

9999999-dev https://github.com/eloquent/php-lcs

An implementation of the 'longest common subsequence' algorithm for PHP.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

common sequence algorithm diff longest subsequence

17/02 2014

2.0.0

2.0.0.0 https://github.com/eloquent/php-lcs

An implementation of the 'longest common subsequence' algorithm for PHP.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

common sequence algorithm diff longest subsequence

04/03 2013

1.0.3

1.0.3.0 https://github.com/ezzatron/php-lcs

An implementation of the 'longest common subsequence' algorithm for PHP.

  Sources   Download

MIT

The Requires

  • php >=5

 

The Development Requires

common sequence algorithm diff longest subsequence

15/08 2012

1.0.2

1.0.2.0 https://github.com/ezzatron/php-lcs

An implementation of the 'longest common subsequence' algorithm for PHP.

  Sources   Download

MIT

The Requires

  • php >=5

 

common sequence algorithm diff longest subsequence

15/08 2012

1.0.1

1.0.1.0 https://github.com/ezzatron/php-lcs

An implementation of the 'longest common subsequence' algorithm for PHP.

  Sources   Download

MIT

The Requires

  • php >=5

 

common sequence algorithm diff longest subsequence

15/08 2012

1.0.0

1.0.0.0 https://github.com/ezzatron/php-lcs

An implementation of the 'longest common subsequence' algorithm for PHP.

  Sources   Download

MIT

The Requires

  • php >=5

 

common sequence algorithm diff longest subsequence