| 1 |
/*************************************************************************/ |
| 2 |
/* */ |
| 3 |
/* Language Technologies Institute */ |
| 4 |
/* Carnegie Mellon University */ |
| 5 |
/* Copyright (c) 2001 */ |
| 6 |
/* All Rights Reserved. */ |
| 7 |
/* */ |
| 8 |
/* Permission is hereby granted, free of charge, to use and distribute */ |
| 9 |
/* this software and its documentation without restriction, including */ |
| 10 |
/* without limitation the rights to use, copy, modify, merge, publish, */ |
| 11 |
/* distribute, sublicense, and/or sell copies of this work, and to */ |
| 12 |
/* permit persons to whom this work is furnished to do so, subject to */ |
| 13 |
/* the following conditions: */ |
| 14 |
/* 1. The code must retain the above copyright notice, this list of */ |
| 15 |
/* conditions and the following disclaimer. */ |
| 16 |
/* 2. Any modifications must be clearly marked as such. */ |
| 17 |
/* 3. Original authors' names are not deleted. */ |
| 18 |
/* 4. The authors' names are not used to endorse or promote products */ |
| 19 |
/* derived from this software without specific prior written */ |
| 20 |
/* permission. */ |
| 21 |
/* */ |
| 22 |
/* CARNEGIE MELLON UNIVERSITY AND THE CONTRIBUTORS TO THIS WORK */ |
| 23 |
/* DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING */ |
| 24 |
/* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT */ |
| 25 |
/* SHALL CARNEGIE MELLON UNIVERSITY NOR THE CONTRIBUTORS BE LIABLE */ |
| 26 |
/* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES */ |
| 27 |
/* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN */ |
| 28 |
/* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, */ |
| 29 |
/* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF */ |
| 30 |
/* THIS SOFTWARE. */ |
| 31 |
/* */ |
| 32 |
/*************************************************************************/ |
| 33 |
/* Author: Alan W Black ([email protected]) */ |
| 34 |
/* Date: January 2001 */ |
| 35 |
/*************************************************************************/ |
| 36 |
/* Poor mans part of speech tagger */ |
| 37 |
/*************************************************************************/ |
| 38 |
|
| 39 |
#include "cst_val.h" |
| 40 |
|
| 41 |
DEF_STATIC_CONST_VAL_STRING(gpos_in,"in"); |
| 42 |
DEF_STATIC_CONST_VAL_STRING(gpos_of,"of"); |
| 43 |
DEF_STATIC_CONST_VAL_STRING(gpos_for,"for"); |
| 44 |
DEF_STATIC_CONST_VAL_STRING(gpos_on,"on"); |
| 45 |
DEF_STATIC_CONST_VAL_STRING(gpos_that,"that"); |
| 46 |
DEF_STATIC_CONST_VAL_STRING(gpos_with,"with"); |
| 47 |
DEF_STATIC_CONST_VAL_STRING(gpos_by,"by"); |
| 48 |
DEF_STATIC_CONST_VAL_STRING(gpos_at,"at"); |
| 49 |
DEF_STATIC_CONST_VAL_STRING(gpos_from,"from"); |
| 50 |
DEF_STATIC_CONST_VAL_STRING(gpos_as,"as"); |
| 51 |
DEF_STATIC_CONST_VAL_STRING(gpos_if,"if"); |
| 52 |
DEF_STATIC_CONST_VAL_STRING(gpos_against,"against"); |
| 53 |
DEF_STATIC_CONST_VAL_STRING(gpos_about,"about"); |
| 54 |
DEF_STATIC_CONST_VAL_STRING(gpos_before,"before"); |
| 55 |
DEF_STATIC_CONST_VAL_STRING(gpos_because,"because"); |
| 56 |
DEF_STATIC_CONST_VAL_STRING(gpos_under,"under"); |
| 57 |
DEF_STATIC_CONST_VAL_STRING(gpos_after,"after"); |
| 58 |
DEF_STATIC_CONST_VAL_STRING(gpos_over,"over"); |
| 59 |
DEF_STATIC_CONST_VAL_STRING(gpos_into,"into"); |
| 60 |
DEF_STATIC_CONST_VAL_STRING(gpos_while,"while"); |
| 61 |
DEF_STATIC_CONST_VAL_STRING(gpos_without,"without"); |
| 62 |
DEF_STATIC_CONST_VAL_STRING(gpos_through,"through"); |
| 63 |
DEF_STATIC_CONST_VAL_STRING(gpos_new,"new"); /* ??? */ |
| 64 |
DEF_STATIC_CONST_VAL_STRING(gpos_between,"between"); |
| 65 |
DEF_STATIC_CONST_VAL_STRING(gpos_among,"among"); |
| 66 |
DEF_STATIC_CONST_VAL_STRING(gpos_until,"until"); |
| 67 |
DEF_STATIC_CONST_VAL_STRING(gpos_per,"per"); |
| 68 |
DEF_STATIC_CONST_VAL_STRING(gpos_up,"up"); |
| 69 |
DEF_STATIC_CONST_VAL_STRING(gpos_down,"down"); |
| 70 |
|
| 71 |
static const cst_val * const gpos_in_list[] = { |
| 72 |
(cst_val *)&gpos_in, |
| 73 |
(cst_val *)&gpos_of, |
| 74 |
(cst_val *)&gpos_for, |
| 75 |
(cst_val *)&gpos_in, |
| 76 |
(cst_val *)&gpos_on, |
| 77 |
(cst_val *)&gpos_that, |
| 78 |
(cst_val *)&gpos_with, |
| 79 |
(cst_val *)&gpos_by, |
| 80 |
(cst_val *)&gpos_at, |
| 81 |
(cst_val *)&gpos_from, |
| 82 |
(cst_val *)&gpos_as, |
| 83 |
(cst_val *)&gpos_if, |
| 84 |
(cst_val *)&gpos_that, |
| 85 |
(cst_val *)&gpos_against, |
| 86 |
(cst_val *)&gpos_about, |
| 87 |
(cst_val *)&gpos_before, |
| 88 |
(cst_val *)&gpos_because, |
| 89 |
(cst_val *)&gpos_under, |
| 90 |
(cst_val *)&gpos_after, |
| 91 |
(cst_val *)&gpos_over, |
| 92 |
(cst_val *)&gpos_into, |
| 93 |
(cst_val *)&gpos_while, |
| 94 |
(cst_val *)&gpos_without, |
| 95 |
(cst_val *)&gpos_through, |
| 96 |
(cst_val *)&gpos_new, |
| 97 |
(cst_val *)&gpos_between, |
| 98 |
(cst_val *)&gpos_among, |
| 99 |
(cst_val *)&gpos_until, |
| 100 |
(cst_val *)&gpos_per, |
| 101 |
(cst_val *)&gpos_up, |
| 102 |
(cst_val *)&gpos_down, |
| 103 |
0 }; |
| 104 |
|
| 105 |
DEF_STATIC_CONST_VAL_STRING(gpos_to,"to"); |
| 106 |
|
| 107 |
static const cst_val * const gpos_to_list[] = { |
| 108 |
(cst_val *)&gpos_to, |
| 109 |
(cst_val *)&gpos_to, |
| 110 |
0 }; |
| 111 |
|
| 112 |
DEF_STATIC_CONST_VAL_STRING(gpos_det,"det"); |
| 113 |
DEF_STATIC_CONST_VAL_STRING(gpos_the,"the"); |
| 114 |
DEF_STATIC_CONST_VAL_STRING(gpos_a,"a"); |
| 115 |
DEF_STATIC_CONST_VAL_STRING(gpos_an,"an"); |
| 116 |
DEF_STATIC_CONST_VAL_STRING(gpos_some,"some"); |
| 117 |
DEF_STATIC_CONST_VAL_STRING(gpos_this,"this"); |
| 118 |
DEF_STATIC_CONST_VAL_STRING(gpos_each,"each"); |
| 119 |
DEF_STATIC_CONST_VAL_STRING(gpos_another,"another"); |
| 120 |
DEF_STATIC_CONST_VAL_STRING(gpos_those,"those"); |
| 121 |
DEF_STATIC_CONST_VAL_STRING(gpos_every,"every"); |
| 122 |
DEF_STATIC_CONST_VAL_STRING(gpos_all,"all"); |
| 123 |
DEF_STATIC_CONST_VAL_STRING(gpos_any,"any"); |
| 124 |
DEF_STATIC_CONST_VAL_STRING(gpos_these,"these"); |
| 125 |
DEF_STATIC_CONST_VAL_STRING(gpos_both,"both"); |
| 126 |
DEF_STATIC_CONST_VAL_STRING(gpos_neither,"neither"); |
| 127 |
DEF_STATIC_CONST_VAL_STRING(gpos_no,"no"); |
| 128 |
DEF_STATIC_CONST_VAL_STRING(gpos_many,"many"); |
| 129 |
|
| 130 |
static const cst_val * const gpos_det_list[] = { |
| 131 |
(cst_val *)&gpos_det, |
| 132 |
(cst_val *)&gpos_the, |
| 133 |
(cst_val *)&gpos_a, |
| 134 |
(cst_val *)&gpos_an, |
| 135 |
(cst_val *)&gpos_no, |
| 136 |
(cst_val *)&gpos_some, |
| 137 |
(cst_val *)&gpos_this, |
| 138 |
(cst_val *)&gpos_each, |
| 139 |
(cst_val *)&gpos_another, |
| 140 |
(cst_val *)&gpos_those, |
| 141 |
(cst_val *)&gpos_every, |
| 142 |
(cst_val *)&gpos_all, |
| 143 |
(cst_val *)&gpos_any, |
| 144 |
(cst_val *)&gpos_these, |
| 145 |
(cst_val *)&gpos_both, |
| 146 |
(cst_val *)&gpos_neither, |
| 147 |
(cst_val *)&gpos_no, |
| 148 |
(cst_val *)&gpos_many, |
| 149 |
0 }; |
| 150 |
|
| 151 |
DEF_STATIC_CONST_VAL_STRING(gpos_md,"md"); |
| 152 |
DEF_STATIC_CONST_VAL_STRING(gpos_will,"will"); |
| 153 |
DEF_STATIC_CONST_VAL_STRING(gpos_may,"may"); |
| 154 |
DEF_STATIC_CONST_VAL_STRING(gpos_would,"would"); |
| 155 |
DEF_STATIC_CONST_VAL_STRING(gpos_can,"can"); |
| 156 |
DEF_STATIC_CONST_VAL_STRING(gpos_could,"could"); |
| 157 |
DEF_STATIC_CONST_VAL_STRING(gpos_should,"should"); |
| 158 |
DEF_STATIC_CONST_VAL_STRING(gpos_must,"must"); |
| 159 |
DEF_STATIC_CONST_VAL_STRING(gpos_ought,"ought"); |
| 160 |
DEF_STATIC_CONST_VAL_STRING(gpos_might,"might"); |
| 161 |
|
| 162 |
static const cst_val * const gpos_md_list[] = { |
| 163 |
(cst_val *)&gpos_md, |
| 164 |
(cst_val *)&gpos_will, |
| 165 |
(cst_val *)&gpos_may, |
| 166 |
(cst_val *)&gpos_would, |
| 167 |
(cst_val *)&gpos_can, |
| 168 |
(cst_val *)&gpos_could, |
| 169 |
(cst_val *)&gpos_should, |
| 170 |
(cst_val *)&gpos_must, |
| 171 |
(cst_val *)&gpos_ought, |
| 172 |
(cst_val *)&gpos_might, |
| 173 |
0 }; |
| 174 |
|
| 175 |
DEF_STATIC_CONST_VAL_STRING(gpos_cc,"cc"); |
| 176 |
DEF_STATIC_CONST_VAL_STRING(gpos_and,"and"); |
| 177 |
DEF_STATIC_CONST_VAL_STRING(gpos_but,"but"); |
| 178 |
DEF_STATIC_CONST_VAL_STRING(gpos_or,"or"); |
| 179 |
DEF_STATIC_CONST_VAL_STRING(gpos_plus,"plus"); |
| 180 |
DEF_STATIC_CONST_VAL_STRING(gpos_yet,"yet"); |
| 181 |
DEF_STATIC_CONST_VAL_STRING(gpos_nor,"nor"); |
| 182 |
|
| 183 |
static const cst_val * const gpos_cc_list[] = { |
| 184 |
(cst_val *)&gpos_cc, |
| 185 |
(cst_val *)&gpos_and, |
| 186 |
(cst_val *)&gpos_but, |
| 187 |
(cst_val *)&gpos_or, |
| 188 |
(cst_val *)&gpos_plus, |
| 189 |
(cst_val *)&gpos_yet, |
| 190 |
(cst_val *)&gpos_nor, |
| 191 |
0 }; |
| 192 |
|
| 193 |
DEF_STATIC_CONST_VAL_STRING(gpos_wp,"wp"); |
| 194 |
DEF_STATIC_CONST_VAL_STRING(gpos_who,"who"); |
| 195 |
DEF_STATIC_CONST_VAL_STRING(gpos_what,"what"); |
| 196 |
DEF_STATIC_CONST_VAL_STRING(gpos_where,"where"); |
| 197 |
DEF_STATIC_CONST_VAL_STRING(gpos_how,"how"); |
| 198 |
DEF_STATIC_CONST_VAL_STRING(gpos_when,"when"); |
| 199 |
|
| 200 |
static const cst_val * const gpos_wp_list[] = { |
| 201 |
(cst_val *)&gpos_wp, |
| 202 |
(cst_val *)&gpos_who, |
| 203 |
(cst_val *)&gpos_what, |
| 204 |
(cst_val *)&gpos_where, |
| 205 |
(cst_val *)&gpos_how, |
| 206 |
(cst_val *)&gpos_when, |
| 207 |
0 }; |
| 208 |
|
| 209 |
DEF_STATIC_CONST_VAL_STRING(gpos_pps,"pps"); |
| 210 |
DEF_STATIC_CONST_VAL_STRING(gpos_her,"her"); |
| 211 |
DEF_STATIC_CONST_VAL_STRING(gpos_his,"his"); |
| 212 |
DEF_STATIC_CONST_VAL_STRING(gpos_their,"their"); |
| 213 |
DEF_STATIC_CONST_VAL_STRING(gpos_its,"its"); |
| 214 |
DEF_STATIC_CONST_VAL_STRING(gpos_our,"our"); |
| 215 |
DEF_STATIC_CONST_VAL_STRING(gpos_mine,"mine"); |
| 216 |
|
| 217 |
static const cst_val * const gpos_pps_list[] = { |
| 218 |
(cst_val *)&gpos_pps, |
| 219 |
(cst_val *)&gpos_her, |
| 220 |
(cst_val *)&gpos_his, |
| 221 |
(cst_val *)&gpos_their, |
| 222 |
(cst_val *)&gpos_its, |
| 223 |
(cst_val *)&gpos_our, |
| 224 |
(cst_val *)&gpos_mine, |
| 225 |
0 }; |
| 226 |
|
| 227 |
DEF_STATIC_CONST_VAL_STRING(gpos_aux,"aux"); |
| 228 |
DEF_STATIC_CONST_VAL_STRING(gpos_is,"is"); |
| 229 |
DEF_STATIC_CONST_VAL_STRING(gpos_am,"am"); |
| 230 |
DEF_STATIC_CONST_VAL_STRING(gpos_are,"are"); |
| 231 |
DEF_STATIC_CONST_VAL_STRING(gpos_was,"was"); |
| 232 |
DEF_STATIC_CONST_VAL_STRING(gpos_were,"were"); |
| 233 |
DEF_STATIC_CONST_VAL_STRING(gpos_has,"has"); |
| 234 |
DEF_STATIC_CONST_VAL_STRING(gpos_have,"have"); |
| 235 |
DEF_STATIC_CONST_VAL_STRING(gpos_had,"had"); |
| 236 |
DEF_STATIC_CONST_VAL_STRING(gpos_be,"be"); |
| 237 |
|
| 238 |
static const cst_val * const gpos_aux_list[] = { |
| 239 |
(cst_val *)&gpos_aux, |
| 240 |
(cst_val *)&gpos_is, |
| 241 |
(cst_val *)&gpos_am, |
| 242 |
(cst_val *)&gpos_are, |
| 243 |
(cst_val *)&gpos_was, |
| 244 |
(cst_val *)&gpos_were, |
| 245 |
(cst_val *)&gpos_has, |
| 246 |
(cst_val *)&gpos_have, |
| 247 |
(cst_val *)&gpos_had, |
| 248 |
(cst_val *)&gpos_be, |
| 249 |
0 }; |
| 250 |
|
| 251 |
DEF_STATIC_CONST_VAL_STRING(gpos_punc,"punc"); |
| 252 |
DEF_STATIC_CONST_VAL_STRING(gpos_dot,"."); |
| 253 |
DEF_STATIC_CONST_VAL_STRING(gpos_comma,","); |
| 254 |
DEF_STATIC_CONST_VAL_STRING(gpos_colon,":"); |
| 255 |
DEF_STATIC_CONST_VAL_STRING(gpos_semicolon,";"); |
| 256 |
DEF_STATIC_CONST_VAL_STRING(gpos_dquote,"\""); |
| 257 |
DEF_STATIC_CONST_VAL_STRING(gpos_squote,"'"); |
| 258 |
DEF_STATIC_CONST_VAL_STRING(gpos_leftparen,"("); |
| 259 |
DEF_STATIC_CONST_VAL_STRING(gpos_qmark,"?"); |
| 260 |
DEF_STATIC_CONST_VAL_STRING(gpos_rightparen,")"); |
| 261 |
DEF_STATIC_CONST_VAL_STRING(gpos_emark,"!"); |
| 262 |
|
| 263 |
static const cst_val * const gpos_punc_list[] = { |
| 264 |
(cst_val *)&gpos_punc, |
| 265 |
(cst_val *)&gpos_dot, |
| 266 |
(cst_val *)&gpos_comma, |
| 267 |
(cst_val *)&gpos_colon, |
| 268 |
(cst_val *)&gpos_semicolon, |
| 269 |
(cst_val *)&gpos_dquote, |
| 270 |
(cst_val *)&gpos_squote, |
| 271 |
(cst_val *)&gpos_leftparen, |
| 272 |
(cst_val *)&gpos_qmark, |
| 273 |
(cst_val *)&gpos_rightparen, |
| 274 |
(cst_val *)&gpos_emark, |
| 275 |
0 }; |
| 276 |
|
| 277 |
const cst_val * const * const us_gpos[] = { |
| 278 |
gpos_in_list, |
| 279 |
gpos_to_list, |
| 280 |
gpos_det_list, |
| 281 |
gpos_md_list, |
| 282 |
gpos_cc_list, |
| 283 |
gpos_wp_list, |
| 284 |
gpos_pps_list, |
| 285 |
gpos_aux_list, |
| 286 |
gpos_punc_list, |
| 287 |
0 }; |
| 288 |
|
| 289 |
|
| 290 |
|