Skip to content

Commit

Permalink
Merge pull request #38 from WyvernIXTL/master
Browse files Browse the repository at this point in the history
Added example to README.me showing how to embed a single dictionary.
  • Loading branch information
tapeinosyne authored Jan 24, 2024
2 parents 19693c6 + 5fe0fd6 commit 4e01786
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4e01786

Please sign in to comment.