us_gpos.c 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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 (awb@cs.cmu.edu) */
  34. /* Date: January 2001 */
  35. /*************************************************************************/
  36. /* Poor mans part of speech tagger */
  37. /*************************************************************************/
  38. #include "cst_val.h"
  39. DEF_STATIC_CONST_VAL_STRING(gpos_in,"in");
  40. DEF_STATIC_CONST_VAL_STRING(gpos_of,"of");
  41. DEF_STATIC_CONST_VAL_STRING(gpos_for,"for");
  42. DEF_STATIC_CONST_VAL_STRING(gpos_on,"on");
  43. DEF_STATIC_CONST_VAL_STRING(gpos_that,"that");
  44. DEF_STATIC_CONST_VAL_STRING(gpos_with,"with");
  45. DEF_STATIC_CONST_VAL_STRING(gpos_by,"by");
  46. DEF_STATIC_CONST_VAL_STRING(gpos_at,"at");
  47. DEF_STATIC_CONST_VAL_STRING(gpos_from,"from");
  48. DEF_STATIC_CONST_VAL_STRING(gpos_as,"as");
  49. DEF_STATIC_CONST_VAL_STRING(gpos_if,"if");
  50. DEF_STATIC_CONST_VAL_STRING(gpos_against,"against");
  51. DEF_STATIC_CONST_VAL_STRING(gpos_about,"about");
  52. DEF_STATIC_CONST_VAL_STRING(gpos_before,"before");
  53. DEF_STATIC_CONST_VAL_STRING(gpos_because,"because");
  54. DEF_STATIC_CONST_VAL_STRING(gpos_under,"under");
  55. DEF_STATIC_CONST_VAL_STRING(gpos_after,"after");
  56. DEF_STATIC_CONST_VAL_STRING(gpos_over,"over");
  57. DEF_STATIC_CONST_VAL_STRING(gpos_into,"into");
  58. DEF_STATIC_CONST_VAL_STRING(gpos_while,"while");
  59. DEF_STATIC_CONST_VAL_STRING(gpos_without,"without");
  60. DEF_STATIC_CONST_VAL_STRING(gpos_through,"through");
  61. DEF_STATIC_CONST_VAL_STRING(gpos_new,"new"); /* ??? */
  62. DEF_STATIC_CONST_VAL_STRING(gpos_between,"between");
  63. DEF_STATIC_CONST_VAL_STRING(gpos_among,"among");
  64. DEF_STATIC_CONST_VAL_STRING(gpos_until,"until");
  65. DEF_STATIC_CONST_VAL_STRING(gpos_per,"per");
  66. DEF_STATIC_CONST_VAL_STRING(gpos_up,"up");
  67. DEF_STATIC_CONST_VAL_STRING(gpos_down,"down");
  68. static const cst_val * const gpos_in_list[] = {
  69. (cst_val *)&gpos_in,
  70. (cst_val *)&gpos_of,
  71. (cst_val *)&gpos_for,
  72. (cst_val *)&gpos_in,
  73. (cst_val *)&gpos_on,
  74. (cst_val *)&gpos_that,
  75. (cst_val *)&gpos_with,
  76. (cst_val *)&gpos_by,
  77. (cst_val *)&gpos_at,
  78. (cst_val *)&gpos_from,
  79. (cst_val *)&gpos_as,
  80. (cst_val *)&gpos_if,
  81. (cst_val *)&gpos_that,
  82. (cst_val *)&gpos_against,
  83. (cst_val *)&gpos_about,
  84. (cst_val *)&gpos_before,
  85. (cst_val *)&gpos_because,
  86. (cst_val *)&gpos_under,
  87. (cst_val *)&gpos_after,
  88. (cst_val *)&gpos_over,
  89. (cst_val *)&gpos_into,
  90. (cst_val *)&gpos_while,
  91. (cst_val *)&gpos_without,
  92. (cst_val *)&gpos_through,
  93. (cst_val *)&gpos_new,
  94. (cst_val *)&gpos_between,
  95. (cst_val *)&gpos_among,
  96. (cst_val *)&gpos_until,
  97. (cst_val *)&gpos_per,
  98. (cst_val *)&gpos_up,
  99. (cst_val *)&gpos_down,
  100. 0 };
  101. DEF_STATIC_CONST_VAL_STRING(gpos_to,"to");
  102. static const cst_val * const gpos_to_list[] = {
  103. (cst_val *)&gpos_to,
  104. (cst_val *)&gpos_to,
  105. 0 };
  106. DEF_STATIC_CONST_VAL_STRING(gpos_det,"det");
  107. DEF_STATIC_CONST_VAL_STRING(gpos_the,"the");
  108. DEF_STATIC_CONST_VAL_STRING(gpos_a,"a");
  109. DEF_STATIC_CONST_VAL_STRING(gpos_an,"an");
  110. DEF_STATIC_CONST_VAL_STRING(gpos_some,"some");
  111. DEF_STATIC_CONST_VAL_STRING(gpos_this,"this");
  112. DEF_STATIC_CONST_VAL_STRING(gpos_each,"each");
  113. DEF_STATIC_CONST_VAL_STRING(gpos_another,"another");
  114. DEF_STATIC_CONST_VAL_STRING(gpos_those,"those");
  115. DEF_STATIC_CONST_VAL_STRING(gpos_every,"every");
  116. DEF_STATIC_CONST_VAL_STRING(gpos_all,"all");
  117. DEF_STATIC_CONST_VAL_STRING(gpos_any,"any");
  118. DEF_STATIC_CONST_VAL_STRING(gpos_these,"these");
  119. DEF_STATIC_CONST_VAL_STRING(gpos_both,"both");
  120. DEF_STATIC_CONST_VAL_STRING(gpos_neither,"neither");
  121. DEF_STATIC_CONST_VAL_STRING(gpos_no,"no");
  122. DEF_STATIC_CONST_VAL_STRING(gpos_many,"many");
  123. static const cst_val * const gpos_det_list[] = {
  124. (cst_val *)&gpos_det,
  125. (cst_val *)&gpos_the,
  126. (cst_val *)&gpos_a,
  127. (cst_val *)&gpos_an,
  128. (cst_val *)&gpos_no,
  129. (cst_val *)&gpos_some,
  130. (cst_val *)&gpos_this,
  131. (cst_val *)&gpos_each,
  132. (cst_val *)&gpos_another,
  133. (cst_val *)&gpos_those,
  134. (cst_val *)&gpos_every,
  135. (cst_val *)&gpos_all,
  136. (cst_val *)&gpos_any,
  137. (cst_val *)&gpos_these,
  138. (cst_val *)&gpos_both,
  139. (cst_val *)&gpos_neither,
  140. (cst_val *)&gpos_no,
  141. (cst_val *)&gpos_many,
  142. 0 };
  143. DEF_STATIC_CONST_VAL_STRING(gpos_md,"md");
  144. DEF_STATIC_CONST_VAL_STRING(gpos_will,"will");
  145. DEF_STATIC_CONST_VAL_STRING(gpos_may,"may");
  146. DEF_STATIC_CONST_VAL_STRING(gpos_would,"would");
  147. DEF_STATIC_CONST_VAL_STRING(gpos_can,"can");
  148. DEF_STATIC_CONST_VAL_STRING(gpos_could,"could");
  149. DEF_STATIC_CONST_VAL_STRING(gpos_should,"should");
  150. DEF_STATIC_CONST_VAL_STRING(gpos_must,"must");
  151. DEF_STATIC_CONST_VAL_STRING(gpos_ought,"ought");
  152. DEF_STATIC_CONST_VAL_STRING(gpos_might,"might");
  153. static const cst_val * const gpos_md_list[] = {
  154. (cst_val *)&gpos_md,
  155. (cst_val *)&gpos_will,
  156. (cst_val *)&gpos_may,
  157. (cst_val *)&gpos_would,
  158. (cst_val *)&gpos_can,
  159. (cst_val *)&gpos_could,
  160. (cst_val *)&gpos_should,
  161. (cst_val *)&gpos_must,
  162. (cst_val *)&gpos_ought,
  163. (cst_val *)&gpos_might,
  164. 0 };
  165. DEF_STATIC_CONST_VAL_STRING(gpos_cc,"cc");
  166. DEF_STATIC_CONST_VAL_STRING(gpos_and,"and");
  167. DEF_STATIC_CONST_VAL_STRING(gpos_but,"but");
  168. DEF_STATIC_CONST_VAL_STRING(gpos_or,"or");
  169. DEF_STATIC_CONST_VAL_STRING(gpos_plus,"plus");
  170. DEF_STATIC_CONST_VAL_STRING(gpos_yet,"yet");
  171. DEF_STATIC_CONST_VAL_STRING(gpos_nor,"nor");
  172. static const cst_val * const gpos_cc_list[] = {
  173. (cst_val *)&gpos_cc,
  174. (cst_val *)&gpos_and,
  175. (cst_val *)&gpos_but,
  176. (cst_val *)&gpos_or,
  177. (cst_val *)&gpos_plus,
  178. (cst_val *)&gpos_yet,
  179. (cst_val *)&gpos_nor,
  180. 0 };
  181. DEF_STATIC_CONST_VAL_STRING(gpos_wp,"wp");
  182. DEF_STATIC_CONST_VAL_STRING(gpos_who,"who");
  183. DEF_STATIC_CONST_VAL_STRING(gpos_what,"what");
  184. DEF_STATIC_CONST_VAL_STRING(gpos_where,"where");
  185. DEF_STATIC_CONST_VAL_STRING(gpos_how,"how");
  186. DEF_STATIC_CONST_VAL_STRING(gpos_when,"when");
  187. static const cst_val * const gpos_wp_list[] = {
  188. (cst_val *)&gpos_wp,
  189. (cst_val *)&gpos_who,
  190. (cst_val *)&gpos_what,
  191. (cst_val *)&gpos_where,
  192. (cst_val *)&gpos_how,
  193. (cst_val *)&gpos_when,
  194. 0 };
  195. DEF_STATIC_CONST_VAL_STRING(gpos_pps,"pps");
  196. DEF_STATIC_CONST_VAL_STRING(gpos_her,"her");
  197. DEF_STATIC_CONST_VAL_STRING(gpos_his,"his");
  198. DEF_STATIC_CONST_VAL_STRING(gpos_their,"their");
  199. DEF_STATIC_CONST_VAL_STRING(gpos_its,"its");
  200. DEF_STATIC_CONST_VAL_STRING(gpos_our,"our");
  201. DEF_STATIC_CONST_VAL_STRING(gpos_mine,"mine");
  202. static const cst_val * const gpos_pps_list[] = {
  203. (cst_val *)&gpos_pps,
  204. (cst_val *)&gpos_her,
  205. (cst_val *)&gpos_his,
  206. (cst_val *)&gpos_their,
  207. (cst_val *)&gpos_its,
  208. (cst_val *)&gpos_our,
  209. (cst_val *)&gpos_mine,
  210. 0 };
  211. DEF_STATIC_CONST_VAL_STRING(gpos_aux,"aux");
  212. DEF_STATIC_CONST_VAL_STRING(gpos_is,"is");
  213. DEF_STATIC_CONST_VAL_STRING(gpos_am,"am");
  214. DEF_STATIC_CONST_VAL_STRING(gpos_are,"are");
  215. DEF_STATIC_CONST_VAL_STRING(gpos_was,"was");
  216. DEF_STATIC_CONST_VAL_STRING(gpos_were,"were");
  217. DEF_STATIC_CONST_VAL_STRING(gpos_has,"has");
  218. DEF_STATIC_CONST_VAL_STRING(gpos_have,"have");
  219. DEF_STATIC_CONST_VAL_STRING(gpos_had,"had");
  220. DEF_STATIC_CONST_VAL_STRING(gpos_be,"be");
  221. static const cst_val * const gpos_aux_list[] = {
  222. (cst_val *)&gpos_aux,
  223. (cst_val *)&gpos_is,
  224. (cst_val *)&gpos_am,
  225. (cst_val *)&gpos_are,
  226. (cst_val *)&gpos_was,
  227. (cst_val *)&gpos_were,
  228. (cst_val *)&gpos_has,
  229. (cst_val *)&gpos_have,
  230. (cst_val *)&gpos_had,
  231. (cst_val *)&gpos_be,
  232. 0 };
  233. DEF_STATIC_CONST_VAL_STRING(gpos_punc,"punc");
  234. DEF_STATIC_CONST_VAL_STRING(gpos_dot,".");
  235. DEF_STATIC_CONST_VAL_STRING(gpos_comma,",");
  236. DEF_STATIC_CONST_VAL_STRING(gpos_colon,":");
  237. DEF_STATIC_CONST_VAL_STRING(gpos_semicolon,";");
  238. DEF_STATIC_CONST_VAL_STRING(gpos_dquote,"\"");
  239. DEF_STATIC_CONST_VAL_STRING(gpos_squote,"'");
  240. DEF_STATIC_CONST_VAL_STRING(gpos_leftparen,"(");
  241. DEF_STATIC_CONST_VAL_STRING(gpos_qmark,"?");
  242. DEF_STATIC_CONST_VAL_STRING(gpos_rightparen,")");
  243. DEF_STATIC_CONST_VAL_STRING(gpos_emark,"!");
  244. static const cst_val * const gpos_punc_list[] = {
  245. (cst_val *)&gpos_punc,
  246. (cst_val *)&gpos_dot,
  247. (cst_val *)&gpos_comma,
  248. (cst_val *)&gpos_colon,
  249. (cst_val *)&gpos_semicolon,
  250. (cst_val *)&gpos_dquote,
  251. (cst_val *)&gpos_squote,
  252. (cst_val *)&gpos_leftparen,
  253. (cst_val *)&gpos_qmark,
  254. (cst_val *)&gpos_rightparen,
  255. (cst_val *)&gpos_emark,
  256. 0 };
  257. const cst_val * const * const us_gpos[] = {
  258. gpos_in_list,
  259. gpos_to_list,
  260. gpos_det_list,
  261. gpos_md_list,
  262. gpos_cc_list,
  263. gpos_wp_list,
  264. gpos_pps_list,
  265. gpos_aux_list,
  266. gpos_punc_list,
  267. 0 };