address

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

View Source
var Cities = Places{}/* 1895 elements not displayed */
View Source
var Prefectures = Places{
	{Name: "北海道", Katakana: "ホッカイドウ", Hiragana: "ほっかいどう", Roman: "hokkaidou"},
	{Name: "青森県", Katakana: "アオモリケン", Hiragana: "あおもりけん", Roman: "aomoriken"},
	{Name: "岩手県", Katakana: "イワテケン", Hiragana: "いわてけん", Roman: "iwateken"},
	{Name: "宮城県", Katakana: "ミヤギケン", Hiragana: "みやぎけん", Roman: "miyagiken"},
	{Name: "秋田県", Katakana: "アキタケン", Hiragana: "あきたけん", Roman: "akitaken"},
	{Name: "山形県", Katakana: "ヤマガタケン", Hiragana: "やまがたけん", Roman: "yamagataken"},
	{Name: "福島県", Katakana: "フクシマケン", Hiragana: "ふくしまけん", Roman: "fukushimaken"},
	{Name: "茨城県", Katakana: "イバラキケン", Hiragana: "いばらきけん", Roman: "ibarakiken"},
	{Name: "栃木県", Katakana: "トチギケン", Hiragana: "とちぎけん", Roman: "tochigiken"},
	{Name: "群馬県", Katakana: "グンマケン", Hiragana: "ぐんまけん", Roman: "gummaken"},
	{Name: "埼玉県", Katakana: "サイタマケン", Hiragana: "さいたまけん", Roman: "saitamaken"},
	{Name: "千葉県", Katakana: "チバケン", Hiragana: "ちばけん", Roman: "chibaken"},
	{Name: "東京都", Katakana: "トウキョウト", Hiragana: "とうきょうと", Roman: "toukyouto"},
	{Name: "神奈川県", Katakana: "カナガワケン", Hiragana: "かながわけん", Roman: "kanagawaken"},
	{Name: "新潟県", Katakana: "ニイガタケン", Hiragana: "にいがたけん", Roman: "niigataken"},
	{Name: "富山県", Katakana: "トヤマケン", Hiragana: "とやまけん", Roman: "toyamaken"},
	{Name: "石川県", Katakana: "イシカワケン", Hiragana: "いしかわけん", Roman: "ishikawaken"},
	{Name: "福井県", Katakana: "フクイケン", Hiragana: "ふくいけん", Roman: "fukuiken"},
	{Name: "山梨県", Katakana: "ヤマナシケン", Hiragana: "やまなしけん", Roman: "yamanashiken"},
	{Name: "長野県", Katakana: "ナガノケン", Hiragana: "ながのけん", Roman: "naganoken"},
	{Name: "岐阜県", Katakana: "ギフケン", Hiragana: "ぎふけん", Roman: "gifuken"},
	{Name: "静岡県", Katakana: "シズオカケン", Hiragana: "しずおかけん", Roman: "shizuokaken"},
	{Name: "愛知県", Katakana: "アイチケン", Hiragana: "あいちけん", Roman: "aichiken"},
	{Name: "三重県", Katakana: "ミエケン", Hiragana: "みえけん", Roman: "mieken"},
	{Name: "滋賀県", Katakana: "シガケン", Hiragana: "しがけん", Roman: "shigaken"},
	{Name: "京都府", Katakana: "キョウトフ", Hiragana: "きょうとふ", Roman: "kyoutofu"},
	{Name: "大阪府", Katakana: "オオサカフ", Hiragana: "おおさかふ", Roman: "oosakafu"},
	{Name: "兵庫県", Katakana: "ヒョウゴケン", Hiragana: "ひょうごけん", Roman: "hyougoken"},
	{Name: "奈良県", Katakana: "ナラケン", Hiragana: "ならけん", Roman: "naraken"},
	{Name: "和歌山県", Katakana: "ワカヤマケン", Hiragana: "わかやまけん", Roman: "wakayamaken"},
	{Name: "鳥取県", Katakana: "トットリケン", Hiragana: "とっとりけん", Roman: "tottoriken"},
	{Name: "島根県", Katakana: "シマネケン", Hiragana: "しまねけん", Roman: "shimaneken"},
	{Name: "岡山県", Katakana: "オカヤマケン", Hiragana: "おかやまけん", Roman: "okayamaken"},
	{Name: "広島県", Katakana: "ヒロシマケン", Hiragana: "ひろしまけん", Roman: "hiroshimaken"},
	{Name: "山口県", Katakana: "ヤマグチケン", Hiragana: "やまぐちけん", Roman: "yamaguchiken"},
	{Name: "徳島県", Katakana: "トクシマケン", Hiragana: "とくしまけん", Roman: "tokushimaken"},
	{Name: "香川県", Katakana: "カガワケン", Hiragana: "かがわけん", Roman: "kagawaken"},
	{Name: "愛媛県", Katakana: "エヒメケン", Hiragana: "えひめけん", Roman: "ehimeken"},
	{Name: "高知県", Katakana: "コウチケン", Hiragana: "こうちけん", Roman: "kouchiken"},
	{Name: "福岡県", Katakana: "フクオカケン", Hiragana: "ふくおかけん", Roman: "fukuokaken"},
	{Name: "佐賀県", Katakana: "サガケン", Hiragana: "さがけん", Roman: "sagaken"},
	{Name: "長崎県", Katakana: "ナガサキケン", Hiragana: "ながさきけん", Roman: "nagasakiken"},
	{Name: "熊本県", Katakana: "クマモトケン", Hiragana: "くまもとけん", Roman: "kumamotoken"},
	{Name: "大分県", Katakana: "オオイタケン", Hiragana: "おおいたけん", Roman: "ooitaken"},
	{Name: "宮崎県", Katakana: "ミヤザキケン", Hiragana: "みやざきけん", Roman: "miyazakiken"},
	{Name: "鹿児島県", Katakana: "カゴシマケン", Hiragana: "かごしまけん", Roman: "kagoshimaken"},
	{Name: "沖縄県", Katakana: "オキナワケン", Hiragana: "おきなわけん", Roman: "okinawaken"},
}
View Source
var Towns = Places{}/* 1134 elements not displayed */

Functions

This section is empty.

Types

type Address

type Address struct {
	Prefecture *name.Name
	City       *name.Name
	Town       *name.Name
}

Address is pseudo place name information.

func NewAddress

func NewAddress(rand rand.Source) *Address

NewAddress function returns new Address instance.

Example
package main

import (
	"fmt"

	"github.com/goark/gimei-cli/address"
	"github.com/goark/mt/mt19937"
	"golang.org/x/text/cases"
	"golang.org/x/text/language"
)

func main() {
	a := address.NewAddress(mt19937.New(19650218))
	fmt.Println(a.FullName().Name)
	fmt.Println(a.FullName().Katakana)
	fmt.Println(a.FullName().Hiragana)
	fmt.Println(cases.Title(language.Und, cases.NoLower).String(a.FullName().Roman))
}
Output:

奈良県富士市ダイハツ町
ナラケンフジシダイハツチョウ
ならけんふじしだいはつちょう
Naraken Fujishi Daihatsuchou

func (*Address) FullName

func (a *Address) FullName() *name.Name

FullName method returns full name of place.

func (*Address) FullNameWithSep

func (a *Address) FullNameWithSep(sep string) *name.Name

FullNameWithSep method returns full name of place with the separator.

func (*Address) Prefix

func (a *Address) Prefix(addrs []string) bool

Prefix method returns true if matches with list of addresses.

func (*Address) String

func (a *Address) String() string

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator is context for gimei generator.

func New

func New() *Generator

New function returns Generator instance.

Example
package main

import (
	"fmt"

	"github.com/goark/gimei-cli/address"
	"github.com/goark/mt/mt19937"
)

func main() {
	gen := address.New().WithRandSource(mt19937.New(19650218)).WithUnique(true).WithFilters("松江")
	for i := 0; i < 15; i++ {
		fmt.Println(gen.New())
	}
}
Output:

島根県 松江市 上磯分内 (シマネケン マツエシ カミイソブンナイ)
島根県 松江市 芥田 (シマネケン マツエシ アクタダ)
島根県 松江市 日ノ出 (シマネケン マツエシ ヒノデ)
島根県 松江市 前沢区二十人町 (シマネケン マツエシ マエサワクニジュウニンマチ)
島根県 松江市 尾崎丁 (シマネケン マツエシ オザキチョウ)
島根県 松江市 北沢 (シマネケン マツエシ キタザワ)
島根県 松江市 波積町本郷 (シマネケン マツエシ ハヅミチョウホンゴウ)
島根県 松江市 幸町 (シマネケン マツエシ サイワイチョウ)
島根県 松江市 弓越 (シマネケン マツエシ ミコシ)
島根県 松江市 大蔵 (シマネケン マツエシ オオゾウ)
島根県 松江市 留辺蘂町金華 (シマネケン マツエシ ルベシベチョウカネハナ)
島根県 松江市 材木町 (シマネケン マツエシ ザイモクマチ)
島根県 松江市 木興町 (シマネケン マツエシ キコチョウ)
島根県 松江市 飯島道東 (シマネケン マツエシ イイジマミチヒガシ)
島根県 松江市 江上町 (シマネケン マツエシ エガミチョウ)

func (*Generator) New

func (gen *Generator) New() *Address

New method return new Address instance.

func (*Generator) WithFilters

func (gen *Generator) WithFilters(keyword string) *Generator

WithFilters method sets filters.

func (*Generator) WithRandSource

func (gen *Generator) WithRandSource(src rand.Source) *Generator

WithRandSource methos sets rand.Source.

func (*Generator) WithUnique

func (gen *Generator) WithUnique(flag bool) *Generator

WithUnique method sets unique flag.

type Places

type Places []*name.Name

Places is list of place names

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL