pub struct WordElement {
pub word: String,
pub score: usize,
pub num_syllables: Option<usize>,
pub parts_of_speech: Option<Vec<PartOfSpeech>>,
pub pronunciation: Option<String>,
pub frequency: Option<f32>,
pub definitions: Option<Vec<Definition>>,
}
Expand description
This struct represents each word and its associated data in the response. It is constructed when parsing a Response with the method list(). Note that all optional values can still be None even if the proper flag is set
Fields§
§word: String
The word returned based on the search parameters
score: usize
A score which ranks the word based on how well it fit the provided parameters. Note that by default the words are ranked by score from highest to lowest
num_syllables: Option<usize>
The number of syllables the word has. This will only have a value if the meta data flag SyllableCount is set
parts_of_speech: Option<Vec<PartOfSpeech>>
The part(s) of speech a word can be. This will only have a value if the meta data flag PartsOfSpeech is set
pronunciation: Option<String>
The pronunciation of the word. This will only have a value if the meta data flag Pronunciation is set. If an IPA pronuncation is available, it takes precedence as it is optional
frequency: Option<f32>
The frequency of a word based on how many times the word is used per 1,000,000 words of text. This will only have a value if the meta data flag WordFrequency is set
definitions: Option<Vec<Definition>>
Definitions of a word and the associated part of speech with its use. This will only have a value if the meta data flag Definitions is set