PHPackages                             lsimul/tyop - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. lsimul/tyop

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lsimul/tyop
===========

Solves most of the typos found in the Czech phrases.

0.1.0(1y ago)27MITPHP

Since Aug 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/lSimul/tyop)[ Packagist](https://packagist.org/packages/lsimul/tyop)[ RSS](/packages/lsimul-tyop/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Tyop
====

[](#tyop)

Set of regular expressions trying to fix common mistakes in Czech like

- Multiple spaces,
- spaces on incorrect places (befora comma/fullstop, lack of space after comma/fullstop etc.),
- proper date format,
- currency formating,
- conversion from '-' to '–' where necessary,
- and some more small, but neat fixes.

Installation
------------

[](#installation)

```
composer require lsimul/tyop
```

Usage
-----

[](#usage)

```
use LSimul\Tyop;

$corrector = new Tyop\Corrector;

$text = 'Ale,ovšem ,tato věc , ta je od 2.12. za 300 ,- Kč .  '

$text = $corrector->normalize($text);
// Ale, ovšem, tato věc, ta je od 2.12. za 300,- Kč.

$text = $corrector->fix($text);
// Ale, ovšem, tato věc, ta je od 2. 12. za 300 Kč.
```

`Corrector` has two methods and the idea was to use them in the order *normalize -&gt; fix (-&gt; fixDomain)*

- `normalize(string $text): string` resolves some simple issues with spaces, like lack of them before bracket and so on.
- `fix(string $text): string` digs a little bit deeper and it is willing to format dates, currencies by removing/adding different chars than just a whitespace.

### Extending

[](#extending)

`Corrector` has two methods which allow one to extend its behaviour:

- `addRule(string $regex, string $replacement): self`
    - Adds new rule, basically it just validates *regex* and stores it.
- `fixDomain(string $text): string`
    - Uses all of the new rules on the text.

`fixDomain` is here to fix some issues which are specific for given text and it cannot be put into the main set of rules (for example aggressively turning *lt* into *l* because here it always means *liter*).

Fixing HTML
-----------

[](#fixing-html)

Next to `Corrector` there is also a `Bridge\Html`, which wraps `Corrector` and can work on `HTML`; trimming whitespaces on the end of the paragraph, removing newlines.

```

	Interval 3.3. - 8.3. 2024

	Interval 3. 3. – 8. 3. 2024

```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

650d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d2f2ec4b4527aa27877aee3c4785950a0657097841b59c4bc6aa5fa221562af1?d=identicon)[lSimul](/maintainers/lSimul)

---

Top Contributors

[![lSimul](https://avatars.githubusercontent.com/u/55706364?v=4)](https://github.com/lSimul "lSimul (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lsimul-tyop/health.svg)

```
[![Health](https://phpackages.com/badges/lsimul-tyop/health.svg)](https://phpackages.com/packages/lsimul-tyop)
```

###  Alternatives

[snapshotpl/zf-snap-geoip

MaxMind GeoIP Module for Zend Framework 2

1512.9k](/packages/snapshotpl-zf-snap-geoip)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
