How the custom dictionary works
Words that are not in a general dictionary, such as company names, product names, and domain-specific technical terms, are easily misanalyzed.
Bareun lets you register such words yourself in a custom dictionary and adjust morphological analysis results as you like.
This article explains the kinds of custom dictionaries and how they work during analysis.
The five custom dictionaries
Custom dictionaries are divided into five types by the part of speech (POS) of the word you register.
| Dictionary | POS | Purpose | Example |
|---|---|---|---|
np_set | NP proper noun | Companies, products, personal names, and so on | 바이칼, 누리호 |
cp_set | CP compound noun | A compound noun to be treated as one unit | 인공지능연구소 |
cp_caret_set | CP^ split compound noun | Specify the split point with ^ | 인공지능^연구소 |
vv_set | VV verb | A new verb | The stem of 광클하다 |
va_set | VA adjective | A new adjective | A new adjective stem |
Determiner, adverb, and interjection dictionaries
Besides the five above, dictionaries for determiners (mm_set), adverbs (mag_set), and interjections (ic_set) are also available.
Choose the dictionary that matches the POS of the word you want to handle.
Post-correction during analysis
You specify custom dictionaries with custom_dict_names in a morphological analysis request.
You can specify several dictionaries together, and the dictionary specified first takes priority.
graph TD
IN[Input sentence] --> ANA[Morphological analysis];
ANA --> CHECK{custom_dict_names specified?};
CHECK -->|Yes| APPLY[Post-correct with the custom dictionary];
CHECK -->|No| BASE[Default result];
APPLY --> OUT[Corrected result<br/>marked IN_CUSTOM_DICT];
A morpheme recognized from a custom dictionary has its out_of_vocab value set to IN_CUSTOM_DICT,
and custom_dict_name shows which dictionary it came from.
Combination with built-in dictionaries and priority
Bareun uses custom dictionaries together with the built-in dictionary, Urimalsaem (Open Korean Dictionary), and embeddings.
The custom dictionaries you specify with custom_dict_names are applied first in post-correction, and the source of a morpheme
is distinguished by out_of_vocab. If the same headword is in several dictionaries (NP/CP/CP^/VV/VA)
at once, a conflict can occur, so check for duplicates and conflicts in advance with CheckConflict.
Real-time updates without downtime
Change the dictionary without stopping the server
Custom dictionaries detect file changes in the dictionary directory in real time and are also checked every 60 seconds. When a file is added, modified, or deleted, it is reloaded without restarting the server and without downtime. Even if you register a new word while the service is running, it is reflected in analysis immediately.
Frequently asked questions
Q. What kinds of custom dictionaries are there?
By part of speech, the five basic types are proper noun (NP), compound noun (CP), split compound noun (CP^), verb (VV), and adjective (VA), and dictionaries for determiners, adverbs, and interjections are also available.
Q. If I use several custom dictionaries together, which one takes priority?
You can specify several dictionaries in custom_dict_names of a morphological analysis request,
and the one specified first takes priority. If the same headword is in several dictionaries at once, you can
check the conflict with CheckConflict.
Q. Do I need to restart the server when I change a dictionary?
No. It detects file changes in the directory and checks periodically, so when a dictionary file changes, it is reloaded without stopping the server and without downtime.