(linenum→info "unix/slp.c:2238")

anthy/9100e/anthy/feature_set.h

    1: /* 素性を扱う */
    2: #ifndef _feature_set_h_included_
    3: #define _feature_set_h_included_
    4: 
    5: #include <anthy/wtype.h>
    6: 
    7: /* hash collisionが出たら適宜増やす */
    8: #define WORD_HASH_MAX 1024
    9: 
   10: /**/
   11: #define NR_EM_FEATURES 14
   12: 
   13: struct feature_list {
   14:   /* いまのところ、素性は14個まで */
   15:   int nr;
   16:   int size;
   17:   union {
   18:     short index[NR_EM_FEATURES];
   19:     short *array;
   20:   } u;
   21: };
   22: 
   23: struct feature_freq {
   24:   int f[NR_EM_FEATURES + 2];
   25: };
   26: 
   27: void anthy_init_features(void);
   28: struct feature_freq *
   29: anthy_find_feature_freq(const void *array,
   30:                         const struct feature_list *fl,
   31:                         struct feature_freq *arg);
   32: struct feature_freq *
   33: anthy_find_array_freq(const void *array,
   34:                       int *f, int nr,
   35:                       struct feature_freq *arg);
   36: 
   37: 
   38: /**/
   39: void anthy_feature_list_init(struct feature_list *fl);
   40: void anthy_feature_list_free(struct feature_list *fl);
   41: /**/
   42: void anthy_feature_list_add(struct feature_list *fl, int f);
   43: int anthy_feature_list_nr(const struct feature_list *fl);
   44: int anthy_feature_list_nth(const struct feature_list *fl, int nth);
   45: void anthy_feature_list_sort(struct feature_list *fl);
   46: /**/
   47: void anthy_feature_list_set_cur_class(struct feature_list *fl, int cc);
   48: void anthy_feature_list_set_class_trans(struct feature_list *fl, int pc, int cc);
   49: void anthy_feature_list_set_dep_word(struct feature_list *fl, int h);
   50: void anthy_feature_list_set_dep_class(struct feature_list *fl, int c);
   51: void anthy_feature_list_set_noun_cos(struct feature_list *fl, wtype_t wt);
   52: void anthy_feature_list_set_mw_features(struct feature_list *fl, int mask);
   53: /**/
   54: void anthy_feature_list_print(struct feature_list *fl);
   55: 
   56: #endif
Syntax (Markdown)