unofficial-jisho-api
unofficial-jisho-api copied to clipboard
Word Type Search
On jisho.org, it is possible to see the 'type' of word, for example, suru verb, godan verb etc. In the future would it be possible to get that information via the unofficial jisho api? I also now Jisho has a lot of information about inflection, being able to get that information would be super cool too.
Hi, I'll see if I can add that information when I have some time 👍
Thanks! :)
I added a new scrapeForPhrase function to master that can get you the word type among other things. I need to test it a bit more and write documentation before I push a new version to NPM, but if you want to try it out now you can do npm install https://github.com/mistval/unofficial-jisho-api to install the master branch.
console.log(JSON.stringify(await jisho.scrapeForPhrase('ゆっくり'), null, 2)) returns the following:
{
"found": true,
"tags": [
"Common word",
"JLPT N5"
],
"meanings": [
{
"seeAlsoTerms": [],
"sentences": [],
"meaning": "slowly; at ease; restful",
"supplemental": [
"Onomatopoeic or mimetic word"
],
"meaningAbstract": "",
"meaningTags": [
"adverb",
"noun",
"suru verb",
"adverb taking the 'to' particle"
]
}
],
"query": "ゆっくり",
"uri": "https://jisho.org/word/%E3%82%86%E3%81%A3%E3%81%8F%E3%82%8A"
}
The word type is in the "meaningTags" property, it's the same as in the entry on Jisho.org.
As for the inflections, those are actually conjugated by JavaScript in the browser (here), so I'd have to do something like use Puppeteer to execute that code, I'll look into that some other time if I get a chance.
New version 1.2.0 on NPM has the above mentioned scrapeForPhrase function. Please see the README or jsdocs for more info.
Wow, thanks! This is super cool.