Marc Kupietz | 678185d | 2018-06-05 13:37:02 +0200 | [diff] [blame] | 1 | #include <stdio.h> |
| 2 | #include <stdlib.h> |
| 3 | #include <string.h> |
| 4 | #include <math.h> |
| 5 | #include "collocatordb.h" |
| 6 | |
| 7 | char dbpath[] = "/vol/work/kupietz/Work2/kl/trunk/Analysemethoden/word2vec/models/dereko-2017-ii"; |
| 8 | const int testword = 259; // Welt |
| 9 | |
| 10 | int 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 | } |