Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: 정확도 계산을 위한 함수 #49

Closed
ghost opened this issue Apr 15, 2024 · 1 comment
Closed

[Feature]: 정확도 계산을 위한 함수 #49

ghost opened this issue Apr 15, 2024 · 1 comment
Assignees

Comments

@ghost
Copy link

ghost commented Apr 15, 2024

Description

chosungIncludes 같이 boolean 으로 딱 떨어지는 함수말고도, 정확도 계산을 위한 함수도 존재했으면 좋겠습니다.

Possible Solution

/**
 * 한글 문자열 정확도 계산
 * @param targetText
 * @param inputText
 * @returns 정확도 혹은 철자 오타 갯수?!
 */
function calculateHangulAccuracy(targetText: string,inputText: string): number{
    return 0.4;
}

etc.

예상 사용 사례

자동완성 기능을 만들때, 어느정도의 오차를 허용해주는 제한을 제공하여 더 유연하게 구현가능.

@okinawaa
Copy link
Member

okinawaa commented Jul 9, 2024

너무나 많은 분들이 도움을 주셨지만,
es-hangul의 방향성 문제로 이 이슈는 진행하지 않으려고 해요.

이 메서드의 코어한 로직은, 한글의 복잡도를 이해한 뒤, 유사도를 계산한다기 보다는 Levenshtein 을 사용하는것에 불과하다고 생각합니다.

이 기능을 구현하고 싶다면, disassembleHangul 함수와 levenshetein 알고리즘을 이용해서 직접 구현할 수 있을거라고 생각합니다.
물론 더 좋은 알고리즘이 있다면 그것을 이용해도 좋고요!

@okinawaa okinawaa closed this as completed Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant