romajip
v0.0.6
Published
A translator that converts Japanese into English characters
Downloads
85
Readme
This is a library that converts Japanese address input into English address
Features
- Accurate Conversion: Transforms Japanese addresses into structured English components.
- No Fetch Required: The library includes its own dataset, eliminating the need for fetching data and keeping the library size minimal.
- TypeScript Support: Built with TypeScript for type safety and better developer experience.
- No External Dependencies: Includes all necessary data within the library, avoiding additional dependencies.
- Functional Programming Paradigm: Utilizes modern ES6 features and functional programming for clean and maintainable code.
Installation
Install romajip via npm or yarn:
npm install romajip
yarn add romajip
Usage
Import the romajip function and use it to convert Japanese addresses to their English equivalents.
Basic Example
import { romajip } from "romajip"
const japaneseAddress = "東京都渋谷区神南1丁目23-1"
const parsed = romajip(japaneseAddress)
if (parsed) {
console.log(parsed)
/*
Output:
{
japanese: [ '東京都', '渋谷区', '神南', '1丁目23-1' ],
romaji: [ 'tokyo', 'shibuya-ku', 'jinnan', '1-chome23-1' ]
}
*/
} else {
console.log("Unable to parse the address.")
}