PHPackages                             denis-korolev/opencorpora - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. denis-korolev/opencorpora

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

denis-korolev/opencorpora
=========================

Library to serialize opencorpora export file data from xml to objects

v1.0.0(4y ago)03MITPHPPHP ^7.4

Since Jan 18Pushed 4y ago1 watchersCompare

[ Source](https://github.com/denis-korolev/opencorpora)[ Packagist](https://packagist.org/packages/denis-korolev/opencorpora)[ RSS](/packages/denis-korolev-opencorpora/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (7)Versions (2)Used By (0)

[![Test status on master](https://github.com/denis-korolev/opencorpora/workflows/Master%20status/badge.svg)](https://github.com/denis-korolev/opencorpora/workflows/Master%20status/badge.svg)

Library to serialize opencorpora export file data from xml to objects
---------------------------------------------------------------------

[](#library-to-serialize-opencorpora-export-file-data-from-xml-to-objects)

This library will help you read Opencorpora [export file](http://opencorpora.org/?page=export). In library we have 5 processors:

- GrammemeProcessor (reads only Grammeme node)
- LemmaProcessor (reads only Lemma node)
- LinksProcessor (reads only Links node)
- LinkTypeProcessor (reads only LinkType node)
- RestrictionProcessor (reads only Restr node)

Use this processors to extract xml data to simple DTO objects. XML file opens and reads by PHP library `XMLReader`and `SimpleXMLElement` node by node. That why it use not a lot of memory.

Installation / Usage
--------------------

[](#installation--usage)

Install the latest version via [composer](https://getcomposer.org/):

```
composer require denis-korolev/opencorpora
```

Here is an example of usage `GrammemeProcessor`. Other processors using exactly same.
-------------------------------------------------------------------------------------

[](#here-is-an-example-of-usage-grammemeprocessor-other-processors-using-exactly-same)

```
use JMS\Serializer\Naming\IdenticalPropertyNamingStrategy;
use JMS\Serializer\Naming\SerializedNameAnnotationStrategy;
use JMS\Serializer\SerializerBuilder;
use Opencorpora\Dictionary\Grammeme;
use Opencorpora\GrammemeProcessor;

 $serializer =  SerializerBuilder::create()->setPropertyNamingStrategy(
    new SerializedNameAnnotationStrategy(
        new IdenticalPropertyNamingStrategy()
    )
    )
    ->build();

// path to file
$fileName = $this->projectDir . DIRECTORY_SEPARATOR . 'var' . DIRECTORY_SEPARATOR . 'dict.opcorpora.xml';

$processor = new GrammemeProcessor($serializer);

foreach ($processor->getData($fileName) as $grammeme) {
    /**
     * @var $grammeme Grammeme
     */
    echo $grammeme->name;
    echo $grammeme->parent;
    echo $grammeme->description;
    echo $grammeme->alias;
}
```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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

1628d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c7be182b031a590a466a7e993ef5fe82737ea6c95d7210c5f857fa1cdba5ab0?d=identicon)[denis-korolev](/maintainers/denis-korolev)

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/denis-korolev-opencorpora/health.svg)

```
[![Health](https://phpackages.com/badges/denis-korolev-opencorpora/health.svg)](https://phpackages.com/packages/denis-korolev-opencorpora)
```

###  Alternatives

[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k251.7M11.6k](/packages/symfony-framework-bundle)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M204](/packages/sulu-sulu)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[psx/schema

Parse and generate data schema formats

57245.5k24](/packages/psx-schema)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M576](/packages/shopware-core)

PHPackages © 2026

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