Giter Site home page Giter Site logo

yellowtoast / korean_levenshtein Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 33 KB

Calculates similarity between two Korean strings using Levenshtein distance with decomposed phonemes, improving accuracy.

License: MIT License

Dart 100.00%
dart dartlang levenshtein-algorithm levenshtein-distance textsimilarity

korean_levenshtein's Introduction

KoreanLevenshtein

The KoreanLevenshtein algorithm is a modification of the traditional Levenshtein distance algorithm, specifically tailored to handle Korean text. It calculates the similarity between two Korean strings by measuring the difference in their characters, accounting for the nuances of the Korean language, such as decomposed phonemes and special characters.

Features

  • Decomposed Phonemes Handling: Korean characters consist of decomposed phonemes, namely, chosung, jungsung, and jongsung. The algorithm decomposes each character into its constituent phonemes, allowing for a more accurate comparison.

  • Numeric Character Replacement: Optionally replaces numeric characters with their Korean representations, ensuring uniformity in text comparison regardless of numeric presence.

  • Special Character Replacement: Optionally replaces special characters with their Korean speech equivalents, facilitating consistent comparison by considering special characters as part of the language.

  • Customized Phoneme Weights: Allows users to customize the weights assigned to different phonemes, enabling fine-tuning of the comparison process based on specific requirements.

Getting Started

To use this package, add korean_levenshtein as a dependency in your pubspec.yaml file.

Usage

The KoreanLevenshtein algorithm provides functions for text comparison. Below is an example of how to use it:

import 'package:korean_levenshtein/korean_levenshtein.dart';

void main() {
  // Example usage of jamoSimilarityPercentage function
  double similarity = KoreanLevenshtein.jamoSimilarityPercentage(
    '안녕하세요',
    '안녕하십니까?',
    replaceNumberToKorean: true,
    replaceSpecialCharToKorean: true,
  );

  print('Similarity Percentage: $similarity');
}

korean_levenshtein's People

Contributors

yellowtoast avatar

Stargazers

Jeong Seungdeok avatar

Watchers

 avatar

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.