oblak/vocative
最新稳定版本:v1.0.1
Composer 安装命令:
composer require oblak/vocative
包简介
Transforms Serbian names from nominative case to vocative case
README 文档
README
Vocative 🗣️
Vocative inflector for Serbian names
This library allows you to effortlessly convert Serbian personal names to their correct vocative form.
Key Features
- Peer-reviewed - The library has been tested with almost all Serbian names, and reviewed by a team of linguists.
- Easy to use - The library is designed to be simple and intuitive, making it easy for developers of all skill levels to integrate into their projects.
- Lightweight - The library is small and efficient, ensuring that it won't slow down your application.
Installation
You can install the library via Composer:
composer require oblak/vocative
Usage
Below is a simple example of how to use the library:
Basic Usage
<?php use Oblak\Vocative\Vocative; $firstName = 'Avram'; $vocative = new Vocative(); echo $vocative->make($firstName); // Outputs: Avrame
With custom dictionary
Vocative class depends on an exception dictionary to handle special cases. By default it uses the built-in BaseDictionary class, but you can use your own by implementing the Dictionary interface.
Tip
We provide a NullDictionary class that does not use any exceptions. This is useful for testing purposes.
<?php use Oblak\Vocative\Vocative; use Oblak\Vocative\NullDictionary; $firstName = 'Aleksandar'; $vocative = new Vocative(); echo $vocative->make($firstName); // Outputs: Aleksandre echo $vocative->withDictionary(new NullDictionary())->make($firstName); // Outputs: Aleksandare
Special thanks
As someone without deep expertise in Serbian linguistics, I am deeply grateful to the following individuals—without their guidance and support, this project could never have been completed:
- Svetlana Slijepčević Bjelivuk, PhD - For providing invaluable insights into intricacies of declination and conjugation of Serbian nouns and names and reviewing the data set.
- Nemanja Avramović - For his initial implementation of the
VokativLibrary - Milana Bašić - For taking the time to gather and provide a list of Serbian names, both male and female.
统计信息
- 总下载量: 124
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-26