Download the PHP package reinerttomas/czech-vocative without Composer

On this page you can find all versions of the php package reinerttomas/czech-vocative. 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 czech-vocative

Czech Vocative

Converts Czech names from nominative (1st case) to vocative (5th case) so you can address people properly — and detects gender from a name along the way.

Installation

Requires PHP 8.2+ with ext-mbstring. No runtime dependencies.

Usage

CzechName::of() validates and normalizes the input (trims it, converts to title case) and throws InvalidNameException for an empty string or a name ending with a non-letter.

Gender and first-name/surname detection is automatic, but you can pass explicit hints (the surname hint only affects female names — female surnames stay unchanged in vocative):

Full names ("Petr Novák") are intentionally not supported — split the name yourself and inflect the parts, since deciding what is a surname is ambiguous.

How it works

The library matches the name's suffix against rule tables (longest suffix wins) and replaces it with the vocative ending. Male names are inflected via ~350 suffix rules, female first names change a trailing -a to -o, female surnames stay unchanged. Gender detection uses ~700 suffix rules with a claimed accuracy of 99.7 %.

This library is inspired by granam/czech-vocative, a PHP port of the same algorithm. It is a fresh implementation with a modern API and takes its data directly from the original source instead.

The rule tables come from the Python library Mimino666/vokativ (MIT license) and are derived from Czech Statistical Office name frequency statistics. They are committed to this repository as plain PHP arrays; bin/import-data.sh regenerates them (requires python3 and curl). The upstream test data is imported too — the test suite verifies parity with the original on all 400 fixture names.

Development

License

MIT. Data and algorithm adapted from Mimino666/vokativ by Michal Mimino Danilak (MIT).


All versions of czech-vocative with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-mbstring Version *
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 reinerttomas/czech-vocative contains the following files

Loading the files please wait ...