question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect TypeScript Definition for sentences()

See original GitHub issue

I believe there is a TypeScript definition issue with sentences():

Error:

Property 'subjects' does not exist on type 'ExtendedDocument<{ sentences(n?: number | undefined): Sentences; }, World, Phrase>'.

TS Code:

import nlp from 'compromise';
import compromiseSentences from 'compromise-sentences';
const nlpEx = nlp.extend(compromiseSentences);

nlpEx('Hi bob').sentences().subjects();

Working on observablehq: image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Drache93commented, May 29, 2020

Oh right 😄 sentences(): ExtendedDocument<Ext, W, Ph> is a built in function (looks like it should actually take a parameter also…).

/** overload original sentences() method and return Sentence class**/
1reaction
spencermountaincommented, May 28, 2020

ah, thank you. good find. will add to next release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - Understanding Errors - TypeScript
Whenever TypeScript finds an error, it tries to explain what went wrong in as much detail as possible. Because its type system is...
Read more >
Typescript errors don't match the definition file - Stack Overflow
Typescript errors don't match the definition file ... I just switched to VS2015 and Typescript 1.7 and get some weird type errors when...
Read more >
Wrong Typescript type definitions for RemoteVideoTrack and ...
[X ] I have verified that the issue occurs with the latest twilio-video.js release and is not marked as a known issue in...
Read more >
Surviving the TypeScript Ecosystem — Part 4 - Medium
I will try to update examples from time-to-time with TypeScript updates. ... Now we can remove our incorrect module definition for lodash (delete...
Read more >
Learn TypeScript – The Ultimate Beginners Guide
TypeScript is a superset of JavaScript, meaning that it does ... from a string to a number - no problem // TypeScript let...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found