'Load personalized dict to improve detect rate.
Parameter:
- f : A plain text file contains words and their ocurrences.
Can be a file-like object, or the path of the dictionary file,
whose encoding must be utf-8.
Structure of dict file:
word1 freq1 word_type1
word2 freq2 word_type2
Word type may be ignored'

def load_userdict(self, f):

    self.check_initialized()
    if isinstance(f, string_types):
        f_name = f
        f = open(f, u'rb')
    else:
        f_name = resolve_filename(f)
    for (lineno, ln) in enumerate(f, 1):
        line = ln.strip()
        if (not isinstance(line, text_type)):
            try:
                line = line.decode(u'utf-8').lstrip(u'\ufeff')
            except UnicodeDecodeError:
                raise ValueError((u'dictionary    file    %s    must    be    utf-8' % f_name))
        if (not line):
            continue
        (word, freq, tag) = re_userdict.match(line).groups()
        if (freq is not None):
            freq = freq.strip()
        if (tag is not None):
            tag = tag.strip()
        self.add_word(word, freq, tag)
