Make word list public; addresses #19

This commit is contained in:
Dr. No 2022-03-01 23:03:39 -05:00
parent 520e15a6e5
commit f01e0b2de4
1 changed files with 2 additions and 2 deletions

View File

@ -82,7 +82,7 @@ impl Language {
/// The word list for this language.
#[inline]
pub(crate) fn word_list(self) -> &'static [&'static str; 2048] {
pub fn word_list(self) -> &'static [&'static str; 2048] {
match self {
Language::English => &english::WORDS,
#[cfg(feature = "chinese-simplified")]
@ -146,7 +146,7 @@ impl Language {
/// Get the index of the word in the word list.
#[inline]
pub(crate) fn find_word(self, word: &str) -> Option<u16> {
pub fn find_word(self, word: &str) -> Option<u16> {
self.word_list().iter().position(|w| *w == word).map(|i| i as u16)
}
}