Typescript plugin support
See original GitHub issueAfter the final compromise.min.js update (v12.1.0) the function nlp.plugin() doesn’t work.
E.g.:
let plugin = {
tags:{
Noun:
{
isA: 'Entity'
},
Verb:
{
isA: 'Action'
},
}
}
nlp.plugin(plugin);
Such simple code - and it doesn’t seem to work so far. Had to roll back to 11.14.3 at least to not experience any difficulties.
Any idea?
Btw, you had an awesome project description a month ago. What happened to it?
Issue Analytics
- State:
- Created 4 years ago
- Comments:18 (7 by maintainers)
Top Results From Across the Web
plugins - TSConfig Option - TypeScript
TSConfig. plugins. Customize. Site Colours: System, Always Light, Always Dark. Code Font: Cascadia, Cascadia (ligatures), Consolas, Dank Mono, Fira Code ...
Read more >Writing a Language Service Plugin · microsoft/TypeScript Wiki
The purpose of this guide is to help you write your own plugin. What's a Language Service Plugin? TypeScript Language Service Plugins ("plugins") ......
Read more >How to write a Typescript plugin? - javascript - Stack Overflow
How to write a Typescript plugin? · 1. You can download github.com/microsoft/typescript, include it into your project and via Compiler API or ...
Read more >TypeScript | IntelliJ IDEA Documentation - JetBrains
Javascript and TypeScript - The plugin is available only in IntelliJ IDEA Ultimate, ... IntelliJ IDEA supports developing, running, and debugging TypeScript ......
Read more >@typescript-eslint/eslint-plugin - npm
TypeScript plugin for ESLint. Latest version: 5.47.1, last published: 2 days ago. Start using @typescript-eslint/eslint-plugin in your ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
One option I was looking at was to use the returned value from
.extend
. If plugins return a world, we can use that type to enhance the NLP type.Best part is by inferring the current world type stored on the NLP type, we can keep adding to it with more extends.
Final part, anything in NLP can then use this type…
@spencermountain you are probably right on the
.default
issue. My project was initialised withnpx create-react-app my-app --template typescript
.by the way, this is how i extended the original type definitions within my project to make the plugin
compromise-numbers
work with typescript (in which i also fixed the wrong return type that the method.has()
was returning:then export an
nlp
constructor which will use the extended type definitions (i call it nlpx):