Git Product home page Git Product logo

freeyubin's Introduction

FreeYubin

郵便番号から住所に変換するツールです。

jsmigemo の成果物の一部から流用し開発しました。

実用的?

jsmigemoと同様の辞書構造を用いることでデータサイズの削減を図りましたが、実は全然小さくなっていません。 本ツールで用いている、郵便番号から住所に変換するだけの辞書が 1.39MB です。 郵便局のウェブサイトで配布しているCSVファイルがZIP圧縮で 1.94MB です。

よって現段階では全く実用的ではありません。

今後の方針

  • 辞書ファイルのサイズの削減
  • 読みがなの格納
  • CIにより辞書ファイルを自動的に更新
  • 住所から郵便番号を検索

辞書ファイルの生成方法

  1. 郵便局のウェブサイトから、最新の郵便番号データをダウンロードして下さい。 「最新データのダウンロード」の「最新データのダウンロード」をクリックすると、「utf_all.zip」を入手できます。
  2. 「utf_all.zip」中の「UTF_ALL.CSV」ファイルをプロジェクト直下に展開します。
  3. node .\bin\freeyubin-tool.mjs で、CMigemo形式に変換します。
  4. node .\bin\freeyubin-dict.mjs a.txt freeyubin-dict で、省メモリMigemo形式に変換します。

freeyubin-dict が、生成した辞書ファイルです。

使い方

Node.js

> node bin/freeyubin-cli.mjs 5650871
大阪府 吹田市 山田丘

ウェブ

const url = 'freeyubin-dict'
fetch(url)
.then(e => e.arraybuffer())
.then(e => {
    const dict = new freeyubin.CompactDictionary(e)
    const iter = dict.search('5650871')
    const address = iter.next().value
    console.log(address)
})

ライセンス

三条項BSDライセンス

freeyubin's People

Contributors

oguna avatar dependabot[bot] avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.