go-distance update.

This commit is contained in:
Einar Ryeng 2007-04-26 18:54:34 +00:00
parent a0faed2614
commit f1301be67a
2 changed files with 31 additions and 0 deletions

View File

@ -309,3 +309,30 @@ float resnik(struct node *n1, struct node *n2) {
return n1->ic + n2->ic - 2.0 * subsumer->ic;
}
int read_terms(FILE *fd, struct node *terms[], int *termc) {
char term[11];
int retval;
retval = fscanf(fd, " %10s ", term);
if (retval != EOF) {
terms[*termc++] = get_term(term);
}
return retval;
}
void build_dataset() {
struct node *terms[MAX_NODES];
int termc = 0;
int i, j;
FILE *fd = fopen("dimension", "r");
read_terms(fd, terms, &termc);
for (int i=0; i<termc; i++) {
for (int j=0; j<termc; j++) {
fclose(fd);
}

View File

@ -17,6 +17,8 @@ void print_help() {
int main(int argc, char **argv) {
int i;
char *dimension[MAX_NODES];
while ((i = getopt(argc, argv, "h")) != -1) {
switch(i) {
case 104:
@ -26,6 +28,8 @@ int main(int argc, char **argv) {
};
}
godist_init();
build_dataset();
godist_exit();
}