Reference · Japanese addresses
findMunicipalitiesByRomajifunction
The municipalities a romaji name could mean, written with or without macrons and designators (Chiyoda-ku, Chiyoda City, Sapporo-shi Chuo-ku, Chuo-ku, Sapporo). A town written without its district, and then a ward written
without its city, are looked up when the full name finds nothing.
Import it
import { findMunicipalitiesByRomaji } from "@johnmorrisdotca/address-plus/jp";
Also exported from: @johnmorrisdotca/address-plus
Definition
function findMunicipalitiesByRomaji(text: string, prefectureCode?: string): JapaneseMunicipality[]
Parameters
| Name | Type | Description |
|---|---|---|
text | string | The name in romaji. |
prefectureCode (optional) | string | undefined | A prefecture's JIS code, to look in that prefecture only. |
Returns
JapaneseMunicipality[]
Every match, an empty array when there is none.
Examples
import { findMunicipalitiesByRomaji } from "@johnmorrisdotca/address-plus/jp";
console.log(findMunicipalitiesByRomaji("Chuo-ku, Sapporo").map((one) => one.name));
// → ["札幌市中央区"][ '札幌市中央区' ]What it prints (run when this page was built)