wordnik

package module
v0.0.0-...-007e8a0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2018 License: MIT Imports: 8 Imported by: 0

README

go-wordnik

Unofficial Go library for the Wordnik API

Build Status Go Report Card Documentation

Requirements

Go version >= 1.8

Basic Usage

package main

import (
  "fmt"

  "github.com/rhallora-heidelberg/go-wordnik"
)

func main() {
  cl := wordnik.NewClient("<YOUR API KEY>")

  pochade, _ := cl.GetWordOfTheDay("2016-04-03")
  fmt.Println(pochade.Word, pochade.Definitions)
  // pochade [{A rough sketch. wiktionary  noun} {A slight, rough sketch which
  // can easily be erased for correction. century  noun}]

  phytop, _ := cl.Search("phytop")
  for _, res := range phytop.SearchResults {
    fmt.Println(res.Word, res.Count)
  }
  // phytop 0
  // phytoplankton 2192
  // phytophagous 25
  // phytophthora 23
  // phytoplasma 14

}

Configuring Queries

For endpoints with many optional query parameters, such as Search, this project makes use of the functional options pattern. This means that optional parameters can be set like this:

  //...
  // Only words with 6 or 7 characters:
  response, _ := cl.Search("fru", MinLength(6), MaxLength(7))

  // Disable case-sensitive search
  response, _ = cl.Search("ora", CaseSensitive(false))
  //...

If you need to set the same parameters on a regular basis, you can define your own functions which fit the QueryOption definition in queryOptions.go:

  //  type QueryOption func(*url.Values)
  func LongListOfLongNouns() wordnik.QueryOption {
    return func(q *url.Values) {
      q.Set("includePartOfSpeech", "noun")
      q.Set("minLength", "7")
      q.Set("skip", "1")
      q.Set("limit", "100")
    }
  }

Running The Tests

In order to run the included tests, you'll need to provide some information via three environment variables: WORDNIK_API_KEY, WORDNIK_TEST_USER, and WORDNIK_TEST_PASS. There are a number of ways to do this, but here's a simple one-off example for the command line:

WORDNIK_API_KEY="your_key" WORDNIK_TEST_USER="your_account" WORDNIK_TEST_PASS="your_password" go test

License

This project is licensed under the MIT License - see the LICENSE file for details

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APITokenStatus

type APITokenStatus struct {
	Valid           bool   `json:"valid"`
	Token           string `json:"token"`
	ResetsInMillis  int64  `json:"resetsInMillis"`
	RemainingCalls  int64  `json:"remainingCalls"`
	ExpiresInMillis int64  `json:"expiresInMillis"`
	TotalRequests   int64  `json:"totalRequests"`
}

APITokenStatus as defined by the Wordnik API.

type AudioFile

type AudioFile struct {
	AttributionURL      string  `json:"attributionUrl"`
	CommentCount        int64   `json:"commentCount"`
	VoteCount           int64   `json:"voteCount"`
	FileURL             string  `json:"fileUrl"`
	AudioType           string  `json:"audioType"`
	ID                  int64   `json:"id"`
	Duration            float64 `json:"duration"`
	AttributionText     string  `json:"attributionText"`
	CreatedBy           string  `json:"createdBy"`
	Description         string  `json:"description"`
	CreatedAt           string  `json:"createdAt"`
	VoteWeightedAverage float64 `json:"voteWeightedAverage"`
	VoteAverage         float64 `json:"voteAverage"`
	Word                string  `json:"word"`
}

AudioFile as defined by the Wordnik API. Note from the docs: The metadata includes a time-expiring fileUrl which allows reading the audio file directly from the API. Currently only audio pronunciations from the American Heritage Dictionary in mp3 format are supported.

type AuthenticationToken

type AuthenticationToken struct {
	Token         string `json:"token"`
	UserID        int64  `json:"userId"`
	UserSignature string `json:"userSignature"`
}

AuthenticationToken as defined by the Wordnik API. Needed for user-specific requests.

type Bigram

type Bigram struct {
	Count int64   `json:"count"`
	Gram2 string  `json:"gram2"`
	Gram1 string  `json:"gram1"`
	Wlmi  float64 `json:"wlmi"`
	Mi    float64 `json:"mi"`
}

Bigram as defined by the Wordnik API.

type Citation

type Citation struct {
	Cite   string `json:"cite"`
	Source string `json:"source"`
}

Citation as defined by the Wordnik API.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is an http.Client wrapper which stores an API key and base url.

func NewClient

func NewClient(key string, customClients ...*http.Client) *Client

NewClient creates a Client with the specified API key. The http.Client component is configured with a 10-second timeout.

func (*Client) AddWordsToWordList

func (c *Client) AddWordsToWordList(authToken, permalink string, words []string) error

AddWordsToWordList adds words to a WordList.

func (*Client) AuthenticateGET

func (c *Client) AuthenticateGET(user, pass string) (AuthenticationToken, error)

AuthenticateGET returns an AuthenticationToken object for a given user.

func (*Client) AuthenticatePOST

func (c *Client) AuthenticatePOST(user, pass string) (AuthenticationToken, error)

AuthenticatePOST returns an AuthenticationToken object for a given user.

func (*Client) CreateWordList

func (c *Client) CreateWordList(authToken string, list WordList) (WordList, error)

CreateWordList attempts to create a word list for a given account. Returns the list as a WordList object if successful.

func (*Client) DeleteWordList

func (c *Client) DeleteWordList(authToken, permalink string) error

DeleteWordList deletes a WordList for a given user.

func (*Client) DeleteWordsFromWordList

func (c *Client) DeleteWordsFromWordList(authToken, permalink string, words []string) error

DeleteWordsFromWordList deletes specific words from a WordList if they are present.

func (*Client) GetAPITokenStatus

func (c *Client) GetAPITokenStatus() (APITokenStatus, error)

GetAPITokenStatus returns an APITokenStatus object for a given API key.

func (*Client) GetAudio

func (c *Client) GetAudio(word string, queryOptions ...QueryOption) ([]AudioFile, error)

GetAudio returns a link to pronunciations for a given word, with optional constraints. Configured with QueryOption functions, which ensure basic parameter vailidity.

func (*Client) GetDefinitions

func (c *Client) GetDefinitions(word string, queryOptions ...QueryOption) ([]Definition, error)

GetDefinitions returns definitions for a given word, with optional constraints. Configured with QueryOption functions, which ensure basic parameter vailidity.

func (*Client) GetEtymologies

func (c *Client) GetEtymologies(word string, queryOptions ...QueryOption) (EtymologiesResponse, error)

GetEtymologies returns etymologies for a given word, with optional constraints. Configured with QueryOption functions, which ensure basic parameter vailidity.

func (*Client) GetExamples

func (c *Client) GetExamples(word string, queryOptions ...QueryOption) (ExampleSearchResults, error)

GetExamples returns examples for a given word, with optional constraints. Configured with QueryOption functions, which ensure basic parameter vailidity.

func (*Client) GetPhrases

func (c *Client) GetPhrases(word string, queryOptions ...QueryOption) ([]Bigram, error)

GetPhrases returns two-word phrases for a given word, with optional constraints. Configured with QueryOption functions, which ensure basic parameter vailidity.

func (*Client) GetRelatedWords

func (c *Client) GetRelatedWords(word string, queryOptions ...QueryOption) ([]RelatedWord, error)

GetRelatedWords returns related words for a given word, with optional constraints. Configured with QueryOption functions, which ensure basic parameter vailidity.

func (*Client) GetUser

func (c *Client) GetUser(authToken string) (User, error)

GetUser returns a User object for a given authorization token.

func (*Client) GetWord

func (c *Client) GetWord(word string, queryOptions ...QueryOption) (WordObject, error)

GetWord returns a WordObject for a given word, with optional constraints. Configured with QueryOption functions, which ensure basic parameter vailidity.

func (*Client) GetWordFrequency

func (c *Client) GetWordFrequency(word string, queryOptions ...QueryOption) (FrequencySummary, error)

GetWordFrequency returns a frequency summary for a given word, with optional constraints. Configured with QueryOption functions, which ensure basic parameter vailidity.

func (*Client) GetWordList

func (c *Client) GetWordList(authToken, permalink string) (WordList, error)

GetWordList retrieves a WordList given it's permalink.

func (*Client) GetWordListWords

func (c *Client) GetWordListWords(authToken, permalink string, options ...QueryOption) ([]WordListWord, error)

GetWordListWords retrieves words from a WordList. Note that this may not be all of the words in the list, as determined by the "skip" and "limit" options.

func (*Client) GetWordListsForUser

func (c *Client) GetWordListsForUser(authToken string, options ...QueryOption) ([]WordList, error)

GetWordListsForUser returns a slice of WordList objects for a given account.

func (*Client) GetWordOfTheDay

func (c *Client) GetWordOfTheDay(dateString string) (WordOfTheDay, error)

GetWordOfTheDay returns the word of the day for a given date string in the format "yyyy-MM-dd".

func (*Client) Hyphenation

func (c *Client) Hyphenation(word string, queryOptions ...QueryOption) ([]Syllable, error)

Hyphenation returns hyphenated portions of a given word, with optional constraints. Configured with QueryOption functions, which ensure basic parameter vailidity.

func (*Client) Pronunciations

func (c *Client) Pronunciations(word string, queryOptions ...QueryOption) ([]TextPron, error)

Pronunciations returns pronunciations for a given word, with optional constraints. Configured with QueryOption functions, which ensure basic parameter vailidity.

func (*Client) RandomWord

func (c *Client) RandomWord(queryOptions ...QueryOption) (WordObject, error)

RandomWord returns a random word as a WordObject, with optional constraints. Configured with QueryOption functions, which ensure basic parameter vailidity. See Wordnik docs for appropriate parameters: http://developer.wordnik.com/docs.html#!/words/getRandomWord_get_4

func (*Client) RandomWords

func (c *Client) RandomWords(queryOptions ...QueryOption) ([]WordObject, error)

RandomWords returns random words as a []WordObject, with optional constraints. Configured with QueryOption functions, which ensure basic parameter vailidity. See Wordnik docs for appropriate parameters: http://developer.wordnik.com/docs.html#!/words/getRandomWords_get_3

func (*Client) ReverseDictionary

func (c *Client) ReverseDictionary(query string, queryOptions ...QueryOption) (DefinitionSearchResults, error)

ReverseDictionary returns the result of a reverse dictionary search. Returns an error for empty input, but other 'incorrect' parameters are left to the APIs discretion. Configured with QueryOption functions, which ensure basic parameter vailidity. See Wordnik docs for appropriate parameters: http://developer.wordnik.com/docs.html#!/words/reverseDictionary_get_2

func (*Client) SearchWords

func (c *Client) SearchWords(query string, queryOptions ...QueryOption) (WordSearchResults, error)

SearchWords returns the results of a word search. Returns an error for empty input, but other 'incorrect' parameters are left to the APIs discretion. Configured with QueryOption functions, which ensure basic parameter vailidity.

func (*Client) TopExample

func (c *Client) TopExample(word string, options ...QueryOption) (Example, error)

TopExample returns the top example for a given word, with optional constraints. Configured with QueryOption functions, which ensure basic parameter vailidity.

func (*Client) UpdateWordList

func (c *Client) UpdateWordList(authToken, permalink string, wList WordList) error

UpdateWordList updates a WordList for a given user. Note that this refers to the properties of the WordList itself, not to adding or deleting words from the list.

type ContentProvider

type ContentProvider struct {
	ID   int64  `json:"is"`
	Name string `json:"name"`
}

ContentProvider as defined by the Wordnik API.

type Definition

type Definition struct {
	ExtendedText     string         `json:"extendedText"`
	Text             string         `json:"text"`
	SourceDictionary string         `json:"sourceDictionary"`
	Citations        []Citation     `json:"citations"`
	Labels           []Label        `json:"labels"`
	Score            float64        `json:"score"` //'NaN' will be zero-valued
	ExampleUses      []ExampleUsage `json:"exampleUses"`
	AttributionURL   string         `json:"attributionUrl"`
	SeqString        string         `json:"seqString"`
	AttributionText  string         `json:"attributionText"`
	RelatedWords     []RelatedWord  `json:"relatedWords"`
	Sequence         string         `json:"sequence"`
	Word             string         `json:"word"`
	Notes            []Note         `json:"notes"`
	TextProns        []TextPron     `json:"textProns"`
	PartOfSpeech     string         `json:"partOfSpeech"`
}

Definition as defined by the Wordnik API.

type DefinitionSearchResults

type DefinitionSearchResults struct {
	Results      []Definition `json:"results"`
	TotalResults int64        `json:"totalResults"`
}

DefinitionSearchResults as defined by the Wordnik API.

type EtymologiesResponse

type EtymologiesResponse []string

EtymologiesResponse is provided for convenience, since results are returned as a list of strings with xml formatting.

type Example

type Example struct {
	ID         int64           `json:"id"`
	ExampleID  int64           `json:"exampleId"`
	Title      string          `json:"title"`
	Text       string          `json:"text"`
	Score      ScoredWord      `json:"score"`
	Sentence   Sentence        `json:"sentence"`
	Word       string          `json:"word"`
	Provider   ContentProvider `json:"provider"`
	Year       int64           `json:"year"`
	Rating     float64         `json:"rating"`
	DocumentID int64           `json:"documentId"`
	URL        string          `json:"url"`
}

Example as defined by the Wordnik API.

type ExampleSearchResults

type ExampleSearchResults struct {
	Facets   []Facet   `json:"facets"`
	Examples []Example `json:"examples"`
}

ExampleSearchResults as defined by the Wordnik API.

type ExampleUsage

type ExampleUsage struct {
	Text string `json:"text"`
}

ExampleUsage as defined by the Wordnik API.

type Facet

type Facet struct {
	FacetValues []FacetValue `json:"facetValues"`
	Name        string       `json:"name"`
}

Facet as defined by the Wordnik API.

type FacetValue

type FacetValue struct {
	Count int64  `json:"count"`
	Value string `json:"value"`
}

FacetValue as defined by the Wordnik API.

type Frequency

type Frequency struct {
	Count int64 `json:"count"`
	Year  int64 `json:"year"`
}

Frequency as defined by the Wordnik API.

type FrequencySummary

type FrequencySummary struct {
	UnknownYearCount int64       `json:"unknownYearCount"`
	TotalCount       int64       `json:"totalCount"`
	FrequencyString  string      `json:"frequencyString"`
	Word             string      `json:"word"`
	Frequency        []Frequency `json:"frequency"`
}

FrequencySummary as defined by the Wordnik API.

type Label

type Label struct {
	Text string `json:"text"`
	Type string `json:"type"`
}

Label as defined by the Wordnik API.

type Note

type Note struct {
	NoteType  string   `json:"noteType"`
	AppliesTo []string `json:"appliesTo"`
	Value     string   `json:"value"`
	Pos       int64    `json:"pos"`
}

Note as defined by the Wordnik API.

type QueryOption

type QueryOption func(*url.Values)

QueryOption functions return functions which modify optional query parameters by acting on url.Values pointers.

func CaseSensitive

func CaseSensitive(b bool) QueryOption

CaseSensitive sets the caseSensitive parameter based on boolean input.

func EndYear

func EndYear(n int64) QueryOption

EndYear sets the endYear parameter based on integer input.

func ExcludePartOfSpeech

func ExcludePartOfSpeech(parts ...string) QueryOption

ExcludePartOfSpeech sets the excludePartOfSpeech parameter based on variadic string input.

func ExcludeSourceDictionaries

func ExcludeSourceDictionaries(dicts ...string) QueryOption

ExcludeSourceDictionaries sets the excludeSourceDictionaries parameter based variadic string input.

func ExpandTerms

func ExpandTerms(term string) QueryOption

ExpandTerms sets the expandTerms parameter based on string input.

func FindSenseForWord

func FindSenseForWord(sense string) QueryOption

FindSenseForWord sets the findSenseForWord parameter based on string input.

func HasDictionaryDef

func HasDictionaryDef(b bool) QueryOption

HasDictionaryDef sets the hasDictionaryDef parameter based on boolean input.

func IncludeDuplicates

func IncludeDuplicates(b bool) QueryOption

IncludeDuplicates sets the includeDuplicates parameter based on boolean input.

func IncludePartOfSpeech

func IncludePartOfSpeech(parts ...string) QueryOption

IncludePartOfSpeech sets the includePartOfSpeech parameter based on variadic string input.

func IncludeRelated

func IncludeRelated(b bool) QueryOption

IncludeRelated sets the includeRelated parameter based on boolean input.

func IncludeSourceDictionaries

func IncludeSourceDictionaries(dicts ...string) QueryOption

IncludeSourceDictionaries sets the includeSourceDictionaries parameter based on variadic string input.

func IncludeSuggestions

func IncludeSuggestions(b bool) QueryOption

IncludeSuggestions sets the includeSuggestions parameter based on boolean input.

func IncludeTags

func IncludeTags(b bool) QueryOption

IncludeTags sets the includeTags parameter based on boolean input. Controls whether a closed set of XML tags should be returned in response.

func Limit

func Limit(n int64) QueryOption

Limit sets the limit parameter based on integer input.

func LimitRelationshipType

func LimitRelationshipType(n int64) QueryOption

LimitRelationshipType sets the limitRelationshipType parameter based on integer input. This parameter works in conjunction with relationshipTypes, in that the list of relationship types is allowed but each type is limited in how many examples it returns by limitRelationshipType.

func MaxCorpusCount

func MaxCorpusCount(n int64) QueryOption

MaxCorpusCount sets the maxCorpusCount parameter based on integer input.

func MaxDictionaryCount

func MaxDictionaryCount(n int64) QueryOption

MaxDictionaryCount sets the maxDictionaryCount parameter based on integer input.

func MaxLength

func MaxLength(n int64) QueryOption

MaxLength sets the maxLength parameter based on integer input.

func MinCorpusCount

func MinCorpusCount(n int64) QueryOption

MinCorpusCount sets the minCorpusCount parameter based on integer input.

func MinDictionaryCount

func MinDictionaryCount(n int64) QueryOption

MinDictionaryCount sets the minDictionaryCount parameter based on integer input.

func MinLength

func MinLength(n int64) QueryOption

MinLength sets the minLength parameter based on integer input.

func PartOfSpeech

func PartOfSpeech(parts ...string) QueryOption

PartOfSpeech sets the partOfSpeech parameter based on variadic string input.

func RelationshipTypes

func RelationshipTypes(types ...string) QueryOption

RelationshipTypes sets the relationshipTypes parameter based on variadic string input. This parameter works in conjunction with limitRelationshipType, in that this list of relationship types is allowed but each type is limited in how many examples it returns by limitRelationshipType.

func Skip

func Skip(n int64) QueryOption

Skip sets the skip parameter based on integer input.

func SortBy

func SortBy(sortCriteria string) QueryOption

SortBy sets the sortBy parameter based on string input.

func SortOrder

func SortOrder(direction string) QueryOption

SortOrder sets the sortOrder parameter based on string input.

func SourceDictionaries

func SourceDictionaries(dicts ...string) QueryOption

SourceDictionaries sets the sourceDictionaries parameter based on variadic string input. Differs notably in effect from "includeSourceDictionaries" when used in the context of Definitions. According to the API: Source dictionary to return definitions from. If 'all' is received, results are returned from all sources. If multiple values are received (e.g. 'century,wiktionary'), results

are returned from the first specified dictionary that has definitions. If

left blank, results are returned from the first dictionary that has definitions. By default, dictionaries are searched in this order: ahd, wiktionary, webster, century, wordnet

func SourceDictionary

func SourceDictionary(format string) QueryOption

SourceDictionary sets the sourceDictionary parameter based on string input.

func StartYear

func StartYear(n int64) QueryOption

StartYear sets the startYear parameter based on integer input.

func TypeFormat

func TypeFormat(format string) QueryOption

TypeFormat sets the typeFormat parameter based on string input.

func UseCanonical

func UseCanonical(b bool) QueryOption

UseCanonical sets the useCanonical parameter based on boolean input.

type RelatedWord

type RelatedWord struct {
	Label1           string   `json:"label1"`
	RelationshipType string   `json:"relationshipType"`
	Label2           string   `json:"label2"`
	Label3           string   `json:"label3"`
	Words            []string `json:"words"`
	Gram             string   `json:"gram"`
	Label4           string   `json:"label4"`
}

RelatedWord as defined by the Wordnik API.

type ScoredWord

type ScoredWord struct {
	Position      string `json:"position"`
	ID            string `json:"id"`
	DocTermCount  string `json:"docTermCount"`
	Lemma         string `json:"lemma"`
	WordType      string `json:"wordType"`
	Score         string `json:"score"`
	SentenceID    string `json:"sentenceId"`
	Word          string `json:"word"`
	Stopword      string `json:"stopword"`
	BaseWordScore string `json:"baseWordScore"`
	PartOfSpeech  string `json:"partOfSpeech"`
}

ScoredWord as defined by the Wordnik API.

type Sentence

type Sentence struct {
	HasScoredWords     bool         `json:"hasScoredWords"`
	ID                 int64        `json:"id"`
	ScoredWords        []ScoredWord `json:"scoredWords"`
	Display            string       `json:"display"`
	Rating             int64        `json:"rating"`
	DocumentMetadataID int64        `json:"documentMetadataId"`
}

Sentence as defined by the Wordnik API.

type SimpleDefinition

type SimpleDefinition struct {
	Text         string `json:"text"`
	Source       string `json:"source"`
	Note         string `json:"note"`
	PartOfSpeech string `json:"partOfSpeech"`
}

SimpleDefinition as defined by the Wordnik API.

type SimpleExample

type SimpleExample struct {
	ID    int64  `json:"is"`
	Title string `json:"title"`
	Text  string `json:"text"`
	URL   string `json:"url"`
}

SimpleExample as defined by the Wordnik API.

type Syllable

type Syllable struct {
	Text string `json:"text"`
	Seq  int64  `json:"seq"`
	Type string `json:"type"`
}

Syllable as defined by the Wordnik API.

type TextPron

type TextPron struct {
	Raw     string `json:"raw"`
	Seq     int64  `json:"seq"`
	RawType string `json:"rawType"`
}

TextPron as defined by the Wordnik API.

type User

type User struct {
	ID          int64  `json:"id"`
	Username    string `json:"username"`
	Email       string `json:"email"`
	Status      int64  `json:"status"`
	FaceBookID  string `json:"faceBookId"`
	UserName    string `json:"userName"`
	DisplayName string `json:"displayName"`
	Password    string `json:"password"`
}

User as defined by the Wordnik API.

type WordList

type WordList struct {
	ID                int64  `json:"id,omitempty"`
	Permalink         string `json:"permalink,omitempty"`
	Name              string `json:"name,omitempty"`
	CreatedAt         string `json:"createdAt,omitempty"`
	UpdatedAt         string `json:"updatedAt,omitempty"`
	LastActivityAt    string `json:"lastActivityAt,omitempty"`
	Username          string `json:"username,omitempty"`
	UserID            int64  `json:"userId,omitempty"`
	Description       string `json:"description,omitempty"`
	NumberWordsInList int64  `json:"numberWordsInList,omitempty"`
	Type              string `json:"type,omitempty"`
}

WordList as defined by the Wordnik API.

type WordListWord

type WordListWord struct {
	ID                   int64  `json:"id"`
	Word                 string `json:"word"`
	Username             string `json:"username"`
	UserID               int64  `json:"userId"`
	CreatedAt            string `json:"createdAt"`
	NumberCommentsOnWord int64  `json:"numberCommentsOnWord"`
	NumberLists          int64  `json:"numberLists"`
}

WordListWord as defined by the Wordnik API.

type WordObject

type WordObject struct {
	ID            int64    `json:"id"`
	Word          string   `json:"word"`
	OriginalWord  string   `json:"originalWord"`
	Suggestions   []string `json:"suggestions"`
	CanonicalForm string   `json:"canonicalForm"`
	Vulgar        string   `json:"vulgar"`
}

The WordObject as defined by the Wordnik API.

type WordOfTheDay

type WordOfTheDay struct {
	ID              int64              `json:"id"`
	ParentID        string             `json:"parentId"`
	Category        string             `json:"category"`
	CreatedBy       string             `json:"createdBy"`
	CreatedAt       string             `json:"createdAt"`
	ContentProvider ContentProvider    `json:"contentProvider"`
	HTMLExtra       string             `json:"htmlExtra"`
	Word            string             `json:"word"`
	Definitions     []SimpleDefinition `json:"definitions"`
	Examples        []SimpleExample    `json:"examples"`
	Note            string             `json:"note"`
	PublishDate     string             `json:"publishDate"`
}

WordOfTheDay as defined by the Wordnik API.

type WordSearchResult

type WordSearchResult struct {
	Count      int64   `json:"count"`
	Lexicality float64 `json:"lexicality"`
	Word       string  `json:"word"`
}

WordSearchResult as defined by the Wordnik API.

type WordSearchResults

type WordSearchResults struct {
	SearchResults []WordSearchResult `json:"searchResults"`
	TotalResults  int64              `json:"totalResults"`
}

WordSearchResults as defined by the Wordnik API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL