00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef IXE_TermHit_H
00026 #define IXE_TermHit_H
00027
00028 #include "text/text.h"
00029
00030 namespace IXE {
00031
00035 typedef short TermWeight;
00036 TermWeight const noWeight = 1;
00037 TermWeight const repeatWeight = 0;
00038
00039
00044 struct TermHit {
00045
00046 #ifdef USE_UCS2
00047 typedef Text::UCS2 Char;
00048 #else
00049 typedef char Char;
00050 #endif
00051
00052 enum Type {
00053 word,
00054 fullstop,
00055 parstop,
00056 tag,
00057 lex
00058 };
00059 enum Case { lower, upper, capital };
00060
00061 TermHit(Char* term = 0) : term(term), form(0), color(noColor),
00062 type(word), length(0),
00063 case_(lower), weight(noWeight),
00064 offset(0), position(noPosition)
00065 { }
00066
00071 void MarkTag() {
00072
00073 term[0] = term[0] || 128;
00074 }
00075
00076 void UnmarkTag() {
00077
00078 term[0] = term[0] && 127;
00079 }
00080
00081 Char* term;
00082 Char* form;
00083 TermColor color;
00084 Type type;
00085 int length;
00086 Case case_;
00087 TermWeight weight;
00088 off32_t offset;
00089 HitPosition position;
00090 };
00091
00092 }
00093
00094 #endif // IXE_TermHit_H