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

@heppokofrontend/dictionary-file-maker

v0.2.2

Published

Build to class platform-compatible dictionary data text file.

Downloads

2

Readme

@heppokofrontend/dictionary-file-maker

MIT License Published on NPM test workflow Maintainability Test Coverage Known Vulnerabilities @heppokofrontend/dictionary-file-maker

The dictMaker() method convert object to IME user dictionary tool config file.

See these instructions on how to use the text files exported by this tool.

Usage

Installation:

npm install --save-dev @heppokofrontend/dictionary-file-maker

Example:

import { dictMaker } from '@heppokofrontend/dictionary-file-maker';

const obj = [
  {
    input: 'かな1',
    output: '単語A',
  },
  {
    input: 'かな2',
    output: '単語B',
  },
  {
    input: 'かな3',
    output: '単語C',
  },
];

dictMaker(obj, 'win', './result.txt'); // The text file is writen.

:warning: The "~" varies depending on the OS.

const windows = json.replace(/〜/g, '~');
const macOS = json.replace(/~/g, '〜');

Syntax

dictMaker(src, type, dist);

Parameters

src - {input, output [, type]}[]

The dictionary data array object, or parsed JSON.

[
  {
    "input": "かな",
    "output": "単語",
    "type": "品詞"
  }
]

|property|type|default|required|description| |---|:-:|:-:|:-:|---| |input|string|""|true|The "yomi" of word in Japanese.| |output|string|""|true|The word of conversion result.| |type|string|Will be described later|-|It's the parts of speech. Default value varies depending on the export target platform.|

The type prop is able to use those values.

  • for Windows
    • 名詞 (default)
    • 短縮よみ
    • 人名
    • 地名
    • 顔文字
  • for macOS
    • 普通名詞 (default)
    • サ変名詞
    • 人名
    • 地名
    • 形容詞
    • 副詞
    • 接尾語
    • 動詞

FYI:
https://blogs.windows.com/japan/2017/02/17/imejptips4/
https://support.apple.com/ja-jp/guide/japanese-input-method/jpim10211/6.3/mac/11.0

type - string

The target platform name.

  • win - For Windows IME
  • win-google - For "Google 日本語入力" on Windows
  • mac - For macOS IME

dist - string

Dictionary text file export destination.

CLI

dict-maker [source] [options]

# sample
dict-maker yourfile.json --mac --win --winGoogle --out ./dictionary
  -o, --out        Specify an output folder for dictionary files.                      [string]
      --win        Enable the export of dictionary data for Windows 10 standard IME.   [boolean]
      --winGoogle  Enable the export of dictionary data for Google IME on Windows 10.  [boolean]
      --mac        Enable the export of dictionary data for macOS IME                  [boolean]

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

MIT