static void setup(void) { setup_fixture_path(); read_document("fixtures/complete_tag.atom"); random_background = new_pool(); system("rm -Rf /tmp/valid-copy && cp -R fixtures/valid /tmp/valid-copy && chmod -R 755 /tmp/valid-copy"); item_cache_create(&item_cache, "/tmp/valid-copy", &item_cache_options); tagger = build_tagger(document, item_cache); train_tagger(tagger, item_cache); tagger->probability_function = &naive_bayes_probability; tagger->classification_function = &mock_classify; precompute_tagger(tagger, random_background); assert_equal(TAGGER_PRECOMPUTED, tagger->state); classified_item = NULL; int freeit; item = item_cache_fetch_item(item_cache, (unsigned char*) "urn:peerworks.org:entry#709254", &freeit); }
static void setup_with_random_background(void) { setup(); int freeit; Item *item = item_cache_fetch_item(item_cache, (unsigned char*) "urn:peerworks.org:entry#709254", &freeit); pool_add_item(random_background, item); }