Giter Site home page Giter Site logo

node-concept-net's Issues

search method

Hi

I was wondering whether uri strings are supported in the search method, i.e (end=/c/en/car)?

I looked through the code in src/store.js and in line 34 of the code "path += querystring.stringify(params)" it uses querystring to stringify the params part of the method. So if the params in the path variable was "end=/c/en/car" it will be translated to "end=%2Fc%2Fen%2Fcar" which will cause nothing to be found.

What might be ways to get around this?

add URI standardization

as detailed here
This would allow a user to input any term, get the standard uri, and call the 3 methods (lookup, search, association) using it.

problem with examples

I'm trying the example code, basically:

const ConceptNet = require( 'concept-net' )
// let conceptNet = ConceptNet(null, null, '5.3')
let conceptNet = ConceptNet()

  async checkIdea(word) {

    conceptNet.search({
      start: '/c/en/donut'
    }, function onDone( err, result ) {
      log(err)
      log(result)
    })

    let xpath = '/c/en/toast' // + word
    conceptNet.lookup( xpath, {
      limit: 10,
      offset: 0,
      filter: 'core'
    }, function onDone( err, result ) {
      log(err)
      log(result)
    })
  }

and getting the errors below back:

undefined
{ '@context': [ 'http://api.conceptnet.io/ld/conceptnet5.6/context.ld.json' ],
  error:
   { details: '\'/data/5.4/c/en/toast\' isn\'t a URL that we understand.',
     status: 404 } }
undefined
{ '@context': [ 'http://api.conceptnet.io/ld/conceptnet5.6/context.ld.json' ],
  error:
   { details: '\'/data/5.4/search\' isn\'t a URL that we understand.',
     status: 404 } }

have the URLs changed?

is '/data/5.4 the correct prepend for URI calls?

I also tried with the version exactly as you have specified in the examples
let conceptNet = ConceptNet(null, null, '5.3')

but that doesn't seem to change the error code in the context URI conceptnet5.6

undefined
{ '@context': [ 'http://api.conceptnet.io/ld/conceptnet5.6/context.ld.json' ],
  error:
   { details: '\'/data/5.3/c/en/toast\' isn\'t a URL that we understand.',
     status: 404 } }

Excited to try this out, appreciate any advice.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.