jishocaller v1.0.0 JISHOCALLER

Wrapper for the Jisho API found on https://jisho.org/ Search for a word both in Japanese and English and return the result.

Link to this section Summary

Functions

Search by a word or a term. Returns a JSON result from the call.

Search by a word or a term with tags. Returns a JSON result from the call.

Search by a word or a term with tags and a page. Returns a JSON result from the call.

Search using tags. Returns a JSON result from the call.

Search using tags and a page. Returns a JSON result from the call.

Link to this section Functions

Search by a word or a term. Returns a JSON result from the call.

Parameters:

  • Word or term: "String"

Result:

  • A list of Maps where each map is a word that has been found.
  • If successful then {:ok, data} is returned where data is a list of maps or it returns {:ok, "No data"} if there is nothing in the result.
  • If unsuccessful this will return {:error, reason}

Examples: Searching using an English word:

iex> JISHOCALLER.search("dog")

Searching using a term:

iex> JISHOCALLER.search("fast car")

Search using Romanji:

iex> JISHOCALLER.search("hanako")

Searching using Kana:

iex> JISHOCALLER.search("にほん")

Searching using Kanji:

iex> JISHOCALLER.search("招き猫")
Link to this function

search(word, tags)

Search by a word or a term with tags. Returns a JSON result from the call.

Parameters:

  • Word or term : "String"
  • List of Strings ["String", "String" . . .]

Result:

  • A list of Maps where each map is a word that has been found using the tag(s).
  • If successful then {:ok, data} is returned where data is a list of maps or it returns {:ok, "No data"} if there is nothing in the result.
  • If unsuccessful this will return {:error, reason}

Examples: No tags (This is the same as just using search):

iex> JISHOCALLER.search("dog", [])

Using only tags:

iex> JISHOCALLER.search("", ["jlpt-n5"])

Using a term and a tag:

iex> JISHOCALLER.search("animal", ["jlpt-n5"])

Using multiple tags:

iex> JISHOCALLER.search("出来る", ["jlpt-n5", "verb"])
Link to this function

search(word, tags, page)

Search by a word or a term with tags and a page. Returns a JSON result from the call.

Parameters:

  • Word or term : "String"
  • List of Strings ["String", "String" . . .]
  • Page Number: Integer

Result:

  • A list of Maps where each map is a word that has been found using the word, tag(s), and page number.
  • If successful then {:ok, data} is returned where data is a list of maps or it returns {:ok, "No data"} if there is nothing in the result.
  • If unsuccessful this will return {:error, reason}

Examples: A term, no tags, and a page:

iex> JISHOCALLER.search("差す", [], 1)

Using only tags and page:

iex> JISHOCALLER.search("", ["jlpt-n5"], 30)

Using a term, a tag and a page:

iex> JISHOCALLER.search("差す", ["verb"], 2)

Using a term, multiple tags and a page:

iex> JISHOCALLER.search("出来る", ["jlpt-n5", "verb"], 1)
Link to this function

search_by_tags(tags)

Search using tags. Returns a JSON result from the call.

Parameters:

  • List of Strings ["String", "String" . . .]

Result:

  • A list of Maps where each map is a word that has been found using the tag(s).
  • If successful then {:ok, data} is returned where data is a list of maps or it returns {:ok, "No data"} if there is nothing in the result.
  • If unsuccessful this will return {:error, reason}

Examples: One tag:

iex> JISHOCALLER.search_by_tags(["jlpt-n5"])

Multiple tags:

iex> JISHOCALLER.search_by_tags(["jlpt-n5", "verb"])
Link to this function

search_by_tags(tags, page)

Search using tags and a page. Returns a JSON result from the call.

Parameters:

  • List of Strings ["String", "String" . . .]
  • Page Number: Integer

Result:

  • A list of Maps where each map is a word that has been found using the tag(s).
  • If successful then {:ok, data} is returned where data is a list of maps or it returns {:ok, "No data"} if there is nothing in the result.
  • If unsuccessful this will return {:error, reason}

Examples: One tag and page number:

iex> JISHOCALLER.search_by_tags(["jlpt-n5"], 1)

Multiple tags and page number:

iex> JISHOCALLER.search_by_tags(["jlpt-n5", "verb"], 3)