1 /*
2 
3    wntypes.h - Typedef definitions for WordNet library
4 
5    $Id: wntypes.h,v 1.5 2002/03/07 18:44:48 wn Rel $
6 
7 */
8 
9 #ifndef _WNTYPES_
10 #define _WNTYPES_
11 
12 #include "wnconsts.h"
13 
14 /* Data structures used by search code functions. */
15 
16 /* Structure for index file entry */
17 typedef struct {
18     long idxoffset;		/* byte offset of entry in index file */
19     char *wd;			/* word string */
20     char *pos;			/* part of speech */
21     int sense_cnt;		/* sense (collins) count */
22     int off_cnt;		/* number of offsets */
23     int tagged_cnt;		/* number senses that are tagged */
24     unsigned long *offset;	/* offsets of synsets containing word */
25     int ptruse_cnt;		/* number of pointers used */
26     int *ptruse;		/* pointers used */
27 } Index, *IndexPtr;
28 
29 /* Structure for data file synset */
30 typedef struct ss {
31     long hereiam;		/* current file position */
32     int sstype;			/* type of ADJ synset */
33     int fnum;			/* file number that synset comes from */
34     char *pos;			/* part of speech */
35     int wcount;			/* number of words in synset */
36     char **words;		/* words in synset */
37     int *lexid;			/* unique id in lexicographer file */
38     int *wnsns;			/* sense number in wordnet */
39     int whichword;		/* which word in synset we're looking for */
40     int ptrcount;		/* number of pointers */
41     int *ptrtyp;		/* pointer types */
42     long *ptroff;		/* pointer offsets */
43     int *ppos;			/* pointer part of speech */
44     int *pto;			/* pointer 'to' fields */
45     int *pfrm;			/* pointer 'from' fields */
46     int fcount;			/* number of verb frames */
47     int *frmid;			/* frame numbers */
48     int *frmto;			/* frame 'to' fields */
49     char *defn;			/* synset gloss (definition) */
50     unsigned int key;		/* unique synset key */
51 
52     /* these fields are used if a data structure is returned
53        instead of a text buffer */
54 
55     struct ss *nextss;		/* ptr to next synset containing searchword */
56     struct ss *nextform;	/* ptr to list of synsets for alternate
57 				   spelling of wordform */
58     int searchtype;		/* type of search performed */
59     struct ss *ptrlist;		/* ptr to synset list result of search */
60     char *headword;		/* if pos is "s", this is cluster head word */
61     short headsense;		/* sense number of headword */
62 } Synset, *SynsetPtr;
63 
64 typedef struct si {
65     char *sensekey;		/* sense key */
66     char *word;			/* word string */
67     long loc;			/* synset offset */
68     int wnsense;		/* WordNet sense number */
69     int tag_cnt;		/* number of semantic tags to sense */
70     struct si *nextsi;		/* ptr to next sense index entry */
71 } SnsIndex, *SnsIndexPtr;
72 
73 typedef struct {
74     int SenseCount[MAX_FORMS];	/* number of senses word form has */
75     int OutSenseCount[MAX_FORMS]; /* number of senses printed for word form */
76     int numforms;		/* number of word forms searchword has */
77     int printcnt;		/* number of senses printed by search */
78     char *searchbuf;		/* buffer containing formatted results */
79     SynsetPtr searchds;		/* data structure containing search results */
80 } SearchResults, *SearchResultsPtr;
81 
82 #endif /* _WNTYPES_ */
83