Bug in morphstr() function of packaged wordnet.lib

Bug #305407 reported by Sundaram Ramaswamy
6
Affects Status Importance Assigned to Milestone
wordnet (Debian)
Fix Released
Unknown
wordnet (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: wordnet

Hi,
I am working on Wordnet for a particular project. I installed Wordnet in Ubuntu via Synaptic, the latest package to date. Tried searching "automata" in the Wordnet Browser (bash-command: wnb), it returned 0 results, while the installed Wordnet in Windows (installer from Wordnet's site) shows a couple of definitions for "automata". In fact, the latest version of Wordnet for Windows is just 2.1 while Linux's is 3.0.

Bascially, Wordnet's function morphstr() is supposed to give the root words for a given inflected word. For example, when "knifes" is given to morphstr, it returns "knife". Likewise for "axes" it should return "ax", "axe" and "axis". It first searches an exceptions list file (because of peculiar cases like axes), when it has an entry in it, it returns the file's results. If not found in the list, it tries to predict the root. While the prediction part (e.g. knifes) works fine in Ubuntu, the search from file part doesn't (e.g. axes, automata, etc.)

When I compared the source code of Wordnet (morph.c of Windows and Linux), its the same for both the OSs (they have just used preprocessor switches for the differences). This needs to be fixed from our side, since Wordnet's source code doesn't have any errors/diffs, as the same code is present on both the OSs. The Windows installer was packaged by Wordnet guys themselves, while the deb was packaged from their source by someone of Ubuntu/Deb guys, I guess.

PS: When I wrote my own code, and tried using morphstr(), I could spot the error with Ubuntu's packaged wordnet.lib. The problem is that, morphstr takes two args; 1: inflected word, 2: POS (Part of Speech - NOUN, VERB, etc.) E,g. morphstr("knifes", NOUN); will return "knifes" using the prediction technique (works right in Ubuntu). When I call morphstr("automata", NOUN) it returns NULL but when I call morphstr("automata", NOUN - 1); it returns "automata". Likewise, for any word, which has an exception in the exception list file, when we pass the actual POS value minus 1, we get the proper values. It has some array indexing issue, I believe. The reason why Wordnet Browser doesn't show "automata"'s definitions in Linux is that morphstr() when called with proper POS value returns NULL, while in Windows, it returns correct values for the same set of arguments, so Wordnet Browser in Windows shows it.

Revision history for this message
Sundaram Ramaswamy (legends2k) wrote :

When I build the package from source without going for the binary package, it works fine, but the binary package doesn't give results, this shows that the bug is in the package.

Revision history for this message
Sundaram Ramaswamy (legends2k) wrote :

It is to be noted that the bug is not there in 1:3.0-6 and got introduced in 1:3.0-6ubuntu0.1, version before it doesn't have this bug.

Revision history for this message
YunQiang Su (wzssyqa) wrote :

With this bug

wn done -over

We can get nothing, but we execpt description of 'do'.

Changed in wordnet (Ubuntu):
status: New → Confirmed
Changed in wordnet (Debian):
status: Unknown → New
Changed in wordnet (Debian):
status: New → Fix Released
Revision history for this message
Logan Rosen (logan) wrote :

This bug was fixed in the package wordnet - 1:3.0-29

---------------
wordnet (1:3.0-29) unstable; urgency=low

  * Team upload.
  * Fix index processing error in morphstr() function.
    Closes: #700914

 -- Anton Gladky <email address hidden> Tue, 26 Feb 2013 20:40:25 +0100

Changed in wordnet (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.