PHPackages                             samokspv/exclude-similar-docs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. samokspv/exclude-similar-docs

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

samokspv/exclude-similar-docs
=============================

Exclude similar documents

1.0.8(11y ago)110[2 issues](https://github.com/samokspv/exclude-similar-docs/issues)MITPHPPHP &gt;=5.3.0

Since Oct 29Pushed 11y ago1 watchersCompare

[ Source](https://github.com/samokspv/exclude-similar-docs)[ Packagist](https://packagist.org/packages/samokspv/exclude-similar-docs)[ Docs](http://github.com/samokspv/exclude-similar-docs)[ RSS](/packages/samokspv-exclude-similar-docs/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (10)Used By (0)

ExcludeSimilarDocs
==================

[](#excludesimilardocs)

[![Build Status](https://camo.githubusercontent.com/d990047860933bdc2d92e770384d8cb6aec220647ee53c09f42cbd22018d7609/68747470733a2f2f7472617669732d63692e6f72672f73616d6f6b7370762f6578636c7564652d73696d696c61722d646f63732e706e67)](https://travis-ci.org/samokspv/exclude-similar-docs) [![Coverage Status](https://camo.githubusercontent.com/a994251a96cb7226a4df8a531fea2abedde0521fadaa07959647d9820c336a5c/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f73616d6f6b7370762f6578636c7564652d73696d696c61722d646f63732e737667)](https://coveralls.io/r/samokspv/exclude-similar-docs) [![Latest Stable Version](https://camo.githubusercontent.com/c8b66fa9d93fc2f8701cc046ac334ea8dbfcee3a35bbb32b6e38d6c30b9ce423/68747470733a2f2f706f7365722e707567782e6f72672f73616d6f6b7370762f6578636c7564652d73696d696c61722d646f63732f762f737461626c652e737667)](https://packagist.org/packages/samokspv/exclude-similar-docs) [![Total Downloads](https://camo.githubusercontent.com/3b102e794627d4ff50acd08088903c8bcfeba4d462401f9ce993194c3730b8c5/68747470733a2f2f706f7365722e707567782e6f72672f73616d6f6b7370762f6578636c7564652d73696d696c61722d646f63732f646f776e6c6f6164732e737667)](https://packagist.org/packages/samokspv/exclude-similar-docs) [![Latest Unstable Version](https://camo.githubusercontent.com/4b650bc0588b2d91cbaaca47f8aeb0b3c1e0fcce2f056bd7b3e1f0974b8c5982/68747470733a2f2f706f7365722e707567782e6f72672f73616d6f6b7370762f6578636c7564652d73696d696c61722d646f63732f762f756e737461626c652e737667)](https://packagist.org/packages/samokspv/exclude-similar-docs) [![License](https://camo.githubusercontent.com/9bf118ac1afe99dc983c01e34893ceb4f98500308fe87204242e2238b46dccd0/68747470733a2f2f706f7365722e707567782e6f72672f73616d6f6b7370762f6578636c7564652d73696d696c61722d646f63732f6c6963656e73652e737667)](https://packagist.org/packages/samokspv/exclude-similar-docs)

ExcludeSimilarDocs plugin for CakePHP

Use it if you want to exclude similar documents: Types exclude: simple - exclude documents by identical duplication search shingles - exclude documents by near-duplicate search (shingles algorithm)

Installation
------------

[](#installation)

```
cd my_cake_app/app
git clone git@github.com:samokspv/exclude-similar-docs.git Plugin/ExcludeSimilarDocs

```

or if you use git add as submodule:

```
cd my_cake_app
git submodule add "git@github.com:samokspv/exclude-similar-docs.git" "app/Plugin/ExcludeSimilarDocs"

```

then add plugin loading in Config/bootstrap.php

```
CakePlugin::load('ExcludeSimilarDocs', array('bootstrap' => true, 'routes' => false));

```

Usage
-----

[](#usage)

In any place of your code:

```
App::uses('ExcludeSimilarDocs', 'ExcludeSimilarDocs.Utility');

Configure::write('ExcludeSimilarDocs', array(
	'types' => array(
		'simple' => array(
			'fields' => array(
				'title',
				'description'
			) // documents fields for comparison
		),
		'shingles' => array(
			'fields' => array(
				'title',
				'description'
			), // documents fields for comparison
			'length' => 10, // length of single shingle
			'allowSimilarity' => 1, // alllow percent similarity documents
			'stopWords' => array(), // your own prepositions and conjunction for clear in texts
			'stopSymbols' => array() // your own punctuation marks, others symbols for clear in texts
		)
	)
));

For example:

---------------
(type - simple)

// array of objects documents with fields title/description (default)
$arrayOfObjDocs = array(
	objDoc1,
		/*
		title =
			'title 1'
		description =
			'description 1'
		*/
	objDoc2,
		/*
		title =
			'title 1'
		description =
			'description 2'
		*/
	objDoc3
		/*
		title =
			'title 3'
		description =
			'description 1'
		*/
	//...
);

$arrayOfObjDocs = ExcludeSimilarDocs::exclude($arrayOfObjDocs);
debug($arrayOfObjDocs);
/*
	array(
		objDoc1 // document with 'title 1' or 'description 1' we already have
		//...
	);
*/

-----------------
(type - shingles)

// array of objects documents with fields title/description (default)
$arrayOfObjDocs = array(
	objDoc1,
		/*
		title =
			'Hong Kong Security Chief Says 6 Police Seen on Video Beating Protester Have Been Reassigned'
		description =
			'Hong Kong security chief says 6 police seen on video beating protester have been reassigned'
		*/

	objDoc2,
		/*
		title =
			'Hong Kong police seen beating activist reassigned'
		description =
			'HONG KONG (AP) — Hong Kong’s security chief says some police officers who were captured on video kicking a democracy protester during an operation to clear demonstrators from a tunnel have been reassigned. Secretary for Security Lai Tung-kwok said Wednesday that the officers were moved to other posts and that the police department is carrying out an investigation. (MORE: Violence flares in Hong Kong as protests continue) Local television channel TVB showed footage of around six plainclothes police officers taking a man around the side of a building, placing him on the ground and...'
		*/

	objDoc3
		/*
		title =
			'Violence flares in Hong Kong as protests continue'
		description =
			'Police officers push protesters out to a nearby park to clear the main roads outside government headquarters in Hong Kong’s Admiralty, Wednesday. Pic: AP. Violence flared again in Hong Kong last night as police clashed with protesters. Police are reported to have beaten pro-democracy protesters as they attempted to clear the streets after more than two weeks of rallies. Tuesday night’s clashes followed a tense two days on Hong Kong’s streets. Events have been so fast that even reporting has proven a challenge. Some barricades have been removed, others built. A major road...'
		*/
	//...
);

$arrayOfObjDocs = ExcludeSimilarDocs::exclude($arrayOfObjDocs, array('type' => 'shingles'));
debug($arrayOfObjDocs);
/*
	array(
		objDoc2,
		objDoc3
		//...
	);
*/

```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity64

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~8 days

Recently: every ~16 days

Total

9

Last Release

4199d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7b6c893293921e12292d6356d4d59fd7ea2144f59f9038b8bd4e439e0a5a4d26?d=identicon)[samokspv](/maintainers/samokspv)

### Embed Badge

![Health badge](/badges/samokspv-exclude-similar-docs/health.svg)

```
[![Health](https://phpackages.com/badges/samokspv-exclude-similar-docs/health.svg)](https://phpackages.com/packages/samokspv-exclude-similar-docs)
```

###  Alternatives

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)[mediawiki/maps

Adds various mapping features to MediaWiki

84152.3k3](/packages/mediawiki-maps)[starcitizentools/citizen-skin

A beautiful, usable, responsive MediaWiki skin with in-depth extension support. Originally developed for the Star Citizen Wiki.

3376.6k](/packages/starcitizentools-citizen-skin)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

19251.4k3](/packages/civicrm-civicrm-drupal-8)[altis/core

Core module for Altis

19228.0k3](/packages/altis-core)[pfefferle/wordpress-activitypub

The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.

5721.7k3](/packages/pfefferle-wordpress-activitypub)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
