petehouston/nhieu-php

The pluralization for Vietnamese words

1.0.0 2016-06-07 04:46 UTC

This package is auto-updated.

Last update: 2024-03-27 21:16:11 UTC


README

Latest Version on Packagist Build Status Software License

A very simple helper library for pluralizing Vietnamese.

Installation

Via Composer:

$ composer require petehouston/nhieu-php

Usage

Make sure to include the autoload.php:

require 'vendor/autoload.php';

Just call a simple function nhieu($word, $count = 11):

nhieu("xe", 0); // không xe

nhieu("ô tô", 2); // hai ô tô

nhieu("cái bánh", 8); // tám cái bánh

nhieu("người"); // nhiều người

nhieu("lập trình viên", -100); // không lập trình viên

License

The MIT License (MIT). Please see License File for more information.