Skip to content

Commit

Permalink
Merge pull request #20 from Dr-Julius-No/master
Browse files Browse the repository at this point in the history
Make word list public; addresses #19
  • Loading branch information
stevenroose authored May 13, 2022
2 parents aeccaf6 + f01e0b2 commit da090d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/language/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down Expand Up @@ -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)
}
}
Expand Down

0 comments on commit da090d2

Please sign in to comment.