brainstorm.center
所属分类:人工智能/神经网络/深度学习
开发工具:TypeScript
文件大小:0KB
下载次数:0
上传日期:2021-11-05 18:11:51
上 传 者:
sh-1993
说明: 头脑风暴。中心。核心,,
(brainstorm.center.core,,)
文件列表:
.mochars.json (241, 2021-11-05)
dist/ (0, 2021-11-05)
dist/INote.d.ts (253, 2021-11-05)
dist/INote.js (77, 2021-11-05)
dist/INotebookItem.d.ts (104, 2021-11-05)
dist/INotebookItem.js (77, 2021-11-05)
dist/Mention.d.ts (351, 2021-11-05)
dist/Mention.js (610, 2021-11-05)
dist/Note.d.ts (386, 2021-11-05)
dist/Note.js (801, 2021-11-05)
dist/Notebook.d.ts (1079, 2021-11-05)
dist/Notebook.js (2241, 2021-11-05)
dist/NotebookItem.d.ts (192, 2021-11-05)
dist/NotebookItem.js (362, 2021-11-05)
dist/Utils.d.ts (1095, 2021-11-05)
dist/Utils.js (2876, 2021-11-05)
dist/index.d.ts (189, 2021-11-05)
dist/index.js (687, 2021-11-05)
dist/singleton/ (0, 2021-11-05)
dist/singleton/Note.d.ts (648, 2021-11-05)
dist/singleton/Note.js (2258, 2021-11-05)
dist/singleton/Notebook.d.ts (271, 2021-11-05)
dist/singleton/Notebook.js (599, 2021-11-05)
package-lock.json (32930, 2021-11-05)
package.json (953, 2021-11-05)
src/ (0, 2021-11-05)
src/INote.ts (244, 2021-11-05)
src/INotebookItem.ts (97, 2021-11-05)
src/Mention.ts (547, 2021-11-05)
src/Note.ts (839, 2021-11-05)
src/Notebook.ts (4036, 2021-11-05)
src/NotebookItem.ts (355, 2021-11-05)
src/Utils.ts (3251, 2021-11-05)
src/index.ts (196, 2021-11-05)
src/singleton/ (0, 2021-11-05)
src/singleton/Note.ts (2388, 2021-11-05)
src/singleton/Notebook.ts (665, 2021-11-05)
tests/ (0, 2021-11-05)
... ...
---
## Introduction
Brainstorm.center.core is the core library used in brainstorm.center, that provides utilities to write notes and automaticly create relations between them.
#### Example:
It acomplish this by exposing the Note and the Notebook class:
```js
import Notebook from 'brainstorm.center.core/Notebook';
import Note from 'brainstorm.center.core/Note';
const note = new Note('Functional programming', 'In computer science, functional programming is a programming paradigm where programs are constructed by applying and composing functions.');
const note2 = new Note('Functions', 'In computer programming, a subroutine is a sequence of program instructions that performs a specific task, packaged as a unit.');
const notebook = new Notebook().update(note).update(note2);
// Get mentions
const mentions = notebook.getMentionsOf(note); // returns a Inmutable.Set() { Mention { from: note, to: note2, key: 'functions' } }
const references = notebook.getReferencesOf(note2); // returns a Inmutable.Set() { Mention { from: note2, to: note, key: 'functions' } }
```
#### Core library in TS and JS
The library is writen in TS and transpiled to JS and both files are exposed.
#### Singleton Pattern
It also provides a Notebook Singleton object and a Proxy Note object that automaticly keep track of all the changes of any instance, updating the Notebook.notes repo.
```js
import { Notebook } from 'brainstorm.center.core/singleton/Notebook';
import { NoteProxy as Note } from 'brainstorm.center.core/singleton/Note';
const note = new Note('Title', 'content');
Notebook.dictionary.size === 1; // true
Notebook.notes.size === 1; // true
// do it twice and it must keep the same values because the note has the same title.
// this next line will not return a new note because there is already a Note with the same title, it will return the curent note from Notebook.notes and the note.content updated.
const noteCopy = new Note('Title', 'content');
Notebook.dictionary.size === 1; // true
Notebook.notes.size === 1; // true
note === noteCopy; // true
```
近期下载者:
相关文件:
收藏者: