-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add build script for cbor file generation for color names dataset
- Loading branch information
1 parent
a0a6fc9
commit 3c3e398
Showing
5 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/target | ||
**/*.rs.bk | ||
pkg | ||
pkg | ||
*.cbor |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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,13 @@ | ||
extern crate serde_cbor; | ||
extern crate serde_json; | ||
|
||
use std::fs::File; | ||
|
||
fn main() { | ||
// This dataset has been taken from https://github.com/meodai/color-names | ||
let color_names_file = File::open("./data/colornames.bestof.min.json").unwrap(); | ||
let color_names: serde_json::Value = serde_json::from_reader(color_names_file).unwrap(); | ||
|
||
let dest_file = File::create("./data/colornames.cbor").unwrap(); | ||
serde_cbor::to_writer(dest_file, &color_names).unwrap(); | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.