PHPackages                             coooold/php\_clc\_parser - 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. coooold/php\_clc\_parser

ActiveLibrary

coooold/php\_clc\_parser
========================

解析中图分类号解析器，获得一二级中图分类号

v1.0.0(5y ago)451PHP

Since Oct 19Pushed 5y ago1 watchersCompare

[ Source](https://github.com/coooold/php_clc_parser)[ Packagist](https://packagist.org/packages/coooold/php_clc_parser)[ RSS](/packages/coooold-php-clc-parser/feed)WikiDiscussions main Synced 6d ago

READMEChangelogDependenciesVersions (2)Used By (0)

### 中图分类法解析器

[](#中图分类法解析器)

《中图分类法》是《中国图书馆分类法》的简称，是我国通用的类分图书的工具。根据图书资料的特点，按照从总到分，从一般到具体的编制原则，确定分类体系，在五个基本部类的基础上，组成二十二个大类。

《中图法》的标记符号采用汉语拼音字母与阿拉伯数字相结合的混合号码。即用一个字母表示一个大类，以字母的顺序反映大类的序列。字母后用数字表示大类以下类目的划分。数字的编号使用小数制。称为中图分类号。

中图分类号有较为复杂的规则体系，涉及到新分类的插入、展开、移除等，很难通过简单的正则表达式进行处理。使用该类可传入图书原始信息中的中图分类号，解析成一二三级中图分类，并获取对应名称与路径信息。

该库未对性能进行优化，不适合提供线上业务，仅适用于后台信息处理。

使用方法：

```
composer require coooold/php_clc_parser

```

```
// 解析中图分类号，并获取对应的三级分类数组。注意，可能有多个结果，例如
use \CLCParser\Parser;
Parser::parse('K825.2；E251-53');

/*
Array
(
    [K825.2] => Array
        (
            [0] => K
            [1] => K81
            [2] => K82
        )

    [E251-53] => Array
        (
            [0] => E
            [1] => E2
            [2] => E25
        )

)
*/
```

```
// 获取一二三级中图分类号对应的名称、路径信息
use \CLCParser\Parser;
Parser::getCLCInfoByCode('D92');

/*
Array
(
    [code] => D92
    [name] => 中国法律
    [path] => Array
        (
            [0] => D
            [1] => D9
            [2] => D92
        )

    [namePath] => Array
        (
            [0] => 政治、法律
            [1] => 法律
            [2] => 中国法律
        )

)
*/
```

综合使用案例：

```
$s =  $v) {
        echo "> $k :\n";
        $lastCode = array_pop($v);
        $info = Parser::getCLCInfoByCode($lastCode);
        print_r($info);
    }
}
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 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

2035d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6245836?v=4)[coooold](/maintainers/coooold)[@coooold](https://github.com/coooold)

---

Top Contributors

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

---

Tags

CLC

### Embed Badge

![Health badge](/badges/coooold-php-clc-parser/health.svg)

```
[![Health](https://phpackages.com/badges/coooold-php-clc-parser/health.svg)](https://phpackages.com/packages/coooold-php-clc-parser)
```

PHPackages © 2026

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