'WordNet functions fail for non-base forms of words

I'm using the C API for WordNet. When I try the following code with the word "dog", it correctly tells me that "dog" is a noun. However, if I pass "dogs", it returns 0, indicating that the word is not in the database.

#include <stdio.h>
#include "../lib/wn.h"

int main(int argc, char *argv[]) {
    unsigned rc;

    if (wninit() == -1) {
        perror("wninit() failed");
        return 1;
    }
    rc = in_wn(argv[1], NOUN); // "dog" okay, "dogs" not okay.
    printf("rc: %u\n", rc);
    return 0;
}

I have set the WNSEARCHDIR correctly to the location of the database files.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source