Computer Literacy -- Appendix A

/* Part of speech definitions */
#define		NOUN			0
#define		PRONOUN		1
#define		VERB			2
#define		AVERB			3
#define		ADJECTIVE		4
#define		ADVERB		5

/* Field descriptors */

#define		SUBJECT		0
#define		VERB			2
#define		HELPER			3
#define		DO			4
#define		IO			6

typedef struct
{
	char word[40];
	char post_punct; /* Punctuation after word, if any */
	int p_code[11];
	int code;
}WORD;

int valid_patterns[][4] = {{SUBJECT, VERB, -1, -1},
			   {SUBJECT, VERB, DO, -1},
			   {VERB, SUBJECT, -1, -1},
			   {VERB, SUBJECT, DO, -1},
			   {DO, SUBJECT, VERB, -1},
			   {DO, SUBJECT, VERB, IO},
			   {IO, SUBJECT, VERB, DO},
			   {SUBJECT, VERB, IO, DO},
{VERB, SUBJECT, IO, DO}};