blob: b96979f79c7c7b0869b4caf2dab8fa7107e371e9 [file] [log] [blame]
Marc Kupietz678185d2018-06-05 13:37:02 +02001#include <stdio.h>
2#include <stdlib.h>
3#include <string.h>
4#include <math.h>
5#include "collocatordb.h"
6
7char dbpath[] = "/vol/work/kupietz/Work2/kl/trunk/Analysemethoden/word2vec/models/dereko-2017-ii";
8const int testword = 259; // Welt
9
10int main(int argc, char* argv[]) {
11 COLLOCATORDB *cdb;
12
13 fprintf(stderr, "opening collocatordb for reading: %s ...\n", dbpath);
14 if(!(cdb = open_collocatordb(dbpath))) {
15 fprintf(stderr, "Error opening %s exiting.\n", dbpath);
16 exit(1);
17 }
18 fprintf(stderr, "Successfully opened %s.\n", dbpath);
19
20 /*
21 printf("raw dump of all ā€œ%sā€-neighbour positions and frequencies:\n", get_word(cdb, testword));
22 dump_collocators(cdb, testword, 0, 0);
23 */
24
25 printf("printing collocators of ā€œ%sā€ as json:\n", get_word(cdb, testword));
26 printf("%s\n", get_collocators_as_json(cdb, testword));
27
28 return 0;
29}