0
|
1 |
|
|
2 |
#ifndef _WORD_H_
|
|
3 |
#define _WORD_H_
|
|
4 |
|
|
5 |
#include "list.h"
|
|
6 |
#include "Component.h"
|
|
7 |
#include "string.h"
|
|
8 |
|
|
9 |
class Page;
|
|
10 |
|
|
11 |
class Word {
|
|
12 |
public:
|
|
13 |
|
|
14 |
// Constructor scans through count components starting at first
|
|
15 |
// to set data fields. length is the actual length of the string
|
|
16 |
Word(ListElement * first, int count, int charlength);
|
|
17 |
Word(char * word, int length);
|
|
18 |
~Word();
|
|
19 |
|
|
20 |
Point center() { return (Point((ul.x() + lr.x())/2,
|
|
21 |
(ul.y() +lr.y())/2)); };
|
|
22 |
char * characters; // text string
|
|
23 |
int charCount; // Number of characters in the string
|
|
24 |
int compCount;
|
|
25 |
|
|
26 |
short mispelled;
|
|
27 |
// spelled correctly? only valid if the word
|
|
28 |
// has been spellchecked
|
|
29 |
|
|
30 |
Confidence confid; // The average confidence of each char in word
|
|
31 |
Point ul; // upper left point of word
|
|
32 |
Point lr; // lower right point of word
|
|
33 |
|
|
34 |
Component ** character; // an array of components that
|
|
35 |
// make up this word
|
|
36 |
};
|
|
37 |
|
|
38 |
|
|
39 |
class Words:public List{
|
|
40 |
|
|
41 |
public:
|
|
42 |
int num_words;
|
|
43 |
Words():List(){};
|
|
44 |
~Words();
|
|
45 |
int writeWordPos(char * filename);
|
|
46 |
int writeWordbox(char * filename, int xoffset, int yoffset,
|
|
47 |
Page * page, bool equationsOnly);
|
|
48 |
int writeAscii(char * filename);
|
|
49 |
};
|
|
50 |
|
|
51 |
#endif
|
|
52 |
|
|
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|