korean_levenshtein 0.0.1 copy "korean_levenshtein: ^0.0.1" to clipboard
korean_levenshtein: ^0.0.1 copied to clipboard

Calculates similarity between two Korean strings using Levenshtein distance with decomposed phonemes, improving accuracy. 자모음 분리 및 초/종/중성 가중치 적용을 통해 두 한글 문자열 사이의 유사도를 정확하게 측정하는 패키지.

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');
}
4
likes
140
points
17
downloads

Publisher

unverified uploader

Weekly Downloads

Calculates similarity between two Korean strings using Levenshtein distance with decomposed phonemes, improving accuracy. 자모음 분리 및 초/종/중성 가중치 적용을 통해 두 한글 문자열 사이의 유사도를 정확하게 측정하는 패키지.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on korean_levenshtein