1

what i'm trying to do is get some korean verb or adjective and turn it to it's dictionary form. So let's say that someone typed '추워요', which is the adjective for cold. It's dictionary form is '춥다'. Is there a way that i can do something like

"Hey, if it ends in '워요' append a 'ㅂ' to the character right before it".

Specifically that part of appending, is there a way to do something like that? Like 가 + ㅆ = 갔.

I'm using javascript but i'm open to try another language if it's easier to do it.

3
  • It is more complicated than this, and you have chosen a specific example that has a non standard conversion from it's dictionary root to it's sentence form. What exactly are you trying to do? You will need better understanding of the basics before you can do this programmatically.
    – user17915
    Commented Jul 3, 2022 at 16:45
  • I was trying to get the dictionary from the user input. So if the input is 먹어요, i'll turn it to 먹다. This is a simple case, because you just take 어요 out and append 다. But if it was like 매운, 추운, 더운, i would have to append ㅂ to the first character and then add 다. But i don't think i can do it that easily hahaha Commented Jul 3, 2022 at 19:11
  • Specifically for that appending part, probably most simply, you can do something like de_codepoint(codepoint(추) + 1 + (codepoint(ㅂ) - codepoint(ㄱ))). Still the rule won't work for a verb 키워요 for example.
    – krim
    Commented Jul 4, 2022 at 3:05

1 Answer 1

2

If you're looking for (or wanting to implement) a general Korean word "destructurer", it's not an easy problem. The problem is called "morphological analyzer" and in fact, there have been many academic/industry projects to solve it (IMHO, I don't think it's solved along with all other computational linguistic problems). Here's an early study that's 100% rule-based: Klex, but it's neither free nor open source. See koNLPy for some open-source python options. Also for a larger neural model, Kakao, a Korean big tech, published and maintains khaiii, an open-source morph-analyzer on github. And finally, see also this paper to see how a recent climate-changing AI approach still is struggling with the problem.

Plus, you want to take input from users. That adds even harder components to the problem. Namely, you might want to handle all non-standard input strings, such as spell errors, puns, trendy coinages, creative nonces, and rare loanwords, which probably are not part of your rules or training data.

If what you're looking for is a simpler piece of software that composes Hangul characters from smaller jamo pieces, for example + = , Unicode has algorithmic ways to achieve that. See, for example, tech report #47. Note that these normalization algorithms only work when the input already somewhat normalized (e.g. comes in not as U+3146 nor U+110A, but as U+11BB, and U+11BB alone without other "filler" characters). More importantly, Unicode can't give you any language-level composition algorithm that properly supports irregular conjugations (e.g. + = 추웠), so you need a morph-analyzer at some point anyway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.