# reword
[](https://travis-ci.com/evenorog/reword)
[](https://crates.io/crates/reword)
[](https://docs.rs/reword)
Provides a macro to generate structures used for value lookup.
```rust
reword::reword! {
enum Lang: &'static str {
fn hi {
NO = "Hei";
EN_UK | EN_US = "Hi";
}
fn fall {
NO = "Høst";
EN_UK = "Autumn";
EN_US = "Fall";
}
}
}
let mut lang = Lang::NO;
assert_eq!(lang.hi(), "Hei");
assert_eq!(lang.fall(), "Høst");
lang = Lang::EN_UK;
assert_eq!(lang.hi(), "Hi");
assert_eq!(lang.fall(), "Autumn");
lang = Lang::EN_US;
assert_eq!(lang.hi(), "Hi");
assert_eq!(lang.fall(), "Fall");
```
Attributes can be attached to both the `enum` and the methods generated.
The `Copy`, `Clone`, `Debug`, `Eq`, `PartialEq`, `Ord`, `PartialOrd`, and `Hash` traits are
automatically derived for the `enum` using the derive attribute.
### License
Licensed under either of
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.
### Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any
additional terms or conditions.