jeremydouglass / jeremydouglass/panelcode

Test cases for canonical form coercion

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Need to create a set of test cases to confirm that canonical forms are output -- and settings to enable coercion to canonical form(s) to be enabled / disabled and configured.

------

There are many ways to write the same layout in panelcode. These refer to the same composition, with variations in spacing, argument order, and implicit/explicit terms:

3_3(c2r2,1,1)
3_3(r2c2,1,1)
3_3(c2r2, 1, 1)
3_3(r2c2, 1, 1)
3_3(r2c2, 1, 1)
3_3(1r2c2, 1, 1)
3(1+1+1)_3(c2r2,1,1)
3(1+1+1)_3(r2c2,1,1)
3(1+1+1)_3(c2r2, 1, 1)
3(1+1+1)_3(r2c2, 1, 1)
3(1+1+1)_3(r2c2, 1, 1)
3(1+1+1)_3(1r2c2, 1, 1)

So all of these are valid panelcode strings that refer to the same page layout -- although some of these are very unlikely for a human to write!

If you process a large collection of panelcode -- say thousands or millions of pages -- you may want to ask how many pages have this specific composition. That is harder to anwer if the same page has been written in many slightly different ways. You may also wish to count the number of unique layouts, or create a one unique image for each layout, etc. -- again, if everything is written in slightly different ways, then you will create the same image many times.

3_3(c2r2,1,1).jpg
3_3(r2c2,1,1).jpg
3_3(c2r2, 1, 1).jpg
...etc.

So the "canonical" panelcode is the standardized one that the parser uses, parsing your slightly different handwritten codes and then replacing them with one canonical code -- like a spelling or grammar checker. So the list becomes:

3_3(1c2r2, 1, 1)
3_3(1c2r2, 1, 1)
3_3(1c2r2, 1, 1)
...etc.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.