Priority and combination policy between dictionaries: when built-in and custom dictionaries conflict
Bareun uses several built-in dictionaries together with custom dictionaries. When the same word is in several dictionaries, which one to follow, and how to trace which dictionary recognized it, are important for understanding analysis results.
custom_dict_names: the dictionary specified first takes priority
In a morphological analysis request, you can specify several custom dictionaries with custom_dict_names.
In this case, the dictionary listed first takes priority. If the same entry is in several dictionaries, the one specified earlier is followed.
# Example: put the domain dictionary ahead of the general dictionary so it is applied first
custom_dict_names = ["medical-terms", "general-terms"]
- In the example above, if the same word is in both dictionaries,
medical-termstakes priority. - To change the priority, change the order in which you specify them.
Why is priority decided by order?
The dictionary that should take priority differs by situation. In medical documents, the medical terminology dictionary should come first, and in legal documents, the legal terminology dictionary should come first. Instead of a fixed ranking, Bareun lets you specify the order for each request, so that even the same word follows the dictionary that fits the nature of the document.
The relationship between built-in and custom dictionaries
Built-in dictionaries hold a broad general vocabulary, and custom dictionaries hold vocabulary specific to a domain or an organization. When you specify a dictionary, the words registered in it are recognized as the user intended.
| Dictionary type | Vocabulary it holds | Source marker |
|---|---|---|
| Custom dictionary | Domain- or organization-specific vocabulary | IN_CUSTOM_DICT |
| Basic built-in | Training vocabulary | IN_BUILTIN_DICT |
| Urimalsaem (Open Korean Dictionary) | General Korean vocabulary | IN_URIMALSAEM |
| Onterm (Korean terminology platform) | Technical terms and new words | IN_ON_DICT |
| Wiki | External proper nouns | IN_WIKI_DICT |
Tracing the source with OutOfVocab
You can trace which dictionary recognized a word with the morpheme's out_of_vocab value.
If it came from a custom dictionary, you can also check exactly which dictionary with custom_dict_name.
graph TD
M[Morpheme result] --> O{out_of_vocab};
O -- IN_CUSTOM_DICT --> CN[Check custom_dict_name];
O -- IN_BUILTIN_DICT --> B[Basic dictionary];
O -- IN_URIMALSAEM --> U[Urimalsaem];
O -- OUT_OF_VOCAB --> G[Guessed OOV];
Why you can trust the result
Source tracing lets you tell "this word was recognized from the dictionary I registered" apart from "this is a guess and needs review." This information also guides you when deciding where to add entries to your custom dictionary.
Frequently asked questions
Q. What happens if the same word is in several custom dictionaries?
The dictionary specified first in custom_dict_names takes priority. To change the priority, change the order in which you specify the dictionary names.
Q. Can I tell which dictionary recognized a word?
You can tell the source from each morpheme's out_of_vocab value, and if it came from a custom dictionary, you can also check which dictionary with custom_dict_name.
Q. Can a custom dictionary override a word in the built-in dictionary?
When you specify a custom dictionary, what is registered in it is reflected in the analysis. When you use several dictionaries together, the one specified first takes priority, so put the dictionary you intend first.
Q. How do I register and manage custom dictionaries?
Custom dictionaries are managed with the CustomDictionaryService API.
The dictionary files stored on the server are in a binary format, so you do not edit them directly as text.
The safe flow is to manage the word list source you own in Git and apply it with the UpdateCustomDictionary API.
Q. How do I get a word that came out as an out-of-vocabulary word recognized by a dictionary?
If a frequently used word is guessed as an out-of-vocabulary word (OUT_OF_VOCAB), register it in a custom dictionary.
A registered word is recognized as IN_CUSTOM_DICT and handled more reliably than a guess, and
you can also check which dictionary it came from with custom_dict_name.