| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
#ifndef __grammar_h__ |
| 19 |
#define __grammar_h__ |
| 20 |
|
| 21 |
#include "buf.h" |
| 22 |
|
| 23 |
class MOB; |
| 24 |
class ITEM; |
| 25 |
|
| 26 |
enum VERB_PERSON |
| 27 |
{ |
| 28 |
VERB_I, |
| 29 |
VERB_YOU, |
| 30 |
VERB_HE, |
| 31 |
VERB_SHE, |
| 32 |
VERB_IT, |
| 33 |
VERB_WE, |
| 34 |
VERB_YALL, |
| 35 |
VERB_HES, |
| 36 |
VERB_SHES, |
| 37 |
VERB_THEY, |
| 38 |
NUM_VERBS |
| 39 |
}; |
| 40 |
|
| 41 |
|
| 42 |
bool |
| 43 |
gram_ispronoun(const char *word); |
| 44 |
inline bool |
| 45 |
gram_ispronoun(BUF buf) |
| 46 |
{ return gram_ispronoun(buf.buffer()); } |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
BUF |
| 52 |
gram_capitalize(const char *str); |
| 53 |
BUF |
| 54 |
gram_capitalize(BUF buf); |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
BUF |
| 59 |
gram_makepossessive(const char *str); |
| 60 |
BUF |
| 61 |
gram_makepossessive(BUF str); |
| 62 |
|
| 63 |
|
| 64 |
BUF |
| 65 |
gram_makeplural(const char *phrase); |
| 66 |
BUF |
| 67 |
gram_makeplural(BUF phrase); |
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
const char * |
| 72 |
gram_getpronoun(VERB_PERSON person); |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
const char * |
| 77 |
gram_getpossessive(VERB_PERSON person); |
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
const char * |
| 82 |
gram_getownership(VERB_PERSON person); |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
const char * |
| 87 |
gram_getreflexive(VERB_PERSON person); |
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
const char * |
| 92 |
gram_getaccusative(VERB_PERSON person); |
| 93 |
|
| 94 |
bool |
| 95 |
gram_isvowel(char c); |
| 96 |
|
| 97 |
|
| 98 |
bool |
| 99 |
gram_isendsentence(char c); |
| 100 |
|
| 101 |
bool |
| 102 |
gram_isplural(const char *noun); |
| 103 |
inline bool |
| 104 |
gram_isplural(BUF buf) |
| 105 |
{ return gram_isplural(buf.buffer()); } |
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
bool |
| 111 |
gram_isnameplural(const char *name); |
| 112 |
inline bool |
| 113 |
gram_isnameplural(BUF buf) |
| 114 |
{ return gram_isnameplural(buf.buffer()); } |
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
const char * |
| 120 |
gram_getarticle(const char *noun); |
| 121 |
inline const char * |
| 122 |
gram_getarticle(BUF buf) |
| 123 |
{ return gram_getarticle(buf.buffer()); } |
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
BUF |
| 130 |
gram_createcount(const char *basename, int count, bool article); |
| 131 |
BUF |
| 132 |
gram_createcount(BUF basename, int count, bool article); |
| 133 |
|
| 134 |
|
| 135 |
BUF |
| 136 |
gram_createplace(int place); |
| 137 |
|
| 138 |
|
| 139 |
BUF |
| 140 |
gram_conjugate(const char *verb, VERB_PERSON person, bool past = false); |
| 141 |
inline BUF |
| 142 |
gram_conjugate(BUF verb, VERB_PERSON person, bool past = false) |
| 143 |
{ return gram_conjugate(verb.buffer(), person, past); } |
| 144 |
|
| 145 |
#endif |