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.

Wrong term result when contractions are used since 14.2.0

See original GitHub issue

Since 14.2.0, contractions in the analyzed text result in wrong terms results.

Minimal reproduction case:

import compromise from "compromise/three"

const string = `
Test
plane's plane's
`

const usedWords = new Map()
const data = compromise(string)
for (const term of data.terms().json()) {
    console.log(term)
    const word = term.terms[0].text
    if (word !== '') usedWords.set(word, (usedWords.get(word) ?? 0) + 1)
}

console.log(usedWords)

The expected output is Map(2) { 'Test' => 1, "plane's" => 2 }, which matches the output with 14.1.1. The actual output with 14.2.0 is Map(1) { 'Test' => 2 }.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
spencermountaincommented, Jun 3, 2022

yep, this looks like a bug

let txt = `plane's plane's`
let doc = nlp(txt)
doc.terms().debug()

will check it out.

0reactions
Systemclustercommented, Jun 4, 2022

Thanks for fixing both of these issues so fast! I can confirm everything is working properly now. 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prodromal Labor (False Labor): Causes, Symptoms & Duration
Prodromal labor is a type of false labor contraction. It happens in the third trimester of pregnancy and can feel a lot like...
Read more >
False vs True Labor: How to Tell the Difference
The timing of the contractions is a big component for recognizing the differences between true and false labor. Here's how tell the ...
Read more >
Contractions of English Semi-Modals: The Emancipating ...
2-3: Use of contracted semi-modals in the BNC (from Krug 2000:175). 28. 2-4: Outline of processing stages in word production (adapted from Levelt....
Read more >
compromise/changelog.md at master - GitHub
compromise uses semver, and pushes to npm and github frequently. Major is a breaking api change - method or response changes that can...
Read more >
Angular language service not working in vscode
I use Angular Language Service version 12.2.0. The solution that worked for me is to enable legacy view engine language service.
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