From: Beate D. <do...@im...> - 2005-06-02 08:20:24
|
Hi! Thanks very much for your bug report! I fixed the problem, committed the new code and the "-f" option of associate should now write the correct word vectors to the file specified. Best, Beate On Tue, 31 May 2005, Linuxer Wang wrote: > Hello, all > > I read part of the source codes, I have a problem with function > find_neighbors() in file neighbors.c. > > I marked the problems lines as @1 and @2 as follows: > > if( neighbor_item.score > threshold) { > if ( (neighbor_item.vector = malloc(vector_size)) == NULL ) { <---------@1 > fprintf( stderr, "neighbors.c: can't allocate vector memory.\n" ); > free_tail( list, neighbor_item_free ); > return 0; > } > list_insert( list, &last, depth, <---------@2 > (void *) &neighbor_item, sizeof( NEIGHBOR_ITEM ), > neighbor_item_cmp, neighbor_item_free ); > > list_length++; > > /* Set the threshold to the lowest value in the list */ > if( (last != NULL) && (list_length >= depth)) > threshold = ((NEIGHBOR_ITEM *) (last->data))->score; > } > > Note that, @1 clears the vector of neighbor_item, so when @2 tries to > insert neighbor_item to the list, the vector of neighbor_item is already > zero array. > So the problem is that the order of @1 and @2 should be conversed. The > current codes cause the output to file contains only zeros. > > Can anyone verify it? > Yours, > > > > ------------------------------------------------------- > This SF.Net email is sponsored by Yahoo. > Introducing Yahoo! Search Developer Network - Create apps using Yahoo! > Search APIs Find out how you can build Yahoo! directly into your own > Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005 > _______________________________________________ > infomap-nlp-devel mailing list > inf...@li... > https://lists.sourceforge.net/lists/listinfo/infomap-nlp-devel > |