GithubHelp home page GithubHelp logo

kstring.net's Introduction

KString.net

Korean String Extension for .NET

한글 자모 시스템에 특화된 문자열 비교 및 다양한 기능을 제공합니다. Extension library for String class, specially optimized for "Hangul Jamo System"

Download from Nuget

PM> Install-Package KString

Link: KString on Nuget

Quick Start / 간단한 사용법

프로젝트에 어셈블리를 추가하신 후 " using Moda.KString " 를 소스파일 상단에 넣어주시면 사용이 가능합니다.

// KEquals : 초성이나 초성+중성이 정확히 일치해야 함
"동해물과 백두산이".KEqulas("ㄷㅎㅁㄱ ㅂㄷㅅㅇ"); // true
"동해물과 백두산이".KEqulas("도해무과 ㅂㄷㅅㅇ"); // true
"동해물과 백두산이".KEqulas("ㄷㅎㅁㄱ ㅂㄷㅅ") // false 

// KContains : 해당 초성이나 초중성이 들어가면 OK
"동해물과 백두산이".KContains("ㄷㅎㅁㄱ"); // true

// KIndexOf : 해당 패턴이 시작하는 부분을 리턴
"동해물과 백두산이".KIndexOf("ㄷㅎㅁㄱ"); // 0
"동해물과 백두산이".KIndexOf("ㅂㄷㅅ"); // 4

// KMatch : 해당 패턴에 해당하는 스트링을 추출
"동해물과 백두산이".KMatch("ㄷㅎㅁㄱ"); // "동해물과"
"동해물과 백두산이".KMatch("ㅂㄷㅅ"); // "백두산"

// KSeparate : 자소분리
"동해물과".KSeparate(); // "ㄷㅗㅇㅎㅐㅁㅜㄹㄱㅘ"

// lambda 또는 interface를 활용해 기능 확장이 가능
"동해물과".KContains("ㅗㅐㅜㅘ", (i, p) => { /* ... */ });
"동해물과".KContains("ㅗㅐㅜㅘ", ChosungOnlyComparator);

// 초성 추출
"동해물과 백두산이".KExtract(); // "ㄷㅎㅁㄱ ㅂㄷㅅㅇ"

// 조사 자동추가
"동해물".KAppendJosa(JosaType.WG); // "동해물과"
"백두산".KAppendJosa("이", "가"); // "백두산이"

(소스코드의 Test코드들을 참고하셔도 됩니다)

Required

  • .NET 4.0 or higher
  • Windows Phone 7.5 or higher
  • Windows Store Apps
  • Silverlight 5 or higher

See Also

Special Thanks to

  • HeeJae Chang
  • Junil Um
  • Gilbok Lee

Feedbacks will be welcomed!

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.