View Source Wordnik.Word.Frequency (Wordnik v1.0.0)
frequency of usage across years for the requested word
Link to this section Summary
Types
parsed JSON response to get_frequency/2
query
map of optional parameters that can be passed to get_frequency/2
query
Functions
get frequency for requested word
Link to this section Types
@type frequency() :: %{ frequency: [%{year: String.t(), count: integer()}], frequencyString: String.t(), totalCount: integer(), unknownYearCount: integer(), word: String.t() }
parsed JSON response to get_frequency/2
query
@type frequency_params() :: %{ optional(:start_year) => integer(), optional(:end_year) => integer(), optional(:use_canonical) => boolean() }
map of optional parameters that can be passed to get_frequency/2
query
Link to this section Functions
@spec get_frequency(String.t(), frequency_params()) :: {:error, String.t()} | {:ok, frequency()}
get frequency for requested word
parameters
Parameters
- use_canonical: boolean
- start_year: integer
- end_year: integer
example
Example
iex> get_frequency("verbose", %{ use_canonical: true, start_year: 1990, end_year: 2000 })
response
Response
t:Word.Frequency.frequency/0