PHPackages                             dansrocks/text-search-helper - 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. [Search &amp; Filtering](/categories/search)
4. /
5. dansrocks/text-search-helper

ActiveLibrary[Search &amp; Filtering](/categories/search)

dansrocks/text-search-helper
============================

A search tool to search a list of needles into a spread text.

v0.1.1(6y ago)0472PHPPHP ^7.2

Since May 26Pushed 5y ago1 watchersCompare

[ Source](https://github.com/dansrocks/text-search-helper)[ Packagist](https://packagist.org/packages/dansrocks/text-search-helper)[ RSS](/packages/dansrocks-text-search-helper/feed)WikiDiscussions master Synced today

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

TextSearchHelper
================

[](#textsearchhelper)

A search tool to search a list of needles into a spread text.

```
    "php": "^7.2",

```

Available Classes
=================

[](#available-classes)

Interface: TextSearchInterface
------------------------------

[](#interface--textsearchinterface)

Interface for TextSearch class

**Methods:**

- Construct: Require a text to search in.
- ```
    __construct(string $text, ?int $min_length = null, ?float $max_freq = null);

    ```
- Returns true if the $needle is found into text
- ```
    search(Needle $needle) : bool;

    ```
- Get original text (dummy method)
- ```
    getText(): string;

    ```

Class: TextSearch
-----------------

[](#class--textsearch)

Main class

Class: Needle
-------------

[](#class-needle)

A wrapper class around a needle (string) to search into a text.

\#How to install

```
composer require dansrocks/text-search-helper

```

\#How to use

```
