File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 1010from pythainlp .corpus import path_pythainlp_corpus
1111from pythainlp .corpus .common import _THAI_WORDS_FILENAME
1212
13- _NLPO3_DEFAULT_DICT_NAME = "_67a47bf9 " # supposed to be unique
13+ _NLPO3_DEFAULT_DICT_NAME = "_73bcj049dzbu9t49b4va170k " # supposed to be unique
1414_NLPO3_DEFAULT_DICT = nlpo3_load_dict (
1515 path_pythainlp_corpus (_THAI_WORDS_FILENAME ), _NLPO3_DEFAULT_DICT_NAME
16- )
16+ ) # preload default dict, so it can be accessible by _NLPO3_DEFAULT_DICT_NAME
1717
1818
1919def load_dict (file_path : str , dict_name : str ) -> bool :
2020 """Load a dictionary file into an in-memory dictionary collection.
2121
2222 The loaded dictionary will be accessible through the assigned dict_name.
23- *** This function does not override an existing dict name. ***
23+ *** This function will not override an existing dict name. ***
2424
2525 :param file_path: Path to a dictionary file
2626 :type file_path: str
2727 :param dict_name: A unique dictionary name, used for reference.
2828 :type dict_name: str
29- :return bool
29+ :return success: True if loaded successfully, False otherwise.
30+ :rtype: bool
3031
3132 :See Also:
3233 * \
3334 https://github.com/PyThaiNLP/nlpo3
3435 """
3536 msg , success = nlpo3_load_dict (file_path = file_path , dict_name = dict_name )
36- if bool is False :
37+ if not success :
3738 print (msg , file = stderr )
3839 return success
3940
You can’t perform that action at this time.
0 commit comments