tamtamchik / namecase

PHP package that converts names into the correct case where it is possible.
https://tamtamchika.net/namecase
MIT License
77 stars 7 forks source link

Postnominal exceptions #7

Closed arxeiss closed 4 years ago

arxeiss commented 4 years ago

I don't understand most of post nominals and their origin. But is it possible to add exceptions option to not use some of them?

Reason is in Czech and other Slavic languages "Most" can be valid surname - meaning bridge. It is very rare but there are some occasions. Would it be possible to add post nominal exceptions? I don't want to disable all of them.

Btw. some of them are duplicated like BSc or MR etc

tamtamchik commented 4 years ago

I'll add an option to define post-nominals exceptions in a couple of days. Thanks for the feedback!

tamtamchik commented 4 years ago

Released in 2.1.0

@arxeiss thank you for feedback and for waiting.

Example:

<?php

use Tamtamchik\NameCase\Formatter;

Formatter::excludePostNominals('MOst');
Formatter::nameCase('ČERNÝ MOST'); // => Černý Most