<commit_before>Reviewers editions are a simple way to number editions of useful prose
projects, like policy statements or legal terms.

# Numbers

Each reviewers edition has up to four numbers.

1. An _edition_ number

2. An _update_ number

3. A _correction_ number

4. A _draft_ number

Every reviewers edition has an _edition_ number. The _edition_ number
and any other numbers must be whole numbers, one or greater, written
without any leading zeros.

These numbers increase over time for new published versions of a
project. Correction numbers restart at one for every new update, and
update numbers restart at one for every new edition.

# Meaning

How the authors of a project change edition numbers over time conveys
advice to users of older editions.

1. When authors recommend users review a new edition in its entirety to
   ensure it meets their needs, they increase the _edition_ number.

   For example, if a working group rewrites the second edition of a form
   privacy notice from scratch, they will release the rewrite as the
   third edition of the form.

2. When authors recommend users review at least the new or changed parts
   of a new edition, they increase the _update_ number.

   For example, if the working group adds a new paragraph to the third
   edition of its form privacy notice on location data, they will
   release the expanded policy as the third edition, first update. If
   they later rephrase a paragraph on genetic privacy, the will release
   the updated policy as the third edition, second update.

4. When authors make only typographic or other, minor corrections that
   users need not review, they increase the _correction_ number.

   For example, if the working group corrects a spelling error in the
   second edition, first update of their form, they will release the
   corrected form as second edition, first update, first correction. If
   they later catch and correct a typographical error, the resulting
   edition will be the second edition, first update, second correction.

Authors can also use reviewers editions to mark drafts of a new edition,
update, or correction editions to come.

For example, if the working group publishes two drafts of a second
update to the third edition, those drafts will be the fourth edition,
first draft and fourth edition, second draft.

# Exported Module

This npm package exports a single function that parses reviewers edition
short code strings, returning structured representations of their
components.

```javascript
var parse = require('reviewers-edition-parse')
```

# Examples

The following examples are also the test suite for the parser. The tests
use Node.js' built-in `assert` module.

```javascript
var assert = require('assert')
```

The simplest reviewers edition has only an edition number. This number
is written followed by the lower-case letter "u". So "second edition"
becomes `2e`:

```javascript
assert.deepStrictEqual(
  parse('2e'),
  { edition: 2 })
```

An _edition_ number cannot be zero, nor can it start with a zero.

```javascript
assert.equal(parse('0e'), false)
assert.equal(parse('01e'), false)
```

The fifth update to a second edition adds the number five followed by
the lower-case letter "u". So "second edition, fifth update" becomes
`2e5u`.

```javascript
assert.deepStrictEqual(
  parse('2e5u'),
  { edition: 2, update: 5 })
```

An _edition_ number cannot be zero, nor can it start with a zero.

```javascript
assert.equal(parse('2e0u'), false)
assert.equal(parse('2e01u'), false)
```

The seventh correction to that edition adds the number seven followed
by the lower-case letter "c". So "second edition, fifth update, seventh
correction" becomes `2e5u7c`.

```javascript
assert.deepStrictEqual(
  parse('2e5u7c'),
  { edition: 2, update: 5, correction: 7 })
```

An _correction_ number cannot be zero, nor can it start with a zero.

```javascript
assert.equal(parse('2e5u0c'), false)
assert.equal(parse('2e5u01c'), false)
```

An edition that has not been updated can also be corrected. So "third
edition, second correction" becomes `3e2c`.

```javascript
assert.deepStrictEqual(
  parse('3e2c'),
  { edition: 3, correction: 2 })
```

The first draft of a new fourth edition would use the reviewers edition
code for the fourth edition, followed by the number one and the
lower-case letter "d". So "fourth edition, first draft" becomes `4e1d`.

```javascript
assert.deepStrictEqual(
  parse('4e1d'),
  { edition: 4, draft: 1 })
```

Reviewers editions can similarly describe various drafts of new updates
and corrections. So "fourth edition, fifth update, first draft" becomes
`4e5u1d`.

```javascript
assert.deepStrictEqual(
  parse('4e5u1d'),
  { edition: 4, update: 5, draft: 1 })
```

And "fourth edition, fifth update, eighth correction, first draft"
becomes `4e5u8c1d`.

```javascript
assert.deepStrictEqual(
  parse('4e5u8c1d'),
  { edition: 4, update: 5, correction: 8, draft: 1 })
```

The parser function returns `false` for any invalid reviewers edition.

```javascript
assert.equal(parse('1.0.0'), false)
```

# Other Modules

An array of names for the numbers of reviewers editions are packaged as
a JSON file, and can be required separately.

```javascript
assert.deepStrictEqual(
  require('reviewers-edition-parse/numbers'),
  [ 'edition', 'update', 'correction', 'draft' ])
```

The regular expression used to parse strings can be also be required
separately.

```javascript
var re = require('reviewers-edition-parse/regular-expression')
assert(re.test('1e'))
```

The match groups of the regular expression correspond to the order of
number names.

```javascript
var match = re.exec('1e2u3c4d')
assert.equal(match[1], '1')
assert.equal(match[2], '2')
assert.equal(match[3], '3')
assert.equal(match[4], '4')
```
<commit_msg>Consistently emphasize number components names in README<commit_after>Reviewers editions are a simple way to number editions of useful prose
projects, like policy statements or legal terms.

# Numbers

Each reviewers edition has up to four numbers.

1. An _edition_ number

2. An _update_ number

3. A _correction_ number

4. A _draft_ number

Every reviewers edition has an _edition_ number. The _edition_ number
and any other numbers must be whole numbers, one or greater, written
without any leading zeros.

These numbers increase over time for new published versions of a
project. _Correction_ numbers restart at one for every new update, and
_update_ numbers restart at one for every new edition.

# Meaning

How the authors of a project change numbers over time conveys advice to
users of older editions.

1. When authors recommend users review a new edition in its entirety to
   ensure it meets their needs, they increase the _edition_ number.

   For example, if a working group rewrites the second edition of a form
   privacy notice from scratch, they will release the rewrite as the
   third edition of the form.

2. When authors recommend users review at least the new or changed parts
   of a new edition, they increase the _update_ number.

   For example, if the working group adds a new paragraph to the third
   edition of its form privacy notice on location data, they will
   release the expanded policy as the third edition, first update. If
   they later rephrase a paragraph on genetic privacy, the will release
   the updated policy as the third edition, second update.

4. When authors make only typographic or other, minor corrections that
   users need not review, they increase the _correction_ number.

   For example, if the working group corrects a spelling error in the
   second edition, first update of their form, they will release the
   corrected form as second edition, first update, first correction. If
   they later catch and correct a typographical error, the resulting
   edition will be the second edition, first update, second correction.

Authors can also use reviewers editions to mark drafts of a new edition,
update, or correction editions to come.

For example, if the working group publishes two drafts of a second
update to the third edition, those drafts will be the fourth edition,
first draft and fourth edition, second draft.

# Exported Module

This npm package exports a single function that parses reviewers edition
short code strings, returning structured representations of their
components.

```javascript
var parse = require('reviewers-edition-parse')
```

# Examples

The following examples are also the test suite for the parser. The tests
use Node.js' built-in `assert` module.

```javascript
var assert = require('assert')
```

The simplest reviewers edition has only an _edition_ number. This number
is written followed by the lower-case letter "u". So "second edition"
becomes `2e`:

```javascript
assert.deepStrictEqual(
  parse('2e'),
  { edition: 2 })
```

An _edition_ number cannot be zero, nor can it start with a zero.

```javascript
assert.equal(parse('0e'), false)
assert.equal(parse('01e'), false)
```

The fifth update to a second edition adds the number five followed by
the lower-case letter "u". So "second edition, fifth update" becomes
`2e5u`.

```javascript
assert.deepStrictEqual(
  parse('2e5u'),
  { edition: 2, update: 5 })
```

An _edition_ number cannot be zero, nor can it start with a zero.

```javascript
assert.equal(parse('2e0u'), false)
assert.equal(parse('2e01u'), false)
```

The seventh correction to that edition adds the number seven followed
by the lower-case letter "c". So "second edition, fifth update, seventh
correction" becomes `2e5u7c`.

```javascript
assert.deepStrictEqual(
  parse('2e5u7c'),
  { edition: 2, update: 5, correction: 7 })
```

An _correction_ number cannot be zero, nor can it start with a zero.

```javascript
assert.equal(parse('2e5u0c'), false)
assert.equal(parse('2e5u01c'), false)
```

An edition that has not been updated can also be corrected. So "third
edition, second correction" becomes `3e2c`.

```javascript
assert.deepStrictEqual(
  parse('3e2c'),
  { edition: 3, correction: 2 })
```

The first draft of a new fourth edition would use the reviewers edition
code for the fourth edition, followed by the number one and the
lower-case letter "d". So "fourth edition, first draft" becomes `4e1d`.

```javascript
assert.deepStrictEqual(
  parse('4e1d'),
  { edition: 4, draft: 1 })
```

Reviewers editions can similarly describe various drafts of new updates
and corrections. So "fourth edition, fifth update, first draft" becomes
`4e5u1d`.

```javascript
assert.deepStrictEqual(
  parse('4e5u1d'),
  { edition: 4, update: 5, draft: 1 })
```

And "fourth edition, fifth update, eighth correction, first draft"
becomes `4e5u8c1d`.

```javascript
assert.deepStrictEqual(
  parse('4e5u8c1d'),
  { edition: 4, update: 5, correction: 8, draft: 1 })
```

The parser function returns `false` for any invalid reviewers edition.

```javascript
assert.equal(parse('1.0.0'), false)
```

# Other Modules

An array of names for the numbers of reviewers editions are packaged as
a JSON file, and can be required separately.

```javascript
assert.deepStrictEqual(
  require('reviewers-edition-parse/numbers'),
  [ 'edition', 'update', 'correction', 'draft' ])
```

The regular expression used to parse strings can be also be required
separately.

```javascript
var re = require('reviewers-edition-parse/regular-expression')
assert(re.test('1e'))
```

The match groups of the regular expression correspond to the order of
number names.

```javascript
var match = re.exec('1e2u3c4d')
assert.equal(match[1], '1')
assert.equal(match[2], '2')
assert.equal(match[3], '3')
assert.equal(match[4], '4')
```

{'fraction_non_alphanumeric': 0.08431761358737823, 'fraction_numerical': 0.015346150530218122, 'mean_word_length': 4.593056894889103, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '693787', 'n_tokens_mistral': 3384, 'n_tokens_neox': 3201, 'n_words': 1561}