Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ ConceptNet.prototype.lookup = function(URI, params, callback) {
var limit = params.limit || 50;
var offset = params.offset || 0;

var path = "/data/" + this.version + String(URI) + "?limit=" + limit + "&offset=" + offset;
var path = "/data/" + this.version + String(encodeURIComponent(URI)) +
"?limit=" + limit + "&offset=" + offset;

if ( params.filter === "core" ) {
path += "&filter=core";
}
Expand Down
10 changes: 10 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,16 @@ describe('conceptNet', function tests() {
);
});

it('handles concepts in other languages', function otherLangTest(done) {
this.timeout(1000);
var cnet = new conceptNet();
cnet.lookup("c/ar/سلام/",{
filter: "core"}, function(err, result){
assert(result.edges.length === 7);
done();
}
);
});
});

it('is possible to use search method to retrieve results', function test(done) {
Expand Down