huehue/pgn-parser
最新稳定版本:0.7.0
Composer 安装命令:
composer require huehue/pgn-parser
包简介
Parse PGN files
README 文档
README
A PHP library for parsing Portable Game Notation (PGN) files. This library is designed to extract chess game metadata and moves from PGN strings. It validates move syntax, including support for move annotations.
Features
- PGN Parsing: Parses PGN formatted strings.
- Tag Extraction: Extracts tag pairs (e.g.,
[Event "Chess Game"],[Site "Home"]). - Move Parsing: Parses chess moves, including SAN notation.
- Move Validation: Validates move syntax, including:
- Basic piece moves (e.g., Ne5, Ra1, Qf3)
- Piece captures (e.g., Qxe7, Rxf5)
- Pawn moves (e.g., e4, d5)
- Pawn captures (e.g., exd5, bxa6)
- Pawn promotions (e.g., e8=Q, d8=N+)
- Castling (
O-O,O-O-O) - Disambiguation (e.g., Rae1, Nfd2)
- Move annotations/evaluation symbols (+, #, !, ?, !!, ??, !?, ?!)
Installation
The preferred method of installation is via Composer:
composer require huehue/pgn-parser
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-05-09