When the custom dictionary is not applied
You registered a word in the custom dictionary but the analysis result stays the same? Most of the time the cause is a missing dictionary name, the wrong dictionary type, or a conflict between dictionaries. Let's go through it step by step with this page.
Symptoms
Even though you registered a word with UpdateCustomDictionary, in the morphological analysis result:
- the registered word still comes back as
NA/UNK, out_of_vocabis stillOUT_OF_VOCABrather thanIN_CUSTOM_DICT, orcustom_dict_nameis empty.
Causes
Suspect these three things.
| Cause | Description |
|---|---|
Missing custom_dict_names | The analysis request does not specify the dictionary name to use |
| Wrong dictionary type | The word was registered in the wrong DictSet (np_set/cp_set/vv_set, and so on) |
| Conflict or duplicate | The same headword exists in several dictionaries or several types at once |
Fix
-
Specify
custom_dict_namesin the analysis request. Creating a dictionary does not apply it automatically. You have to state the dictionary names to use in every request. You can give several, and the dictionary specified first takes priority.{ "document": { "content": "바른은 한국어 형태소 분석기입니다.", "language": "ko_KR" }, "custom_dict_names": ["my-domain", "company-names"] } -
Check that the dictionary type is right. The word must go into the DictSet that fits its nature.
DictSet Purpose np_setProper noun (NP) cp_setCompound noun (CP) cp_caret_setCompound noun splitting (mark the split point with ^)vv_setVerb (VV) va_setAdjective (VA) mm_set/mag_set/ic_setDeterminer / adverb / interjection -
Check for conflicts. Use
CheckConflictto check for duplicates within the same dictionary (duplicated) and conflicts between dictionaries (conflict). If the same headword is inNP/CP/CP^/VV/VAat the same time, it is reported as a conflict, and it is best to leave only the one type you intended. -
Check that the update was applied. The custom dictionary is managed through the
CustomDictionaryServiceAPI, and the files placed in the server's dictionary directory are binary (a format managed by the server). When you change it withUpdateCustomDictionary,Bareundetects file changes (additions, edits, deletions) in the dictionary directory in real time and also checks every 60 seconds, performing a zero-downtime reload. If you do not see the change applied right after, wait a moment and analyze again.
Dictionary names must be exact
If the name you put in custom_dict_names differs by even one character from the name you actually registered, it is not
applied. First check the list of registered dictionary names with GetCustomDictionaryList.
Prevention and tips
- You can tell that registration worked when the
out_of_vocabof the morpheme in the analysis result changes toIN_CUSTOM_DICTandcustom_dict_nameis filled with the dictionary name. index.dup.txtis excluded from watching, so do not edit it directly.
Frequently asked questions
Q. Is a dictionary applied automatically once I register it?
No. You must specify the dictionary names to use in custom_dict_names in every analysis request for them to apply. You can specify
several, and the one specified first takes priority.
Q. I changed the dictionary. Do I need to restart the server?
No restart is needed. Bareun detects file changes in the dictionary directory in real time and rereads the changes without downtime.
A 60-second periodic check also runs alongside.
Q. Can I put the same word in several dictionaries?
If the same headword is in several types such as NP/CP/CP^/VV/VA at the same time, it is reported as a conflict. We recommend checking with CheckConflict
and leaving only the one type you intended.
Q. Can I edit the dictionary files directly in a text editor?
We do not recommend it. The files placed in the server's dictionary directory are binary (a format managed by the server),
so you do not edit them directly as .txt. Manage the custom dictionary through the CustomDictionaryService API
(UpdateCustomDictionary). We recommend version-controlling the word list source in Git and applying that list
through the API.