From 5fe0fd6524e80620d0f70a815527cde3a8bf88a5 Mon Sep 17 00:00:00 2001 From: Adam McKellar <100924950+WyvernIXTL@users.noreply.github.com> Date: Tue, 16 Jan 2024 15:44:22 +0100 Subject: [PATCH] Added example to README.me showing how to embed a single dictionary. --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index f9528f5..4224ef7 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,13 @@ let path_to_dict = "/path/to/en-us.bincode"; let english_us = Standard::from_path(Language::EnglishUS, path_to_dict) ?; ``` +Or to embed them individually with [`include_bytes!`](https://doc.rust-lang.org/std/macro.include_bytes.html): +```rust +let bytes = include_bytes!("./relative_path_to_dict_from_source_file/de-1996.standard.bincode"); +let mut cursor = std::io::Cursor::new(bytes); +let german_de = Standard::any_from_reader(&mut cursor)?; +``` + Dictionaries bundled with `hyphenation` can be retrieved from the build folder under `target`, and packaged with the final application as desired. ```bash