Skip to content

jev-jp-address

CLI that normalises messy Japanese addresses to postal codes with rules and Japan Post data, asking Jev only for ambiguous steps.

Libraryprototype

Overview

jev-jp-address normalises unnormalised Japanese addresses step by step (prefecture, city, town area, block and building) against Japan Post's KEN_ALL and JIGYOSYO postal code master data, and outputs the postal code. Only where rules and master lookups cannot decide does it ask Jev, through the AI SDK's experimental_evaluate, to choose from candidates, recording probability and confidence. Because Jev does not generate text, the normalised string is always assembled in code.

The README example turns a hiragana address into the correct Kasumigaseki address and postal code with three Jev calls in 440 ms. Options include running without AI, choosing the model, a review threshold (0.7 by default) below which results are flagged, JSON output with per-stage method (rule, zip, ai or none) and verbose logs. The repository is framed as a performance evaluation of how far Jev helps with fuzzy address matching. Documentation is in Japanese.

What the decision model decides

TypeQuestionAnswers
ChoiceWhich candidate prefecture, city or town area matches this address?—

How it works

  1. Parse the input address
  2. Resolve each stage with rules and master data
  3. Ask Jev to choose among candidates where rules cannot decide
  4. Assemble the normalised address and postal code; flag low confidence

Strengths

  • AI used only where needed
  • Per-stage provenance in output
  • Rule-only mode available

Caveats

  • Japan-specific
  • Requires downloading postal master data

Getting started

`npm install`, `scripts/download-data.sh`, set TYPESAFE_AI_API_KEY, `npm run build`, then `node dist/cli.js "address"`.

At a glance

Type
Library
Status
prototype
Language
TypeScript
Runtime
Node 20+ CLI (AI SDK)
Has code
yes

Use cases and integrations

How curated lists describe it

  • Jev (TypeSafe) 性能評価プロジェクト — 日本郵便 KEN_ALL をマスタに、AI SDK 経由の Jev が住所のあいまい一致にどこまで使えるかを検証.

    hellogumbo/awesome-jev

Frequently asked questions

What does Jev decide?

Which candidate prefecture, city or town fits when rules cannot decide.

Can it run without AI?

Yes, with --no-ai.

How are uncertain results handled?

Below the threshold (default 0.7) they are flagged for review.

Related projects

  • Record linkage for researchers: write the match rule in plain English and Jev judges each candidate pair with a probability.

    ProjectbetaPython
  • Small dependency-free library that maps uploaded CSV columns to your schema with exact-name matching, then one Jev Noul per remaining pair.

    ProjectprototypeJavaScript
  • Eight zero-dependency examples applying Jev to mechanical and electrical engineering: CAD routing, FEM triage, DFM, BOM alignment.

    ProjectprototypePython
  • Python re-style library that finds, replaces, splits and extracts text by meaning, with Jev judging each candidate span.

    DemobetaPython
  • dbt package whose macros run Jev Choice, Noul and Score over SQL values in DuckDB and ClickHouse models.

    ProjectbetaSQL (Jinja)
  • DuckDB extension that asks Jev about every row in SQL and returns answers as ENUM, DOUBLE or STRUCT columns.

    PluginbetaC++