-
-
Notifications
You must be signed in to change notification settings - Fork 556
etl: Add canonical data #507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
"transform": { | ||
"#": [ | ||
"Note: The expected input data for these tests should have", | ||
"integer keys (not stringified numbers as shown in the JSON below", | ||
"Unless the language prohibits that, please implement these tests", | ||
"such that keys are integers. e.g. in JavaScript, it might look ", | ||
"like `transform( { 1: ['A'] } );`" | ||
], | ||
"description": "transforms the a set of scrabble data previously indexed by the tile score to a set of data indexed by the tile letter", | ||
"cases": [ | ||
{ | ||
"description": "a single letter", | ||
"input": { | ||
"1": ["A"] | ||
}, | ||
"expected": { | ||
"a" : 1 | ||
} | ||
}, | ||
{ | ||
"description": "single score with multiple letters", | ||
"input": { | ||
"1": ["A", "E", "I", "O", "U" ] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "multiple letters with the same score" |
||
}, | ||
"expected": { | ||
"a" : 1, | ||
"e" : 1, | ||
"i" : 1, | ||
"o" : 1, | ||
"u" : 1 | ||
} | ||
}, | ||
{ | ||
"description": "multiple scores with multiple letters", | ||
"input": { | ||
"1": ["A", "E"], | ||
"2": ["D", "G"] | ||
}, | ||
"expected": { | ||
"a" : 1, | ||
"e" : 1, | ||
"d" : 2, | ||
"g" : 2 | ||
} | ||
}, | ||
{ | ||
"description": "multiple scores with differing numbers of letters", | ||
"input": { | ||
"1": [ "A", "E", "I", "O", "U", "L", "N", "R", "S", "T" ], | ||
"2": [ "D", "G" ], | ||
"3": [ "B", "C", "M", "P" ], | ||
"4": [ "F", "H", "V", "W", "Y" ], | ||
"5": [ "K" ], | ||
"8": [ "J", "X" ], | ||
"10": [ "Q", "Z" ] | ||
}, | ||
"expected": { | ||
"a": 1, "b": 3, "c": 3, "d": 2, "e": 1, | ||
"f": 4, "g": 2, "h": 4, "i": 1, "j": 8, | ||
"k": 5, "l": 1, "m": 3, "n": 1, "o": 1, | ||
"p": 3, "q": 10, "r": 1, "s": 1, "t": 1, | ||
"u": 1, "v": 4, "w": 4, "x": 8, "y": 4, | ||
"z": 10 | ||
} | ||
} | ||
] | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that this is a
"1":
(rather than1:
) because JSON would only allow string keys in their objects.Is it the case that languages will usually use integers as their keys? If so, perhaps a note saying so? Can put it on the same level as
description
andcases
. No standard key for that note, for some reason people ahve used"#":
in the past, but maybe"notes":
is better.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also thought about this when I started this PR but then quickly got distracted with other changes. I'll add a note. I think it's an important thing to call out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at several data files. Not a single one uses
notes
. Though that is probably a better key (long term) I'm not sure this commit should be the one to start that. So I went with#
.If there is some documentation that could be updated... and if you guys want (me) to build a script to update all
#
entries withnotes
to lay down the "new" convention. I'd be happy to help. but for now, i'm sticking with#