1 /* 2 * Copyright 2006-2008 The FLWOR Foundation. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 #pragma once 17 #ifndef ZORBA_FT_TYPES_H 18 #define ZORBA_FT_TYPES_H 19 20 #include <iostream> 21 22 #define DEF_OSTREAM_INSERT_OPERATOR \ 23 inline std::ostream& operator<<( std::ostream &o, type t ) { \ 24 return o << string_of[ t ]; \ 25 } 26 27 /////////////////////////////////////////////////////////////////////////////// 28 29 namespace zorba { 30 31 namespace ft_anyall_mode { 32 enum type { 33 any, 34 any_word, 35 all, 36 all_words, 37 phrase 38 }; 39 type const DEFAULT = any; 40 extern char const *const string_of[]; 41 DEF_OSTREAM_INSERT_OPERATOR 42 } 43 44 namespace ft_big_unit { 45 enum type { 46 sentence, 47 paragraph 48 }; 49 extern char const *const string_of[]; 50 DEF_OSTREAM_INSERT_OPERATOR 51 } 52 53 namespace ft_case_mode { 54 enum type { 55 insensitive, 56 sensitive, 57 lower, 58 upper 59 }; 60 type const DEFAULT = insensitive; 61 extern char const *const string_of[]; 62 DEF_OSTREAM_INSERT_OPERATOR 63 } 64 65 namespace ft_content_mode { 66 enum type { 67 at_start, 68 at_end, 69 entire 70 }; 71 extern char const *const string_of[]; 72 DEF_OSTREAM_INSERT_OPERATOR 73 }; 74 75 namespace ft_diacritics_mode { 76 enum type { 77 insensitive, 78 sensitive 79 }; 80 type const DEFAULT = insensitive; 81 extern char const *const string_of[]; 82 DEF_OSTREAM_INSERT_OPERATOR 83 } 84 85 namespace ft_range_mode { 86 enum type { 87 exactly, 88 at_least, 89 at_most, 90 from_to 91 }; 92 extern char const *const string_of[]; 93 DEF_OSTREAM_INSERT_OPERATOR 94 } 95 96 namespace ft_scope { 97 enum type { 98 same, 99 different 100 }; 101 extern char const *const string_of[]; 102 DEF_OSTREAM_INSERT_OPERATOR 103 } 104 105 namespace ft_stem_mode { 106 enum type { 107 no_stemming, 108 stemming 109 }; 110 type const DEFAULT = no_stemming; 111 extern char const *const string_of[]; 112 DEF_OSTREAM_INSERT_OPERATOR 113 } 114 115 namespace ft_stop_words_mode { 116 enum type { 117 without, 118 with, 119 with_default 120 }; 121 type const DEFAULT = without; 122 extern char const *const string_of[]; 123 DEF_OSTREAM_INSERT_OPERATOR 124 } 125 126 namespace ft_stop_words_unex { 127 enum type { 128 union_, 129 except 130 }; 131 extern char const *const string_of[]; 132 DEF_OSTREAM_INSERT_OPERATOR 133 } 134 135 namespace ft_unit { 136 enum type { 137 words, 138 sentences, 139 paragraphs 140 }; 141 extern char const *const string_of[]; 142 DEF_OSTREAM_INSERT_OPERATOR 143 } 144 145 namespace ft_wild_card_mode { 146 enum type { 147 without, 148 with 149 }; 150 type const DEFAULT = without; 151 extern char const *const string_of[]; 152 DEF_OSTREAM_INSERT_OPERATOR 153 } 154 155 } // namespace zorba 156 157 /////////////////////////////////////////////////////////////////////////////// 158 159 #undef DEF_OSTREAM_INSERT_OPERATOR 160 161 #endif /* ZORBA_FT_TYPES_H */ 162 /* vim:set et sw=2 ts=2: */ 163