Download the PHP package daikazu/gibberish-name-detector without Composer

On this page you can find all versions of the php package daikazu/gibberish-name-detector. 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 gibberish-name-detector

Gibberish Name Detector

Latest Version on Packagist Tests Code Style Total Downloads

A pure-PHP gibberish / random-string detector for Laravel name fields. It returns a calibrated probability that a short string is mashed or random input (asdfgh, qwerty, xkjqwz) rather than a real name, using a logistic-regression classifier over engineered features (n-gram scores + structural signals), with an optional Bloom-filter name gazetteer that whitelists known real names.

The output is a probability in [0, 1], not a hard truth. Use it to fail validation, soft-warn ("Did you type your name correctly?"), or flag a submission for review.

How it works

Inference is pure PHP — n-gram table lookups, a dot product through a sigmoid, and a Bloom membership test. There is *no ML runtime, no FFI, no `ext-requirement, and no network call** on the inference path. The trained model and gazetteer ship as committed PHP array files underresources/data/(opcache-friendly; neverjson_decode`d).

analyze() runs a short-circuit ladder:

  1. Normalize — lowercase; letters = [a-z]; tokens = split on non-letters (so Mary-Jane, O'Brien, Van Berg score per token).
  2. Length gate — too short → not gibberish (reason: too_short).
  3. Gazetteer — every token is a known name → not gibberish (reason: gazetteer).
  4. Fast pre-reject — extreme junk (long repeats, keyboard walks, no vowels) → gibberish (reason: heuristic).
  5. Classifier — logistic regression → probability; gibberish = p >= threshold (reason: model).

Requirements

Installation

No datasets to download. The trained model and gazetteer ship committed with the package under resources/data/. The external name lists referenced in Regenerating the artifacts are only needed if you want to retrain from scratch.

The service provider and Gibberish facade are auto-discovered. Publish the config to tune the threshold or messaging:

Usage

Facade

Validation

Rule object:

String rule:

Both resolve the configured singleton when given no overrides.

Configuration

config/gibberish.php:

Key Env Default Meaning
threshold GIBBERISH_THRESHOLD null Probability cutoff. null → the model's calibrated threshold.
min_length GIBBERISH_MIN_LENGTH 3 Below this letter count, never flagged.
gazetteer GIBBERISH_GAZETTEER true Enable the known-name whitelist.
message — … Validation failure message (:attribute supported).

Threshold note. The shipped model carries its own calibrated threshold (~0.46, chosen by Youden's J). Leaving threshold null uses it — this is what keeps recall ≥ 90% out of the box. Set GIBBERISH_THRESHOLD to a fixed value to override (e.g. raise it for fewer false positives when hard-failing validation).

The gibberish:check command

Inspect a single value (debug / manual QA):

Caveats

Regenerating the artifacts

Both artifacts are committed and reproducible from scratch with a fixed seed.

Corpora

The source name lists are third-party data — git-ignored, not redistributed. See resources/corpora/SOURCES.md for the exact sources and licenses (MIT and The Unlicense). Fetch them into resources/corpora/:

Model (resources/data/model.php)

Negatives are synthesized (uniform-random, keyboard walks, letter-shuffled real names), classes balanced, features standardized, logistic regression fit with L2, and the threshold calibrated by Youden's J (or --target-fpr=). The calibration test asserts the held-out FPR ≤ 8% and recall ≥ 90%.

Gazetteer (resources/data/gazetteer.php)

Add multi-locale lists so non-Anglo names are whitelisted — this is the lever that fixes false positives. A curated supplement ships in resources/names/multilocale.txt.

Regenerating model.php / gazetteer.php is a deliberate, reviewed commit — note the corpus and command in the commit body.

Testing

License

The MIT License (MIT). See LICENSE.


All versions of gibberish-name-detector with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^12.0 || ^13.0
illuminate/support Version ^12.0 || ^13.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 daikazu/gibberish-name-detector contains the following files

Loading the files please wait ...