-
Notifications
You must be signed in to change notification settings - Fork 654
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2222794
commit 818d9a7
Showing
2 changed files
with
6 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,22 @@ | ||
### Extending nlp_compromise with Plugins/Mixins | ||
### Plugins/Mixins | ||
nlp_compromise attempts to become the best way to work with, interpret, and manipulate language in javascript. Any sort of procedure or analysis can be applied, then shared as a plugin. Multiple plugins can be applied, and co-ordinated. | ||
|
||
```javascript | ||
const nlp_compromise = require("nlp_compromise") | ||
let my_mixin = { | ||
Term: { | ||
fun : function() { | ||
return this.text + '!'; | ||
} | ||
} | ||
}; | ||
nlp.mixin(my_mixin); | ||
let w = nlp.term('work'); | ||
nlp_compromise.mixin(my_mixin); | ||
let w = nlp_compromise.term('work'); | ||
w.fun() | ||
// "work!" | ||
``` | ||
see a [basic plugin example](../plugins/demo) | ||
|
||
|
||
##List of plugins: | ||
**Please add yours here** | ||
###Existing plugins: | ||
* [English simplification](../plugins/simple_english) - swaps hard words for their simpler synonyms | ||
* [valley_girl abstraction](../plugins/valley_girl) - adds 'like' etc. |