Skip to main content

Crate ferrichess_study

Crate ferrichess_study 

Source
Expand description

Convert compact chess study text into validated move trees and deterministic PGN.

The normal conversion path is convert_single_raw followed by PgnWriter::render:

use ferrichess_study::{
    convert_single_raw, PgnWriter, RepertoireRole, RepertoireSide,
    SingleRawMetadata,
};

let metadata = SingleRawMetadata {
    course_title: "Example study".to_owned(),
    event: "Open games".to_owned(),
    chapter_slug: "open-games".to_owned(),
    index: "001".to_owned(),
    repertoire_side: RepertoireSide::White,
    repertoire_role: RepertoireRole::Main,
};

let document = convert_single_raw("1. e4e52. Nf3Nc6", &metadata)?;
let pgn = PgnWriter::render(&document)?;
assert!(pgn.contains("1. e4 e5 2. Nf3 Nc6 *"));

See the crate README for the compact input format, conversion model, and pre-1.0 compatibility policy.

Re-exports§

pub use course::ChapterMetadata;
pub use course::CourseDocumentError;
pub use course::CourseDocuments;
pub use course::CourseInfo;
pub use course::CourseKind;
pub use course::CourseMetadata;
pub use course::CurriculumClassification;
pub use course::DocumentMerge;
pub use course::LichessChapter;
pub use course::LichessMetadata;
pub use course::MetadataError;
pub use course::NamedDocument;
pub use course::RawCourseLine;
pub use course::RepertoireSettings;
pub use course::SourceAttribution;
pub use course::generate_course_documents;
pub use diagnostics::canonical_tree_json;
pub use diagnostics::parser_trace_json;
pub use domain::Annotation;
pub use domain::DepthLimit;
pub use domain::PositionKey;
pub use domain::RepertoireRole;
pub use domain::RepertoireSide;
pub use domain::SourceId;
pub use pgn::Header;
pub use pgn::Headers;
pub use pgn::PgnDocument;
pub use pgn::PgnError;
pub use pgn::PgnWriter;
pub use pgn::SingleRawMetadata;
pub use pgn::convert_single_raw;
pub use raw::EmbeddedMove;
pub use raw::ParsedMove;
pub use raw::RawLineParse;
pub use raw::RawParser;
pub use raw::SourceSpan;
pub use tree::BuiltRawTree;
pub use tree::ClassifiedRawLine;
pub use tree::CommentFragment;
pub use tree::CommentReason;
pub use tree::CommentVariationDecision;
pub use tree::MergeConflict;
pub use tree::MergeError;
pub use tree::MergeReport;
pub use tree::MoveTree;
pub use tree::MoveTreeMerger;
pub use tree::Node;
pub use tree::NodeId;
pub use tree::RawLineRecord;
pub use tree::RawTreeBuilder;
pub use tree::TreeError;

Modules§

course
Versioned course metadata, validation, and filesystem-independent assembly.
diagnostics
Stable JSON diagnostics for differential compatibility checks.
domain
pgn
PGN document construction and deterministic rendering.
raw
tree