Sha256: caf92d1e7e798bca7179ff837b5390c0bab518101ae4cb4624f2b0775e50e313

Contents?: true

Size: 913 Bytes

Versions: 18

Compression:

Stored size: 913 Bytes

Contents

#ifndef _DICT_H_
#define _DICT_H_

#include "word.h"

/**
 * A dictionary is a hash table of
 *  - key: string
 *  - value: word
 *
 * Dictionary data can be loaded from files. Two type of dictionary
 * files are supported:
 *  - character file: Each line contains a number and a character,
 *                    the number is the frequency of the character.
 *                    The frequency should NOT exceeds 65535.
 *  - word file:      Each line contains a number and a word, the
 *                    number is the character count of the word.
 */

namespace rmmseg
{
    /* Instead of making a class with only one instance, i'll not
     * bother to make it a class here. */

    namespace dict
    {
        void  add(Word *word);
        bool  load_chars(const char *filename);
        bool  load_words(const char *filename);
        Word *get(const char *str, int len);
    }
}

#endif /* _DICT_H_ */

Version data entries

18 entries across 18 versions & 5 rubygems

Version Path
rmmseg-cpp-new-0.3.1 ext/rmmseg/dict.h
rmmseg-cpp-new-0.3.0 ext/rmmseg/dict.h
lijia-rmmseg-cpp-10.2.9.2 ext/rmmseg/dict.h
pluskid-rmmseg-cpp-0.2.0 ext/rmmseg/dict.h
pluskid-rmmseg-cpp-0.2.1 ext/rmmseg/dict.h
pluskid-rmmseg-cpp-0.2.2 ext/rmmseg/dict.h
pluskid-rmmseg-cpp-0.2.3 ext/rmmseg/dict.h
pluskid-rmmseg-cpp-0.2.4 ext/rmmseg/dict.h
rmmseg-cpp-traditional-2.0.4 ext/rmmseg/dict.h
rmmseg-cpp-traditional-2.0.2 ext/rmmseg/dict.h
rmmseg-cpp-traditional-2.0.0 ext/rmmseg/dict.h
rmmseg-cpp-traditional-1.0.1 ext/rmmseg/dict.h
rmmseg-cpp-traditional-1.0.0 ext/rmmseg/dict.h
rmmseg-cpp-traditional-0.0.2 ext/rmmseg/dict.h
rmmseg-cpp-0.2.9 ext/rmmseg/dict.h
rmmseg-cpp-0.2.6 ext/rmmseg/dict.h
rmmseg-cpp-0.2.5 ext/rmmseg/dict.h
rmmseg-cpp-0.2.7 ext/rmmseg/dict.h