Skip to content

Commit

Permalink
naming: ready shiratsu-naming for publish
Browse files Browse the repository at this point in the history
  • Loading branch information
chyyran committed Mar 28, 2021
1 parent 25f2c85 commit 84c123e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 24 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 調ツー shiratsu
# 調ツー • shiratsū

Second-generation aggregator for [shiragame 2.0](https://github.com/SnowflakePowered/shiragame) databases.

Expand Down
23 changes: 3 additions & 20 deletions SPECIFICATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ The following changes to the schema do not incur an API breakage, and the PATCH

As of schema 2, releases of the shiragame database are versioned by the schema version of the released database, and the Unix timestamp of its generation, in the form `X.XXXXXX`. A release is also identified by its unique UUIDv4.

shiratsu's constituent libraries (such as `shiratsu-naming`) MAY be versioned independently of this specification, however the `shiratsu` crate MUST BE versioned according to this specification.

### Relationship of shiratsu version to shiragame version
Each MAJOR.MINOR version of the shiratsu application MUST generate a shiragame database with the same MAJOR.MINOR schema version. Effectively, this means that shiragame schema versions are tied to the shiratsu implementation. In the case where this document and shiratsu differ, it should be considered a bug in the specification.

Expand Down Expand Up @@ -198,26 +200,7 @@ The name given to a *game entry* by a *cataloguing organization*, following a *n
* **cataloguing organization**
A group that maintains databases of *game entries* and the *dump entries* belonging to the distribution thereof.
* **naming convention**
The method of assigning names to *game entries* followed by the *cataloguing organization* that catalogues such games. The shiragame schema does not restrict the naming convention of files. However, shiratsu knows only how to handle the following naming conventions.
* [The TOSEC Naming Convention (2015-03-23)](https://www.tosecdev.org/tosec-naming-convention), used by the TOSEC cataloguing organization, with the following "wobbly exceptions"
* `(demo)` MAY appear without a following space.
* Motivating example: `2600 Digital Clock - Demo 1 (demo)(1997-10-03)(Cracknell, Chris 'Crackers')(NTSC)(PD)`
* Upper cased `X` MAY be used as a placeholder in dates, e.g. `19XX`.
* Motivating example: `Defender Vector (19XX)(-)[h][Defender][b1]`
* The date tag SHALL NOT be mandatory, **if and only if** the title does **not** end with a closing parenthesis.
* Motivating example: `Motocross & Pole Position (Starsoft - JVP)(PAL)[b1][possible unknown mode]`
* If the title ends with a closing parenthesis, it MAY omit the preceding space before the date tag. In addition, if the space is omitted, the entire substring prior to the date tag MUST be taken as the title.
* Motivating example: `Bombsawa (Jumpman Selected levels)(19XX)(-)(PD)`, the title is taken as "Bombsawa (Jumpman Selected levels)"

Any of these "wobbly exceptions" MAY be removed without incurring a breaking change in the schema version. This will probably
happen as TOSEC cleans up these inconsistencies.
* [The Official No-Intro Convention (2007-10-30)](https://datomatic.no-intro.org/stuff/The%20Official%20No-Intro%20Convention%20(20071030).pdf), used by No-Intro and Redump cataloguing organizations, with the following amendments.
* A numbered tag matching the format `(z|[0-9])[0-9]{3} - ` is allowed before the title, and is not considered part of the title.
* Before the `[b]` Status flag, the flag (Disc X), where X is a number from 0-9 MAY appear.
* The (Version) flag MAY appear after the (Unl) License flag.
* A full list of regions is available in [`regions.rs`](https://github.com/SnowflakePowered/shiratsu/blob/5c2d03d62f8f65b55c58eb53e9e71999fa5eab45/src/shiratsu-lib/src/region.rs#L127)

These amendments are used by names given by Redump
The method of assigning names to *game entries* followed by the *cataloguing organization* that catalogues such games. The shiragame schema does not restrict the naming convention of files. shiratsu uses the [`shiratsu-naming`](https://github.com/SnowflakePowered/shiratsu/tree/master/shiratsu-naming) library to parse file names of known naming conventions.
* **dump**
Any file that is part of a *game distribution* that identifies such a file by its *dump entry*.
* **game distribution**
Expand Down
6 changes: 4 additions & 2 deletions shiratsu-naming/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ name = "shiratsu-naming"
version = "0.1.0"
authors = ["Ronny Chan <[email protected]>"]
edition = "2018"
repository = "https://github.com/SnowflakePowered/shiratsu"
repository = "https://github.com/SnowflakePowered/shiratsu/tree/master/shiratsu-naming"
license = "MIT"

categories = ["parser-implementations", "parsing", "emulators", "text-processing", "games"]
readme = "README.md"
description = "Zero-copy file name parser for No-Intro, TOSEC, and GoodTools named ROM files."
[dependencies]
# Statics
phf = { version = "0.8", features = ["macros"] }
Expand Down
14 changes: 14 additions & 0 deletions shiratsu-naming/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# shiratsu-naming

[![Latest Version](https://img.shields.io/crates/v/shiratsu-naming.svg)](https://crates.io/crates/shiratsu-naming) [![Docs](https://docs.rs/shiratsu-naming/badge.svg)](https://docs.rs/shiratsu-naming) ![License](https://img.shields.io/crates/l/shiratsu-naming)

`shiratsu-naming` is a parser for catalogued ROM file names that follow common naming conventions.
It provides a zero-copy tokenizing API for file names from the following supported naming conventions.

* [No-Intro](https://datomatic.no-intro.org/stuff/The%20Official%20No-Intro%20Convention%20(20071030).pdf)
* [TOSEC](https://www.tosecdev.org/tosec-naming-convention)
* [GoodTools](https://raw.githubusercontent.com/SnowflakePowered/shiratsu/25f2c858dc3a9373e27de3df559cd00931d8e55f/shiratsu-naming/src/naming/goodtools/GoodCodes.txt)

`shiratsu-naming` does not use regular expressions and is throughly tested against a large set of names to support a variety of edge cases for each supported naming convention.

See the [crate documentation](https://docs.rs/shiratsu-naming) for usage examples and more.
2 changes: 1 addition & 1 deletion shiratsu-naming/src/naming/goodtools/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Parsers for the GoodTools naming convention.
//!
//! Defined loosely by [GoodCodes.txt](https://raw.githubusercontent.com/SnowflakePowered/shiratsu/f5b668c44d9087204d0ec94b3002c643a5d82109/shiratsu-naming/src/naming/goodtools/GoodCodes.txt)
//! Defined loosely by [GoodCodes.txt](https://raw.githubusercontent.com/SnowflakePowered/shiratsu/25f2c858dc3a9373e27de3df559cd00931d8e55f/shiratsu-naming/src/naming/goodtools/GoodCodes.txt)
//! Also uses information from [Emulation GameTech Wiki](https://emulation.gametechwiki.com/index.php/GoodTools)
//!
//! Specifically guarantees support for the 2016-04-03 GoodTools release,
Expand Down

0 comments on commit 84c123e

Please sign in to comment.