Drop the vocabulary[] structure.

This commit is contained in:
Jason S. Ninneman 2017-06-26 15:23:51 -07:00
parent b9bfa744e1
commit 205b152301

View file

@ -88,12 +88,6 @@ typedef struct {{
const char* hint;
}} hint_t;
typedef struct {{
const char* word;
const int type;
const int value;
}} vocabulary_t;
typedef struct {{
const char** words;
}} motion_t;
@ -106,7 +100,6 @@ extern const turn_threshold_t turn_thresholds[];
extern const obituary_t obituaries[];
extern const hint_t hints[];
extern long conditions[];
extern const vocabulary_t vocabulary[];
extern const long actspk[];
extern const motion_t motions[];
@ -117,7 +110,6 @@ extern const motion_t motions[];
#define NDEATHS {}
#define NTHRESHOLDS {}
#define NVERBS {}
#define NVOCAB {}
enum arbitrary_messages_refs {{
{}
@ -178,10 +170,6 @@ long conditions[] = {{
{}
}};
const vocabulary_t vocabulary[] = {{
{}
}};
const long actspk[] = {{
NO_MESSAGE,
{}
@ -409,22 +397,6 @@ def recompose(type_word, value):
sys.stderr.write("%s is not a known word classifier" % attrs["type"])
sys.exit(1)
def get_vocabulary(vocabulary):
template = """ {{
.word = {},
.type = {},
.value = {},
}},
"""
voc_str = ""
for vocab in vocabulary:
word = make_c_string(vocab["word"])
type_code = recompose(vocab["type"], vocab["value"])
value = vocab["value"]
voc_str += template.format(word, type_code, value)
voc_str = voc_str[:-1] # trim trailing newline
return voc_str
def get_actspk(actspk):
res = ""
for (i, word) in actspk.items():
@ -460,7 +432,6 @@ if __name__ == "__main__":
get_obituaries(db["obituaries"]),
get_hints(db["hints"], db["arbitrary_messages"]),
get_condbits(db["locations"]),
get_vocabulary(db["vocabulary"]),
get_actspk(db["actspk"]),
get_motions(db["motions"]),
)
@ -473,7 +444,6 @@ if __name__ == "__main__":
len(db["obituaries"]),
len(db["turn_thresholds"]),
len(db["actspk"]),
len(db["vocabulary"]),
get_refs(db["arbitrary_messages"]),
get_refs(db["locations"]),
get_refs(db["objects"]),