Skip to content

KavajNaruj/prepositioner

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prepositioner

PHP Prepositioner for replacing prepositions with   after preposition

Build Status Code Climate Coverage Status Dependency Status

Latest Stable Version Latest Unstable Version License

SensioLabsInsight

Instalation

Install package via composer:

$ composer require tomaj/prepositioner

Usage

Simple usage without Factory is very simple:

$prepositioner = new Tomaj\Prepositioner\Prepositioner(array('one', 'two'));
$prepositioner->formatText($inputText);

This example replaces all occurences of 'one' or 'two' strings in $inputText as 'one ' and 'two '.

For using with Factory which contains language support try:

$prepositioner = Tomaj\Prepositioner\Factory::build('slovak')
$prepositioner->formatText($inputText);

Extending

For new language support you need to implement new language class which implements LanguageInterface with prepositions. See SlovakLanguage for details.

Known issue

  1. each new language has to be in Tomaj\Prepositioner namespace

About

PHP Prepositioner for replacing prepositions with   after preposition

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 98.0%
  • Makefile 2.0%