reference/ocr-simple/Word.h
changeset 0 6b8091ca909a
equal deleted inserted replaced
-1:000000000000 0:6b8091ca909a
       
     1 
       
     2 #ifndef _WORD_H_
       
     3 #define _WORD_H_
       
     4 
       
     5 #include "list.h"
       
     6 #include "Component.h"
       
     7 
       
     8 class Word {
       
     9  public:
       
    10 
       
    11  // Constructor scans through length components starting at first
       
    12  // to set data fields 
       
    13  Word(ListElement * first, int length);
       
    14  Word(char * word, int length);
       
    15  ~Word();
       
    16 
       
    17   char * characters;        // text string
       
    18   int charCount;            // Number of characters in the string
       
    19 
       
    20   short mispelled;          
       
    21   // spelled correctly? only valid if the word 
       
    22   // has been spellchecked
       
    23 
       
    24   Confidence confid;        // The average confidence of each char in word
       
    25   Point ul;                 // upper left point of word     
       
    26   Point lr;                 // lower right point of word
       
    27   
       
    28   Component ** character;   // an array of components that 
       
    29                              // make up  this word
       
    30 };
       
    31 
       
    32 
       
    33 class Words:public List{
       
    34 
       
    35  public:
       
    36   int num_words;
       
    37   Words():List(){};
       
    38  ~Words();
       
    39   int writeWordPos(char * filename);
       
    40   int writeAscii(char * filename);
       
    41 };
       
    42 
       
    43 #endif