npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hakka-dict-toolkit

v0.2.0

Published

A toolkit for https://hakka.dict.edu.tw/hakkadict/index.htm

Downloads

6

Readme

hakka-dict-toolkit

NPM version Open Source Love

A toolkit for Taiwan Hakka Dictionary.

Installation

yarn add hakka-dict-toolkit

or

npm install hakka-dict-toolkit --save

Usage

Overview

var hakka = require('hakka-dict-toolkit')
// search query
hakka.search('客')
// access entry via index
hakka.entry(10377)
// appendix in the entry 10377
hakka.appendix('03002-001', 3)
  • hakka.search(query, [options]): search entries
  • hakka.entry(index, [options]): access to the entry
  • hakka.appendix(indicator, type, [options]): access to the appendix

hakka.search(query, [options])

Search entries with a query and returns a promise with list of Entry.Item.

hakka.entry(index, [options])

Provide access to the appendix of MOE Hakka Dictionary by index and returns a promise with either a format of word or character's.

Return Format (word)

{
  title    : string,
  sounds   : Entry.MainSound[],
  another  : Entry.ItemSound[],
  meaning  : string,
  mandarin : string,
  pos      : string[],
  variant  : string,
  synonym  : Entry.Item[],
  antonym  : Entry.Item[]
}
  • title: title of the entry
  • sounds: pronounciations in 6 main Hakka dialects in Taiwan. See Entry.MainSound.
  • another: other pronounciations, including Vun-pag accents (文白讀). See Entry.ItemSound.
  • meaning: definition of the entry
  • mandarin: gloss in Mandarin
  • pos: part of speeches
  • variant: a link to a table containing variant written forms form other references
  • synonym: list of synonyms. See Entry.Item.
  • antonym: similar as above

Return Format (character)

{
  title    : string,
  sounds   : Entry.MainSound[],
  another  : Entry.ItemSound[],
  meaning  : string,
  mandarin : string
  radical  : string,
  stroke   : number[]
}
  • radical: an important component of Sinitic character to look up (部首)
  • stroke: two numbers indicating stroke count of Sinitic character excluding radical and including radical, respectively

hakka.appendix(indicator, type, [options])

Provide access to the entry of MOE Hakka Dictionary by indicator and dialect type, and returns a promise with list of Entry.AppSound. Dialect type is the following:

  • 1: Xi-Ien dialect (四縣腔)
  • 2: Hoi-Liug dialect (海陸腔)
  • 3: Tai-Bu dialect (大埔腔)
  • 4: Ngiau-Pin dialect (饒平腔)
  • 5: Zhio-On dialect (詔安腔)
  • 6: Nam-Xi-Ian dialect (南四縣)

See Hakka Dialects.

Options

verbose (boolean)

Default value is true. If the flag is set to be false, the return values will turn to be:

Other Formats

Entry.MainSound

{
  type     : string,
  phonetic : string,
  vunpag?  : string,
  media    : string
}

Entry.ItemSound

{
  type     : string,
  phonetic : string,
  vunpag?  : string,
  link?    : string
}

Entry.AppSound

{
  type     : string,
  phonetic : string,
  vunpag?  : string,
  text?    : string,
  media?   : string
}
  • type, phonetic, vunpag, media: see Entry.MainSound
  • text: title of the appendix

Entry.Item

{
  text  : string;
  link? : string;
}
  • link: an uri to entry

Proto.Word

{
  title    : string,
  type     : string,
  index    : number,
  index_ap : string,
  sounds   : Proto.MainSound[],
  another  : Proto.ItemSound[],
  related  : { type : number }[],
  meaning  : string,
  mandarin : string,
  pos      : string[],
  variant  : boolean,
  synonym  : Proto.Item[],
  antonym  : Proto.Item[]
}
  • title: title of the entry
  • type: word, indicating the type of return value
  • sounds: pronounciations in 6 main Hakka dialects in Taiwan. See Proto.MainSound.
  • another: other pronounciations, including Vun-pag accents (文白讀). See Proto.ItemSound.
  • meaning: definition of the entry
  • mandarin: gloss in Mandarin
  • pos: part of speeches
  • variant: indicate whether the entry exists the link about variant written form
  • synonym: list of synonyms. See Proto.Item.
  • antonym: similar as above

Proto.Char

{
  title    : string,
  type     : string,
  index    : number,
  index_ap : string,
  sounds   : Proto.MainSound[],
  another  : Proto.ItemSound[],
  related  : { type : number }[],
  meaning  : string,
  mandarin : string,
  radical  : string,
  stroke   : number[]
}
  • type: character, indicating the type of return value
  • radical: an important component of Sinitic character to look up (部首)
  • stroke: two numbers indicating stroke count of Sinitic character excluding radical and including radical, respectively

Proto.MainSound

{
  phonetic  : string,
  vunbag?   : string,
  type?     : number,
  hasmedia? : boolean
}

Proto.ItemSound

{
  phonetic : string,
  vunbag?  : string,
  type?    : number,
  index?   : number
}

Proto.AppSound

{
  phonetic : string,
  vunbag?  : string,
  type?    : number,
  text?    : string,
  index?   : number
}
  • phonetic, vunbag, type: see Proto.MainSound
  • text: title of the appendix
  • index: index about media

Proto.Item

{
  text   : string,
  index? : number
}
  • text: title of the entry
  • index: index to the entry

Misc

Romanisation

The romanisation is called Hakka-ngi Phin-Yim Fong-On (客家語拼音方案), published by MOE in Taiwan in 2012.

Literary Readings and Colloquial Readings (文白異讀)

A relative notation between distinct reading forms to the identical character, called Literary Reading (Vun-tug, 文讀) and Colloquial Reading (Pag-tug, 白讀), is mainly used in languages in Sinitic family. Generally, tag '文讀' indicates the reading form is used in formal situation or is later introduced in the phonological system, whereas tag '白讀' often indicates the reading form is used in informal situation or is former introduced or original in the phonological system.

For example, character (life, fresh, raw, unacquaintance), in Xi-Ien Hakka, has two reading forms: literary reading sen24 (sɛn˨˦) and colloquial form sang24 (saŋ˨˦).

Hakka Dialects

There are 6 main Hakka dialects recognized in Taiwan:

  1. Xi-Ien dialect (四縣腔)
  2. Hoi-Liug dialect (海陸腔)
  3. Tai-Bu dialect (大埔腔)
  4. Ngiau-Pin dialect (饒平腔)
  5. Zhio-On dialect (詔安腔)
  6. Nam-Xi-Ian dialect (南四縣)

License

MIT