{"id":13571686,"url":"https://github.com/parmentf/node-ector","last_synced_at":"2025-04-12T05:29:57.607Z","repository":{"id":47871886,"uuid":"7371733","full_name":"parmentf/node-ector","owner":"parmentf","description":"ECTOR is a learning chatterbot. This is its Node.js version.","archived":false,"fork":false,"pushed_at":"2018-01-22T16:59:34.000Z","size":177,"stargazers_count":22,"open_issues_count":5,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-04T08:41:52.660Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parmentf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-30T00:04:18.000Z","updated_at":"2024-01-22T07:53:00.000Z","dependencies_parsed_at":"2022-08-28T23:23:13.902Z","dependency_job_id":null,"html_url":"https://github.com/parmentf/node-ector","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parmentf%2Fnode-ector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parmentf%2Fnode-ector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parmentf%2Fnode-ector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parmentf%2Fnode-ector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parmentf","download_url":"https://codeload.github.com/parmentf/node-ector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248523085,"owners_count":21118434,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T14:01:04.975Z","updated_at":"2025-04-12T05:29:57.580Z","avatar_url":"https://github.com/parmentf.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# ector\n\nECTOR is a learning chatterbot. This is its Node.js version.\n[![Build Status](https://secure.travis-ci.org/parmentf/node-ector.png)](http://travis-ci.org/parmentf/node-ector)\n[![NPM version](https://badge.fury.io/js/ector.png)](http://badge.fury.io/js/ector)\n[![NPM](https://nodei.co/npm/ector.png)](https://nodei.co/npm/ector/)\n\n## Getting Started\nInstall the module with: `npm install ector`\n\n```javascript\nvar Ector = require('ector');\nvar ector = new Ector();\nector.addEntry(\"Hello ECTOR!\");\nvar response = ector.generateResponse();\nconsole.log(response.sentence);\n```\n\n## Documentation\n\n### Class Ector\nUse it to instanciate one bot.\n\nWarning: username and botname should be at least 3 characters long.\n\n## Constructor\n### botname\n_string_ name of the bot (default: `ECTOR`)\n### username\n_string_ name of the user (default:  `Guy`)\n\n## setUser\n### username\n_string_ new user's name\n\nreturn the user's name or an Error.\n\n## setName\n### botname\n_string_ new bot's name\n\nreturn _string|Error_ the name of the bot, or an Error.\n\n## addEntry\nAdd an entry into the ECTOR's Concept Network\n### entry\n_string_ One or several sentences.\n### cns\n_conceptNetworkState_ see [ConceptNetworkState].\n\nreturn _Array|Error_ array of token nodes used in the entry.\n\n## generateResponse\nGenerate a response from the Concept Network and a network state.\n\nreturn _Object_ { response, nodes } The _response_ is a string, and _nodes_ is an array of nodes (see [linkNodesToLastSentence]).\n\n## linkNodesToLastSentence\n\nLink nodes to the previous sentence node id (this is automatically set by\n[addEntry](https://github.com/parmentf/node-ector#addentry), it is the node id\nof the first sentence of the entry).\n\nUsed with the nodes returned by [addEntry](https://github.com/parmentf/node-ector#addentry).\n\n### nodes\n\n_Array_ Array of nodes ids.\n\n## injectConceptNetwork\nInject a new [ConceptNetwork] constructor.\nUseful when one wants to use specialized ConceptNetwork (e.g.\n[FileConceptNetwork](https://github.com/parmentf/node-file-concept-network)).\n\nWARNING: reinitialize `this.cn` and `this.cn[this.username].cns`\n\n### NewConceptNetwok\n_ConceptNetwork_ derivated class of [ConceptNetwork](https://github.com/parmentf/node-concept-network).\n\n_(Coming soon)_\n\n## Examples\nThe [browser-ector](https://github.com/parmentf/browser-ector) is an example of how this library can be used.\n\nYou can talk to ECTOR in the browser. [Take a chat](http://parmentf.github.com/browser-ector/ector.html).\n\nOr you add the [hubot-ector script](https://github.com/parmentf/hubot-ector)\nto a [Hubot](https://github.com/github/hubot).\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [mocha](http://mochajs.org/).\n\n## Release History\n\n* 2014/08/07: version 0.1.7: fix bug: injector did not always work.\n* 2013/01/27: version 0.1.6: add a ConceptNetwork injector.\n* 2013/01/25: version 0.1.5: fix bug: replace all names in a response.\n* 2013/01/17: version 0.1.4: fix bug: beg value for second sentence.\n* 2013/01/17: version 0.1.3: fix bug: create node for second sentence.\n* 2013/01/06: version 0.1.2: add linkNodesToLastSentence()\n* 2013/01/05: version 0.1.1: fix github URL (to install)\n* 2013/01/05: version 0.1.0: first release\n\nWarning: this is a work in progress.\n\n## License\nCopyright (c) 2012 François Parmentier\nLicensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparmentf%2Fnode-ector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparmentf%2Fnode-ector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparmentf%2Fnode-ector/lists"}