Download the PHP package zachleigh/pronounce-php without Composer

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

Pronounce-PHP

Build Status

-Converts words to pronunciation strings using the Carnegie Mellon University Pronouncing Dictionary (CMUdict) file. Currently converts to the International Phonetic Alphabet (IPA) and to an easier to read spelling approximation.
-Hyphenates English words. Hyphenation for IPA and spelling approximation hopefully coming soon. -Outputs to the console, to a file, or to a database

Contents

Installation
Usage

Installation

Requirements
PHP 5.3.9 or higher

Linux users can find PHP releases in their distribution repositories. For other operating systems, please visit the php installation guide for instructions.

composer

Check the composer documentation for installation instructions.

Install

If requirements are met, you can install the package in two ways.

Download

Recommended. Download here and run

Through composer

If you install through composer, the program will be in vendor/zachleigh/pronounce-php

Usage

General syntax overview

Commands

all

Output the entire CMUdict file with arpabet, hyphenation, IPA, and spelling approximation strings to either a file or a database. Default is to write to a file called 'output.txt'.

Syntax overview
Options
--destination [-d]

Set the output destination. Default is to output to a file called 'output.txt'. If file is selected (default), fields will be seperated by a forward slash (/) surrounded by spaces.
Available desitinations: [file, database]

--fields [-f]

Set the output fields to be displayed. Fields must be in a comma seperated list. All fields are enabled by default.
Available fields: [word, hyphenated_word, arpabet, ipa, spelling]

--file [-o]

If 'file' is selected for the output destination, the 'file' option can be used to set a file name to write to. The default file name is 'output.txt' and is written to the pronounce-php directory.

--multiple [-m]

For some words in the CMUdict file, there are multiple pronunciation entries. The file deals with these by appending a number in parentheses to each additional entry.

The 'multiple' command sets the behavior to deal with thses multiple entries for the output. By default, 'multiple' is set to 'none', which outputs entries exactly as they appear in the CMUdict file. 'repeat' outputs entries without the parentheses or numbers.

--symbol [-s]

Set the character to be used for hyphenation. The default value is a hyphen (-). Note: if writing to a file, keep in mind that items in the file will be divided by forward slashes(/) so setting the hyphenation symbol to forward slash will complicate reading of the file.

Examples

Basic usage

Set desired output fields with the 'fields' option.

Change the symbol used to divide the hyphenated word with the 'symbol' option.

Set the ouput destination with the 'destination' option. Only one destination may be choosen. If 'destination' is set to 'file' (the default value), use the 'file' option to specify a file to write to.

If 'destination' is set to 'database', database credentials will be read from .env and configuration will be read from config.php.

hyphenate

Hyphenate a word or words. Note that this function is mostly accurate, but there may be some errors. If you find an error, please report it so I can add the word to the exception list.

Syntax overview
Options
--destination [-d]

Set the output destination. Default is to output a table to the console. If file is selected, fields will be seperated by a forward slash (/) surrounded by spaces.
Available desitinations: [table, string, file, database]

--file [-o]

If 'file' is selected for the output destination, the 'file' option can be used to set a file name to write to. The default file name is 'output.txt' and is written to the pronounce-php directory.

--symbol [-s]

Set the character to be used for hyphenation. The default value is a hyphen (-). Note: if writing to a file, keep in mind that items in the file will be divided by forward slashes(/) so setting the hyphenation symbol to forward slash will complicate reading of the file.

Examples

Basic usage

A comma seperated list of words may also be given.

Change the symbol used to divide word with the 'symbol' option.

Set the ouput destination with the 'destination' option. Only one destination may be choosen. Setting 'destination' to 'string' produces a string instead of a table.

Setting 'destination' to 'file' writes the output to a file. The default file is 'output.txt'.

ouput.txt

If 'destination' is set to 'file', use the 'file' option to specify a file to write to.

hyphen.txt

If 'destination' is set to 'database', database credentials will be read from .env and configuration will be read from config.php.

lookup

Look up a word and output the Arpabet, IPA and Spelling approximation pronunciation strings. The lookup command takes one argument: the word or words to be looked up.

Syntax overview
Options
--destination [-d]

Set the output destination. Default is to output a table to the console. If 'file' is selected, fields will be seperated by a forward slash (/) surrounded by spaces.
Available desitinations: [table, string, file, database]

--fields [-f]

Set the output fields to be displayed. Fields must be in a comma seperated list. All fields are enabled by default.
Available fields: [word, arpabet, ipa, spelling]

--file [-o]

If 'file' is selected for the output destination, the 'file' option can be used to set a file name to write to. The default file name is 'output.txt' and is written to the pronounce-php directory.

--hyphenate [-y]

If the 'hyphenate' flag is given, applicable fields will be hyphenated. Currently, only the 'word' field may be hyphenated.

--multiple [-m]

For some words in the CMUdict file, there are multiple pronunciation entries. The file deals with these by appending a number in parentheses to each additional entry.

The 'multiple' command sets the behavior to deal with thses multiple entries for the output. By default, 'multiple' is set to 'none', which outputs entries exactly as they appear in the CMUdict file. 'repeat' outputs entries without the parentheses or numbers.

--symbol [-s]

Set the character to be used for hyphenation. The default value is a hyphen (-). Note: if writing to a file, keep in mind that items in the file will be divided by forward slashes(/) so setting the hyphenation symbol to forward slash will complicate reading of the file.

Examples

Basic usage

A comma seperated list of words may also be given. Note that words will be returned in alphabetical order.

Using the 'hyphenate' flag hyphenates the 'word' field.

Use the 'symbol' option to set the character used for hyphenation.

Set desired output fields with the 'fields' option. Fields will be displayed in the order given.

Set the ouput destination with the 'destination' option. Only one destination may be choosen.
Setting 'destination' to 'string' produces a string instead of a table.

Setting 'destination' to 'file' writes the output to a file. The default file is 'output.txt'.

ouput.txt

If 'destination' is set to 'file', use the 'file' option to specify a file to write to.

words.txt

If 'destination' is set to 'database', database credentials will be read from .env and configuration will be read from config.php.

Database Usage

Requirements

If you wish to fill a database with the information gained from using this program, you must be sure that your database meets the following requirements:

Use the 'field' option to set which fields you wish to insert into your database.

Setup

First, copy the .env.example file (found in the pronounce-php root folder) to a new file called .env. Open the .env file in a text editor and enter applicable database information.

Next, open config.php in a text-editor. In the 'database' field, enter in the database type you are using. Currently, only Mysql is supported (see below for information about other database types). If you wish, you can change the charset in the 'connections' field, but the default 'utf8' should satisfy most people. That should be all you have to do. The other information in the file is pulled in from the .env file you setup in the previous step.

Other database types

The database connection uses php PDO drivers that can be changed out fairly easily. Currently, PDO supports 12 database types. Check the driver list for more information. If you wish to make an adapter for one of these database types, adapter name rules must be followed.

The adapter class should be in its own file in src/Database/Databases/ and must implement DatabaseInterface. If you make a new adapter, please let me know so I can include it in the main program. If you dont know how to write a new adapter, let me know and Ill do it if time permits.

Besides making an adapter, you will also have to make a new array for the database in 'connections' in config.php.


All versions of pronounce-php with dependencies

PHP Build Version
Package Version
Requires symfony/console Version ~2.0
symfony/filesystem Version ~2.0
phpunit/phpunit Version ~4.0
vlucas/phpdotenv Version ^2.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 zachleigh/pronounce-php contains the following files

Loading the files please wait ....