Git Product home page Git Product logo

dot-gimei's Introduction

dot-gimei

.NET port of gimei, inspired by go-gimei

Installation

Available via Nuget

PM> Install-Package dot-gimei

Usage

using System;
using DotGimei;

class Program
{
    public static void Main(string[] args)
    {
        var name = Gimei.NewName();
        Console.WriteLine(name);                // 斎藤 陽菜
        Console.WriteLine(name.Kanji);          // 斎藤 陽菜
        Console.WriteLine(name.Hiragana);       // さいとう はるな
        Console.WriteLine(name.Katakana);       // サイトウ ハルナ
        Console.WriteLine(name.Last.Kanji);     // 斎藤
        Console.WriteLine(name.Last.Hiragana);  // さいとう
        Console.WriteLine(name.Last.Katakana);  // サイトウ
        Console.WriteLine(name.First.Kanji);    // 陽菜
        Console.WriteLine(name.First.Hiragana); // はるな
        Console.WriteLine(name.First.Katakana); // ハルナ
        Console.WriteLine(name.IsMale);         // false

        var male = Gimei.NewMale();
        Console.WriteLine(male);          // 小林 顕士
        Console.WriteLine(male.IsMale);   // true
        Console.WriteLine(male.IsFemale); // false

        var address = Gimei.NewAddress();
        Console.WriteLine(address);                     // 岡山県大島郡大和村稲木町
        Console.WriteLine(address.Kanji);               // 岡山県大島郡大和村稲木町
        Console.WriteLine(address.Hiragana);            // おかやまけんおおしまぐんやまとそんいなぎちょう
        Console.WriteLine(address.Katakana);            // オカヤマケンオオシマグンヤマトソンイナギチョウ
        Console.WriteLine(address.Prefecture);          // 岡山県
        Console.WriteLine(address.Prefecture.Kanji);    // 岡山県
        Console.WriteLine(address.Prefecture.Hiragana); // おかやまけん
        Console.WriteLine(address.Prefecture.Katakana); // オカヤマケン
        Console.WriteLine(address.Town);                // 大島郡大和村
        Console.WriteLine(address.Town.Kanji);          // 大島郡大和村
        Console.WriteLine(address.Town.Hiragana);       // おおしまぐんやまとそん
        Console.WriteLine(address.Town.Katakana);       // オオシマグンヤマトソン
        Console.WriteLine(address.City);                // 稲木町
        Console.WriteLine(address.City.Kanji);          // 稲木町
        Console.WriteLine(address.City.Hiragana);       // いなぎちょう
        Console.WriteLine(address.City.Katakana);       // イナギチョウ

        var prefecture = Gimei.NewPrefecture();
        Console.WriteLine(prefecture); // 青森県
    }
}

Notes

License

MIT

Author

INOMATA Kentaro (@matarillo)

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.