Skip to content

Commit 3e85e19

Browse files
committed
Fixed issue #3 - bug introduced in 0.0.3 handling related synsets
1 parent daf6d28 commit 3e85e19

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ Changelog
1717
-----------------------
1818
* Fixed reflection warnings
1919
* Nil and empty/trimmed string short circuiting
20+
21+
0.0.5 (Sat Oct 19 2013)
22+
-----------------------
23+
* Fixed issue #3 - bug introduced in 0.0.3 handling related synsets

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ There is an initial version hosted at [Clojars](https://clojars.org/clj-wordnet/
2222
For leiningen include a dependency:
2323

2424
```clojure
25-
[clj-wordnet "0.0.4"]
25+
[clj-wordnet "0.0.5"]
2626
```
2727

2828
For maven-based projects, add the following to your `pom.xml`:
@@ -31,7 +31,7 @@ For maven-based projects, add the following to your `pom.xml`:
3131
<dependency>
3232
<groupId>clj-wordnet</groupId>
3333
<artifactId>clj-wordnet</artifactId>
34-
<version>0.0.4</version>
34+
<version>0.0.5</version>
3535
</dependency>
3636
```
3737

@@ -63,7 +63,7 @@ separately from [here](http://wordnet.princeton.edu/wordnet/download/current-ver
6363

6464
(def frump (first (wordnet "frump" :noun)))
6565

66-
(map :lemma (related-words frump :derivationally-related)))
66+
(map :lemma (related-words frump :derivationally-related))
6767
=> ("frumpy")
6868

6969
(map :lemma (flatten (vals (related-synsets dog :hypernym))))

project.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(defproject clj-wordnet "0.0.4"
1+
(defproject clj-wordnet "0.0.5"
22
:description "A WordNet/JWI wrapper library"
33
:url "https://github.com/delver/clj-wordnet"
44
:license {:name "Creative Commons 3.0"

src/clj_wordnet/core.clj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@
6464
^IWord word (:word m)]
6565
(apply merge-with concat
6666
(for [synset-id (.getRelatedSynsets (.getSynset word) (coerce/pointer pointer))
67-
^ISynset synset (locking coarse-lock (.getSynset dict synset-id))
68-
word (.getWords synset) ]
67+
word (.getWords (locking coarse-lock (.getSynset dict synset-id)))]
6968
{ synset-id [(from-java dict word)] }))))
7069

7170
(defn related-words

test/clj_wordnet/test/client.clj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,8 @@
1919
(deftest fetch-nil-word
2020
(is (empty? (wordnet nil))))
2121

22+
(deftest relational-synset-test
23+
(let [dog (first (wordnet "dog" :noun))]
24+
(is (= '("domestic_animal" "domesticated_animal" "canine" "canid")
25+
(map :lemma (flatten (vals (related-synsets dog :hypernym))))))))
2226

0 commit comments

Comments
 (0)