Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

English words? #1

Open
ghost opened this issue May 10, 2022 · 1 comment
Open

English words? #1

ghost opened this issue May 10, 2022 · 1 comment

Comments

@ghost
Copy link

ghost commented May 10, 2022

How do I generate English words???

@rokonio
Copy link
Owner

rokonio commented May 10, 2022

The English dictionary is not implemented in the set of languages, but you can use one from somewhere else like that

let reader = BufReader::new(File::open("Your_lang.txt")?); // Your_lang is a file with each word of the language on a different line

// Your can generate the words like this 
let table = ProbabilityTable::from_reader(reader, 3)?; // Generate the generator with an accuracy of 3
println!("{:?}", table.generate_words(15)); // Generate 15 word


// Or like that 
println!("{:?}", generate_words(reader, 3, 15)?); // Generate 3 words with an accuracy of 3

If you happened to find an English dictionary free of use, you can tell me it or even send a push request

(Also here's a link to the documentation for more explanations https://docs.rs/word_generator )

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant