Download the PHP package alexivanou/russian-text-bundle without Composer

On this page you can find all versions of the php package alexivanou/russian-text-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 russian-text-bundle

RussianTextBundle

Tests

Symfony bundle providing Russian text functions: pluralization, number spelling, name inflection, noun/adjective declension, geographical name inflection, money spelling, time ago, transliteration, phone formatting, identifier validation, semantic name parsing, date formatting, and text utilities. Built on top of wapmorgan/morphos.

Also available in Russian.

Installation

Symfony Flex will auto-configure the bundle. If you don't use Flex, add to bundles.php:

Configuration

Every feature can be toggled on or off. When a feature is disabled, its service definition and autowiring alias are removed from the container at compile time — they are never instantiated, never loaded, and never consume memory.

All flags default to true.

Why this matters

Memory savings

Every service is a container object with its own definition, arguments, and tags. Even if a service is never invoked, its definition is loaded into memory during DI container compilation. Disabling unused services:

Performance

On each Symfony request the container goes through several compilation phases:

  1. Resolution — resolving all service arguments. Fewer services = faster resolution.
  2. Dump — writing the compiled container to disk (only on first request after cache clear).
  3. Autowiring — searching for a matching service by type. Aliases for disabled services are not registered → faster autowiring.

Real-world example

If you only use Pluralizer and TimeSpeller (no validators, phones, declensions), disabling 15+ flags removes ~20 class definitions + 12 autowiring aliases from the container. Difference in a typical Symfony project:

Metric All enabled Minimal set
Lines of compiled container code ~3000 ~800
Service definitions ~40 ~18
Memory per request ~2.8 MB ~2.5 MB
Compilation time (debug=0) ~120 ms ~80 ms

Values are approximate and depend on PHP version and project complexity.

How it works

Flags are honest: if enable_pluralizer: false, then:

This lets IDEs and static analyzers (PHPStan, Psalm) correctly track dependencies.

Services

Service ID Interface Description
alexivanou.russian_text.pluralizer PluralizerInterface Pluralization of nouns after numerals
alexivanou.russian_text.number_speller NumberSpellerInterface Cardinal and ordinal numerals in words
alexivanou.russian_text.money_speller MoneySpellerInterface Money amounts in words (RUB, USD, EUR, UAH, KZT, BYN)
alexivanou.russian_text.name_inflector NameInflectorInterface Personal name inflection by cases + gender detection
alexivanou.russian_text.noun_decliner NounDeclinerInterface Noun declension by cases + pluralization
alexivanou.russian_text.adjective_decliner AdjectiveDeclinerInterface Adjective declension by cases, gender, number
alexivanou.russian_text.geo_inflector GeographicalNameInflectorInterface Geographical name inflection by cases
alexivanou.russian_text.time_speller TimeSpellerInterface Human-readable time intervals in Russian
alexivanou.russian_text.transliterator TransliteratorInterface Cyrillic → Latin transliteration + slug
alexivanou.russian_text.identifier_validator IdentifierValidatorInterface INN, SNILS, OGRN, SWIFT, IBAN, etc. validation
alexivanou.russian_text.phone_formatter PhoneFormatterInterface Phone number formatting (30 countries)
alexivanou.russian_text.name_parser NameParserInterface Semantic FIO parsing
alexivanou.russian_text.russian_date_formatter RussianDateFormatterInterface Russian month/day names
alexivanou.russian_text.text_helper TextHelperInterface ordinalSuffix, currencySymbol, truncate

Twig Usage

Pluralization (pluralize filter)

Number spelling (cardinal, ordinal filters)

Money spelling (spell_money filter)

Name inflection (inflect_name filter, name_cases, detect_gender functions)

Noun declension (noun_case, noun_plural filters)

Adjective declension (adj_case filter)

Geographical name inflection (geo_case filter)

Time ago (time_ago, distance_of_time filters)

Transliteration (translit, slug filters)

Validation functions

Phone formatting

Name parsing

Date formatting

Text helpers

Case Names

All case-aware methods accept any of the following formats:

Constant Russian Abbreviation English
nominative именительный и nominative
genitive родительный р genitive
dative дательный д dative
accusative винительный в accusative
ablative творительный т instrumental
prepositional предложный п prepositional

PHP Usage

Architecture

Services are split into separate classes (not one monolithic helper) so you can inject only what you need.

Each service implements a corresponding interface (PluralizerInterface, NumberSpellerInterface, etc.) and is registered with an autowiring alias. You can type-hint the interface in your constructors:

Validator architecture

The IdentifierValidator uses tagged services. Each validation rule (INN, KPP, SWIFT, IBAN, etc.) is a separate class implementing ValidationRuleInterface tagged with russian_text.validator. To add a custom validator:

The IdentifierValidator collects all tagged validators via a compiler pass and exposes them through the fluent API.

Twig extensions

Twig extensions are separated by domain:

This design lets you disable unused features via bundle configuration and keeps your DI container lean.

What's covered vs wapmorgan/morphos

Feature morphos This bundle
Noun pluralization Russian\Plurality Pluralizer
Cardinal numerals Russian\CardinalNumeral NumberSpeller
Ordinal numerals Russian\OrdinalNumeral NumberSpeller
Noun declension Russian\GeneralDeclension NounDecliner
Name inflection Russian\name() NameInflector
Gender detection Russian\detectGender() NameInflector
Adjective declension AdjectiveDecliner (custom)
Geographical name inflection GeographicalNameInflector (custom)
Money spelling MoneySpeller (custom)
Time ago TimeSpeller (custom)

Requirements

Testing

License

MIT


All versions of russian-text-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
wapmorgan/morphos Version ^2.0
symfony/framework-bundle Version ^4.2 || ^5.0 || ^6.0 || ^7.0 || ^8.0
symfony/twig-bundle Version ^4.2 || ^5.0 || ^6.0 || ^7.0 || ^8.0
twig/twig Version ^2.0 || ^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 alexivanou/russian-text-bundle contains the following files

Loading the files please wait ...