Download the PHP package bitandblack/hyphenizer-bundle without Composer

On this page you can find all versions of the php package bitandblack/hyphenizer-bundle. 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 hyphenizer-bundle

PHP from Packagist Latest Stable Version Total Downloads License

Bit&Black Logo

Bit&Black Hyphenizer Bundle

Perfect hyphenation for your Website. This library integrates the Hyphenizer into your Symfony project.

If you don't run your website with Symfony, you can integrate the Hyphenizer SDK for PHP by your own.

Please note: The Hyphenizer API requires you to have a valid API token.

Installation

This library is made for the use with Composer. Add it to your project by running $ composer require bitandblack/hyphenizer-bundle.

Usage

Basic setup and usage of the Bit&Black Hyphenizer Bundle

The Bit&Black Hyphenizer bundle offers a smooth way to extract and hyphenate long words automatically. It implements the Hyphenizer SDK for PHP and allows to update the extracted words.

To use this library in your project, wrap your texts with the AutoHyphenation class. This will add soft hyphens to all words, that are long enough to be hyphenated:

It's also possible to hyphenate using a Twig filter:

Inside, the class extracts all words having more than 12 characters, and searches for a previously defined hyphenation. You can change this value when initialising the class.

The hyphenations themselves are stored inside a JSON file using a pipe, for example

whereas the pipe is getting replaced afterwards by the defined hyphenation character. This is a soft hyphen per default. You can change the hyphenation character when initialising the class.

The JSON file is getting stored under /hyphenation/words-hyphenated.json.

The list of extracted words will grow over time. You can add hyphenations by yourself, by modifying the JSON file, but it's also possibly to do this via script:

This is the manual approach. The approach that you’ll really enjoy is:

Using the Hyphenation API for automatic hyphenation

This library provides a command, to contact the Hyphenation API and ask for validated hyphenations:

The response will contain more information about every hyphenated word, for example a score and if the hyphenation has been approved. The response will also be stored in the words-hyphenated.json file.

Extracting words manually

If you don't want to wait, until your hyphenation list contains all words from your project, you can manually scan your files and extract the words from there:

Using the hyphenations with JavaScript

If you want to use the hyphenations in JavaScript, you can use the Hyphenation library written in JavaScript to do that. In this case, you need to import your words-hyphenated.json before initialising the class:

Help

If you have any questions, feel free to contact us under [email protected].

Further information about Bit&Black can be found under www.bitandblack.com.


All versions of hyphenizer-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
bitandblack/hyphenizer-sdk-php Version ^0
kiwa/hyphenizer Version ^1.0
nyholm/psr7 Version ^1.0
symfony/console Version ^7.0 || ^8.0
symfony/framework-bundle Version ^7.0 || ^8.0
symfony/http-client Version ^7.0 || ^8.0
twig/twig Version ^3.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 bitandblack/hyphenizer-bundle contains the following files

Loading the files please wait ...