Crates.io | figure_skating_element_parser |
lib.rs | figure_skating_element_parser |
version | 0.1.0 |
source | src |
created_at | 2024-11-11 19:04:51.223539 |
updated_at | 2024-11-11 19:04:51.223539 |
description | A parser for recognizing and structuring figure skating elements according to ISU standards. |
homepage | |
repository | https://github.com/nxxtia/figure_skating_element_parser |
max_upload_size | |
id | 1444101 |
size | 28,185 |
This project is a parser for figure skating elements that complies with ISU (International Skating Union) standards. It automatically recognizes and classifies technical elements of figure skating, such as jumps, spins, and step sequences. The parser reads abbreviations used in the ISU judging system and converts them into a structured format suitable for analysis and use in various applications.
The parser is based on grammar rules that adhere to ISU standards. It can recognize and classify the following categories of figure skating elements:
Below is the formal grammar structure used by the parser to recognize each category of elements.
WHITESPACE = _{ " " | "\t" | "\n" }
DIGIT = { "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" }
LETTER = _{ ASCII_ALPHANUMERIC }
ALLOWED_SYMBOL = _{ LETTER | "-" | "_" }
elements = { element ~ (WHITESPACE+ ~ element)* }
element = { jump | spin | step_sequence | death_spiral | pair_spin | twizzle | choreographic_element }
jump = { ("1" | "2" | "3" | "4") ~ jump_type ~ throw_jump? }
jump_type = { "T" | "S" | "Lo" | "F" | "Lz" | "A" }
throw_jump = { "Th" }
spin = { (spin_position ~ "Sp") | flying_spin | flying_change_foot_spin }
spin_position = { "U" | "L" | "C" | "S" }
flying_spin = { "F" ~ spin_position ~ "Sp" }
flying_change_foot_spin = { "FC" ~ spin_position ~ "Sp" }
step_sequence = { "StSq" | "ChSq" }
death_spiral = { death_spiral_position ~ "Ds" }
death_spiral_position = { "Fi" | "Bi" | "Fo" | "Bo" }
pair_spin = { "PSp" | "PCoSp" }
twizzle = { "STw" }
choreographic_element = { "ChLi1" | "ChSp1" }
The parsing results can be used to create performance protocols for skaters, automate performance analysis, develop scoring systems, or serve as a basis for analytics and training programs.
The Makefile includes commands to simplify working with the project:
git clone [<repository URL>](https://github.com/nxxtia/figure_skating_element_parser)
cd figure_skating_element_parser
cargo build
cargo run -- "elements.txt"
make all