dict/hyphen.h

Go to the documentation of this file.
00001 
00019 #ifndef HYPHEN_H
00020 #define HYPHEN_H
00021 
00022 /*----------------------------------------------------------------------
00023               I n c l u d e s
00024 ----------------------------------------------------------------------*/
00025 #include "choices.h"
00026 
00027 /*----------------------------------------------------------------------
00028               V a r i a b l e s
00029 ----------------------------------------------------------------------*/
00031 extern int last_word_on_line;
00033 extern char *hyphen_string;
00035 extern float hyphen_rating;
00037 extern int hyphen_state;
00038 
00039 /*----------------------------------------------------------------------
00040               M a c r o s
00041 ----------------------------------------------------------------------*/
00045 #define set_last_word()  \
00046 last_word_on_line = TRUE
00047 
00051 #define reset_hyphen_word()                      \
00052 if (last_word_on_line == FALSE) {              \
00053    if (hyphen_string) strfree (hyphen_string); \
00054    hyphen_string = NULL;                       \
00055    hyphen_rating = MAX_FLOAT32;                   \
00056    hyphen_state = 0;                           \
00057 }                                              \
00058 
00059 
00063 #define reset_last_word()  \
00064 last_word_on_line = FALSE
00065 
00069 #define is_last_word()  \
00070 (last_word_on_line)
00071 
00076 #define hyphen_base_size()                 \
00077 ((! is_last_word () && hyphen_string) ?  \
00078    (strlen (hyphen_string))             :  \
00079    (0))                                    \
00080 
00081 
00088 #define hyphen_tail(word)        \
00089 (& word [hyphen_base_size()])  \
00090 
00091 /*----------------------------------------------------------------------
00092           Public Function Prototypes
00093 ----------------------------------------------------------------------*/
00094 void set_hyphen_word(char *word, float rating, int state); 
00095 #endif

Generated on Wed Feb 28 19:49:10 2007 for Tesseract by  doxygen 1.5.1